config 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. # i3 config — adapted for NixOS
  2. # Dotfiles managed via Stow; packages provided by myOptions.i3 module
  3. ###############################################################################
  4. # General
  5. ###############################################################################
  6. set $mod Mod4
  7. font pango:monospace 12
  8. floating_modifier $mod
  9. # Border style (Rose Pine inspired)
  10. client.focused #191724 #191724 #e0def4 #191724 #e0def4
  11. client.focused_inactive #191724 #191724 #908caa #191724 #908caa
  12. client.unfocused #191724 #191724 #6e6a86 #191724 #6e6a86
  13. client.urgent #191724 #eb6f92 #191724 #eb6f92 #eb6f92
  14. ###############################################################################
  15. # Workspaces
  16. ###############################################################################
  17. set $ws1 "1:  "
  18. set $ws2 "2:  "
  19. set $ws3 "3:  "
  20. set $ws4 "4:  "
  21. set $ws5 "5:  "
  22. set $ws6 "6:  "
  23. set $ws7 "7:  "
  24. set $ws8 "8:  "
  25. set $ws9 "9:  "
  26. set $ws10 "0:  "
  27. ###############################################################################
  28. # Appearance
  29. ###############################################################################
  30. new_window pixel 1
  31. new_float pixel 1
  32. gaps inner 10
  33. gaps outer 5
  34. popup_during_fullscreen smart
  35. ###############################################################################
  36. # Keybindings — Window management
  37. ###############################################################################
  38. bindsym $mod+Return exec alacritty
  39. bindsym $mod+Shift+q kill
  40. bindsym $mod+c kill
  41. # Focus (vim keys)
  42. bindsym $mod+h focus left
  43. bindsym $mod+j focus down
  44. bindsym $mod+k focus up
  45. bindsym $mod+l focus right
  46. # Focus (arrow keys)
  47. bindsym $mod+Left focus left
  48. bindsym $mod+Down focus down
  49. bindsym $mod+Up focus up
  50. bindsym $mod+Right focus right
  51. # Move window (vim keys)
  52. bindsym $mod+Shift+h move left
  53. bindsym $mod+Shift+j move down
  54. bindsym $mod+Shift+k move up
  55. bindsym $mod+Shift+l move right
  56. # Move window (arrow keys)
  57. bindsym $mod+Shift+Left move left
  58. bindsym $mod+Shift+Down move down
  59. bindsym $mod+Shift+Up move up
  60. bindsym $mod+Shift+Right move right
  61. # Move workspace between outputs
  62. bindsym $mod+bracketright move workspace to output right
  63. bindsym $mod+bracketleft move workspace to output left
  64. # Split orientation
  65. bindsym $mod+semicolon split h
  66. # Fullscreen
  67. bindsym $mod+f fullscreen toggle
  68. # Layout
  69. bindsym $mod+s layout stacking
  70. bindsym $mod+w layout toggle tabbed split
  71. bindsym $mod+Ctrl+e layout toggle split
  72. # Floating
  73. bindsym $mod+Shift+space floating toggle
  74. bindsym $mod+space focus mode_toggle
  75. # Parent container
  76. bindsym $mod+a focus parent
  77. # Switch workspace
  78. bindsym $mod+1 workspace $ws1
  79. bindsym $mod+2 workspace $ws2
  80. bindsym $mod+3 workspace $ws3
  81. bindsym $mod+4 workspace $ws4
  82. bindsym $mod+5 workspace $ws5
  83. bindsym $mod+6 workspace $ws6
  84. bindsym $mod+7 workspace $ws7
  85. bindsym $mod+8 workspace $ws8
  86. bindsym $mod+9 workspace $ws9
  87. bindsym $mod+0 workspace $ws10
  88. # Move container to workspace
  89. bindsym $mod+Shift+1 move container to workspace $ws1
  90. bindsym $mod+Shift+2 move container to workspace $ws2
  91. bindsym $mod+Shift+3 move container to workspace $ws3
  92. bindsym $mod+Shift+4 move container to workspace $ws4
  93. bindsym $mod+Shift+5 move container to workspace $ws5
  94. bindsym $mod+Shift+6 move container to workspace $ws6
  95. bindsym $mod+Shift+7 move container to workspace $ws7
  96. bindsym $mod+Shift+8 move container to workspace $ws8
  97. bindsym $mod+Shift+9 move container to workspace $ws9
  98. bindsym $mod+Shift+0 move container to workspace $ws10
  99. # i3 management
  100. bindsym $mod+Shift+c reload
  101. bindsym $mod+Shift+r restart
  102. bindsym $mod+Shift+e exec --no-startup-id "i3-nagbar -t warning -m 'Exit i3?' -b 'Yes' 'i3-msg exit'"
  103. ###############################################################################
  104. # Resize mode
  105. ###############################################################################
  106. bindsym $mod+r mode "resize"
  107. mode "resize" {
  108. bindsym h resize shrink width 10 px or 10 ppt
  109. bindsym j resize grow height 10 px or 10 ppt
  110. bindsym k resize shrink height 10 px or 10 ppt
  111. bindsym l resize grow width 10 px or 10 ppt
  112. bindsym Left resize shrink width 10 px or 10 ppt
  113. bindsym Down resize grow height 10 px or 10 ppt
  114. bindsym Up resize shrink height 10 px or 10 ppt
  115. bindsym Right resize grow width 10 px or 10 ppt
  116. bindsym Return mode "default"
  117. bindsym Escape mode "default"
  118. bindsym $mod+r mode "default"
  119. }
  120. ###############################################################################
  121. # Keybindings — Launchers & utilities
  122. ###############################################################################
  123. # rofi
  124. bindsym $mod+d exec --no-startup-id rofi -show drun -dpi 1
  125. bindsym $mod+y exec --no-startup-id clipmenu -i -fn 'monospace:size=12' -nb '#191724' -nf '#e0def4' -sb '#c4a7e7' -sf '#191724'
  126. # Project launcher
  127. bindsym $mod+t exec ~/.local/bin/dev-launcher ~/Dev
  128. # File manager (match niri)
  129. bindsym $mod+e exec --no-startup-id ~/.local/bin/i3-launch-or-focus thunar
  130. # StrongDM UI
  131. bindsym $ood+n exec ~/.local/bin/i3-launch-or-focus --class sdm-connect alacritty -e ~/.local/bin/sdm-ui.sh
  132. # Power menu
  133. bindsym XF86PowerOff exec --no-startup-id echo -e "lock\nsuspend\nreboot\nshutdown\nlogout" | $dmenu -p "Power" | xargs -I{} sh -c 'case {} in lock) betterlockscreen -l;; suspend) systemctl suspend;; reboot) systemctl reboot;; shutdown) systemctl poweroff;; logout) i3-msg exit;; esac'
  134. bindsym $mod+x exec --no-startup-id $HOME/.config/rofi/kill.sh | $dmenu -p "Kill" | xargs -I{} kill {}
  135. # Screenshot
  136. bindsym $mod+p exec --no-startup-id flameshot gui
  137. # Pause notifications
  138. bindsym $mod+F5 exec --no-startup-id ~/.bin/pause-notifications
  139. ###############################################################################
  140. # Mouse bindings
  141. ###############################################################################
  142. bindsym --release button2 kill
  143. bindsym --whole-window $mod+button2 kill
  144. bindsym button3 floating toggle
  145. bindsym $mod+button3 floating toggle
  146. ###############################################################################
  147. # Scratchpad
  148. ###############################################################################
  149. bindsym $mod+u [instance="dropdown"] scratchpad show; [instance="dropdown"] move position center
  150. bindsym $mod+Shift+u exec --no-startup-id alacritty --class dropdown
  151. bindsym $mod+Shift+minus move scratchpad
  152. bindsym $mod+minus scratchpad show
  153. ###############################################################################
  154. # Window rules
  155. ###############################################################################
  156. for_window [class=".*"] border pixel 0
  157. for_window [instance="dropdown"] floating enable
  158. for_window [instance="dropdown"] resize set 2366 1568
  159. for_window [instance="dropdown"] move scratchpad
  160. for_window [instance="dropdown"] border pixel 1
  161. for_window [instance="sdm-connect"] floating enable, resize set 2366 1568, border pixel 1, move position center
  162. # Workspace assignments
  163. for_window [workspace=$ws1] layout tabbed
  164. assign [class="^Slack"] $ws1
  165. assign [instance="crx__cifhbcnohmdccbgoicgdjpfamggdegmo"] $ws1
  166. assign [instance="crx__faolnafnngnfdaknnbpnkhgohbobgegn"] $ws1
  167. assign [class="^zen"] $ws2
  168. assign [class="^thunderbird"] $ws4
  169. assign [class="^vesktop$"] $ws4
  170. ###############################################################################
  171. # Media & hardware keys
  172. ###############################################################################
  173. # Volume (PipeWire/PulseAudio via pactl)
  174. bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2%
  175. bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2%
  176. bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
  177. # Brightness (brightnessctl)
  178. bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5%
  179. bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-
  180. # Media playback (playerctl)
  181. bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
  182. bindsym XF86AudioNext exec --no-startup-id playerctl next
  183. bindsym XF86AudioPrev exec --no-startup-id playerctl previous
  184. ###############################################################################
  185. # Bar — i3status-rust
  186. ###############################################################################
  187. bar {
  188. status_command i3status-rs ~/.config/i3status-rust/config.toml
  189. position top
  190. font pango:JetBrainsMono Nerd Font 9
  191. strip_workspace_numbers false
  192. colors {
  193. background #191724
  194. statusline #e0def4
  195. separator #6e6a86
  196. # border bg text
  197. focused_workspace #c4a7e7 #c4a7e7 #191724
  198. active_workspace #26233a #26233a #e0def4
  199. inactive_workspace #191724 #191724 #908caa
  200. urgent_workspace #eb6f92 #eb6f92 #191724
  201. }
  202. }
  203. ###############################################################################
  204. # Autostart
  205. ###############################################################################
  206. # X11
  207. exec --no-startup-id setxkbmap us -variant altgr-intl -option caps:escape
  208. exec --no-startup-id numlockx on
  209. exec --no-startup-id xrdb -merge ~/.Xresources
  210. exec --no-startup-id picom
  211. exec --no-startup-id dunst
  212. exec --no-startup-id xidlehook \
  213. --detect-sleep \
  214. --not-when-audio \
  215. --not-when-fullscreen \
  216. --timer 300 'betterlockscreen -l' '' \
  217. --timer 120 'xset dpms force off' '' \
  218. --timer 300 'systemctl suspend' ''
  219. exec --no-startup-id lxqt-policykit-agent
  220. exec --no-startup-id clipmenud
  221. exec --no-startup-id autorandr --change
  222. exec_always --no-startup-id feh --randomize --bg-fill ~/Pictures/* --no-fehbg
  223. exec --no-startup-id betterlockscreen -u ~/Pictures/*
  224. # Scratchpad
  225. exec --no-startup-id alacritty --class dropdown
  226. # Apps
  227. exec --no-startup-id easyeffects --gapplication-service
  228. exec --no-startup-id nm-applet
  229. # exec --no-startup-id zen-twilight
  230. # exec --no-startup-id thunderbird
  231. # exec --no-startup-id discord
  232. # exec --no-startup-id slack
  233. # exec --no-startup-id gtk-launch msedge-cifhbcnohmdccbgoicgdjpfamggdegmo-Default
  234. # exec --no-startup-id gtk-launch msedge-pkooggnaalmfkidjmlhoelhdllpphaga-Default
  235. # exec --no-startup-id fusuma