9
homedir/.config/bspwm/bin/bspfloat
Executable file
9
homedir/.config/bspwm/bin/bspfloat
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
while read -r _ _ did wid _; do
|
||||
for d in "$@"; do
|
||||
if [[ $d == "$did" ]]; then
|
||||
bspc node "$wid" -t floating
|
||||
fi
|
||||
done
|
||||
done < <( bspc subscribe node_manage )
|
45
homedir/.config/bspwm/bin/bspset
Executable file
45
homedir/.config/bspwm/bin/bspset
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
usage() {
|
||||
printf 'No help available'
|
||||
}
|
||||
|
||||
main() {
|
||||
while (( $# )); do
|
||||
case "$1" in
|
||||
(-h) usage;;
|
||||
(-d) desktop=$2; shift;;
|
||||
|
||||
(--) shift; break;;
|
||||
(*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
setting=$1
|
||||
shift
|
||||
|
||||
desktop=${desktop:-"focused"}
|
||||
|
||||
case "$setting" in
|
||||
(padding)
|
||||
if [[ "$1" =~ ^(north|west|south|east)$ ]]; then
|
||||
direction=$1
|
||||
fi
|
||||
|
||||
if [[ "$direction" ]]; then
|
||||
bspc config -d "$desktop" "${direction}_padding" "$1"
|
||||
else
|
||||
for d in top bottom right left; do
|
||||
bspc config -d "$desktop" "${d}_padding" "$1"
|
||||
done
|
||||
fi
|
||||
;;
|
||||
|
||||
(gaps)
|
||||
bspc config -d "$desktop" window_gap "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
43
homedir/.config/bspwm/bin/bspstate
Executable file
43
homedir/.config/bspwm/bin/bspstate
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
ensure_dir() {
|
||||
declare d
|
||||
|
||||
for d in "$@"; do
|
||||
if ! [[ -d "$d" ]]; then
|
||||
if ! mkdir -p "$d"; then
|
||||
return $?
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Set XDG_RUNTIME_DIR
|
||||
if ! [[ "$XDG_RUNTIME_DIR" ]]; then
|
||||
XDG_RUNTIME_DIR="/run/user/$UID"
|
||||
fi
|
||||
|
||||
# Define some workdirs
|
||||
bspwm_rundir="$XDG_RUNTIME_DIR/bspwm"
|
||||
bspwm_statedir="$bspwm_rundir/state"
|
||||
|
||||
# Ensure the workdirs exist
|
||||
ensure_dir "$bspwm_rundir" "$bspwm_statedir" || exit $?
|
||||
|
||||
case "$1" in
|
||||
(save)
|
||||
# Save state
|
||||
bspc query -T > "$bspwm_statedir/tree"
|
||||
bspc query -H > "$bspwm_statedir/hist"
|
||||
bspc query -S > "$bspwm_statedir/stack"
|
||||
;;
|
||||
|
||||
(restore)
|
||||
# Restore state, if any
|
||||
[[ -f "$bspwm_statedir/tree" ]] && bspc restore -T "$bspwm_statedir/tree"
|
||||
[[ -f "$bspwm_statedir/hist" ]] && bspc restore -H "$bspwm_statedir/hist"
|
||||
[[ -f "$bspwm_statedir/stack" ]] && bspc restore -S "$bspwm_statedir/stack"
|
||||
;;
|
||||
esac
|
67
homedir/.config/bspwm/bspwmrc
Executable file
67
homedir/.config/bspwm/bspwmrc
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
nullexec() {
|
||||
"$@" &>/dev/null
|
||||
}
|
||||
|
||||
PATH+=":$HOME/.config/alternatives"
|
||||
PATH+=":$HOME/.config/bspwm/bin"
|
||||
|
||||
# Cursor for the root window
|
||||
xsetroot -cursor_name left_ptr
|
||||
|
||||
# Global config
|
||||
bspc config focused_sticky_border_color "#030061"
|
||||
bspc config focused_border_color "#467EC2"
|
||||
bspc config normal_border_color "#1f1f1f"
|
||||
bspc config urgent_border_color "#f9f9f9"
|
||||
bspc config window_gap "9"
|
||||
bspc config border_width '2'
|
||||
bspc config split_ratio '0.52'
|
||||
bspc config borderless_monocle 'false'
|
||||
bspc config gapless_monocle 'false'
|
||||
bspc config focus_by_distance 'true'
|
||||
bspc config ignore_ewmh_focus 'true'
|
||||
bspc config initial_polarity 'second_child'
|
||||
bspc config auto_cancel 'true'
|
||||
bspc config click_to_focus 'true'
|
||||
|
||||
# Workspaces and monitors
|
||||
bspc monitor -d 1 2 3 4 5 6 7 8 9 h
|
||||
|
||||
# Float some bastards
|
||||
bspfloat 1 &
|
||||
|
||||
# Individual padding
|
||||
for d in 1 3; do
|
||||
bspset -d "$d" padding 48
|
||||
done
|
||||
|
||||
# Clear the rules before adding any
|
||||
while read -r rule _; do bspc rule -r "$rule"; done < <(bspc rule -l)
|
||||
|
||||
# Now add the rules
|
||||
bspc rule -a Steam state=floating desktop=^8
|
||||
bspc rule -a Firefox:Navigator state=tiled desktop=^2
|
||||
bspc rule -a \*:Hearthstone.exe desktop=^5
|
||||
bspc rule -a \* state=floating
|
||||
|
||||
|
||||
# start some services
|
||||
services=( sxhkd dunst )
|
||||
for s in "${services[@]}"; do
|
||||
if ! service "$s" status; then
|
||||
service "$s" start
|
||||
fi
|
||||
done
|
||||
|
||||
# Always restart the panel
|
||||
service moltenbar restart
|
||||
|
||||
nullexec browser &
|
||||
nullexec terminal &
|
||||
nullexec telegram &
|
||||
nullexec dropbox &
|
||||
|
||||
terminal -e 'ssh-add-all' &
|
||||
terminal -e 'sudo wrkvpn' &
|
72
homedir/.config/bspwm/sxhkdrc
Normal file
72
homedir/.config/bspwm/sxhkdrc
Normal file
@@ -0,0 +1,72 @@
|
||||
#
|
||||
# bspwm hotkeys
|
||||
#
|
||||
|
||||
super + {_,shift + } w
|
||||
bspc node {-c,-k}
|
||||
|
||||
super + q
|
||||
bspc node -t '~fullscreen'
|
||||
|
||||
super + {j,k}
|
||||
bspc node -f {next,prev}.local
|
||||
|
||||
control + {h,j,k,l}
|
||||
bspc node {@east -r -32,@south -r +32,@south -r -32,@east -r +32}
|
||||
|
||||
super + {_,shift + } space
|
||||
bspc node -t '~'{tiled,floating}
|
||||
|
||||
super + Return
|
||||
bspc node -s biggest
|
||||
|
||||
super + {1-9,h}
|
||||
bspc desktop -f {1-9,h}
|
||||
|
||||
super + shift + {1-9,h}
|
||||
bspc node -d {1-9,h}
|
||||
|
||||
super + m
|
||||
bspc monitor -f next
|
||||
|
||||
super + shift + m
|
||||
bspc node -m next
|
||||
|
||||
super + t
|
||||
bspc desktop -l next
|
||||
|
||||
super + shift + t
|
||||
bspc node -t '~pseudo_tiled'
|
||||
|
||||
super + x
|
||||
terminal
|
||||
|
||||
super + {r,u,p}
|
||||
dmenu-extras -l 9 {run,bmark,pass}
|
||||
|
||||
super + z
|
||||
ssm lockd lock
|
||||
|
||||
Print
|
||||
snap -f
|
||||
|
||||
super + {Left,Up,Right,Down}
|
||||
bspc node --presel-dir '~'{west,north,east,south}
|
||||
|
||||
super + {_,shift + } c
|
||||
win-hd-center {1280x720,854x480}
|
||||
|
||||
super + {a,s,n,p}
|
||||
mpc {play,stop,next,prev}
|
||||
|
||||
super + bracketright
|
||||
bspc node '@/' -R 90
|
||||
|
||||
super + f
|
||||
bspc rule -a \* -o state=floating
|
||||
|
||||
super + XF86AudioLowerVolume
|
||||
amixer -c 0 set PCM 2dB-
|
||||
|
||||
super + XF86AudioRaiseVolume
|
||||
amixer -c 0 set PCM 2dB+
|
Reference in New Issue
Block a user