Skip to content

Instantly share code, notes, and snippets.

@emmanuelrosa
Created November 18, 2021 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save emmanuelrosa/88b929b69a54cec72945299326f65c82 to your computer and use it in GitHub Desktop.
Save emmanuelrosa/88b929b69a54cec72945299326f65c82 to your computer and use it in GitHub Desktop.
bspwmrc and sxhkdrc
#! /run/current-system/sw/bin/sh
. "${HOME}/.cache/wal/colors.sh"
pgrep -x sxhkd > /dev/null || sxhkd &
pgrep -x udiskie > /dev/null || udiskie &
pgrep -x picom > /dev/null || picom &
pgrep -x dunst > /dev/null || dunst &
killall xmobar > /dev/null ; (bspc subscribe report | awk -v ulcolor="$color4" -v tcolor="$color7" -v fcolor="$color2" -f $HOME/.config/bspwm/desktops.awk | xmobar -B $color0 -F $color7 $HOME/.config/bspwm/xmobarrc) &
wal -R
xinput --disable 14
xsetroot -cursor_name left_ptr
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
bspc config border_width 2
bspc config focused_border_color "$color5"
bspc config window_gap 10
bspc config gapless_monocle true
bspc config single_monocle true
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc rule -a Zathura state=tiled follow=on
alacritty
# # wm independent hotkeys #
super + Return
alacritty
super + shift + Return
alacritty -e "su"
super + b
qutebrowser
super + shift + b
alacritty -e "vifm"
super + v
vlc
super + shift + v
vlc $(xclip -out -selection clipboard)
# program launcher
super + i
rofi -combi-modi window,drun -show-icons -show combi -location 1 -width 100 -theme $HOME/.cache/wal/rofi-sidetab.rasi
# history launcher
super + s
rofi -show open -modi open:rofi-menu-open -location 1 -width 100 -theme $HOME/.cache/wal/rofi-dark.rasi
# make sxhkd reload its configuration files:
super + shift + r
pkill -USR1 -x sxhkd; \
bspc wm -r
super + F3
betterlockscreen -l dimblur
XF86MonBrightness{Down,Up}
light {-U 5, -A 5}
XF86Audio{LowerVolume,RaiseVolume,Mute}
amixer -- sset Master playback {5dB-,5dB+,toggle}
# Take a screenshot of the focused window, and save it to the clipboard
Print
scrot -u -e 'xclip -selection clipboard -t image/png -i $f' $(mktemp --suffix .png)
#
# bspwm hotkeys
#
# quit/restart bspwm
super + shift + e
rofi -show shutdown -modi shutdown:rofi-menu-shutdown -location 1 -width 100 -theme $HOME/.cache/wal/rofi-sidetab.rasi
# close and kill
super + shift + q
bspc node -c
# alternate between the tiled and monocle layout
super + space
bspc desktop -l next
# swap the current node and the biggest window
super + g
bspc node -s biggest.window
#
# state/flags
#
# set the window state
super + {z,x,c,v}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
#
# focus/swap
# focus the next/previous window in the current desktop
super + {k,l,j,h}
bspc node -f {north,east,south,west}.local.!hidden.window
# rotate windows on the current desktop
super + shift + ctrl + {k,j}
bspc node @focused:/ -R {90,-90}
# rotate windows on the current desktop
super + shift + ctrl + {l,h}
bspc node first_ancestor -R {90,-90}
# focus the next/previous node in the current desktop
super + bracket{left,right}
bspc node -f {prev,next}.local.!hidden.window
# focus or send to the given desktop
super + {_,shift+}{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# swap with node in the given direction
super + shift + {k,l,j,h}
bspc node -s {north,east,south,west}.local.!hidden.window
# Resize windows by adjusting ratio
super + {less,greater}
bspc node @parent -r {-,+}20
# resize a window by first selecting a side to enter "resize mode."
# Then resizing that side. Press ESC to exit the mode.
super + alt + l : {h,l}
step=20; \
bspc node -z right {-$step,$step} 0
super + alt + h : {h,l}
step=20; \
bspc node -z left {-$step,$step} 0
super + alt + k : {j,k}
step=20; \
bspc node -z top 0 {$step,-$step}
super + alt + j : {j,k}
step=20; \
bspc node -z bottom 0 {$step,-$step}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment