diff options
-rwxr-xr-x | .config/bspwm/bspwmrc | 30 | ||||
-rw-r--r-- | .config/sxhkd/sxhkdrc | 24 | ||||
-rw-r--r-- | .config/x11/xprofile | 1 | ||||
-rwxr-xr-x | .local/bin/statusbar/statusbar | 12 | ||||
-rwxr-xr-x | .local/bin/statusbar/statusbar_bar1 | 4 |
5 files changed, 40 insertions, 31 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 & diff --git a/.local/bin/statusbar/statusbar b/.local/bin/statusbar/statusbar index c5ee748..7c2b0be 100755 --- a/.local/bin/statusbar/statusbar +++ b/.local/bin/statusbar/statusbar @@ -1,11 +1,15 @@ #!/bin/sh PANEL_FIFO=/tmp/panel-fifo -PANEL_HEIGHT=24 -# PANEL_FONT="-*-fixed-*-*-*-*-10-*-*-*-*-*-*-*" +PANEL_HEIGHT=20 +PANEL_FONT="Noto Sans Mono:size=10" +PANEL_EMOJI_FONT0="Noto Color Emoji" +PANEL_EMOJI_FONT1="Font Awesome 5 Free" +PANEL_EMOJI_FONT2="Font Awesome 5 Brands" +PANEL_EMOJI_FONT3="Font Awesome 5 Free Solid" PANEL_WM_NAME=bspwm_statusbar if xdo id -a "$PANEL_WM_NAME" > /dev/null ; then - printf "%s\n" "The status bar is already running." >&2 + printf "%s\n" "The status bar is already running. Try pkill -x statusbar." >&2 exit 1 fi @@ -20,7 +24,7 @@ bspc subscribe report > "$PANEL_FIFO" & . statusbar_colors -statusbar_bar1 < "$PANEL_FIFO" | lemonbar -a 32 -u 2 -n "$PANEL_WM_NAME" -g x$PANEL_HEIGHT -f "$PANEL_FONT" -F "$COLOR_DEFAULT_FG" -B "$COLOR_DEFAULT_BG" & +statusbar_bar1 < "$PANEL_FIFO" | lemonbar -a 32 -u 2 -n "$PANEL_WM_NAME" -g x$PANEL_HEIGHT -f "$PANEL_FONT" -f "$PANEL_EMOJI_FONT0" -f "$PANEL_EMOJI_FONT1" -f "$PANEL_EMOJI_FONT2" -f "$PANEL_EMOJI_FONT3" -F "$COLOR_DEFAULT_FG" -B "$COLOR_DEFAULT_BG" | sh & # This only really works for one monitor. # wid=$(xdo id -m -a "$PANEL_WM_NAME") diff --git a/.local/bin/statusbar/statusbar_bar1 b/.local/bin/statusbar/statusbar_bar1 index 1aff3a9..16297ef 100755 --- a/.local/bin/statusbar/statusbar_bar1 +++ b/.local/bin/statusbar/statusbar_bar1 @@ -29,7 +29,7 @@ while read -r line ; do # monitor FG=$COLOR_MONITOR_FG BG=$COLOR_MONITOR_BG - on_focused_monitor= + on_focused_monitor=0 ;; M*) # focused monitor @@ -39,7 +39,7 @@ while read -r line ; do ;; esac [ $num_mon -lt 2 ] && shift && continue - wm="${wm}%{F${FG}}%{B${BG}}%{A:bspc monitor -f ${name}:} ${name} %{A}%{B-}%{F-}" + wm="%{S${on_focused_monitor}}${wm}%{F${FG}}%{B${BG}}%{A:bspc monitor -f ${name}:} ${name} %{A}%{B-}%{F-}" ;; [fFoOuU]*) case $item in |