# https://i3wm.org/docs/userguide.html
# mark scratchpad output
# consider using Mod3 with a remap Super->Hyper
set $mod Mod4
floating_modifier $mod
tiling_drag modifier
font pango:monospace 20
exec_always --no-startup-id dunst
bindsym $mod+BackSpace exec dunstctl close-all
bindsym $mod+Shift+BackSpace exec dunstctl history-pop
# XXX: https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
exec_always --no-startup-id "killall systembus-notify; systembus-notify"
exec_always --no-startup-id "killall earlyoom; #earlyoom \
--prefer '^(RDD Process|Isolated Web Co|Web Content)$' \
--avoid '^(firefox)$' \
-n -p -r0 -s100"
exec_always --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork -e -c 111111
bindsym Print exec --no-startup-id loginctl lock-session
bindsym $mod+Print exec --no-startup-id systemctl suspend
bindsym $mod+Shift+Print exec --no-startup-id systemctl hibernate
exec_always --no-startup-id "killall unclutter; unclutter --exclude-root --ignore-scrolling"
exec_always --no-startup-id nm-applet
exec_always --no-startup-id fcitx5 -r
mode "escape" {
bindsym Escape mode "default", exec --no-startup-id fcitx5
}
bindsym $mod+Escape exec --no-startup-id killall fcitx5, mode "escape"
for_window [class="pavucontrol"] floating enable
mode "safe" {
bindsym $mod+Shift+Escape mode "default"
}
bindsym $mod+Shift+v mode "safe"
bindsym $mod+v exec xterm -e /bin/bash -l -c "vim ~/caryll/one"
bindsym XF86LaunchA exec --no-startup-id "if [[ $(xrandr --verbose | grep -i gamma | sed -e 's/.* //') = 1.0:1.0:1.0 ]]; then redshift -PO4000; else redshift -x; fi"
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -perceived -inc 10
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -perceived -dec 10
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
bindsym $mod+r exec "rofi -modi drun,run -show drun"
bindsym $mod+t exec xterm
for_window [class="modal"] floating enable, fullscreen enable
bindsym $mod+Shift+t exec realvnc
for_window [class="realvnc-vncviewer"] floating enable
bindsym --release $mod+c exec maim -so ~/shot-$(date +%s).png
bindsym --release $mod+Shift+c exec maim ~/shot-$(date +%s).png
bindsym $mod+g exec firefox
bindsym $mod+Shift+g exec firefox --private-window
bindsym $mod+slash exec "bash -c 'tab=$(bt list | rofi -dmenu -p tab -display-columns 2 -i -no-custom | cut -f1); [[ -n ${tab} ]] && bt activate --focused \\"${tab}\\"'"
for_window [window_role="PictureInPicture"] floating enable, sticky enable
for_window [window_role="alert"] floating enable, sticky enable, border none
no_focus [window_role="alert"]
for_window [class="firefox"] border pixel 2
for_window [class="Chromium"] border pixel 2
for_window [class="qutebrowser"] border pixel 2
bindsym $mod+Shift+e exec rofimoji --action copy
bindsym $mod+p exec gpick -os | xclip -r -sel c
mode "leader" {
bindsym Escape mode "default"
}
bindsym $mod+backslash mode "leader"
bindsym $mod+y exec mpv /dev/video0 --profile=low-latency --untimed
for_window [title="video0 - mpv"] floating enable, border none, sticky enable, move position 1890 60
bindsym $mod+Shift+w kill
bindsym $mod+Shift+q exec "kill $(xprop -id $(xdotool getwindowfocus) _NET_WM_PID | sed -e 's/.* //')"
# XXX: https://github.com/svenstaro/wmfocus/issues/344
bindsym $mod+x exec wmfocus --bgcolor '#222222' --bgcolorcurrent '#285577' --textcolor '#888888' --textcolorcurrent '#ffffff' --font 'mono:72' --margin 1.5 --halign center --valign center
bindsym $mod+Shift+x [urgent=latest] focus
bindsym $mod+semicolon focus parent
bindsym $mod+apostrophe focus child
bindsym $mod+comma focus output left
bindsym $mod+period focus output right
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+comma move to output left
bindsym $mod+Shift+period move to output right
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+Shift+backslash split horizontal
bindsym $mod+Shift+s split vertical
bindsym $mod+s split toggle
# XXX: these are just random
bindsym $mod+q layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+a layout toggle split
bindsym $mod+z focus mode_toggle
bindsym $mod+Shift+z floating toggle
bindsym $mod+m scratchpad show
bindsym $mod+Shift+m move scratchpad
bindsym $mod+Return fullscreen toggle
bindsym $mod+f fullscreen toggle
bindsym $mod+Shift+f fullscreen toggle global
bindsym $mod+0 resize set width 722 px
bindsym $mod+minus resize shrink width 12 px or 12 ppt
bindsym $mod+equal resize grow width 12 px or 12 ppt
bindsym $mod+Shift+0 resize set height 404 px
bindsym $mod+Shift+minus resize shrink height 12 px or 12 ppt
bindsym $mod+Shift+equal resize grow height 12 px or 12 ppt
# XXX: keep prior numeric prefix?
bindsym $mod+Shift+apostrophe exec "bash -c 'name=$(i3-msg -t get_workspaces | jq -r \\"map(select(.focused))[0].name\\"); name=$(rofi -dmenu -p \\"rename workspace to\\" -theme-str \\"listview { enabled: false; } entry { placeholder: \\\\"${name}\\\\"; }\\" -disable-history -no-plugins); [[ $? -eq 0 && -n ${name} ]] && i3-msg \\"rename workspace to \\\\"${name}\\\\"\\"'"
bindsym $mod+grave exec "i3-msg workspace $(i3-msg -t get_workspaces | jq -r '.[].name' | rofi -dmenu -p workspace)"
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
for_window [title="^\[1] "] move container to workspace number 1
for_window [title="^\[2] "] move container to workspace number 2
for_window [title="^\[3] "] move container to workspace number 3
for_window [title="^\[4] "] move container to workspace number 4
for_window [title="^\[5] "] move container to workspace number 5
for_window [title="^\[6] "] move container to workspace number 6
for_window [title="^\[7] "] move container to workspace number 7
for_window [title="^\[8] "] move container to workspace number 8
for_window [title="^\[9] "] move container to workspace number 9
bindsym $mod+bracketleft workspace prev
bindsym $mod+bracketright workspace next
bindsym $mod+Shift+bracketleft move to workspace prev
bindsym $mod+Shift+bracketright move to workspace next
bindsym $mod+Tab workspace back_and_forth
bindsym $mod+Shift+Tab move to workspace back_and_forth
bindsym $mod+Shift+r reload
bindsym $mod+Shift+Escape exec "bash -c 'res=$(rofi -dmenu -p \\"exit by\\" < <(echo -en \\"cancel\nrestart\nlogout\nreboot\nshutdown\\")); case $res in restart) i3-msg restart;; logout) i3-msg exit;; reboot) sudo systemctl reboot;; shutdown) sudo systemctl poweroff -i;; esac'"
bindsym $mod+Shift+semicolon exec "i3-msg \\"$(rofi -dmenu -p \\"\\" -theme-str \\"listview { enabled: false; } entry { placeholder: \\\\"${name}\\\\"; }\\" -disable-history -no-plugins)\\""
bar {
status_command i3status-rs
# XXX: https://github.com/i3/i3/issues/5476
tray_padding 0
#padding 0 0 0 16
workspace_min_width 150
font pango:monospace 25
# disable wheel workspace switching
wheel_up_cmd nop
wheel_down_cmd nop
}
# disable wheel tab switching
bindsym button4 nop
bindsym button5 nop
title_align center
hide_edge_borders vertical