dotfiles/config/i3/config.j2
Geoffrey Frogeye 4b8c4f29ce
nix: Start i3 config
And wow, we're starting to get crazy here!
2023-11-03 01:37:37 +01:00

192 lines
6.4 KiB
Django/Jinja
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# vi:syntax=conf
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4
# set default desktop layout (default is tiling)
# workspace_layout tabbed <stacking|tabbed>
# Configure border style <normal|1pixel|pixel xx|none|pixel>
new_window pixel 2
new_float normal
# Hide borders
hide_edge_borders both
mouse_warping output
# Workspace names
set $WS1 1
set $WS2 2
set $WS3 3
set $WS4 4
set $WS5 5
set $WS6 6
set $WS7 7
set $WS8 8
set $WS9 9
set $WS10 10
# Workspace output
{% set screens = x11_screens | default(['DEFAULT']) %}
{% for i in range(1, 11) %}
workspace "$WS{{ i }}" output {{ screens[(i - 1) % (screens | length)] }}
{% endfor %}
# Default layout = tabs, since I mostly exclusively use them
workspace_layout tabbed
# Open specific applications in floating mode
for_window [title="pacmixer"] floating enable border pixel 2
for_window [class="Firefox"] layout tabbed # Doesn't seem to work anymore
for_window [class="qutebrowser"] layout tabbed
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [ title="^pdfpc.*" window_role="presenter" ] move to output left, fullscreen
for_window [ title="^pdfpc.*" window_role="presentation" ] move to output right, fullscreen
# switch to workspace with urgent window automatically
for_window [urgent=latest] focus
# Set shut down, restart and locking features
set $mode_kblock Keyboard lock
mode "$mode_kblock" {
bindsym $mod+Shift+Escape mode "$mode_kblock"
}
"$mod+Shift+Escape" = "mode "$mode_kblock"";
# Set shut down, restart and locking features
set $locker $HOME/.config/i3/lock
set $mode_system [L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction
mode "$mode_system" {
bindsym l exec --no-startup-id $locker, mode "default"
bindsym e exit, mode "default"
bindsym s exec --no-startup-id $locker & systemctl suspend, mode "default"
bindsym h exec --no-startup-id $locker & systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym p exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
"$mod+Escape" = "mode "$mode_system"";
# resize window (you can also use the mouse for that)
mode "Resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt; exec ~/.config/i3/focus_windows
bindsym j resize grow height 10 px or 10 ppt; exec ~/.config/i3/focus_windows
bindsym k resize shrink height 10 px or 10 ppt; exec ~/.config/i3/focus_windows
bindsym l resize grow width 10 px or 10 ppt; exec ~/.config/i3/focus_windows
## same bindings, but for the arrow keys
#bindsym Left resize shrink width 10 px or 10 ppt
#bindsym Down resize grow height 10 px or 10 ppt
#bindsym Up resize shrink height 10 px or 10 ppt
#bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
"$mod+r" = "mode "Resize"";
set $mode_pres_main "Presentation (main display)"
mode $mode_pres_main {
bindsym b workspace $WS3, workspace $WS4, mode $mode_pres_sec
# back to normal: Enter or Escape
bindsym q mode "default"
# bindsym Escape mode "default"
bindsym Return mode "default"
}
set $mode_pres_sec "Presentation (secondary display)"
mode $mode_pres_sec {
bindsym b workspace $WS2, workspace $WS1, mode $mode_pres_main
# back to normal: Enter or Escape
bindsym q mode "default"
# bindsym Escape mode "default"
bindsym Return mode "default"
}
"$mod+Shift+p" = "mode $mode_pres_main";
set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default
"$mod+t" = "mode "$mode_screen"";
mode "$mode_screen" {
bindsym a exec autorandr --change --force, mode "default"
bindsym l exec ~/.config/i3/autorandrloadmenu, mode "default"
bindsym s exec ~/.config/i3/autorandrsavemenu, mode "default"
bindsym r exec ~/.config/i3/autorandrremovemenu, mode "default"
bindsym d exec ~/.config/i3/autorandrdefaultmenu, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Screen temperature ("redness") setting
"$mod+y" = "mode "$mode_temp"";
set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue
mode "$mode_temp" {
bindsym r exec sct 1000
bindsym d exec sct 2000
bindsym c exec sct 4500
bindsym o exec sct
bindsym a exec sct 8000
bindsym b exec sct 10000
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Inactivity settings
exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker'
"$mod+F1" = "exec --no-startup-id sh -c "sleep .25 && xset dpms force off"";
"$mod+F4" = "exec --no-startup-id xautolock -disable";
"$mod+F5" = "exec --no-startup-id xautolock -enable";
# Autostart applications
#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Password remembering
#exec --no-startup-id gnome-keyring-daemon # Password remembering
# exec --no-startup-id urxvtd -q -f # urxvt daemon
{% if auto_numlock %}
exec --no-startup-id numlockx on # Activate Num lock
{% endif %}
exec --no-startup-id unclutter -root # Hide mouse cursor after some time
#exec --no-startup-id dunst # Notifications (handled by systemd)
exec --no-startup-id keynav # Keyboard cursor controller
#exec --no-startup-id mpd # Music Player Daemon (handled by systemd)
# exec --no-startup-id ~/.config/i3/ashuffle # MPD Auto-refill
exec --no-startup-id autorandr --change --force # Screen configuration and everything that depends on it
{% if has_battery %}
exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification
{% endif %}
# exec --no-startup-id ~/.config/i3/aw_start # Activity tracker