default.nix 7.6 KB

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