1
0

default.nix 8.6 KB

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