Skip to content

Instantly share code, notes, and snippets.

@Hubro
Created March 17, 2019 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hubro/c9d305348ef7595ce2e06f4bae931304 to your computer and use it in GitHub Desktop.
Save Hubro/c9d305348ef7595ce2e06f4bae931304 to your computer and use it in GitHub Desktop.
i3 config
# vim: ft=i3config
# DON'T EDIT THIS FILE MANUALLY - It has been automatically built by:
# /home/tomas/Dropbox/Personal/config_sync/i3/build.sh
# This file should contain general i3 settings as well as shared variables. If
# the variable list grows long it should get its own file.
set $mod Mod4
font pango:Monospace 10
font pango:Source Code Pro Medium 10
font pango:Source Pro Regular 10
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
workspace_auto_back_and_forth yes
# No title bars
for_window [class="."] border pixel 2
# Include the window class in the title bar
for_window [class="."] title_format "%title <b>(Class: %class)</b>"
# Floating windows by default
#for_window [class="[.]*"] floating enable
# This file should contain all application-specific settings, variables and
# keybinds.
# Torrent clients (Win+T)
## Transmission
set $transmission [class="Transmission-gtk"]
for_window $transmission floating enable
for_window $transmission move scratchpad
## Deluge
set $deluge [class="Deluge" window_type="normal"]
for_window $deluge move scratchpad
## Deluge Web-UI
set $deluge_webui [class="Google-chrome" title="^Deluge"]
for_window $deluge_webui move scratchpad
bindsym $mod+t $transmission scratchpad show, \
$deluge scratchpad show, \
$deluge_webui scratchpad show
# Boostnote
set $boostnote [class="^Boostnote$"]
for_window $boostnote move scratchpad
for_window $boostnote scratchpad show
bindsym $mod+b $boostnote scratchpad show
# Shutter
for_window [class="Shutter"] floating enable
#set $shutter [class="Shutter" title=" - Shutter$"]
#set $shutter_empty [class="Shutter" title="^Session - Shutter$"]
#set $shutter_image [class="Shutter" title=".png - Shutter$"]
#for_window $shutter move scratchpad
#for_window $shutter_empty move scratchpad
#for_window $shutter_image move scratchpad
#bindcode 107 $shutter scratchpad show
# Calculator
for_window [class="Gnome-calculator"] floating enable
# pavucontrol (pulse audio control panel)
for_window [class="Pavucontrol"] floating enable
# feh (Image viewer)
for_window [class="feh"] floating enable
# SpiderOak
for_window [class="SpiderOakONE"] floating enable
# mplayer
for_window [class="mplayer2"] floating enable
# Wine
for_window [instance="explorer.exe"] floating enable
for_window [class="Wine"] floating enable
for_window [class="Crossover"] floating enable
# TeamViewer
for_window [instance="TeamViewer.exe"] floating enable
# UMongo
for_window [class="com-edgytech-umongo-UMongo"] floating enable
# Crossover
for_window [class="Crossover"] floating enable
# Tk
for_window [class="Tk"] floating enable
# PuTTY
for_window [class="Putty"] floating enable
# Chrome web browser
#for_window [instance="^google-chrome$" class="Google-chrome"] floating disable
# YouTube (Chrome app)
#for_window [instance="youtube\.com" class="Google-chrome"] floating disable
assign [instance="youtube\.com" class="Google-chrome"] workspace 4
# Twitch.tv (Chrome app)
#for_window [instance="twitch\.tv" class="Google-chrome"] floating disable
assign [instance="twitch\.tv" class="Google-chrome"] workspace 4
# Netflix (Chrome app)
#for_window [instance="netflix\.com" class="Google-chrome"] floating disable
assign [instance="netflix\.com" class="Google-chrome"] workspace 4
# Crunchyroll (Chrome app)
#for_window [instance="crunchyroll\.com" class="Google-chrome"] floating disable
assign [instance="crunchyroll\.com" class="Google-chrome"] workspace 4
# Facebook messenger (Chrome app)
#for_window [instance="www\.messenger\.com"] floating disable
assign [instance="www\.messenger\.com"] workspace 3
# Vivaldi
#for_window [class="Vivaldi-stable"] floating disable
for_window [class="Vivaldi-stable" window_role="pop-up"] floating enable
assign [class="Vivaldi-stable"] workspace 1
# Spotify
#for_window [class="Spotify"] floating disable
assign [class="Spotify"] workspace 4
# LibreOffice
#for_window [class="libreoffice-calc"] floating disable
for_window [class="libreoffice-calc" window_type="dialog"] floating enable
# Slack
for_window [class="Slack" title="^Slack Call"] floating enable
assign [class="Slack"] workspace 3
# SmartGit
#for_window [class="^SmartGit$"] floating disable
# Steam
for_window [class="^Steam$" title="^Settings$"] floating enable
assign [class="^Steam$"] workspace 5
# Lutris
for_window [class="^Lutris$" window_type="dialog"] floating enable
assign [class="^Lutris$"] workspace 5
# Viber
#for_window [class="Viber"] floating disable
assign [class="Viber"] workspace 3
# TeamSpeak 3 (ts3)
assign [class="^TeamSpeak 3$"] workspace 3
for_window [class="^TeamSpeak 3$" title="^Bookmarks$"] floating enable
# xev
for_window [title="Event Tester"] floating enable
# Dota 2
for_window [class="dota2"] fullscreen enable
assign [class="dota2"] workspace 6
# Stardew Valley
for_window [class="StardewValley.bin.x86_64"] fullscreen enable
assign [class="StardewValley.bin.x86_64"] workspace 6
# CS GO
for_window [class="csgo_linux64"] fullscreen enable
assign [class="csgo_linux64"] workspace 6
# Open Broadcast Studio
for_window [class="obs" window_type="dialog"] floating enable
assign [class="obs"] workspace 9
# Focus urgent window (the one with red borders)
bindsym $mod+bar [urgent=latest] focus
# start a terminal
bindsym $mod+Return exec xfce4-terminal --disable-server
# kill focused window
bindsym $mod+Shift+q kill
bindsym $mod+Ctrl+w kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
bindsym $mod+Shift+d exec --no-startup-id j4-dmenu-desktop
# change focus
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
# 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
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# move focused workspace
bindsym $mod+Ctrl+Shift+k move workspace to output up
bindsym $mod+Ctrl+Shift+l move workspace to output right
bindsym $mod+Ctrl+Shift+j move workspace to output down
bindsym $mod+Ctrl+Shift+h move workspace to output left
bindsym $mod+Ctrl+Shift+Up move workspace up
bindsym $mod+Ctrl+Shift+Right move workspace right
bindsym $mod+Ctrl+Shift+Down move workspace down
bindsym $mod+Ctrl+Shift+Left move workspace left
# split in horizontal orientation
bindsym $mod+c 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, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# 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
bindsym $mod+Shift+a focus child
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# switch to next/previous workspace with mod+pageup/pagedown
bindsym $mod+Next workspace prev
bindsym $mod+Prior workspace next
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# Resize mode
bindsym $mod+r mode "resize"
# Move mode
bindsym $mod+m mode "move"
#bindsym $mod+Shift+c reload
#bindsym $mod+Shift+r restart
bindsym $mod+Shift+c exec "bash $HOME/Dropbox/Personal/config_sync/i3/build.sh; i3-msg reload"
bindsym $mod+Shift+r exec "bash $HOME/Dropbox/Personal/config_sync/i3/build.sh; i3-msg restart"
# bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# Ctrl+Win+Alt+Escape exits the window manager
bindsym $mod+Ctrl+Mod1+Escape exit
# Turn off screen
bindsym $mod+F7 exec "xset dpms force off"
bindsym $mod+Shift+F9 exec "systemctl suspend; i3lock -i /home/tomas/lock-screen.png -n -d -I 7200 -e -c 333333; xset -dpms"
bindsym $mod+F9 exec "i3lock -i /home/tomas/lock-screen.png -n -d -I 7200 -e -c 333333; xset -dpms"
bindsym $mod+F10 exec "nautilus -w"
bindsym $mod+F12 exec "gnome-control-center sound; unity-control-center sound"
# Focus the main browser window
bindsym $mod+i [class="Vivaldi-stable"] focus
# Screenshot button
bindcode 107 exec "screenshot"
bindcode Shift+107 exec "screenshot -s"
bindcode Ctrl+107 exec "xdg-open $HOME/Pictures/Screenshots"
# Volume buttons
bindcode 121 exec "amixer set Master toggle; killall i3status -USR1"
bindcode 122 exec "vol -5%; killall i3status -USR1"
bindcode 123 exec "vol +5%; killall i3status -USR1"
# Brightness buttons
#bindcode 232 exec "xbacklight -dec 15% -time 50"
#bindcode 233 exec "xbacklight -inc 15% -time 50"
bindcode 232 exec "bl dec"
bindcode 233 exec "bl inc"
bindcode 224 exec "bl dec"
bindcode 225 exec "bl inc"
bindcode Shift+232 exec "bl min"
bindcode Shift+233 exec "bl max"
bindcode Shift+224 exec "bl min"
bindcode Shift+225 exec "bl max"
# Search button
bindcode 217 exec --no-startup-id j4-dmenu-desktop
# Play/pause, prev, next
bindcode 172 exec "playerctl play-pause"
bindcode 173 exec "playerctl previous"
bindcode 171 exec "playerctl next"
gaps inner 20
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
bindsym k gaps inner current plus 5
bindsym j gaps inner current minus 5
bindsym 0 gaps inner current set 0
bindsym Shift+k gaps inner current plus 30
bindsym Shift+j gaps inner current minus 30
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym k gaps outer current plus 5
bindsym j gaps outer current minus 5
bindsym 0 gaps outer current set 0
bindsym Shift+k gaps outer current plus 30
bindsym Shift+j gaps outer current minus 30
bindsym Shift+0 gaps outer current set 0
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "move" {
bindsym h move left 10 px
bindsym j move down 10 px
bindsym k move up 10 px
bindsym l move right 10 px
bindsym Shift+h move left 100 px
bindsym Shift+j move down 100 px
bindsym Shift+k move up 100 px
bindsym Shift+l move right 100 px
bindsym Ctrl+h move left 500 px
bindsym Ctrl+j move down 500 px
bindsym Ctrl+k move up 500 px
bindsym Ctrl+l move right 500 px
bindsym Mod1+h move left 1 px
bindsym Mod1+j move down 1 px
bindsym Mod1+k move up 1 px
bindsym Mod1+l move right 1 px
bindsym Return mode "default"
bindsym Escape mode "default"
}
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 h resize shrink width 10 px or 3 ppt
bindsym j resize shrink height 10 px or 3 ppt
bindsym k resize grow height 10 px or 3 ppt
bindsym l resize grow width 10 px or 3 ppt
bindsym Shift+h resize shrink width 100 px or 10 ppt
bindsym Shift+j resize shrink height 100 px or 10 ppt
bindsym Shift+k resize grow height 100 px or 10 ppt
bindsym Shift+l resize grow width 100 px or 10 ppt
bindsym Ctrl+h resize shrink width 500 px or 50 ppt
bindsym Ctrl+j resize shrink height 500 px or 50 ppt
bindsym Ctrl+k resize grow height 500 px or 50 ppt
bindsym Ctrl+l resize grow width 500 px or 50 ppt
bindsym Mod1+h resize shrink width 1 px or 1 ppt
bindsym Mod1+j resize shrink height 1 px or 1 ppt
bindsym Mod1+k resize grow height 1 px or 1 ppt
bindsym Mod1+l resize grow width 1 px or 1 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
exec --no-startup-id "/bin/bash -c '[[ -f $HOME/autostart.sh ]] && . $HOME/autostart.sh &>> $HOME/autostart.log'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment