Skip to content

Instantly share code, notes, and snippets.

@NeMO84
Last active June 8, 2018 04:02
Show Gist options
  • Save NeMO84/da56bb3685f71dd841e037b8e9ed1ed7 to your computer and use it in GitHub Desktop.
Save NeMO84/da56bb3685f71dd841e037b8e9ed1ed7 to your computer and use it in GitHub Desktop.
i3wm config file
# 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 some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
# 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: Monaco 10
# Use custom colors for black
set $black #282828
set $darkblack #1d2021
set $transparent #00000000
client.focused $black $black $darkwhite $darkblack $darkblack
client.unfocused $black $black $white $darkblack $darkblack
client.focused_inactive $black $black $white $darkblack $darkblack
client.urgent $darkred $darkred $black $darkred $darkred
client.background $black
# 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 TERMINAL=tilix i3-sensible-terminal -p i3wm
# kill focused window
bindsym $mod+Shift+q kill
bindsym $mod+Shift+c kill
# start dmenu (a program launcher)
# bindsym $mod+d exec dmenu_run
# 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 $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus; changed to vim bindings
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+o split v
# split in vertical orientation
bindsym $mod+v split h
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# 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+d focus child
# setup workspaces
set $term "0:"
set $web "1:"
set $code "2:"
set $chat "3:"
set $music "4:"
set $games "5:"
# switch workspaces
bindsym $mod+grave workspace $term
bindsym $mod+1 workspace $web
bindsym $mod+2 workspace $code
bindsym $mod+3 workspace $chat
bindsym $mod+4 workspace $music
bindsym $mod+5 workspace $games
# move focused container to workspace
bindsym $mod+Shift+grave move container to workspace $term
bindsym $mod+Shift+1 move container to workspace $web
bindsym $mod+Shift+2 move container to workspace $code
bindsym $mod+Shift+3 move container to workspace $chat
bindsym $mod+Shift+4 move container to workspace $music
bindsym $mod+Shift+5 move container to workspace $games
# helper to see active window
bindsym $mod+semicolon exec i3-msg border pixel 3
bindsym --release $mod+semicolon exec i3-msg border pixel 0
# auto assign new windows to workspaces
assign [class="(?i)chrome" window_role="browser"] $web
assign [class="(?i)code"] $code
assign [class="(?i)sublime"] $code
assign [class="(?i)slack"] $chat
assign [class="(?i)chrome" window_role="app"] $chat
assign [class="(?i)spotify"] $music
assign [class="(?i)google" class="(?i)play"] $music
assign [class="(?i)steam"] $games
# handle floating windows
for_window [window_role="pop-up"] floating enable
for_window [class="(?i)google-chrome" window_role="app"] floating enable
for_window [class="(?i)spotify"] floating enable
for_window [class="(?i)google" class="(?i)play"] floating enable
for_window [class="(?i)rhythmbox"] floating enable
for_window [class="(?i)slack"] floating enable
for_window [class="(?i)hangouts"] floating enable
for_window [class="(?i)steam"] floating enable
# set window settings
new_window none
floating_minimum_size 75 x 50
floating_maximum_size -1 x -1
# reload the configuration file
bindsym $mod+Shift+o 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 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'"
## custom binds
# lock screen
bindsym Ctrl+l exec --no-startup-id "gnome-screensaver-command --lock"
bindsym Ctrl+Pause exec --no-startup-id "gnome-screensaver-command --lock && systemctl syspend"
# audio functionality (original)
bindsym XF86AudioMute exec amixer -qD pulse sset Master 1+ toggle
bindsym XF86AudioLowerVolume exec amixer -qD pulse sset Master 5%- unmute
bindsym XF86AudioRaiseVolume exec amixer -qD pulse sset Master 5%+ unmute
bindsym XF86AudioPrev exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
bindsym XF86AudioPlay exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
bindsym XF86AudioNext exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
# audio functionality (w/mod key)
bindsym $mod+F1 exec amixer -qD pulse set Master 1+ toggle
bindsym $mod+F2 exec amixer -qD pulse sset Master 5%- unmute
bindsym $mod+F3 exec amixer -qD pulse sset Master 5%+ unmute
bindsym $mod+F5 exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
bindsym $mod+F6 exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
bindsym $mod+F7 exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
set $scale 5
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the widow’s height.
# Pressing down will grow the window’s height.
#bindsym j resize shrink width $scale px or $scale ppt
#bindsym k resize grow height $scale px or $scale ppt
#bindsym l resize shrink height $scale px or $scale ppt
#bindsym semicolon resize grow width $scale px or $scale ppt
bindsym j resize grow height $scale px or $scale ppt
bindsym k resize shrink height $scale px or $scale ppt
bindsym s resize shrink width $scale px or $scale ppt
bindsym g resize grow width $scale px or $scale ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width $scale px or $scale ppt
bindsym Down resize grow height $scale px or $scale ppt
bindsym Up resize shrink height $scale px or $scale ppt
bindsym Right resize grow width $scale px or $scale 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: FontAwesome, Font Awesome 5 Free 18
# position bottom
# strip_workspace_numbers yes
#}
## AUTOSTART APPLICATIONS
# daemons and applets
# exec once
exec --no-startup-id compton --config ~/.config/compton.conf -b
exec --no-startup-id variety &
exec --no-startup-id nm-applet &
exec --no-startup-id ulauncher &
# exec always
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment