i3/.config/i3/config

306 lines
11 KiB
Plaintext

# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# variables for use later
set $mod Mod4
set $mon1 DP-0
set $mon2 LVDS-0
set $config_dir ~/.config/i3
include include/`hostname`.conf
## Startup Applications ##
exec --no-startup-id ~/.fehbg
exec --no-startup-id xfce4-panel -d
exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd
exec --no-startup-id nm-applet
exec --no-startup-id redshift-gtk -l 43:-72
exec --no-startup-id insync start
exec --no-startup-id syncthing-gtk
exec --no-startup-id pasystray -a
exec --no-startup-id udiskie -s0
exec --no-startup-id caffeine
exec --no-startup-id mailnag
exec --no-startup-id touchegg 2>&1 > /dev/null
exec --no-startup-id numlockx on # enable numlock
exec --no-startup-id xset s off dpms 0 0 0 # disable auto screen blanking
exec --no-startup-id xautolock -time 5 -locker "$config_dir/lock.sh lock 5" -detectsleep -corners -000 -notify 5 -notifier 'notify-send "Locking screen in 5 seconds" -i system-lock-screen -t 4500'
# firefox workspace bindings
for_window [class="(?i)Firefox" title="^«work» "] move --no-auto-back-and-forth container to workspace number 2
for_window [class="(?i)Firefox" title="^«music» "] move --no-auto-back-and-forth container to workspace number 10
for_window [class="(?i)Emacs" title="\*Org PDF LaTeX Output\*"] move --no-auto-back-and-forth container to workspace 10
# keyboard settings
exec --no-startup-id setxkbmap -option 'ctrl:nocaps' -option "shift:both_capslock"
#exec --no-startup-id compton --backend glx --vsync opengl
## Keybindings! ##
mode "bypass" {
bindsym $mod+Escape mode "default"
}
bindsym $mod+Escape mode "bypass"
bindsym $mod+Return exec alacritty # start a terminal
bindsym --release $mod+Shift+Return exec $config_dir/passthrough "Emacs|Alacritty" "super+Return" alacritty # start a terminal in current pwd
bindsym $mod+e exec emacsclient -c -n # start emacs
bindsym $mod+Shift+e exec emacsclient -ce '(nm)' # start NeverMore
bindsym Mod1+Mod4+s exec $config_dir/lock.sh suspend # suspend
bindsym Mod1+Control+l exec $config_dir/lock.sh lock 5 # lock screen
bindsym Mod1+$mod+l exec $config_dir/lock.sh lock 5 # lock screen
bindsym Mod1+Control+Delete exec $config_dir/lock.sh pick # power menu
bindsym Mod1+$mod+Delete exec $config_dir/lock.sh pick # power menu
bindsym $mod+p exec --no-startup-id $config_dir/killPanel.sh # restart xfce4-panel
bindsym $mod+Print exec scrot ~/scratch/'%Y-%m-%d_%H:%M:%S.png'
mode "launch" {
bindsym e exec emacsclient -c -n; mode "default"
bindsym f exec firefox; mode "default"
bindsym t exec thunar; mode "default"
bindsym --release Shift+t exec $config_dir/passthrough "Emacs" "super+t" thunar; mode "default"
bindsym x exec gajim; mode "default"
bindsym Escape mode "default"
bindsym Return mode "default"
bindsym grave mode "default"
}
bindsym $mod+x mode "launch"
bindsym $mod+space exec --no-startup-id "rofi -show drun"
bindsym $mod+d exec --no-startup-id "rofi -show run"
bindsym $mod+t exec --no-startup-id "rofi -show sworkspace"
bindsym $mod+Shift+t exec --no-startup-id "rofi -show mworkspace"
bindsym $mod+n exec $config_dir/rename_workspace.py
bindsym $mod+c exec --no-startup-id rofi-pass --last-used
bindsym $mod+Shift+c exec --no-startup-id "$config_dir/pass_typer.py"
# Brighness Control
bindsym XF86MonBrightnessUp exec light -A 10
bindsym XF86MonBrightnessDown exec light -U 10
bindsym Mod1+XF86MonBrightnessUp exec light -A 1
bindsym Mod1+XF86MonBrightnessDown exec light -U 1
# Keyboard Brightness Control
bindsym XF86KbdBrightnessUp exec kbdlight up 10
bindsym XF86KbdBrightnessDown exec kbdlight down 10
bindsym Mod1+XF86KbdBrightnessUp exec kbdlight up 1
bindsym Mod1+XF86KbdBrightnessDown exec kbdlight down 1
# Volume Control
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym Mod1+XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -1%
bindsym Mod1+XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +1%
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
# Screen Rotation
bindsym $mod+Mod1+Down exec $config_dir/rotate.sh 0
bindsym $mod+Mod1+Right exec $config_dir/rotate.sh 1
bindsym $mod+Mod1+Up exec $config_dir/rotate.sh 2
bindsym $mod+Mod1+Left exec $config_dir/rotate.sh 3
## Actual i3 Config ##
# Stop all windows from stealing focus when they open
no_focus [tiling]
no_focus [floating]
# Floating windows
for_window [class="Wrapper-1.0"] floating enable
for_window [class="Pinentry"] floating enable, focus
for_window [class="Gcr-prompter"] floating enable, focus ; # Pinentry got renamed to this, I guess?
for_window [class="Thunar" title="Rename .*"] focus
for_window [class="WSJT-X"] floating disable
for_window [class="Freecad" title="Formula editor"] floating enable, focus
for_window [class="Freecad" title="Insert length"] floating enable, focus
for_window [class="calibre" title="calibre - Preferences.*|User plugins"] floating disable
for_window [class="firefox" window_type="dialog"] focus
# Font for window titles.
font pango:DejaVu Sans Mono 10
# i3 options
focus_follows_mouse no
default_border pixel 2
for_window [all] title_window_icon padding 2px
workspace_auto_back_and_forth yes
focus_on_window_activation urgent
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# kill focused window
bindsym $mod+Shift+q kill
# toggle border style
bindsym $mod+b border toggle 2
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+g split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
# change container layout (tabbed, toggle split)
bindsym $mod+w layout tabbed
bindsym $mod+Shift+s layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+Control+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+z focus child
bindsym $mod+Tab workspace back_and_forth
# Window swapping
mode "swap-dest" {
set $swp_cmd swap container with mark quickswap; [con_mark="quickswap"] focus; unmark quickswap; mode default
bindsym --whole-window button1 $swp_cmd
bindsym --whole-window $mod+Shift+button1 $swp_cmd
set $cancel_cmd unmark quickswap; mode "default"
bindsym Return $cancel_cmd
bindsym Escape $cancel_cmd
}
bindsym --whole-window $mod+Shift+button1 mark --add quickswap; mode "swap-dest"
# Keyboard only bindings (can't use binding mode, since would have to rebind all movement commands
bindsym $mod+Mod1+comma mark --add quickswap
bindsym $mod+comma swap container with mark quickswap; [con_mark="quickswap"] focus; unmark quickswap
# bind workspaces 1-10 to monitor 1, 11-20 to monitor 2
workspace 1 output $mon1
workspace 2 output $mon1
workspace 3 output $mon1
workspace 4 output $mon1
workspace 5 output $mon1
workspace 6 output $mon1
workspace 7 output $mon1
workspace 8 output $mon1
workspace 9 output $mon1
workspace 10 output $mon1
workspace 11 output $mon2
workspace 12 output $mon2
workspace 13 output $mon2
workspace 14 output $mon2
workspace 15 output $mon2
workspace 16 output $mon2
workspace 17 output $mon2
workspace 18 output $mon2
workspace 19 output $mon2
workspace 20 output $mon2
# switch to 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+0 workspace number 10
bindsym $mod+Mod1+1 workspace number 11
bindsym $mod+Mod1+2 workspace number 12
bindsym $mod+Mod1+3 workspace number 13
bindsym $mod+Mod1+4 workspace number 14
bindsym $mod+Mod1+5 workspace number 15
bindsym $mod+Mod1+6 workspace number 16
bindsym $mod+Mod1+7 workspace number 17
bindsym $mod+Mod1+8 workspace number 18
bindsym $mod+Mod1+9 workspace number 19
bindsym $mod+Mod1+0 workspace number 20
# move focused container to workspace
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
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+Mod1+Shift+1 move container to workspace number 11
bindsym $mod+Mod1+Shift+2 move container to workspace number 12
bindsym $mod+Mod1+Shift+3 move container to workspace number 13
bindsym $mod+Mod1+Shift+4 move container to workspace number 14
bindsym $mod+Mod1+Shift+5 move container to workspace number 15
bindsym $mod+Mod1+Shift+6 move container to workspace number 16
bindsym $mod+Mod1+Shift+7 move container to workspace number 17
bindsym $mod+Mod1+Shift+8 move container to workspace number 18
bindsym $mod+Mod1+Shift+9 move container to workspace number 19
bindsym $mod+Mod1+Shift+0 move container to workspace number 20
# reload the configuration file
bindsym $mod+Mod1+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Mod1+Shift+r restart
# resize window
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym c exec --no-startup-id $config_dir/compact_workspace_numbers.py; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym grave mode "default"
}
bindsym $mod+r mode "resize"