diff --git a/home/programs/tmux.nix b/home/programs/tmux.nix index ec89712..c06a80f 100644 --- a/home/programs/tmux.nix +++ b/home/programs/tmux.nix @@ -16,7 +16,7 @@ } ]; extraConfig = '' - set -g update-environment 'DISPLAY TERM SWAYSOCK WAYLAND_DISPLAY' + set -g update-environment 'DISPLAY TERM SWAYSOCK WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE' if "[[ ''${TERM} =~ 256color || ''${TERM} == xterm-kitty || ''${TERM} == fbterm ]]" 'set -g default-terminal tmux-256color' set -g allow-rename on set -g set-titles on diff --git a/home/programs/tui.nix b/home/programs/tui.nix index 78d24c7..dbbea46 100644 --- a/home/programs/tui.nix +++ b/home/programs/tui.nix @@ -55,7 +55,7 @@ ''; profileExtra = '' if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ] ; then - exec ${pkgs.sway}/bin/sway + exec ${config.wayland.windowManager.hyprland.package}/bin/Hyprland fi ''; shellAliases = { diff --git a/home/wm/addon/waybar/default.nix b/home/wm/addon/waybar/default.nix index dfd3ee2..005fe5b 100644 --- a/home/wm/addon/waybar/default.nix +++ b/home/wm/addon/waybar/default.nix @@ -11,7 +11,7 @@ layer = "top"; position = "top"; height = 28; - modules-left = [ "sway/workspaces" "sway/window" "sway/mode" ]; + modules-left = [ "sway/workspaces" "wlr/workspaces" "sway/window" "hyprland/window" "sway/mode" "hyprland/submap" ]; modules-center = [ ]; modules-right = [ "tray" "custom/power_profile" "idle_inhibitor" "network" "bluetooth" "pulseaudio" "backlight" "battery" "clock" ]; "sway/mode" = { diff --git a/home/wm/default.nix b/home/wm/default.nix index 186e780..ef9a4d4 100644 --- a/home/wm/default.nix +++ b/home/wm/default.nix @@ -1,5 +1,6 @@ { ... }: { imports = [ + ./hyprland ./sway ./addon ]; diff --git a/home/wm/hyprland/default.nix b/home/wm/hyprland/default.nix new file mode 100644 index 0000000..7356063 --- /dev/null +++ b/home/wm/hyprland/default.nix @@ -0,0 +1,69 @@ +{ config, pkgs, ... }: +let + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; + hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; + kitty = "${pkgs.kitty}/bin/kitty"; + playerctl = "${pkgs.playerctl}/bin/playerctl"; + rofi = "${pkgs.rofi-wayland}/bin/rofi"; + swaylock = "${pkgs.swaylock}/bin/swaylock"; + tmux = "${pkgs.tmux}/bin/tmux"; + wpctl = "${pkgs.wireplumber}/bin/wpctl"; +in { + wayland.windowManager.hyprland = { + enable = true; + systemdIntegration = true; + recommendedEnvironment = true; + extraConfig = '' + monitor = eDP-1, 1920x1080, 0x0, 1 + monitor = , preferred, auto, 1 + + input { + touchpad { + disable_while_typing = true + middle_button_emulation = true + natural_scroll = true + tap-to-click = true + } + } + + exec-once = ${hyprctl} setcursor ${config.gtk.cursorTheme.name} 24 + + bind = SUPER,Return, exec, ${kitty} ${tmux} new + bind = SUPER_SHIFT,Return, exec, ${kitty} + bind = SUPER,d, exec, ${rofi} -show drun + bind = SUPER_SHIFT,C, exec, ${hyprctl} reload + bind = SUPER_SHIFT,Q, killactive, + bind = SUPER,l, exec, ${swaylock} -f -i /tmp/lockpaper.jpg + bind = SUPER_SHIFT,W, exec, ~/.config/scripts/chpaper.sh + + bind = SUPER,1, workspace, 1 + bind = SUPER,2, workspace, 2 + bind = SUPER,3, workspace, 3 + bind = SUPER,4, workspace, 4 + bind = SUPER,5, workspace, 5 + bind = SUPER,6, workspace, 6 + bind = SUPER,7, workspace, 7 + bind = SUPER,8, workspace, 8 + bind = SUPER,9, workspace, 9 + + bind = SUPER_SHIFT,1, movetoworkspace, 1 + bind = SUPER_SHIFT,2, movetoworkspace, 2 + bind = SUPER_SHIFT,3, movetoworkspace, 3 + bind = SUPER_SHIFT,4, movetoworkspace, 4 + bind = SUPER_SHIFT,5, movetoworkspace, 5 + bind = SUPER_SHIFT,6, movetoworkspace, 6 + bind = SUPER_SHIFT,7, movetoworkspace, 7 + bind = SUPER_SHIFT,8, movetoworkspace, 8 + bind = SUPER_SHIFT,9, movetoworkspace, 9 + + binde = ,XF86MonBrightnessUp, exec, ${brightnessctl} set +2% + binde = ,XF86MonBrightnessDown, exec, ${brightnessctl} set 2%- + bind = ,XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle + binde = ,XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+ + binde = ,XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 2%- + bind = ,XF86AudioPlay, exec, ${playerctl} play-pause + bind = ,XF86AudioNext, exec, ${playerctl} next + bind = ,XF86AudioPrev, exec, ${playerctl} previous + ''; + }; +}