diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-01-10 21:25:34 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-01-10 21:25:34 +0200 |
commit | ae1dbae7c9273ad6bc19059bfc00541ada6a4d61 (patch) | |
tree | 3c66b25cda8afa30b6ff631ce490aedd032a88ac | |
parent | 57c493361061e1e7b35a234391b26d40efb3395b (diff) | |
download | nixos-configuration-ae1dbae7c9273ad6bc19059bfc00541ada6a4d61.tar.gz nixos-configuration-ae1dbae7c9273ad6bc19059bfc00541ada6a4d61.tar.bz2 nixos-configuration-ae1dbae7c9273ad6bc19059bfc00541ada6a4d61.zip |
feat(hyprland): hyprland music controls
5 files changed, 11 insertions, 10 deletions
diff --git a/home-manager/stvnliu/hypr/hyprland/binds.nix b/home-manager/stvnliu/hypr/hyprland/binds.nix index 0325faa..c8b16b5 100644 --- a/home-manager/stvnliu/hypr/hyprland/binds.nix +++ b/home-manager/stvnliu/hypr/hyprland/binds.nix @@ -25,7 +25,7 @@ in "$mod, E, exec, ${config.defaultApplications.fileManager}" # foot terminal "$mod, Return, exec, ${terminalCmd} ${config.myShells.defaultShell}" - "$mod SHIFT, Return, exec, [float] ${terminalCmd} ${config.myShells.defaultShell}" + "$mod SHIFT, Return, exec, ${terminalCmd} --title=floats ${config.myShells.defaultShell}" # cmdline utilities /* @@ -43,7 +43,7 @@ in "$mod, L, movefocus, r" ] ++ ( - if config.services.mpd.enable then [ "$mod, M, exec, ${terminalCmd} --title=ncmpc ${pkgs.ncmpc}/bin/ncmpc -h 127.0.0.1" ] else [ ] + if config.services.mpd.enable then [ "$mod, M, exec, ${terminalCmd} --title=ncmpc ${pkgs.ncmpcpp}/bin/ncmpcpp" ] else [ ] ) ++ ( if config.services.swaync.enable diff --git a/home-manager/stvnliu/hypr/hyprland/default.nix b/home-manager/stvnliu/hypr/hyprland/default.nix index 15902c3..8fcfc0b 100644 --- a/home-manager/stvnliu/hypr/hyprland/default.nix +++ b/home-manager/stvnliu/hypr/hyprland/default.nix @@ -39,9 +39,8 @@ repeat_delay = 250; accel_profile = "flat"; }; - exec-once = config.myAutostartCommands ++ import ./hypr_autostart.nix { - inherit config; - }; + exec-once = config.myAutostartCommands + ++ (import ./hypr_autostart.nix { inherit config; inherit pkgs; }); misc = { disable_hyprland_logo = true; disable_splash_rendering = true; @@ -49,9 +48,7 @@ focus_on_activate = true; # see if fixes mako daemon not focusing }; "$mod" = "SUPER"; - binde = import ./xf86_binds.nix { - inherit pkgs; - }; + binde = import ./xf86_binds.nix { inherit pkgs; }; bind = import ./binds.nix { inherit config; inherit pkgs; diff --git a/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix b/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix index 8cbf3a9..df12b0e 100644 --- a/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix +++ b/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix @@ -1,8 +1,10 @@ -{ config }: +{ config, pkgs }: let term = config.defaultApplications.terminal; shell = config.myShells.defaultShell; in [ "${term} --title=autorun ${shell}" + "${pkgs.mpris-notifier}/bin/mpris-notifier" + "${pkgs.mpd-discord-rpc}/bin/mpd-discord-rpc" ] diff --git a/home-manager/stvnliu/hypr/hyprland/window_rules.nix b/home-manager/stvnliu/hypr/hyprland/window_rules.nix index b09a597..e481482 100644 --- a/home-manager/stvnliu/hypr/hyprland/window_rules.nix +++ b/home-manager/stvnliu/hypr/hyprland/window_rules.nix @@ -1,6 +1,6 @@ [ "workspace special silent, class:^(foot.*)$, title:autorun" - "float, tag:floats" + "float, title:floats" "float, title:ncmpc" "size 50% 50%, title:ncmpc" "immediate, class:^(cs2)$" diff --git a/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix b/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix index fdb7447..566e55b 100644 --- a/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix +++ b/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix @@ -3,6 +3,8 @@ }: [ ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" ", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop" + ", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" + ", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" ", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+" ", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" ", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%" |