2018-04-03 15:55:41 +02:00
# i3 config file (v4)
# See http://i3wm.org/docs/userguide.html for a complete reference
2018-04-29 17:04:01 +02:00
# Used to address resp. refer to the user. Example for males: "bro" and "man", for females: "sis" and "gal". This is freetext, use something you're comfortable with.
set $usertitle bro
set $usertype man
2018-04-03 15:55:41 +02:00
set $term $HOME/.config/i3/terminal.sh
2018-04-25 12:18:22 +02:00
set $termexec xfce4-terminal
2018-04-03 15:55:41 +02:00
set $barlaunchcmd $HOME/.config/polybar/launch.sh
########################
# i3 basic preferences # {{{1
########################
# font for window titles
font pango:Fira Sans 9
# modifier key: Super (swapped below, so effective key is Alt)
set $mod Mod4
# use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# resize window
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Shift+h resize shrink width 30 px or 30 ppt
bindsym Shift+j resize grow height 30 px or 30 ppt
bindsym Shift+k resize shrink height 30 px or 30 ppt
bindsym Shift+l resize grow width 30 px or 30 ppt
# back to normal: Enter, Escape or mod+r
bindsym Return mode "default"
bindsym KP_Enter mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# mouse following breaks keyboard window switching between terminals when the terminal tries to hide the mouse when you start typing, or something
# also, it's annoying to lose focus on your window when you move the mouse slightly
focus_follows_mouse no
# gaps when more than one window is open on a workspace
for_window [class="^.*"] border pixel 0
gaps inner 10
smart_gaps on
############
# Keyboard # {{{1
############
# Belgian layout, swap Alt and Super, set caps lock as compose key ♥
exec_always --no-startup-id setxkbmap \
-layout be \
-option altwin:swap_lalt_lwin \
-option compose:caps
# enable NumLock
exec_always --no-startup-id numlockx on
################
# Applications # {{{1
################
# program launcher
set $launcher rofi -show combi -display-combi $USER@$(cat /etc/hostname)
bindsym $mod+space exec --no-startup-id "$launcher"
#bindsym $mod+Shift+space exec --no-startup-id rofi -show window
# lock the screen
2018-04-05 14:12:44 +02:00
bindsym Mod1+l exec --no-startup-id i3lock --image="$HOME/Pictures/background/Red-billed_streamertail_Trochilus_polytmus_female_in_flight_2_lock.png" || notify-send -u normal -i lock -a i3 "Failed to lock screen" "i3lock had a non-zero exit code."
2018-04-03 15:55:41 +02:00
# start a terminal
2018-04-17 11:09:16 +02:00
bindsym $mod+Return exec $term
bindsym $mod+KP_Enter exec $term
2018-04-29 17:04:01 +02:00
bindsym Ctrl+Mod4+t exec --no-startup-id "notify-send -a 'i3' -u normal 'You'\''re on i3, $usertitle.' 'Don'\''t try to Ctrl+Alt+T me. Use $mod+Enter like a real $usertype.'"
bindsym Ctrl+Mod1+t exec --no-startup-id "notify-send -a 'i3' -u normal 'You'\''re on i3, $usertitle.' 'Don'\''t try to Ctrl+Alt+T me. Use $mod+Enter like a real $usertype.'"
2018-04-30 17:19:00 +02:00
# start a terminal and execute the command `exec-with-shortcut` from your PATH in it
bindsym XF86Calculator exec "$termexec --zoom 3 -x bash -c 'exec-with-shortcut; zsh'"
2018-04-03 15:55:41 +02:00
# start web browser
set $browser TZ=UTC firefox
bindsym XF86HomePage exec $browser
# open file manager
set $filemanager thunar
bindsym XF86MyComputer exec $filemanager
# change display layout
2018-04-25 12:15:45 +02:00
bindsym $mod+XF86Display exec arandr
2018-04-30 17:19:00 +02:00
bindsym XF86Display exec --no-startup-id $HOME/.config/i3/monitors.sh
2018-04-03 15:55:41 +02:00
#############################
# Keyboard function buttons # {{{1
#############################
set $volumeStep 5
bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d $volumeStep
bindsym XF86AudioRaiseVolume exec --no-startup-id pamixer -i $volumeStep
bindsym XF86AudioMute exec --no-startup-id pamixer -t
bindsym XF86AudioMicMute exec --no-startup-id pamixer --source alsa_input.pci-0000_00_1b.0.analog-stereo -t
2018-04-29 16:58:32 +02:00
bindsym $mod+XF86AudioLowerVolume workspace number 11; exec cantata
2018-04-25 12:18:22 +02:00
2018-04-03 15:55:41 +02:00
bindsym XF86MonBrightnessDown exec --no-startup-id $HOME/.config/i3/backlight.sh down
bindsym XF86MonBrightnessUp exec --no-startup-id $HOME/.config/i3/backlight.sh up
bindsym XF86PowerOff exec sudo shutdown -h now
2018-04-05 14:13:08 +02:00
set $scrot scrot '/tmp/screenshot_%Y-%m-%d_%H-%M-%S.png'
bindsym $mod+Print exec --no-startup-id $scrot
2018-04-05 18:40:09 +02:00
bindsym $mod+Shift+Print exec --no-startup-id $scrot --select --delay 1
2018-04-25 12:19:04 +02:00
bindsym $mod+Ctrl+Shift+Print exec --no-startup-id "$scrot --select --delay $(echo $'2\n3\n5\n10\n15' | rofi -p 'scrot delay' -dmenu)"
2018-04-03 15:55:41 +02:00
# Window stuff {{{2
# kill focused window
bindsym $mod+Shift+q kill
# 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+m split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout
#bindsym $mod+s layout stacking
bindsym $mod+z layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+d floating toggle
# change focus between tiling / floating windows
bindsym $mod+d focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# More window manager stuff {{{2
# reload the configuration file and restart the bar
bindsym $mod+Shift+c reload, exec $barlaunchcmd
# restart i3 inplace (preserves layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Quit i3?' -b 'Yes' 'i3-msg exit'"
#bindsym $mod+Shift+e exec "i3-msg exit"
bindsym $mod+p exec "sleep 8; notify-send -u critical -a Tasks \\"Urgent reminder\\" \\"You've got to leave now!\\""
# Workspace stuff {{{2
# switch to workspace
2018-04-29 16:58:32 +02:00
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+parenright workspace number 11
2018-04-03 15:55:41 +02:00
# this goes up to eleven!
# move focused container to workspace
2018-04-29 16:58:32 +02:00
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+Shift+degree move container to workspace number 11
2018-04-03 15:55:41 +02:00
# Monitor stuff {{{2
bindsym $mod+x move workspace to output right
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
#status_command python /usr/lib/python3.6/site-packages/powerline/bindings/i3/powerline-i3.py
#font pango:PowerlineFont 12
##status_command i3status
#position top
#}
# launch Polybar, a nicer bar
exec_always --no-startup-id $barlaunchcmd
2018-04-05 14:14:08 +02:00
# some applets (bah)
2018-04-03 15:55:41 +02:00
exec --no-startup-id nm-applet
2018-04-10 20:12:03 +02:00
#exec --no-startup-id nextcloud
2018-04-03 15:55:41 +02:00
# hide the mouse after some time
2018-04-05 14:14:28 +02:00
exec --no-startup-id unclutter -idle 3
2018-04-03 15:55:41 +02:00
# battery monitor script
2018-04-30 20:49:16 +02:00
exec --no-startup-id "$HOME/Programs/own/battery/monitor.py &>$HOME/.log/my-i3-desktop/battery-monitor.log || notify-send -u critical -i battery -a i3 'Failed to start battery monitor' 'Battery monitor had a non-zero exit code.'"
2018-04-06 18:52:08 +02:00
2018-04-03 15:55:41 +02:00
# set background
2018-05-01 16:16:29 +02:00
exec_always --no-startup-id "$HOME/.config/i3/background.sh"
2018-04-03 15:55:41 +02:00
##################
# Specific rules # {{{1
##################
for_window [class="Tor Browser"] floating enable
2018-04-17 16:05:42 +02:00
for_window [class="Peek"] floating enable
2018-04-17 11:10:19 +02:00
for_window [class="org-openstreetmap-josm-gui-MainApplication" instance="sun-awt-X11-XDialogPeer" title="^Download$|^Mapillary image|^Geotagged Images"] floating disable
2018-04-05 14:15:07 +02:00
for_window [class="Nextcloud" instance="nextcloud"] floating disable
for_window [class="Xfce4-settings-manager"] floating disable
2018-04-03 15:55:41 +02:00
2018-04-05 14:12:09 +02:00
# class border backgr. text indicator child_border
client.focused #293123 #293123 #ffffff #2ef49e #285577
client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
client.unfocused #000000 #000000 #888888 #292d2e #000000
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
client.background #ffffff
2018-04-03 15:55:41 +02:00
# vim: set ft=i3 noet foldmethod=marker :