Starting apps via array and loop now
This commit is contained in:
108
f01
108
f01
@@ -39,102 +39,28 @@ xcalib /s/misc/monitor_calibration/dell.icc
|
|||||||
#############################################
|
#############################################
|
||||||
# Launch scripts
|
# Launch scripts
|
||||||
# Check if running first for idempotency
|
# Check if running first for idempotency
|
||||||
|
# 20220604 - dramatically simplified using a loop+array
|
||||||
#############################################
|
#############################################
|
||||||
|
|
||||||
# compositor - for true transparency
|
HOME_DIR=$HOME
|
||||||
# compton is dead, picom is a fork
|
echo $HOME
|
||||||
if pgrep -x -u $USERNAME "picom" > /dev/null
|
|
||||||
then
|
|
||||||
#already running - do nothing
|
|
||||||
echo "picom - Already Running ..."
|
|
||||||
else
|
|
||||||
# not running - launch
|
|
||||||
picom &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# pasystray - volume control
|
apps=( "picom" "pasystray" "jstat" "keepassxc" "solaar" "nextcloud" "playerctld" "fcitx5" )
|
||||||
if pgrep -x -u $USERNAME "pasystray" > /dev/null
|
|
||||||
then
|
|
||||||
#already running - do nothing
|
|
||||||
echo "pasystray - Already Running ..."
|
|
||||||
else
|
|
||||||
# not running - launch
|
|
||||||
pasystray &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# clipboard manager
|
for i in "${apps[@]}"
|
||||||
if pgrep -x -u $USERNAME "copyq" > /dev/null
|
do
|
||||||
|
if pgrep -x "$i" >/dev/null
|
||||||
then
|
then
|
||||||
#already running - do nothing
|
# check for binary
|
||||||
echo "copyq - Already Running ..."
|
if [ -f "/usr/bin/$i" ] || [ -f "$HOME/bin/$i" ] || [ -f "/usr/local/bin/$i" ]
|
||||||
|
then
|
||||||
|
echo "$i - Already Running ..."
|
||||||
else
|
else
|
||||||
# not running - launch
|
echo "$i - Error - $i binary not found!"
|
||||||
# 2021-08-18 JMD - commented out its making gimp crash when i copy
|
|
||||||
#copyq &
|
|
||||||
echo "Not really starting, it breaks gimp!"
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "$i stopped - starting now"
|
||||||
|
command $i &
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# launch menu bar status script
|
|
||||||
if pgrep -x "jstat" >/dev/null
|
|
||||||
then
|
|
||||||
echo "jstat - Already Running ..."
|
|
||||||
else
|
|
||||||
echo "jstat stopped - starting now"
|
|
||||||
jstat &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# launch keepassxc
|
|
||||||
if pgrep -x "keepassxc" >/dev/null
|
|
||||||
then
|
|
||||||
echo "keepassxc - Already Running ..."
|
|
||||||
else
|
|
||||||
echo "keepassxc stopped - starting now"
|
|
||||||
keepassxc &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# launch nextcloud
|
|
||||||
if pgrep -x "nextcloud" >/dev/null
|
|
||||||
then
|
|
||||||
echo "nextcloud - Already Running ..."
|
|
||||||
else
|
|
||||||
echo "nextcloud stopped - starting now"
|
|
||||||
nextcloud &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# launch solaar - mouse tool
|
|
||||||
if pgrep -x "solaar" >/dev/null
|
|
||||||
then
|
|
||||||
echo "solaar - Already Running ..."
|
|
||||||
else
|
|
||||||
echo "solaar stopped - starting now"
|
|
||||||
/usr/bin/solaar -w hide &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# launch playerctld - keyboard shortcuts for play/pause
|
|
||||||
if pgrep -x "playerctld" >/dev/null
|
|
||||||
then
|
|
||||||
if [ -f "/usr/bin/playerctld" ]
|
|
||||||
then
|
|
||||||
echo "playerctld - Already Running ..."
|
|
||||||
else
|
|
||||||
echo "playerctld - Error - playerctld binary not found!"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "playerctld stopped - starting now"
|
|
||||||
/usr/bin/playerctld &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# launch fcitx5 if we're on wayland
|
|
||||||
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
|
|
||||||
if pgrep -x "fcitx5" >/dev/null; then
|
|
||||||
echo "fcitx5 - Already running ..."
|
|
||||||
else
|
|
||||||
if [ -f "/usr/bin/fcitx5" ]; then
|
|
||||||
echo "fcitx5 - Starting ..."
|
|
||||||
/usr/bin/fcitx5 &
|
|
||||||
else
|
|
||||||
echo "fcitx5 - binary not found."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# else run ibus-daemon
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user