Commit 7720b4ed authored by Guilherme Semente's avatar Guilherme Semente 🌱

Add bspwm config

parent 928df2f5
! *foreground: rgb:e5/e5/e5
! *background: rgb:00/00/00
Sxiv.foreground: #d3d7cf
Sxiv.background: #111111
#!/bin/sh
#
# - Get window class names using the `xprop WM_CLASS' command
#
#
# displays
#
~/etc/setup-displays.sh
# turn off display after 8 minutes of inactivity
xset dpms 480 480 480
# set wallpaper and cursor
test -f "$HOME/.wallpaper" && feh --bg-fill "$HOME/.wallpaper"
xsetroot -cursor_name left_ptr
#
# bspwm config
#
bspc config split_ratio 0.52
bspc config click_to_focus false
bspc config focus_follow_point true
bspc config focus_follows_pointer true
bspc config pointer_follows_focus true
bspc config pointer_follows_monitor true
bspc config borderless_monocle true
bspc config gapless_monocle false
bspc config single_monocle true
bspc config window_gap 32
bspc config border_width 1
bspc config normal_border_color "#333333"
bspc config focused_border_color "#333333"
bspc config presel_feedback_color "#8b008b"
bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true
bspc config merge_overlapping_monitors true
bspc monitor -d 1 2 3 4 0
bspc rule -a "*" state=floating
#
# startup
#
# start the hotkey daemon (see ~/.config/sxhkd/sxhkdrc)
pkill -USR1 -x sxhkd || sxhkd &
# auto lock screen after 8 minutes of inactivity
xautolock -secure -time 8 -locker x-lock &
rofi.mobi: combi
rofi.combi-mode: run,drun,window,sh
rofi.terminal: st -f "monoid-14"
rofi.scroll-method: 1
rofi.font: monoid 14
rofi.lines: 6
rofi.width: -64
# -*- mode: conf -*-
#
# To Do
#
# - Write about AltGr + {`,F1-12}
# - Write about hotkeys with shift
#
# general hotkeys
#
# make sxhkd reload its configuration files
super + shift + r
pkill -USR1 -x sxhkd
#
# applications
#
# rofi launcher
super + space
rofi -modi combi -show combi -combi-modi run,drun,window,ssh
shift + super + space
bspc rule -a \* -o desktop=^5 follow=on;
rofi -modi combi -show combi -combi-modi run,drun,window,ssh
# lock screen
super + shift + l
x-lock
# screen capture
shift + super + @p
cd ~/downloads/screenshots && scrot --select --exec 'sxiv -b -g 1024x768 $f'
# terminal
super + Return
st -f monoid-12
# quick launch
super + semicolon ; {t,e,f,v}
{st -f monoid-12,emacsclient -a="" -c,firejail firefox, x-view}
#
# multimedia
#
# volume
super + {bracketleft,bracketright}
pulsemixer --change-volume "{-,+}10" && x-message "$(pulsemixer --get-volume | cut -d' ' -f2)"
{XF86AudioLowerVolume,XF86AudioRaiseVolume}
pulsemixer --change-volume "{-,+}10" && x-message "$(pulsemixer --get-volume | cut -d' ' -f2)"
{XF86AudioMute,super + backslash}
pulsemixer --toggle-mute && x-message "($(pulsemixer --get-volume | cut -d ' ' -f2))"
# player control
super + {comma,period,slash}
playerctl {previous,next,play-pause}
XF86MonBrightnessDown
xbacklight -dec 10 && x-message "$(printf "%d" $(xbacklight -get))"
XF86MonBrightnessUp
xbacklight -inc 10 && x-message "$(printf "%d" $(xbacklight -get))"
#
# bspwm
#
# quit node
shift + super + k
bspc node -c
# focus the next node in the current desktop
super + o
bspc node -f next.local
# circulate windows in the current desktop
super + c
bspc node @/ -C forward
# rotate the tree rooted at selected window
super + r
bspc node @/ -R 90
# flip windows in the current desktop
super + f
bspc node @/ -F {horizontal,horizontal,vertical}
# balance windows area
super + b
bspc node @/ -B
# equalize windows area
super + e
bspc node @/ -E
# alternate node between tiled and floating state
super + t
bspc node focused -t {tiled,floating}
# alternate node between tiled and floating state
shift + super + f
bspc node focused -t {fullscreen,floating}
# alternate all nodes between tiled and floating state
shift + super + t
bspc query -N -n .window.local | xargs -n1 -I '%nid' bspc node %nid -t {tiled,floating}
# alternate between the tiled and monocle layouts
super + m
bspc desktop -l next
# change window gap
super + g
bspc config -d focused window_gap {0,4,8,16,32,64,96,128} && x-message "$(bspc config -d focused window_gap)"
# change focus to given desktop
{super,alt} + {F1,F2,F3,F4}
{true,true};\
curdesk="$(bspc query -D -d --names)";\
deskname="{1,2,3,4}";\
test "$curdesk" -eq "$deskname" && bspc desktop -f last || bspc desktop -f "$deskname";\
x-message "$(bspc query -D -d --names)"
# send node to given desktop
{super,alt} + shift + {F1,F2,F3,F4,grave}
{true,true};\
bspc node -d "{1,2,3,4,0}"
# focus the helper/scratch desktop
grave
curdesk="$(bspc query -D -d --names)";\
test "$curdesk" -eq "0" && bspc desktop -f last || bspc desktop -f "0";\
x-message "$(bspc query -D -d --names)"
# use this to type grave
ctrl + q ; ~grave
true
# focus the next/previous desktop
super + {Prior,p,Next,n}
bspc desktop -f {prev,prev,next,next};\
x-message "$(bspc query -D -d --names)"
# focus the last desktop
{super + l, alt + Tab}
bspc desktop -f last && x-message "$(bspc query -D -d --names)"
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-50 0,0 50,0 -50,50 0}
# expand a window by moving one of its side outward
super + alt + {Left,Down,Up,Right}
bspc node -z {left -50 0,bottom 0 50,top 0 -50,right 50 0}
# contract a window by moving one of its side inward
super + alt + shift + {Left,Down,Up,Right}
bspc node -z {right -50 0,top 0 50,bottom 0 -50,left 50 0}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment