Skip to content

Instantly share code, notes, and snippets.

@UtahDave
Forked from diyan/i3.conf
Last active August 29, 2015 14:12
Show Gist options
  • Save UtahDave/fc677f2512c1905ace01 to your computer and use it in GitHub Desktop.
Save UtahDave/fc677f2512c1905ace01 to your computer and use it in GitHub Desktop.
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Note that only i3 >= 4.3 has support for TTF fonts via Pango library
#set $font = exec (xrandr | grep -E 'connected 1920x1080.*? 282mm x 165mm' &> /dev/null) && echo Ubuntu 16 || echo Ubuntu 16
#set $font = exec xrandr | grep -E 'connected 1920x1080.*? 282mm x 165mm' > /dev/null && echo Ubuntu 16 || echo Ubuntu 11
#set $font = Ubuntu 16
#set $font = exec "if [ `xrandr | grep -E 'connected 1920x1080.*? 282mm x 165mm' | wc -l` -eq 1 ]; then echo 'Ubuntu 16'; else echo 'Ubuntu 16'; fi"
#set $font = exec "mon=`xrandr | grep -E 'connected 1920x1080.*? 282mm x 165mm'`; if [ -n "$mon" ]; then echo 'Ubuntu 16'; else echo 'Ubuntu 16'; fi"
#font pango:$font
#font pango:Ubuntu 11
font pango:Ubuntu 16
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+Q kill
# start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run
#bindsym $mod+d exec xfce4-appfinder --disable-server
bindsym $mod+d exec synapse
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon 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+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon 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+h 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 (stacked, tabbed, default)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout default
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindcode $mod+d focus child
# switch to workspace
bindsym $mod+1 workspace "1: main"
bindsym $mod+2 workspace "2: web"
bindsym $mod+3 workspace "3: chat"
bindsym $mod+4 workspace "4: notes"
bindsym $mod+5 workspace "5: music"
bindsym $mod+6 workspace "6: vnc/rdp"
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+exclam move container to workspace "1: main"
bindsym $mod+Shift+at move container to workspace "2: web"
bindsym $mod+Shift+numbersign move container to workspace "3: chat"
bindsym $mod+Shift+dollar move container to workspace "4: notes"
bindsym $mod+Shift+percent move container to workspace "5: music"
bindsym $mod+Shift+asciicircum move container to workspace "6: vnc/rdp"
bindsym $mod+Shift+ampersand move container to workspace 7
bindsym $mod+Shift+asterisk move container to workspace 8
bindsym $mod+Shift+parenleft move container to workspace 9
bindsym $mod+Shift+parenright move container to workspace 10
# reload the configuration file
bindsym $mod+Shift+C reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+R restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+E exit
#bindsym $mod+Shift+E exec "i3-nagbar -t warning -m 'Do you really want to exit i3 and end your X session?' -b 'Yes, exit i3' 'exit'"
# 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 window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# Same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
#font pango:Ubuntu 11
position top
tray_output primary
status_command i3status
}
# Q: How to setup preferred applications?
# sudo update-alternatives --config x-www-browser
# sudo update-alternatives --config x-terminal-emulator
# sudo update-alternatives --config editor
### Setup displays and wallpaper ###
#exec_always xrandr --output HDMI1 --mode 1920x1080 --primary --left-of VGA1
exec_always (xrandr | grep -E 'connected .*? 518mm x 324mm' &> /dev/null) && xrandr --output HDMI1 --mode 1920x1200 --primary --left-of VGA1
# Investigate how to delay feh execution until xrandr will finish setup display
exec_always feh --no-fehbg --bg-fill ~/Dropbox/pictures/wallpapers/horseregion_ssro_2356.jpg
### Custom Keyboard Shortcuts ###
# Lock screen. --dpms option will turn off all displays right after locking.
bindsym Mod4+Control+l exec i3-msg workspace 10 && i3lock --tiling --dpms --color 000000
# Audio shortcuts
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 -- +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -- -5%
bindsym XF86AudioMute exec pactl set-sink-mute 0 $((pactl list sinks | grep -q Mute:.no && echo 1) || echo 0)
#bindsym XF86AudioPlay exec clementine --play-pause
#bindsym XF86AudioStop exec clementine --stop
#bindsym XF86AudioPrev exec clementine --previous
#bindsym XF86AudioNext exec clementine --next
# TODO consider use this shortcut instead of Win+Shift+Q
# bindsym $mod+Shift+C kill
# https://bbs.archlinux.org/viewtopic.php?id=159418
# http://www.linux.org.ru/forum/general/6603527
exec_always setxkbmap -layout us,ru -option grp:ctrl_shift_toggle -variant winkeys
# Keyboard backlight shortcuts
bindsym XF86KbdBrightnessUp exec "file=/sys/class/leds/asus::kbd_backlight/brightness; val=`cat $file`; if [ $val -lt 3 ]; then echo `expr $val + 1` > $file; fi"
bindsym XF86KbdBrightnessDown exec "file=/sys/class/leds/asus::kbd_backlight/brightness; val=`cat $file`; if [ $val -gt 0 ]; then echo `expr $val - 1` > $file; fi"
#exec_always i3-msg border normal
# TODO display current keyboard layout on i3status or i3bar
# http://docs.slackware.com/howtos:window_managers:keyboard_layout_in_i3
# TODO investigate how-to setup launcher for i3
# wine ~/Dropbox/soft/develop/heidi_sql/heidisql.exe
# TODO consider setup 'N: code' workspace
#4 code
workspace "1: main" output HDMI1
workspace "2: web" output HDMI1
workspace "3: chat" output HDMI1
workspace "4: notes" output VGA1
workspace "5: music" output VGA1
workspace "6: vnc/rdp" output VGA1
exec_always (xrandr | grep -E 'connected 1920x1080.*? 282mm x 165mm' &> /dev/null) && gnome-settings-daemon
exec i3-sensible-terminal
exec nm-applet
exec dropbox start -i
exec remmina -i
#exec shutter
exec zim
exec deadbeef
# workspace layout could be switched only in following way:
# run first program in that workspace and wait when it finish to load
# switch layout
# run all other programs
exec firefox
exec pidgin
exec skype --dbpath=~/.config/skype/alexey.diyan
exec skype --dbpath=~/.config/skype/dev-pro.alexey.diyan
# TODO i3 created additonal useless container. We should avoid this behavior
#exec i3-msg 'workspace 1: main; exec wine ~/Dropbox/soft/develop/heidi_sql/heidisql.exe'
assign [class="(?i)firefox"] 2: web
assign [class="(?i)chrome"] 2: web
assign [class="(?i)skype"] 3: chat
assign [class="(?i)pidgin"] 3: chat
assign [class="(?i)zim"] 4: notes
assign [class="(?i)sublime"] 4: notes
assign [class="(?i)deadbeef"] 5: music
assign [class="jetbrains-pycharm"] 10
assign [class="(?i)remmina"] 6: vnc/rdp
# xprop tool can be used to get WM_CLASS, WM_NAME properties
for_window [title="Unlock Login Keyring"] floating enable
for_window [class="Skype" title="Information"] floating enable
for_window [class="Skype" title="Add to Chat"] floating enable
for_window [class="Skype" title="Profile for"] floating enable
for_window [class="Skype" title="Contact request from"] floating enable
for_window [class="Skype" title="Are you sure you want to call?"] floating enable
for_window [class="Skype" title="Rename"] floating enable
for_window [class="Skype" title="Search for Skype Contacts"] floating enable
for_window [class="Speedcrunch"] floating enable
for_window [class="Synapse"] border 1pixel
for_window [title="HeidiSQL"] floating disable
#TODO investigate how to arrange windows in a correct way
#exec_always $HOME/.config/i3/autostart.sh
#
#
#TODO setup font aliasing for GTK and Qt applications
#TODO setup Qt theme
#TODO display current keyboard language at i3bar
#TODO is gnome-keyring-daemon required on i3?
#TODO should NetworkManaber be replaced with wicd?
#TODO gvfsd-http dconf-service gnome-pty-helper xfconfd notify-osd gconfd-2?
#TODO at-spi2-registryd at-spi-bus-launcher pulseaudio/gconf-helper udisksd
#TODO rtkit-daemon winbindd nmdb upowerd console-kit-daemon accounts-daemon
#TODO wpa_supplicant smbd whoopsie polkitd cupsd irqbalance cups-browsed
#TODO avahi-daemon atd cron acpid getty bluetoothd rsyslogd
#TODO upstart-socket-bridge udevd upstart-udev-bridge
# vim:filetype=i3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment