diff --git a/localbin/.local/bin/autostart b/localbin/.local/bin/autostart index 15503c0be..bf54cfe64 100755 --- a/localbin/.local/bin/autostart +++ b/localbin/.local/bin/autostart @@ -12,7 +12,7 @@ #Created: # Mon 22 November 2021, 03:15:54 PM [GMT+1] #Modified: -# Thu 20 October 2022, 03:26:36 PM [GMT+1] +# Tue 25 October 2022, 06:43:21 AM [GMT+1] # #Description: # @@ -22,52 +22,61 @@ # if command -v /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &>/dev/null; then - if ! pgrep -f "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" >/dev/null; then - /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & - else - echo "polkit-gnome already Running" - fi + if ! pgrep -f "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" >/dev/null; then + /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & + else + echo "polkit-gnome already Running" + fi fi if [[ $DESKTOP_SESSION != "qtile" ]]; then - if command -v autotiling &>/dev/null; then - if ! pgrep -f "autotiling" >/dev/null; then - autotiling & - else - echo "autotiling already Running" - fi - fi - - if command -v xroot &>/dev/null; then - if ! pgrep -f "xroot" >/dev/null; then - if command -v xmenu_desktop &>/dev/null; then - if ! pgrep -f "xmenu_desktop" >/dev/null; then - xroot -r xmenu_desktop & + if command -v autotiling &>/dev/null; then + if ! pgrep -f "autotiling" >/dev/null; then + ( + sleep 2s + autotiling + ) & else - echo "xroot already Running" + echo "autotiling already Running" + fi + fi + + if command -v xroot &>/dev/null; then + if ! pgrep -f "xroot" >/dev/null; then + if command -v xmenu_desktop &>/dev/null; then + if ! pgrep -f "xmenu_desktop" >/dev/null; then + ( + sleep 2s + xroot -r xmenu_desktop + ) & + else + echo "xroot already Running" + fi + fi + else + echo "xroot already Running" fi - fi - else - echo "xroot already Running" fi - fi fi if command -v clipmenu-daemon &>/dev/null; then - if ! pgrep -f "clipmenu-daemon" >/dev/null; then - clipmenu-daemon & - else - echo "clipmenu-daemon already Running" - fi + if ! pgrep -f "clipmenu-daemon" >/dev/null; then + ( + sleep 2s + clipmenu-daemon + ) & + else + echo "clipmenu-daemon already Running" + fi fi if ! command -v picom &>/dev/null; then - echo "picom could not be found" + echo "picom could not be found" else - if ! pgrep -x "picom" >/dev/null; then - picom -CGb --experimental-backend --config "$HOME"/.config/picom/picom.conf & - else - echo "picom already Running" - fi + if ! pgrep -x "picom" >/dev/null; then + picom -CGb --experimental-backend --config "$HOME"/.config/picom/picom.conf & + else + echo "picom already Running" + fi fi ################ @@ -75,72 +84,92 @@ fi ################ if ! command -v ckb-next &>/dev/null; then - echo "ckb-next could not be found" + echo "ckb-next could not be found" else - if ! pgrep -x "ckb-next" >/dev/null; then - ckb-next --background & - else - echo "ckb-next already Running" - fi + if ! pgrep -x "ckb-next" >/dev/null; then + ( + sleep 2s + ckb-next --background + ) & + else + echo "ckb-next already Running" + fi fi if command -v nm-applet &>/dev/null; then - if ! pgrep -x "nm-applet" >/dev/null; then - nm-applet & - else - echo "nm-applet already Running" - fi + if ! pgrep -x "nm-applet" >/dev/null; then + ( + sleep 2s + nm-applet + ) & + else + echo "nm-applet already Running" + fi fi if command -v blueman-applet &>/dev/null; then - if ! pgrep -x "blueman-applet" >/dev/null; then - blueman-applet & - else - echo "blueman-applet already Running" - fi + if ! pgrep -x "blueman-applet" >/dev/null; then + ( + sleep 2s + blueman-applet + ) & + else + echo "blueman-applet already Running" + fi fi if command -v touchpad-indicator &>/dev/null; then - if ! pgrep -f "touchpad-indicator" >/dev/null; then - touchpad-indicator & - else - echo "touchpad-indicator already Running" - fi -fi - -if command -v numlockx &>/dev/null; then - numlockx on & -fi - -if command -v volumeicon &>/dev/null; then - if ! pgrep -x "volumeicon" >/dev/null; then - volumeicon & - else - echo "volumeicon already Running" - fi + if ! pgrep -f "touchpad-indicator" >/dev/null; then + ( + sleep 2s + touchpad-indicator + ) & + else + echo "touchpad-indicator already Running" + fi fi if command -v cbatticon &>/dev/null; then if ! pgrep -x "cbatticon" >/dev/null; then - cbatticon & + ( + sleep 2s + cbatticon + ) & else echo "cbatticon already Running" fi fi +if command -v volumeicon &>/dev/null; then + if ! pgrep -x "volumeicon" >/dev/null; then + ( + sleep 5s + volumeicon + ) & + else + echo "volumeicon already Running" + fi +fi + +if command -v numlockx &>/dev/null; then + numlockx on & +fi + #################### ## Fix Background ## #################### if ! command -v feh &>/dev/null; then - echo "feh could not be found" + echo "feh could not be found" else - if ! test -f "$HOME/.fehbg"; then - echo "$HOME/.fehbg could not be found" - else - sh "$HOME/.fehbg" & - sleep 2s - sh "$HOME/.fehbg" & - fi + if ! test -f "$HOME/.fehbg"; then + echo "$HOME/.fehbg could not be found" + else + sh "$HOME/.fehbg" + ( + sleep 2s + sh "$HOME/.fehbg" + ) & + fi fi ############### @@ -148,24 +177,27 @@ fi ############### if command -v xidlehook &>/dev/null; then - # shellcheck disable=SC2155 - export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')" - if ! pgrep -x "xidlehook" >/dev/null; then - xidlehook \ - --not-when-fullscreen \ - --not-when-audio \ - --timer 300 \ - "xrandr --output $PRIMARY_DISPLAY --brightness .1" \ - "xrandr --output $PRIMARY_DISPLAY --brightness 1" \ - --timer 30 \ - "xrandr --output $PRIMARY_DISPLAY --brightness 1; multimonitorlock -l -- --time-str=%I:%M:%S %p" \ - "" \ - --timer 3600 \ - "systemctl suspend" \ - "" & - else - echo "xidlehook already Running" - fi + # shellcheck disable=SC2155 + export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')" + if ! pgrep -x "xidlehook" >/dev/null; then + ( + sleep 2s + xidlehook \ + --not-when-fullscreen \ + --not-when-audio \ + --timer 300 \ + "xrandr --output $PRIMARY_DISPLAY --brightness .1" \ + "xrandr --output $PRIMARY_DISPLAY --brightness 1" \ + --timer 30 \ + "xrandr --output $PRIMARY_DISPLAY --brightness 1; multimonitorlock -l -- --time-str=%I:%M:%S %p" \ + "" \ + --timer 3600 \ + "systemctl suspend" \ + "" + ) & + else + echo "xidlehook already Running" + fi fi ################ @@ -175,7 +207,7 @@ fi systemctl --user import-environment DISPLAY XAUTHORITY if command -v dbus-update-activation-environment >/dev/null 2>&1; then - dbus-update-activation-environment DISPLAY XAUTHORITY + dbus-update-activation-environment DISPLAY XAUTHORITY fi # see https://wiki.archlinux.org/title/GNOME/Keyring#xinitrc