diff --git a/home/modules/graphical/mouse-actions/actions/default.nix b/home/modules/graphical/mouse-actions/actions/default.nix index 51cad7b..65cd6a6 100644 --- a/home/modules/graphical/mouse-actions/actions/default.nix +++ b/home/modules/graphical/mouse-actions/actions/default.nix @@ -5,4 +5,5 @@ deafen = import ./deafen.nix { inherit pkgs; }; sober-lag = import ./sober-lag.nix { inherit pkgs; }; flick = import ./flick.nix { inherit pkgs; }; + play-pause = import ./play-pause.nix { inherit pkgs; }; } diff --git a/home/modules/graphical/mouse-actions/actions/play-pause.nix b/home/modules/graphical/mouse-actions/actions/play-pause.nix new file mode 100644 index 0000000..fefeb2d --- /dev/null +++ b/home/modules/graphical/mouse-actions/actions/play-pause.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + package = pkgs.writeShellScriptBin "play-pause-action" '' + ${pkgs.playerctl}/bin/playerctl play-pause + ''; +} diff --git a/home/modules/graphical/mouse-actions/cycle.nix b/home/modules/graphical/mouse-actions/cycle.nix index b5b8c8f..83426d0 100644 --- a/home/modules/graphical/mouse-actions/cycle.nix +++ b/home/modules/graphical/mouse-actions/cycle.nix @@ -15,6 +15,7 @@ "deafen") NEW_ACTION="sober-lag" ;; "sober-lag") NEW_ACTION="autoclick" ;; "autoclick") NEW_ACTION="flick" ;; + "flick") NEW_ACTION="play-pause" ;; *) NEW_ACTION="deafen" esac diff --git a/home/modules/graphical/mouse-actions/run.nix b/home/modules/graphical/mouse-actions/run.nix index 31d562c..83f8f78 100644 --- a/home/modules/graphical/mouse-actions/run.nix +++ b/home/modules/graphical/mouse-actions/run.nix @@ -23,6 +23,9 @@ "flick") ${pkgs.systemd}/bin/systemd-run --user ${actions.flick.package}/bin/flick-action ;; + "play-pause") + ${pkgs.systemd}/bin/systemd-run --user ${actions.play-pause.package}/bin/play-pause-action + ;; esac ''; }