Change stuff to make it work on more systems (error/exception handling in bspwm startup etc.)

This commit is contained in:
David Holland 2020-05-01 19:52:06 +02:00
parent a5df098e56
commit d23d459fb9
Signed by: DustVoice
GPG key ID: 47068995A14EDCA9
5 changed files with 58 additions and 6 deletions

View file

@ -1,6 +1,25 @@
#!/usr/bin/env bash #!/usr/bin/env bash
command -v sxhkd >/dev/null 2>&1
return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Can't seem to find the sxhkd executable. Exiting!"
bspc quit && exit 1
else
sxhkd & sxhkd &
return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Couldn't fire up sxhkd: $return_val. Exiting!"
bspc quit && exit 1
fi
fi
command -v alacritty >/dev/null 2>&1
return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Can't seem to find the alacritty executable. Exiting!"
bspc quit && exit 1
fi
for monitor in $(bspc query -M); do for monitor in $(bspc query -M); do
bspc monitor $monitor -d \~ bspc monitor $monitor -d \~
@ -32,7 +51,37 @@ bspc config presel_feedback_color "#6272a4"
bspc rule -a Screenkey manage=off bspc rule -a Screenkey manage=off
bspc rule -a Zathura state=tiled manage=on bspc rule -a Zathura state=tiled manage=on
command -v nitrogen >/dev/null 2>&1
return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Can't seem to find the nitrogen executable"
else
nitrogen --restore & nitrogen --restore &
/usr/lib/xfce-polkit/xfce-polkit & return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Couldn't fire up nitrogen: $return_val"
fi
fi
$HOME/.config/polybar/launch.sh command -v /usr/lib/xfce-polkit/xfce-polkit >/dev/null 2>&1
return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Can't seem to find the /usr/lib/xfce-polkit/xfce-polkit executable"
else
/usr/lib/xfce-polkit/xfce-polkit &
return_val=$?
if [ $return_val -ne 0 ]; then
echo >&2 "Couldn't fire up xfce-polkit: $return_val"
fi
fi
command -v polybar >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2 "Can't seem to find the polybar executable. Starting barless!"
bspc config top_padding 0
else
$HOME/.config/polybar/launch
if [ $? -ne 0 ]; then
echo >&2 "Couldn't fire up polybar: $?"
fi
fi

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
killall -q polybar killall -q polybar

1
.gitignore vendored
View file

@ -13,6 +13,7 @@
!/.xinitrc !/.xinitrc
!/.Xmodmap.example !/.Xmodmap.example
!/.Xresources !/.Xresources
!/.xsession
!/.zshenv !/.zshenv
!/.zshpath.example !/.zshpath.example
!/.zshrc !/.zshrc

View file

@ -10,4 +10,5 @@ fi
setxkbmap "us,us" ",intl" "grp:shifts_toggle" setxkbmap "us,us" ",intl" "grp:shifts_toggle"
[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap [ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap
exec bspwm mkdir -p $HOME/.local/share/bspwm
exec bspwm >$HOME/.local/share/bspwm/output.log 2>$HOME/.local/share/bspwm/error.log

1
.xsession Executable file
View file

@ -0,0 +1 @@
bspwm