More refactoring and added hyprlock
This commit is contained in:
@@ -7,20 +7,13 @@ in {
|
||||
|
||||
options.samfelag.modules.desktop.wm.hyprland = with lib; {
|
||||
enable = mkEnableOption "hyprland window manager";
|
||||
|
||||
mod = my.mkOpt' types.str "Mod4" "Main modifier key for hyprland";
|
||||
|
||||
kb_layout = my.mkOpt' types.str "es" "Keyboard layout(s) for hyprland";
|
||||
|
||||
extraKeybindings = my.mkOpt (types.listOf types.str) [ ];
|
||||
# extraStartup = my.mkOpt (types.listOf types.attrs) [ ];
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
# - Configuration -----------------------------
|
||||
|
||||
# Hyprland config
|
||||
@@ -31,11 +24,9 @@ in {
|
||||
|
||||
hm.wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
|
||||
package = pkgs.hyprland;
|
||||
# Optional
|
||||
# Whether to enable hyprland-session.target on hyprland startup
|
||||
|
||||
xwayland.enable = true;
|
||||
systemd.enable = true;
|
||||
|
||||
plugins = [
|
||||
@@ -60,8 +51,6 @@ in {
|
||||
monitor = ",highres,auto,1";
|
||||
|
||||
exec-once = [
|
||||
"hyprpaper"
|
||||
"eww open top-bar"
|
||||
];
|
||||
|
||||
decoration = {
|
||||
@@ -120,29 +109,11 @@ in {
|
||||
"${cfg.mod} SHIFT, 5, movetoworkspace, 5"
|
||||
"${cfg.mod} SHIFT, 0, movetoworkspace, 6"
|
||||
|
||||
# - Media ------------------------------
|
||||
|
||||
# Pulse Audio controls (mute)
|
||||
", XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
||||
|
||||
# Media player controls
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioPause, exec, playerctl play-pause"
|
||||
", XF86AudioNext, exec, playerctl next"
|
||||
", XF86AudioPrev, exec, playerctl previous"
|
||||
", XF86AudioStop, exec, playerctl stop"
|
||||
|
||||
# - Keyboard ---------------------------
|
||||
"${cfg.mod}, Escape, exec, hyprctl switchxkblayout current next"
|
||||
|
||||
] ++ cfg.extraKeybindings;
|
||||
|
||||
binde = [
|
||||
# Pulse Audio controls (volume)
|
||||
", XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%"
|
||||
", XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
"${cfg.mod}, mouse:272, hy3:movewindow"
|
||||
"${cfg.mod} SHIFT, mouse:272, resizewindow 1"
|
||||
|
||||
Reference in New Issue
Block a user