Skip to content

Instantly share code, notes, and snippets.

@Marahin
Created February 15, 2016 23:10
Show Gist options
  • Save Marahin/f1cbff656a7f06c03f36 to your computer and use it in GitHub Desktop.
Save Marahin/f1cbff656a7f06c03f36 to your computer and use it in GitHub Desktop.
#Mod1 for ALT and Mod4 for Winkey
set $modkey Mod4
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
#
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# font pango:Inconsolata 10
# font pango:Hermit 9
# font pango:DejaVu Sans Mono 9
# font pango:Cousine 10
# font pango:Inconsolata Medium 10
# font pango: Liberation Mono regular 09
font pango: Monospace 09
# 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:DejaVu Sans Mono 9
# 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 these keys for focus, movement, and resize directions when reaching for
# the arrows is not convenient
set $up l
set $down k
set $left j
set $right semicolon
# use Mouse+$modkey to drag floating windows to their wanted position
floating_modifier $modkey
# start a terminal
# bindsym $modkey+Return exec --no-startup-id uxterm
# bindsym $modkey+Return exec --no-startup-id urxvt
# bindsym $modkey+Return exec --no-startup-id terminology
# bindsym $modkey+Return exec --no-startup-id xterm
# bindsym $modkey+Return exec --no-startup-id termite
bindsym $modkey+Return exec --no-startup-id i3-sensible-terminal
# kill focused window
bindsym $modkey+Shift+q kill
# start dmenu (a program launcher)
# bindsym $modkey+d exec --no-startup-id dmenu_run
# bindsym $modkey+d exec --no-startup-id rofi -show run
bindsym $modkey+d exec --no-startup-id rofi -show run -font "Liberation Mono regular 10" -fg "#D3DAE3" -bg "#383C4A" -hlfg "#000000" -hlbg "#5294e2"
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $modkey+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $modkey+$left focus left
bindsym $modkey+$down focus down
bindsym $modkey+$up focus up
bindsym $modkey+$right focus right
# alternatively, you can use the cursor keys:
bindsym $modkey+Left focus left
bindsym $modkey+Down focus down
bindsym $modkey+Up focus up
bindsym $modkey+Right focus right
# move focused window
bindsym $modkey+Shift+$left move left
bindsym $modkey+Shift+$down move down
bindsym $modkey+Shift+$up move up
bindsym $modkey+Shift+$right move right
bindsym ISO_Level3_Shift+Left move left
bindsym ISO_Level3_Shift+Down move down
bindsym ISO_Level3_Shift+Up move up
bindsym ISO_Level3_Shift+Right move right
# alternatively, you can use the cursor keys:
bindsym $modkey+Shift+Left move left
bindsym $modkey+Shift+Down move down
bindsym $modkey+Shift+Up move up
bindsym $modkey+Shift+Right move right
# split in horizontal orientation
bindsym $modkey+h split h
# split in vertical orientation
bindsym $modkey+v split v
# enter fullscreen mode for the focused container
bindsym $modkey+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $modkey+s layout stacking
bindsym $modkey+w layout tabbed
bindsym $modkey+e layout toggle split
# toggle tiling / floating
bindsym $modkey+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $modkey+space focus mode_toggle
# focus the parent container
bindsym $modkey+a focus parent
# focus the child container
bindsym $modkey+z focus child
# move the currently focused window to the scratchpad
bindsym $modkey+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $modkey+minus scratchpad show
# Shortcuts for workspaces
set $WK1 1:
set $WK2 2:
set $WK3 3:
set $WK4 4:
set $WK5 5:
set $WK6 6:
set $WK7 7:
set $WK8 8:
set $WK9 9:
set $WK10 10:
# switch to workspace
bindsym $modkey+1 workspace $WK1
bindsym $modkey+2 workspace $WK2
bindsym $modkey+3 workspace $WK3
bindsym $modkey+4 workspace $WK4
bindsym $modkey+5 workspace $WK5
bindsym $modkey+6 workspace $WK6
bindsym $modkey+7 workspace $WK7
bindsym $modkey+8 workspace $WK8
bindsym $modkey+9 workspace $WK9
bindsym $modkey+0 workspace $WK10
# move focused container to workspace
bindsym $modkey+Shift+1 move container to workspace $WK1
bindsym $modkey+Shift+2 move container to workspace $WK2
bindsym $modkey+Shift+3 move container to workspace $WK3
bindsym $modkey+Shift+4 move container to workspace $WK4
bindsym $modkey+Shift+5 move container to workspace $WK5
bindsym $modkey+Shift+6 move container to workspace $WK6
bindsym $modkey+Shift+7 move container to workspace $WK7
bindsym $modkey+Shift+8 move container to workspace $WK8
bindsym $modkey+Shift+9 move container to workspace $WK9
bindsym $modkey+Shift+0 move container to workspace $WK10
# reload the configuration file
bindsym $modkey+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $modkey+Shift+r restart
# exit i3 (logs you out of your X session)
# bindsym $modkey+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'"
# 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 $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
# 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 $modkey+r mode "resize"
#bindsym $modkey+r mode "resize" ISO_Level3_Shift
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
# I will set variable to color, so it`ll get more practical
set $red #ff0000
set $green #00ff00
set $blue #002bff
set $white #ffffff
set $black #000000
set $darkgray #808080
set $ligray #c0c0c0
set $darkgreen #009900
set $dkkgray #606060
set $dkkkgray #404040
set $niceblue #2054CD
set $nicegreen #00cc66
set $ice #ECECEC
set $ADbg #383C4A
set $ADhl #D3DAE3
set $ADred #cd626d
# My first bar
bar {
# output LVDS1
mode dock
# tray_output LVDS1
position top
status_command i3status
font pango: Monospace 10
colors {
#Where #Color
background $ADbg
statusline $ADhl
#Where #Border #Background #Text
focused_workspace $black $ADhl $black
urgent_workspace $red $ADhl $black
}
separator_symbol ")("
}
##################################
##### Personal configuration #####
##################################
# 1. Startup configurations
# This will set the background
# exec_always --no-startup-id sh ~/.fehbg
# This will 'configure' some settings.
# exec --no-startup-id sh ~/.configs.sh
exec --no-startup-id compton -b
# exec --no-startup-id megasync > /dev/null 2>&1 &
# bindsym --release Caps_Lock exec --no-startup-id ~/Programming/Shell/capsnum.sh 1 > /dev/null 2>&1
# bindsym --release Num_Lock exec --no-startup-id ~/Programming/Shell/capsnum.sh 2 > /dev/null 2>&1
# exec --no-startup-id ~/Programming/Shell/internet.sh > /dev/null 2>&1 &
# exec --no-startup-id ~/Programming/Shell/pacman.sh > /dev/null 2>&1 &
bindsym $modkey+m bar mode toggle
# 2. Borders
# hide_edge_borders both
new_window pixel 2
# 3. Specific Workspace
workspace_auto_back_and_forth yes
force_display_urgency_hint 500 ms
# 4. Colors
# Class border backgr text indic
client.focused $ADred $ADred $black $ADred
client.focused_inactive $darkgray $black $white
client.unfocused $darkgray $black $darkgray
client.urgent $red $ADhl $red
client.placeholder $darkgray $black $ADred
# 5. Shutdown and others commands
#set $Locker i3lock -c 000000 && sleep 1 && xset dpms force off
set $Locker i3lock
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown, (b) off-screen
mode "$mode_system" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym b exec --no-startup-id sleep 1 && xset dpms force off, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $modkey+Shift+e mode "$mode_system"
# 6. Some hotkeys
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -q sset 'Master' 05%+ #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -q sset 'Master' 05%- #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id amixer -q sset 'Master' toggle # mute sound
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -steps 1 -inc 20%
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -steps 1 -dec 20%
# Media player controls
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioPause exec --no-startup-id playerctl pause
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioStop exec --no-startup-id playerctl stop
# 7. Floating dialogs
#for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [class="SimpleScreenRecorder"] floating enable
for_window [class="Galculator"] floating enable
for_window [class="Notifyconf"] floating enable
floating_minimum_size 0 x 0
floating_maximum_size 0 x 0
# 8. Assigning some apps to specifics workspaces
#assign [class="Chromium" window_role="browser"] $WK2
#assign [class="Google-chrome" window_role="browser"] $WK2
#assign [class="google-chrome" window_role="browser"] $WK2
# 9. Auto exec some apps
# 10. Some keybinds
bindsym $modkey+o exec --no-startup-id i3-msg open
bindsym $modkey+Shift+w kill; exec --no-startup-id i3-msg open
bindsym Print exec --no-startup-id scrot -m -q 60 '%Y-%m-%d-%H:%M:%S-$wx$h.png' -e 'mv "$f" ~/Pictures/Screenshots/'
bindsym $modkey+Print exec --no-startup-id scrot -s -q 90 '%Y-%m-%d-%H:%M:%S-$wx$h.png' -e 'mv "$f" ~/Pictures/Screenshots/'
bindsym --release --border button2 kill
bindsym --whole-window $modkey+button2 kill
######################################################################
# automatically start i3-config-wizard to offer the user to create a
# keysym-based config which used their favorite modifier (alt or windows)
#
# i3-config-wizard will not launch if there already is a config file
# in ~/.i3/config.
#
# Please remove the following exec line:
#######################################################################
exec --no-startup-id i3-config-wizard
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
color_good = "#5294e2"
color_bad = "#cd626d"
color_degraded = "#F5D76E"
output_format = i3bar
interval = 02
}
order += "disk /"
order += "disk /home"
order += "run_watch SSH"
order += "wireless wlp1s0"
order += "ethernet enp2s0f5"
#order += "battery 0"
order += "cpu_temperature 0"
#order += "load"
order += "cpu_usage"
#order += "volume master"
order += "tztime local"
cpu_temperature 0 {
format = ":%degrees ºC"
max_threshold = 70
path = "/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input"
}
wireless wlp1s0 {
#format_up = ":%quality %ip"
format_up = ":%quality"
format_down = ":down"
#color_good = "#00cc66"
#color_bad = "#ffff00"
#color_degraded = "#002bff"
}
ethernet enp2s0f5 {
#if you use %speed, i3status requires root privileges
format_up = ":%ip"
format_down = ""
#color_good = "#00cc66"
#color_bad = "#ffff00"
#color_degraded = "#002bff"
}
battery 0 {
format = ":%status %remaining"
status_chr = "⚇ Chr"
status_bat = "⚡ Bat"
status_full = "☻ Full"
low_threshold = "20"
threshold_type = "time"
format_down = "No battery"
#color_degraded = "#ffff00"
#color_good = "#00cc66"
}
run_watch DHCP {
pidfile = "/var/run/dhclient*.pid"
}
run_watch SSH {
pidfile = "/var/run/ssh*.pid"
format = "%title"
#color_bad = "#ffff00"
}
run_watch VPN {
pidfile = "/var/run/vpnc/pid"
}
tztime local {
format = "%d/%m/%y %H:%M:%S"
}
load {
format = "%1min"
}
cpu_usage {
format = ":%usage"
}
volume master {
format = ":%volume"
format_muted = ":%volume"
device = "default"
mixer = "Master"
}
disk "/" {
format = ":%used"
prefix_type = custom
low_threshold = 50
threshold_type = percentage_free
}
disk "/home" {
format = ":%used"
prefix_type = custom
low_threshold = 50
threshold_type = percentage_free
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment