1
0

default.nix 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. { pkgs, lib, ... }:
  2. let
  3. left = "j";
  4. up = "k";
  5. down = "l";
  6. right = "oslash";
  7. mod = "Mod1";
  8. super = "Super";
  9. in
  10. {
  11. imports = [
  12. ./waybar.nix
  13. ];
  14. home.packages = with pkgs; [
  15. ];
  16. wayland.windowManager.sway = {
  17. enable = true;
  18. checkConfig = true;
  19. config = {
  20. bars = [
  21. {
  22. command = "swaybar_command waybar";
  23. }
  24. ];
  25. modes = {
  26. resize = {
  27. # Letters
  28. ${left} = "resize shrink width 10 px or 10 ppt";
  29. ${up} = "resize grow height 10 px or 10 ppt";
  30. ${down} = "resize shrink height 10 px or 10 ppt";
  31. ${right} = "resize grow width 10 px or 10 ppt";
  32. # Arrow keys
  33. "Left" = "resize shrink width 10 px or 10 ppt";
  34. "Down" = "resize grow height 10 px or 10 ppt";
  35. "Up" = "resize shrink height 10 px or 10 ppt";
  36. "Right" = "resize grow width 10 px or 10 ppt";
  37. # Exit mode
  38. "Escape" = "mode default";
  39. "Return" = "mode default";
  40. };
  41. };
  42. keybindings = {
  43. "${mod}+Shift+r" = "reload";
  44. "${mod}+Shift+q" = "kill";
  45. "${mod}+d" = "exec rofi -show drun";
  46. "${mod}+Return" = "exec alacritty";
  47. "${super}+l" = "exec swaylock";
  48. "${mod}+r" = "mode \"resize\"";
  49. "${mod}+Shift+e" = "exec /home/johron/.config/rofi/powermenu/type-1/powermenu.sh";
  50. "${mod}+h" = "split h";
  51. "${mod}+v" = "split v";
  52. "${mod}+f" = "fullscreen toggle";
  53. "${mod}+s" = "layout stacking";
  54. "${mod}+t" = "layout tabbed";
  55. "${mod}+e" = "layout toggle split";
  56. "${mod}+Shift+space" = "floating toggle";
  57. "${mod}+space" = "focus mode_toggle";
  58. "${mod}+a" = "focus parent";
  59. # Focus movement
  60. "${mod}+${left}" = "focus left";
  61. "${mod}+${down}" = "focus down";
  62. "${mod}+${up}" = "focus up";
  63. "${mod}+${right}" = "focus right";
  64. # Focus movement (arrow keys)
  65. "${mod}+Left" = "focus left";
  66. "${mod}+Down" = "focus down";
  67. "${mod}+Up" = "focus up";
  68. "${mod}+Right" = "focus right";
  69. # Move windows
  70. "${mod}+Shift+${left}" = "move left";
  71. "${mod}+Shift+${down}" = "move down";
  72. "${mod}+Shift+${up}" = "move up";
  73. "${mod}+Shift+${right}" = "move right";
  74. # Move windows (arrow keys)
  75. "${mod}+Shift+Left" = "move left";
  76. "${mod}+Shift+Down" = "move down";
  77. "${mod}+Shift+Up" = "move up";
  78. "${mod}+Shift+Right" = "move right";
  79. # Switch to workspace
  80. "${mod}+1" = "workspace number 1";
  81. "${mod}+2" = "workspace number 2";
  82. "${mod}+3" = "workspace number 3";
  83. "${mod}+4" = "workspace number 4";
  84. "${mod}+5" = "workspace number 5";
  85. "${mod}+6" = "workspace number 6";
  86. "${mod}+7" = "workspace number 7";
  87. "${mod}+8" = "workspace number 8";
  88. "${mod}+9" = "workspace number 9";
  89. "${mod}+0" = "workspace number 10";
  90. ## Switch to secondary workspace
  91. "${super}+1" = "workspace number 11";
  92. "${super}+2" = "workspace number 12";
  93. "${super}+3" = "workspace number 13";
  94. "${super}+4" = "workspace number 14";
  95. "${super}+5" = "workspace number 15";
  96. "${super}+6" = "workspace number 16";
  97. "${super}+7" = "workspace number 17";
  98. "${super}+8" = "workspace number 18";
  99. "${super}+9" = "workspace number 19";
  100. "${super}+0" = "workspace number 20";
  101. # Move to workspace
  102. "${mod}+Shift+1" = "move container to workspace number 1";
  103. "${mod}+Shift+2" = "move container to workspace number 2";
  104. "${mod}+Shift+3" = "move container to workspace number 3";
  105. "${mod}+Shift+4" = "move container to workspace number 4";
  106. "${mod}+Shift+5" = "move container to workspace number 5";
  107. "${mod}+Shift+6" = "move container to workspace number 6";
  108. "${mod}+Shift+7" = "move container to workspace number 7";
  109. "${mod}+Shift+8" = "move container to workspace number 8";
  110. "${mod}+Shift+9" = "move container to workspace number 9";
  111. "${mod}+Shift+0" = "move container to workspace number 10";
  112. ## Move to secondary workspace
  113. "${super}+Shift+1" = "move container to workspace number 11";
  114. "${super}+Shift+2" = "move container to workspace number 12";
  115. "${super}+Shift+3" = "move container to workspace number 13";
  116. "${super}+Shift+4" = "move container to workspace number 14";
  117. "${super}+Shift+5" = "move container to workspace number 15";
  118. "${super}+Shift+6" = "move container to workspace number 16";
  119. "${super}+Shift+7" = "move container to workspace number 17";
  120. "${super}+Shift+8" = "move container to workspace number 18";
  121. "${super}+Shift+9" = "move container to workspace number 19";
  122. "${super}+Shift+0" = "move container to workspace number 20";
  123. # Multimedia
  124. XF86AudioMute = "exec wpctl set-mute @DEFAULT_SINK@ toggle";
  125. XF86AudioPlay = "exec playerctl play-pause";
  126. XF86AudioPause = "exec playerctl pause";
  127. XF86AudioNext = "exec playerctl next";
  128. XF86AudioPrev = "exec playerctl previous";
  129. XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_SINK@ 5%+";
  130. XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_SINK@ 5%-";
  131. # Applications
  132. "${super}+q" = "exec firefox";
  133. "${super}+e" = "exec nemo";
  134. "${super}+s" = "exec spotify";
  135. "${super}+d" = "exec discord";
  136. "${super}+v" = "exec cliphist list | rofi -dmenu | cliphist decode | wl-copy";
  137. "${super}+Shift+s" = "exec flameshot gui";
  138. "${super}+Shift+c" = "exec hyprpicker --autocopy";
  139. # Scripts
  140. "${mod}+Control+a" = "exec $HOME/.config/waybar/mic-mute.sh";
  141. "${mod}+Control+s" = "exec $HOME/.config/waybar/output-mute.sh";
  142. };
  143. window.commands = [
  144. { command = "floating enable"; criteria.instance = "spotify"; }
  145. #{ command = "floating enable"; criteria.class = "steam"; }
  146. ];
  147. input = {
  148. "*" = {
  149. xkb_layout = "no";
  150. #xkb_variant = "cole";
  151. };
  152. };
  153. };
  154. extraConfig = ''
  155. output DP-2 pos 0 0 mode 1920x1080@143.981Hz
  156. output HDMI-A-1 mode 1920x1080@143.981Hz
  157. workspace 1 output DP-2
  158. workspace 2 output DP-2
  159. workspace 3 output DP-2
  160. workspace 11 output HDMI-A-1
  161. workspace 12 output HDMI-A-1
  162. workspace 13 output HDMI-A-1
  163. exec wl-paste --watch cliphist store
  164. exec flameshot
  165. seat seat0 xcursor_theme Notwaita-Black 20
  166. ## Bind Alt+Shift+e to show a Swaynag exit confirmation
  167. #bindsym Mod1+Shift+e exec swaynag -t warning \
  168. # -m "Are you sure you want to exit Sway?" \
  169. # -b "Exit" "swaymsg exit" \
  170. # -b "Reboot" "reboot"
  171. exec swaybg -i "/storage/Pictures/Backgrounds/reef-1920x1080-2.png" -m fill
  172. exec_always {
  173. systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
  174. lxqt-policykit-agent
  175. swayidle \
  176. timeout 600 'swaylock -f' \
  177. timeout 1200 'systemctl suspend' \
  178. before-sleep 'swaylock -f'
  179. }
  180. '';
  181. };
  182. }