[bugfix] autostart not working

This commit is contained in:
Klesh Wong 2020-10-31 11:55:05 +08:00
parent 4bd7cf3a53
commit 73d27e65d5
3 changed files with 9 additions and 34 deletions

View File

@ -13,49 +13,23 @@ $HOME/.config/dwm/statusbar
xset s off
xset dpms 300 300 300
killall xss-lock
xss-lock (which slock) &
xss-lock $(which slock) &
# start network applet
pgrep -x nm-applet || nm-applet &
# start bluetooth applet
if which blueman-applet
pgrep -x blueman-applet || blueman-applet &
end
which blueman-applet && ! pgrep -x blueman-applet || blueman-applet &
# start screenshot tool
if which flameshot
pgrep -x flameshot || flameshot &
end
which flameshot && ! pgrep -x flameshot && flameshot &
# start input method
#pgrep -x fcitx || fcitx &
pgrep -x ibus-daemon || ibus-daemon -drx &
# restart wallpaper
nitrogen --restore
# start password manager
#pgrep -x keepassxc || keepassxc &
# start a terminal with tmux
#if not xdotool search --onlyvisible --class term && not xdotool search --onlyvisible --class Alacritty
#if tmux has-session -t 0
#st -c term -n autostart -e tmux a -t 0 &
##alacritty --class autostart,term -e tmux a -t 0 &
#else
#st -c term -n autostart -e tmux new -s 0 &
##alacritty --class autostart,term -e tmux new -s 0 &
#end
#end
# start nextcloud
#if which nextcloud
#if not pgrep -x nextcloud
#nextcloud &
#while not xdotool search --onlyvisible --name Nextcloud
#sleep 0.5
#end
#xdotool windowclose (xdotool search --onlyvisible --name Nextcloud)
#end
#end
pgrep -x nextcloud || nextcloud &

View File

@ -115,8 +115,9 @@ start() {
}
restart() {
pkill -f 'dwmbar loop'
$0 loop &
FP=$(readlink -f $0)
pkill -f "$FP loop"
$FP loop &
}
if [ "$1" = "loop" ]; then

View File

@ -82,5 +82,5 @@ EOT
[[ -L $XDG_CONFIG_HOME/dwm/autostart ]] && rm $XDG_CONFIG_HOME/dwm/autostart
mkdir -p $XDG_CONFIG_HOME/dwm
cp $DIR/config/dwm/autostart $XDG_CONFIG_HOME/dwm/autostart
lnsf $DIR/config/dwm/dwmbar $XDG_CONFIG_HOME/dwm/dwmbar
lnsf $DIR/config/dwm/statusbar $XDG_CONFIG_HOME/dwm/statusbar
lnsf $DIR/config/autorandr/postswitch $XDG_CONFIG_HOME/autorandr/postswitch