feat(graphical/qtile): add espanso and use playerctl for media commands
This commit is contained in:
parent
baabb466aa
commit
3bbd0667a8
1 changed files with 44 additions and 9 deletions
|
@ -84,14 +84,6 @@ let
|
||||||
${dpmsScript} default
|
${dpmsScript} default
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
dbusSendMediaPlayer2 = pkgs.writeScript "dbusSendMediaPlayer2" ''
|
|
||||||
#!${pkgs.bash}/bin/bash
|
|
||||||
for player in vlc spotify; do
|
|
||||||
${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.$player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.''${1:-PlayPause}
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
qtileConfig = pkgs.writeScript "qtile_config.py" ''
|
qtileConfig = pkgs.writeScript "qtile_config.py" ''
|
||||||
from libqtile.config import Key, Screen, Group, Drag, Click
|
from libqtile.config import Key, Screen, Group, Drag, Click
|
||||||
from libqtile.command import lazy
|
from libqtile.command import lazy
|
||||||
|
@ -175,7 +167,7 @@ keys = [
|
||||||
Key([key_super], "k", lazy.layout.previous()),
|
Key([key_super], "k", lazy.layout.previous()),
|
||||||
|
|
||||||
# Multimedia Keys
|
# Multimedia Keys
|
||||||
Key([], "XF86AudioPlay", lazy.spawn("${dbusSendMediaPlayer2} PlayPause")),
|
Key([], "XF86AudioPlay", lazy.spawn("${pkgs.playerctl}/bin/playerctl play-pause")),
|
||||||
Key([], "XF86AudioPrev", lazy.spawn("${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous")),
|
Key([], "XF86AudioPrev", lazy.spawn("${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous")),
|
||||||
Key([], "XF86AudioNext", lazy.spawn("${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next")),
|
Key([], "XF86AudioNext", lazy.spawn("${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next")),
|
||||||
## Microsoft Comfort Curve specific
|
## Microsoft Comfort Curve specific
|
||||||
|
@ -306,6 +298,49 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
espanso = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
matches = let
|
||||||
|
playerctl = ''${pkgs.coreutils}/bin/env DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(${pkgs.coreutils}/bin/id -u)/bus" ${pkgs.playerctl}/bin/playerctl'';
|
||||||
|
in [
|
||||||
|
{
|
||||||
|
trigger = ":vpos";
|
||||||
|
replace = "{{output}}";
|
||||||
|
vars = [
|
||||||
|
{
|
||||||
|
name = "output";
|
||||||
|
type = "script";
|
||||||
|
params = {
|
||||||
|
args = [
|
||||||
|
(pkgs.writeShellScript "espanso" ''
|
||||||
|
${playerctl} position''
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
trigger = ":vtit";
|
||||||
|
replace = "{{output}}";
|
||||||
|
vars = [
|
||||||
|
{
|
||||||
|
name = "output";
|
||||||
|
type = "script";
|
||||||
|
params = {
|
||||||
|
args = [
|
||||||
|
(pkgs.writeShellScript "espanso" ''
|
||||||
|
${playerctl} metadata title''
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.pointerCursor = {
|
home.pointerCursor = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue