Organize i3 config

This commit is contained in:
Austen Adler 2016-06-01 18:41:40 -04:00
parent a6a563746c
commit fc1f4b672b

201
i3/config
View File

@ -1,106 +1,56 @@
# Variables
set $mod Mod4 set $mod Mod4
set $x_switch workspace
# Assignments
for_window [class=ownCloud] floating disable for_window [class=ownCloud] floating disable
assign [class=Firefox] 2 assign [class=Firefox] 2
assign [class=midori4] 2 assign [class=midori4] 2
assign [class=Chromium-browser] 2 assign [class=Chromium-browser] 2
exec --no-startup-id "zsh -c 'xrandr --output LVDS1 --primary || xrandr --output HDMI3 --primary'"
# Bindings
floating_modifier $mod
# Hide/show bar
bindsym $mod+apostrophe bar mode hide bindsym $mod+apostrophe bar mode hide
bindsym $mod+shift+apostrophe bar mode dock bindsym $mod+shift+apostrophe bar mode dock
# Rename a workspace
bindsym $mod+shift+d exec i3-input -F 'rename workspace to "%s"' -P 'Rename to: ' bindsym $mod+shift+d exec i3-input -F 'rename workspace to "%s"' -P 'Rename to: '
bindsym $mod+semicolon exec quickswitch.py -d 'rofi -font "Monospace 12" -dmenu' # Rofi shortcuts
bindsym $mod+p exec rofi -font "Monospace 12" -show run bindsym $mod+p exec rofi -font "Monospace 12" -show run
#bindsym $mod+shift+p exec "~/.i3/run.sh pass"
bindsym $mod+shift+p exec "rofi-pass" bindsym $mod+shift+p exec "rofi-pass"
# Misc shortcuts
bindsym --release Num_Lock exec "xdotool key --clearmodifiers Shift+Insert;numlockx on" bindsym --release Num_Lock exec "xdotool key --clearmodifiers Shift+Insert;numlockx on"
workspace_layout tabbed
bindsym Print exec "shutter -s" bindsym Print exec "shutter -s"
# Split in vertical orientation
#exec --no-startup-id xautolock -time 10 -locker '~/.i3/run.sh screensaver'
set $bg #121212
set $fg #9f9f9f
set $hi #efef8f
set $ac #a0afa0
set $tx #ffffff
set $ia #8f8f8f
set $be #8faf9f
set $yw #ccdc90
set $gn #88b090
set $rd #e89393
## set some nice colors border background text
client.focused #2f2f2f #2f2f2f #ffffff
client.unfocused $bg $bg $ia
client.focused_inactive $bg $bg $ac
client.urgent $rd $rd $tx
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
smart_borders on
bar {
height 12
status_command i3status --config ~/.i3/i3status.conf
#status_command i3blocks -c ~/.i3/i3blocks.conf
font -*-*-*-*-*-*-8-*-*-*-*-*-*-*
mode dock
#position top
modifier Mod4
colors {
background $bg
statusline $fg
separator $hi
focused_workspace $gn $bg $ac
active_workspace $gn $ac $tx
inactive_workspace $bg $bg $ia
urgent_workspace $rd $bg $ac
}
}
new_window pixel 1
# split in vertical orientation
bindsym $mod+v split h bindsym $mod+v split h
# split in horizontal orientation # Split in horizontal orientation
bindsym $mod+shift+v split v bindsym $mod+shift+v split v
# Use keyboard as a mouse
# split in vertical orientation
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
bindsym $mod+h resize shrink width 1 px or 1 ppt
bindsym $mod+j resize grow height 1 px or 1 ppt
bindsym $mod+k resize shrink height 1 px or 1 ppt
bindsym $mod+l resize grow width 1 px or 1 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 15 px or 15 ppt
bindsym Down resize grow height 15 px or 15 ppt
bindsym Up resize shrink height 15 px or 15 ppt
bindsym Right resize grow width 15 px or 15 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
floating_modifier $mod
bindsym $mod+z exec xdotool click 1 bindsym $mod+z exec xdotool click 1
bindsym $mod+shift+z exec xdotool click 3 bindsym $mod+shift+z exec xdotool click 3
# Show/hide title
bindsym $mod+i border normal bindsym $mod+i border normal
bindsym $mod+shift+i border 1pixel bindsym $mod+shift+i border 1pixel
# Run a terminal
bindsym $mod+Return exec urxvt bindsym $mod+Return exec urxvt
bindsym $mod+shift+Return exec urxvt -cd `xcwd` bindsym $mod+shift+Return exec urxvt -cd `xcwd`
# Terminate program
bindsym $mod+shift+c kill bindsym $mod+shift+c kill
bindsym $mod+c move absolute position center # XF86 Buttons
bindsym $mod+F1 exec "~/.i3/run.sh lock"
bindsym XF86MonBrightnessUp exec "xbacklight -inc 10 -time 0 -steps 1" bindsym XF86MonBrightnessUp exec "xbacklight -inc 10 -time 0 -steps 1"
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10 -time 0 -steps 1" bindsym XF86MonBrightnessDown exec "xbacklight -dec 10 -time 0 -steps 1"
bindsym $mod+XF86MonBrightnessUp exec "xbacklight -inc 5 -time 0 -steps 1" bindsym $mod+XF86MonBrightnessUp exec "xbacklight -inc 5 -time 0 -steps 1"
bindsym $mod+XF86MonBrightnessDown exec "xbacklight -dec 5 -time 0 -steps 1" bindsym $mod+XF86MonBrightnessDown exec "xbacklight -dec 5 -time 0 -steps 1"
bindsym XF86TouchpadToggle exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')" bindsym XF86TouchpadToggle exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
bindsym $mod+backslash exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
bindsym XF86AudioRaiseVolume exec "amixer set Master 1%+ unmute" bindsym XF86AudioRaiseVolume exec "amixer set Master 1%+ unmute"
bindsym XF86AudioLowerVolume exec "amixer set Master 1%- unmute" bindsym XF86AudioLowerVolume exec "amixer set Master 1%- unmute"
bindsym XF86AudioMute exec "amixer -D pulse set Master 1+ toggle" bindsym XF86AudioMute exec "amixer -D pulse set Master 1+ toggle"
# Toggle toucpad
bindsym $mod+backslash exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
# Movement
bindsym $mod+o workspace back_and_forth
bindsym $mod+bracketleft workspace prev
bindsym $mod+bracketright workspace next
bindsym $mod+h focus left bindsym $mod+h focus left
bindsym $mod+j focus down bindsym $mod+j focus down
bindsym $mod+k focus up bindsym $mod+k focus up
@ -117,19 +67,15 @@ bindsym $mod+shift+Left move left
bindsym $mod+shift+Down move down bindsym $mod+shift+Down move down
bindsym $mod+shift+Up move up bindsym $mod+shift+Up move up
bindsym $mod+shift+Right move right bindsym $mod+shift+Right move right
# Fullscreen
bindsym $mod+f fullscreen bindsym $mod+f fullscreen
bindsym $mod+shift+f fullscreen global bindsym $mod+shift+f fullscreen global
# Layouts
bindsym $mod+s layout stacking bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split bindsym $mod+e layout toggle split
bindsym $mod+shift+space floating toggle bindsym $mod+shift+space floating toggle
bindsym $mod+space focus mode_toggle bindsym $mod+space focus mode_toggle
# bindsym $mod+space workspace back_and_forth
bindsym $mod+o workspace back_and_forth
bindsym $mod+bracketleft workspace prev
bindsym $mod+bracketright workspace next
#set $x_switch exec --no-startup-id /usr/local/bin/i3-wk-switch.py
set $x_switch workspace
bindsym $mod+1 $x_switch 1 bindsym $mod+1 $x_switch 1
bindsym $mod+2 $x_switch 2 bindsym $mod+2 $x_switch 2
bindsym $mod+3 $x_switch 3 bindsym $mod+3 $x_switch 3
@ -150,47 +96,86 @@ bindsym $mod+shift+7 move container to workspace 7
bindsym $mod+shift+8 move container to workspace 8 bindsym $mod+shift+8 move container to workspace 8
bindsym $mod+shift+9 move container to workspace 9 bindsym $mod+shift+9 move container to workspace 9
bindsym $mod+shift+0 move container to workspace 10 bindsym $mod+shift+0 move container to workspace 10
bindsym $mod+shift+r reload
bindsym $mod+shift+minus exec --no-startup-id banshee --previous
bindsym $mod+shift+equal exec --no-startup-id banshee --next
bindsym $mod+minus exec --no-startup-id banshee --pause
bindsym $mod+equal exec --no-startup-id banshee --play
# To initialize wallpapers, run:
# export DISPLAY=:0.0;mkdir -p ~/.i3/wall;cp ~/ownCloud/wallpaper/std/* ~/.i3/wall;cd ~/.i3/wall;rename -v 's/(.* )+//' *;mogrify -resize `xrandr -q|perl -F'\s|,' -lane "/^Sc/&&print join '',@F[8..10]"`^ -verbose -gravity center -format png *;rm *.jpg;rm *.jpeg
bindsym $mod+grave exec "slock" bindsym $mod+grave exec "slock"
bindsym $mod+shift+grave exec "slock" bindsym $mod+shift+grave exec "slock"
# Tees the filename to /tmp/wall for debugging
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+q restart
# exit i3 (logs you out of your X session)
bindsym $mod+shift+q 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)
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"
bindsym $mod+u focus parent bindsym $mod+u focus parent
bindsym $mod+shift+u focus child bindsym $mod+shift+u focus child
bindsym $mod+m focus mode_toggle # Exit/restart i3
# wallOM initialization: bindsym $mod+q restart
# echo -n "Resolution: ";read a;mkdir -p ~/.i3/wallOM;cp ~/ownCloud/wallpaper/std/* ~/.i3/wallOM;cd ~/.i3/wallOM;rename -v 's/(.* )+//' *;mogrify -resize $a^ -verbose -gravity center -format png *;rm *.jpg;rm *.jpeg bindsym $mod+shift+q 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'"
# feh doesn't work with 2 monitors, so the wallOM folder exists for computers with 2 monitors # Wallpaper
#wallpaper
bindsym $mod+shift+w exec "~/.i3/run.sh wall" bindsym $mod+shift+w exec "~/.i3/run.sh wall"
# Visuals
workspace_layout tabbed
smart_borders on
new_window pixel 1
# Colors
set $bg #121212
set $fg #9f9f9f
set $hi #efef8f
set $ac #a0afa0
set $tx #ffffff
set $ia #8f8f8f
set $be #8faf9f
set $yw #ccdc90
set $gn #88b090
set $rd #e89393
# border background text
client.focused #2f2f2f #2f2f2f #ffffff
client.unfocused $bg $bg $ia
client.focused_inactive $bg $bg $ac
client.urgent $rd $rd $tx
# Bar
bar {
height 12
status_command i3status --config ~/.i3/i3status.conf
font -*-*-*-*-*-*-8-*-*-*-*-*-*-*
mode dock
modifier $mod
colors {
background $bg
statusline $fg
separator $hi
focused_workspace $gn $bg $ac
active_workspace $gn $ac $tx
inactive_workspace $bg $bg $ia
urgent_workspace $rd $bg $ac
}
}
# Resize mode
mode "resize" {
bindsym $mod+h resize shrink width 1 px or 1 ppt
bindsym $mod+j resize grow height 1 px or 1 ppt
bindsym $mod+k resize shrink height 1 px or 1 ppt
bindsym $mod+l resize grow width 1 px or 1 ppt
bindsym Left resize shrink width 15 px or 15 ppt
bindsym Down resize grow height 15 px or 15 ppt
bindsym Up resize shrink height 15 px or 15 ppt
bindsym Right resize grow width 15 px or 15 ppt
# Back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Startup
# Monitor setup
exec --no-startup-id "zsh -c 'xrandr --output LVDS1 --primary || xrandr --output HDMI3 --primary'"
# Wallpaper
exec --no-startup-id "~/.i3/run.sh wall" exec --no-startup-id "~/.i3/run.sh wall"
#startup # Keyboard
exec --no-startup-id xmodmap ~/.xmodmap exec --no-startup-id xmodmap ~/.xmodmap
exec --no-startup-id /home/stonewareslord/xmodmap.sh exec --no-startup-id /home/stonewareslord/xmodmap.sh
#exec --no-startup-id i3-msg /usr/bin/redshift t -l 36.3:-80.3 -t 2000:2000 # Misc
# exec --no-startup-id i3-msg 'workspace 2; exec /usr/bin/firefox'
exec --no-startup-id i3-msg 'workspace 1; exec /usr/bin/urxvt' exec --no-startup-id i3-msg 'workspace 1; exec /usr/bin/urxvt'
exec --no-startup-id /usr/bin/shutter --min_at_startup exec --no-startup-id /usr/bin/shutter --min_at_startup
#exec --no-startup-id "sleep 25;/usr/bin/owncloud"
exec --no-startup-id /usr/bin/redshift -l 36.3:-80.3 -t 4000:2000 exec --no-startup-id /usr/bin/redshift -l 36.3:-80.3 -t 4000:2000
exec --no-startup-id /usr/bin/parcellite exec --no-startup-id /usr/bin/parcellite
exec --no-startup-id /usr/bin/numlockx exec --no-startup-id /usr/bin/numlockx
exec --no-startup-id /bin/zsh -c 'pidof syncthing||screen -dmS syncthing /home/stonewareslord/applications/syncthing/syncthing ' exec --no-startup-id /bin/zsh -c 'pidof syncthing||screen -dmS syncthing /home/stonewareslord/applications/syncthing/syncthing '
#exec --no-startup-id /usr/bin/udiskie -tv
#smart_borders on
# vim: ts=2:sw=2:et # vim: ts=2:sw=2:et