diff options
Diffstat (limited to '.config')
-rwxr-xr-x | .config/bspwm/bspwmrc | 30 | ||||
-rw-r--r-- | .config/sxhkd/sxhkdrc | 24 | ||||
-rw-r--r-- | .config/x11/xprofile | 1 |
3 files changed, 30 insertions, 25 deletions
diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index b152f41..ca9335f 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -1,23 +1,35 @@ #!/bin/sh -# Checks if X program is already running, if not, run it. -pgrep -x sxhkd > /dev/null || sxhkd & -pgrep -x statusbar > /dev/null || statusbar & +# Checks if sxhkd is running, if not, run it. +# Also use setsid so it's appart from status bar +# and the kill doesn't ruin it. +pgrep -x sxhkd > /dev/null || setsid sxhkd & -# Multihead. +# This starts or restarts statusbar. Be careful +# with pkill, if neither of these two programs have +# a 'setsid' prepended to their command, sxhdk wil crash. +if [ $(pgrep -x statusbar | wc -l) = 1 ];then + pkill -x statusbar + statusbar & +else + statusbar & +fi + +# Multihead stuff. if [ $(uname -n) = "arch" ]; then - MAINMON="DP-0" + MAINMON="DP-0" SECMON="HDMI-0" - - bspc monitor $MAINMON -d 1 2 3 4 5 - bspc monitor $SECMON -d 6 7 8 9 10 - if [ $(pgrep -f bspwm_enforce_monitor_position) < 2]; then + # Run a script to select the main monitor. + if [ $(pgrep -f bspwm_enforce_monitor_position | wc -l) < 2]; then bspwm_enforce_monitor_position $MAINMON '^1' & else killall bspwm_enforce_monitor_position bspwm_enforce_monitor_position $MAINMON '^1' & fi + + bspc monitor $MAINMON -d 1 2 3 4 5 + bspc monitor $SECMON -d 6 7 8 9 10 else bspc monitor -d I II III IV V VI VII VIII IX X fi diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index d4595ac..3ee3384 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -9,6 +9,9 @@ super + d i3-dmenu-desktop super + Escape pkill -USR1 -x sxhkd +super + shift + Escape + pkill -x statusbar\ + statusbar # Run programs. super + shift + w @@ -116,24 +119,9 @@ super + ctrl + shift + space # Move/resize. # -# Expand a window by moving one of its side outward. -super + alt + {h,j,k,l} - n=20; \ - bspc node -z {left -$n 0,bottom 0 $n,top 0 -$n,right $n 0} - -# Contract a window by moving one of its side inward. -super + alt + shift + {h,j,k,l} - n=20; \ - bspc node -z {right -$n 0,top 0 $n,bottom 0 -$n,left $n 0} - -# Move a floating window. -super + {Left,Down,Up,Right} - bspc node -v {-20 0,0 20,0 -20,20 0} - - # Smart resize, will grow or shrink depending on location. # Will always grow for floating nodes. -super + alt + ctrl + {Left,Down,Up,Right} +super + alt + {h,j,k,l} n=10; \ { d1=left; d2=right; dx=-$n; dy=0; \ , d1=bottom; d2=top; dx=0; dy=$n; \ @@ -141,3 +129,7 @@ super + alt + ctrl + {Left,Down,Up,Right} , d1=right; d2=left; dx=$n; dy=0; \ } \ bspc node --resize $d1 $dx $dy || bspc node --resize $d2 $dx $dy + +# Move a floating window. +super + {Left,Down,Up,Right} + bspc node -v {-20 0,0 20,0 -20,20 0} diff --git a/.config/x11/xprofile b/.config/x11/xprofile index d0d380c..5ee7f6f 100644 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -4,6 +4,7 @@ # Used as source for ~/.xinitrc. numlockx on & +xsetroot -cursor_name left_ptr & xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & nm-applet & picom & |