Skip to content

Instantly share code, notes, and snippets.

@torkelo
Created September 30, 2014 05:02
Show Gist options
  • Save torkelo/c7a4aff4a79aeb6c2a17 to your computer and use it in GitHub Desktop.
Save torkelo/c7a4aff4a79aeb6c2a17 to your computer and use it in GitHub Desktop.
i3config inspiration
# ----------------------------------------------------------------------
# file: ~/.i3/config
# author: moparx - http://moparx.com/configs
# last mod: 08/16/2014 - 10:55 EDT
# vim: set ai et fenc=utf-8 ft=config nu si sts=0 sw=4 ts=8 tw=0 :
# ----------------------------------------------------------------------
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Assign variables -----------------------------------------------------
set $mod Mod4
set $WS1 web
set $WS2 chat
set $WS3 term
set $WS4 media
set $WS5 games
set $WS6 projects
set $WS7 misc
# Launch the initial applications --------------------------------------
exec --no-startup-id clipit
exec --no-startup-id dunst
exec --no-startup-id redshift-gtk
exec --no-startup-id fetchmail -d 300
exec --no-startup-id gpg-agent --daemon
exec --no-startup-id mpd
exec --no-startup-id mpdscribble
exec --no-startup-id nitrogen --restore
exec --no-startup-id udiskie -ans
exec --no-startup-id unclutter -noevents
exec --no-startup-id urxvtd -q -f -o
exec --no-startup-id xautolock -time 15 -locker "i3lock -eti ~/.i3/archlinux.png"
exec --no-startup-id xset dpms 600
exec --no-startup-id i3-msg "workspace $WS1; exec firefox; layout tabbed"
exec --no-startup-id i3-msg "workspace $WS2; exec urxvtc -e fish"
exec --no-startup-id i3-msg "workspace $WS2; exec urxvtc -e mutt"
exec --no-startup-id mpv ~/.i3/login.ogg
# Assign window colors and controls ------------------------------------
hide_edge_borders both
# Assign colors
# Class Border Bg Text
client.focused #6092BE #6092BE #FFFFFF
client.focused_inactive #8AB4DA #8AB4DA #B9D5EF
client.unfocused #B9D5EF #B9D5EF #3E719F
client.urgent #550000 #801515 #D46A6A
client.background #3E719F
# Assign windows to their respective workspaces
assign [class="Chromium|Dwb|Firefox|Uzbl-core"] web
assign [class="Gtk-youtube-viewer|mpv|MPlayer|Vlc"] media
assign [class="^Minecraft .*" instance="^Minecraft .*"] games
assign [class="mumble"] chat
assign [class="net-minecraft-bootstrap-Bootstrap|Steam"] games
# Assign window changes
for_window [class="BleachBit|feh|Fslint-gui|MPlayer|mpv|Mumble|nitrogen|Pavucontrol|Steam|Synergy"] floating enable
for_window [title="^Minecraft .*"] floating enable
for_window [title="Steam - Update News"] kill
for_window [class="Termite|URxvt"] border 1pixel
# Assign miscellaneous keybinds ----------------------------------------
# dmenu-frecency (https://github.com/kspi/dmenu-frecency)
# A Python-powered dmenu wrapper which sorts application results based on frequency and recency of use.
bindsym $mod+e exec --no-startup-id ~/bin/dmenu-frecency
# quickswitch (https://github.com/proxypoke/quickswitch-for-i3)
# A Python-powered dmenu window switcher.
bindsym Mod1+Tab exec --no-startup-id ~/bin/quickswitch.py -d "dmenu -b -i -l 20 -nb \#285577 -nf \#FFFFFF -sb \#B9D5EF -sf \#3E719F"
# mpdmenu (https://github.com/k00mi/mpdmenu)
# A small bash script for controlling MPD through dmenu.
bindsym Mod1+Mod4+Up exec --no-startup-id ~/bin/mpdmenu.sh
# Search Engines
bindsym Mod1+Shift+apostrophe exec --no-startup-id xsel -o | dmenu -p DuckDuckGo: -nb \#285577 -nf \#FFFFFF -sb \#B9D5EF -sf \#3E719F | xargs -I {} dwb https://duckduckgo.com/\?q={}
bindsym Mod1+Shift+comma exec --no-startup-id xsel -o | dmenu -p StartPage: -nb \#285577 -nf \#FFFFFF -sb \#B9D5EF -sf \#3E719F | xargs -I {} dwb https://startpage.com/do/search/\?query={}
bindsym Mod1+Shift+period exec --no-startup-id xsel -o | dmenu -p "Arch Wiki:" -nb \#285577 -nf \#FFFFFF -sb \#B9D5EF -sf \#3E719F | xargs -I {} dwb https://wiki.archlinux.org/index.php/Special:Search\?search={}
# Screenshots
bindsym --release Print exec --no-startup-id scrot "%Y-%m-%d_moparx.png' -t 10% -e 'feh -. $f"
bindsym --release Shift+Print exec --no-startup-id scrot -d 4 "%Y-%m-%d_moparx.png' -t 10% -e 'feh -. $f"
# Power control script - a useful replacement for the normal i3 exiting keybind.
# https://wiki.archlinux.org/index.php/i3#Shutdown.2C_reboot.2C_lock_screen
set $mode_system System (1) lock, (2) logout, (3) suspend, (4) hibernate, (5) reboot, (6) shutdown
mode "$mode_system" {
bindsym 1 exec --no-startup-id ~/bin/i3exit lock, mode "default"
bindsym 2 exec --no-startup-id ~/bin/i3exit logout, mode "default"
bindsym 3 exec --no-startup-id ~/bin/i3exit suspend, mode "default"
bindsym 4 exec --no-startup-id ~/bin/i3exit hibernate, mode "default"
bindsym 5 exec --no-startup-id ~/bin/i3exit reboot, mode "default"
bindsym 6 exec --no-startup-id ~/bin/i3exit shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Pause mode "$mode_system"
# General settings (note: keybinds set to dvorak) ----------------------
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:Terminus 10
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
#bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec urxvtc -e fish
#bindsym $mod+Return exec termite -e fish
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
#bindsym $mod+e exec --no-startup-id j4-dmenu-desktop --dmenu="dmenu -i -nb \#285577 -nf \#FFFFFF -sb \#B9D5EF -sf \#3E719F -p 'Run:'"
# change focus
bindsym $mod+h focus left
bindsym $mod+t focus down
bindsym $mod+n focus up
bindsym $mod+s 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+t move down
bindsym $mod+Shift+n move up
bindsym $mod+Shift+s 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+d split h
# split in vertical orientation
bindsym $mod+k split v
# enter fullscreen mode for the focused container
bindsym $mod+u fullscreen
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+o layout stacking
bindsym $mod+comma layout tabbed
bindsym $mod+period 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+e focus child
# switch to workspace
bindsym $mod+1 workspace $WS1
bindsym $mod+2 workspace $WS2
bindsym $mod+3 workspace $WS3
bindsym $mod+4 workspace $WS4
bindsym $mod+5 workspace $WS5
bindsym $mod+6 workspace $WS6
bindsym $mod+7 workspace $WS7
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $WS1
bindsym $mod+Shift+2 move container to workspace $WS2
bindsym $mod+Shift+3 move container to workspace $WS3
bindsym $mod+Shift+4 move container to workspace $WS4
bindsym $mod+Shift+5 move container to workspace $WS5
bindsym $mod+Shift+6 move container to workspace $WS6
bindsym $mod+Shift+7 move container to workspace $WS7
# reload the configuration file
bindsym $mod+Shift+comma reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+p restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+period 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'"
# 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 h resize shrink width 10 px or 10 ppt
bindsym t resize grow height 10 px or 10 ppt
bindsym n resize shrink height 10 px or 10 ppt
bindsym s 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 Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+p mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
font pango:Terminus, Icons 10
status_command python ~/.config/i3pystatus/config.py
position top
tray_output DVI-I-2
colors {
background #3E719F
statusline #E8F2FC
separator #B9D5EF
#Class Border Bg Text
focused_workspace #153F60 #285577 #FFFFFF
active_workspace #688CA7 #416B8B #FFFFFF
inactive_workspace #688CA7 #416B8B #FFFFFF
urgent_workspace #550000 #801515 #D46A6A
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment