default.nix 8.7 KB

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