pyprland and scratchpads

This commit is contained in:
Sam 2024-06-06 18:13:16 +01:00
parent 861f58946b
commit 20b64f5707
6 changed files with 165 additions and 88 deletions

33
] Normal file
View File

@ -0,0 +1,33 @@
{ ... }:
{
home.file.".config/hypr/pyprland.toml".text = ''
[pyprland]
plugins = [
"scratchpads"
]
[scratchpads.termy]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-y --title 'Scratchpad(y)'"
class = "$TERMINAL-dropterm-y"
size = "70% 70%"
[scratchpads.termu]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-u --title 'Scratchpad(u)'"
class = "$TERMINAL-dropterm-u"
size = "80% 80%"
[scratchpads.termi]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-i --title 'Scratchpad(i)'"
class = "$TERMINAL-dropterm-i"
size = "50% 50%"
[scratchpads.volume]
animation = "fromTop"
command = "pavucontrol --class floating"
class = "org.pulseaudio.pavucontrol"
size = "75% 60%"
'';
}

View File

@ -48,11 +48,11 @@
}; };
}; };
outputs = { outputs =
self, { self
nixpkgs, , nixpkgs
home-manager, , home-manager
... , ...
} @ inputs: } @ inputs:
let let
inherit (self) outputs; inherit (self) outputs;
@ -61,7 +61,8 @@
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
specialArgs = { inherit inputs outputs; }; specialArgs = { inherit inputs outputs; };
in { in
{
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = import ./overlays { inherit inputs; }; overlays = import ./overlays { inherit inputs; };
@ -74,7 +75,8 @@
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./hosts/nixdev ./hosts/nixdev
home-manager.nixosModules.home-manager{ home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs; home-manager.extraSpecialArgs = specialArgs;
} }
]; ];
@ -83,7 +85,8 @@
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./hosts/fileserver ./hosts/fileserver
home-manager.nixosModules.home-manager{ home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs; home-manager.extraSpecialArgs = specialArgs;
} }
]; ];
@ -98,7 +101,8 @@
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./hosts/sparky ./hosts/sparky
home-manager.nixosModules.home-manager{ home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs; home-manager.extraSpecialArgs = specialArgs;
} }
]; ];
@ -107,7 +111,8 @@
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./hosts/semita ./hosts/semita
home-manager.nixosModules.home-manager{ home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs; home-manager.extraSpecialArgs = specialArgs;
} }
]; ];

View File

@ -7,6 +7,7 @@
imports = [ imports = [
../common ../common
../wayland ../wayland
./pyprland.nix
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
@ -108,7 +109,7 @@
sensitivity = -0.5 sensitivity = -0.5
} }
windowrulev2 = float, class:floating
$mainMod = SUPER $mainMod = SUPER
@ -119,6 +120,10 @@
bind = $mainMod, V, togglefloating, bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu bind = $mainMod, R, exec, $menu
bind = $mainMod, y, exec, pypr toggle termy
bind = $mainMod, u, exec, pypr toggle termu
bind = $mainMod, i, exec, pypr toggle termi
bind = $mainMod, h, movefocus, l bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u bind = $mainMod, k, movefocus, u
@ -155,7 +160,7 @@
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
exec-once=swww-wallpaper-changer exec-once=swww-wallpaper-changer & pypr
''; '';
}; };
} }

View File

@ -0,0 +1,33 @@
{ ... }:
{
home.file.".config/hypr/pyprland.toml".text = ''
[pyprland]
plugins = [
"scratchpads"
]
[scratchpads.termy]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-y --title 'Scratchpad(y)'"
class = "$TERMINAL-dropterm-y"
size = "80% 80%"
[scratchpads.termu]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-u --title 'Scratchpad(u)'"
class = "$TERMINAL-dropterm-u"
size = "80% 80%"
[scratchpads.termi]
animation = "fromTop"
command = "$TERMINAL --class $TERMINAL-dropterm-i --title 'Scratchpad(i)'"
class = "$TERMINAL-dropterm-i"
size = "80% 80%"
[scratchpads.volume]
animation = "fromTop"
command = "pavucontrol --class floating"
class = "org.pulseaudio.pavucontrol"
size = "75% 60%"
'';
}

View File

@ -9,5 +9,6 @@
home.packages = [ home.packages = [
pkgs.wofi pkgs.wofi
pkgs.wl-clipboard pkgs.wl-clipboard
pkgs.pyprland
]; ];
} }

View File

@ -130,7 +130,7 @@
"portable" = ""; "portable" = "";
"default" = [ "" "" "" ]; "default" = [ "" "" "" ];
}; };
"on-click" = "pavucontrol"; "on-click" = "pypr toggle volume";
}; };
}; };