2021-01-09 12:38:56 -05:00
|
|
|
#!/usr/bin/env bash
|
2022-07-14 12:15:51 -04:00
|
|
|
#-*-coding:utf-8 -*-
|
|
|
|
#Auto updated?
|
2022-01-20 15:38:50 -05:00
|
|
|
# Yes
|
2022-10-14 13:59:48 -04:00
|
|
|
#File:
|
2022-01-20 15:38:50 -05:00
|
|
|
# autostart
|
2022-10-14 13:59:48 -04:00
|
|
|
#Author:
|
2022-01-21 08:38:27 -05:00
|
|
|
# The-Repo-Club [wayne6324@gmail.com]
|
2022-10-14 13:59:48 -04:00
|
|
|
#Github:
|
2022-01-20 15:38:50 -05:00
|
|
|
# https://github.com/The-Repo-Club/
|
|
|
|
#
|
2022-07-14 12:15:51 -04:00
|
|
|
#Created:
|
|
|
|
# Mon 22 November 2021, 03:15:54 PM [GMT+1]
|
2022-10-14 13:59:48 -04:00
|
|
|
#Modified:
|
2023-08-17 15:14:43 -04:00
|
|
|
# Thu 17 August 2023, 08:10:42 PM [GMT+1]
|
2022-01-20 15:38:50 -05:00
|
|
|
#
|
2022-07-14 12:15:51 -04:00
|
|
|
#Description:
|
2022-01-20 15:38:50 -05:00
|
|
|
# <Todo>
|
|
|
|
#
|
2022-07-14 12:15:51 -04:00
|
|
|
#Dependencies:
|
|
|
|
# <None>
|
|
|
|
#
|
2021-01-09 12:38:56 -05:00
|
|
|
|
2023-08-17 13:04:38 -04:00
|
|
|
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 &
|
2023-08-13 18:55:16 -04:00
|
|
|
else
|
|
|
|
echo "polkit-gnome already Running"
|
|
|
|
fi
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
2022-10-28 03:39:50 -04:00
|
|
|
if [[ $DESKTOP_SESSION == "i3" ]]; then
|
2023-04-24 13:35:14 -04:00
|
|
|
|
2023-08-13 18:55:16 -04:00
|
|
|
if command -v polybar &>/dev/null; then
|
|
|
|
if ! pgrep -f "polybar" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
if ! test -f "$HOME/.config/polybar/launch.sh"; then
|
|
|
|
echo "$HOME/.config/polybar/launch.sh could not be found"
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
exec "$HOME/.config/polybar/launch.sh"
|
2023-04-24 13:35:14 -04:00
|
|
|
fi
|
2023-08-13 18:55:16 -04:00
|
|
|
) &
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "polybar already Running"
|
2023-04-24 13:35:14 -04:00
|
|
|
fi
|
2023-08-13 18:55:16 -04:00
|
|
|
else
|
|
|
|
echo "polybar can not be found"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
|
2023-08-13 18:55:16 -04:00
|
|
|
if command -v i3-autolayout &>/dev/null; then
|
|
|
|
if ! pgrep -f "i3-autolayout" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
i3-autolayout autolayout
|
|
|
|
) &
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "i3-autolayout already Running"
|
2022-10-14 13:59:48 -04:00
|
|
|
fi
|
2023-08-13 18:55:16 -04:00
|
|
|
else
|
|
|
|
echo "i3-autolayout can not be found"
|
|
|
|
fi
|
2023-08-07 17:01:47 -04:00
|
|
|
fi
|
2021-01-09 12:38:56 -05:00
|
|
|
|
2023-08-07 17:01:47 -04:00
|
|
|
if command -v xroot &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
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
|
2023-08-17 15:14:43 -04:00
|
|
|
echo "xmenu_desktop already Running"
|
2023-08-13 18:55:16 -04:00
|
|
|
fi
|
2023-08-17 15:14:43 -04:00
|
|
|
else
|
|
|
|
echo "xmenu_desktop can not be found"
|
2022-10-14 13:59:48 -04:00
|
|
|
fi
|
2023-08-13 18:55:16 -04:00
|
|
|
else
|
|
|
|
echo "xroot already Running"
|
|
|
|
fi
|
2023-08-07 17:01:47 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "xroot can not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
2023-08-07 17:01:47 -04:00
|
|
|
|
2022-01-21 08:38:27 -05:00
|
|
|
if command -v clipmenu-daemon &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -f "clipmenu-daemon" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
clipmenu-daemon
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "clipmenu-daemon already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "clipmenu-daemon can not be found"
|
2022-01-20 11:18:33 -05:00
|
|
|
fi
|
|
|
|
|
2023-04-24 13:35:14 -04:00
|
|
|
if command -v picom &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -x "picom" >/dev/null; then
|
|
|
|
picom --config "$HOME"/.config/picom/picom.conf &
|
|
|
|
else
|
|
|
|
echo "picom already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "picom could not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
################
|
|
|
|
## Tray Icons ##
|
|
|
|
################
|
|
|
|
|
2023-04-24 13:35:14 -04:00
|
|
|
if command -v ckb-next &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -x "ckb-next" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
ckb-next --background
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "ckb-next already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "ckb-next could not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
2022-01-21 08:38:27 -05:00
|
|
|
if command -v nm-applet &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -x "nm-applet" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
nm-applet
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "nm-applet already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "nm-applet could not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
2022-01-21 08:38:27 -05:00
|
|
|
if command -v blueman-applet &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -x "blueman-applet" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
blueman-applet
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "blueman-applet already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "blueman-applet could not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
2022-01-21 08:38:27 -05:00
|
|
|
if command -v touchpad-indicator &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -f "touchpad-indicator" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
touchpad-indicator
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "touchpad-indicator already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "touchpad-indicator could not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
2023-08-17 13:04:38 -04:00
|
|
|
if command -v cbatticon &>/dev/null; then
|
|
|
|
if ! pgrep -x "cbatticon" >/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
(
|
|
|
|
sleep 2s
|
2023-08-17 13:04:38 -04:00
|
|
|
cbatticon
|
2023-08-13 18:55:16 -04:00
|
|
|
) &
|
|
|
|
else
|
2023-08-17 13:04:38 -04:00
|
|
|
echo "cbatticon already Running"
|
2023-08-13 18:55:16 -04:00
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-17 13:04:38 -04:00
|
|
|
echo "cbatticon could not be found"
|
2022-10-16 13:54:14 -04:00
|
|
|
fi
|
|
|
|
|
2023-08-06 15:06:24 -04:00
|
|
|
if command -v pasystray &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! pgrep -x "pasystray" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 5s
|
|
|
|
pasystray
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "pasystray already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "pasystray could not be found"
|
2022-10-25 01:44:12 -04:00
|
|
|
fi
|
|
|
|
|
2023-08-15 12:37:16 -04:00
|
|
|
if command -v firewall-applet &>/dev/null; then
|
|
|
|
if ! pgrep -x "firewall-applet" >/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
(
|
|
|
|
sleep 5s
|
2023-08-15 12:37:16 -04:00
|
|
|
firewall-applet
|
2023-08-13 18:55:16 -04:00
|
|
|
) &
|
|
|
|
else
|
2023-08-15 12:37:16 -04:00
|
|
|
echo "firewall-applet already Running"
|
2023-08-13 18:55:16 -04:00
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-15 12:37:16 -04:00
|
|
|
echo "firewall-applet could not be found"
|
2022-11-14 02:06:13 -05:00
|
|
|
fi
|
|
|
|
|
2022-10-25 01:44:12 -04:00
|
|
|
if command -v numlockx &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
numlockx on &
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "numlockx could not be found"
|
2022-10-25 01:44:12 -04:00
|
|
|
fi
|
|
|
|
|
2022-07-14 12:15:51 -04:00
|
|
|
####################
|
|
|
|
## Fix Background ##
|
|
|
|
####################
|
2023-04-24 13:35:14 -04:00
|
|
|
if command -v feh &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
if ! test -f "$HOME/.fehbg"; then
|
|
|
|
echo "$HOME/.fehbg could not be found"
|
|
|
|
else
|
|
|
|
sh "$HOME/.fehbg"
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
sh "$HOME/.fehbg"
|
|
|
|
) &
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "feh could not be found"
|
2022-07-14 12:15:51 -04:00
|
|
|
fi
|
|
|
|
|
2021-01-09 12:38:56 -05:00
|
|
|
###############
|
|
|
|
## Auto Lock ##
|
|
|
|
###############
|
|
|
|
|
2023-01-16 12:52:07 -05:00
|
|
|
if command -v xautolock &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
# shellcheck disable=SC2155
|
|
|
|
if ! pgrep -x "xautolock" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
xautolock \
|
|
|
|
-time 15 -locker "multimonitorlock -l -- --time-str=%I:%M:%S %p" \
|
|
|
|
-detectsleep
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "xautolock already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "xautolock could not be found"
|
2023-01-16 12:52:07 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if command -v xss-lock &>/dev/null; then
|
2023-08-13 18:55:16 -04:00
|
|
|
# shellcheck disable=SC2155
|
|
|
|
if ! pgrep -x "xss-lock" >/dev/null; then
|
|
|
|
(
|
|
|
|
sleep 2s
|
|
|
|
xss-lock -- multimonitorlock -l -- --time-str="%I:%M:%S %p"
|
|
|
|
) &
|
|
|
|
else
|
|
|
|
echo "xss-lock already Running"
|
|
|
|
fi
|
2023-04-24 13:35:14 -04:00
|
|
|
else
|
2023-08-13 18:55:16 -04:00
|
|
|
echo "xss-lock could not be found"
|
2021-01-09 12:38:56 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
################
|
|
|
|
## Other Junk ##
|
|
|
|
################
|
|
|
|
|
2022-01-21 08:38:27 -05:00
|
|
|
systemctl --user import-environment DISPLAY XAUTHORITY
|
|
|
|
|
|
|
|
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
|
2023-08-13 18:55:16 -04:00
|
|
|
dbus-update-activation-environment DISPLAY XAUTHORITY
|
2022-01-21 08:38:27 -05:00
|
|
|
fi
|
2022-01-19 04:11:28 -05:00
|
|
|
|
|
|
|
# see https://wiki.archlinux.org/title/GNOME/Keyring#xinitrc
|
2022-01-21 08:38:27 -05:00
|
|
|
eval "$(/usr/bin/gnome-keyring-daemon --start)"
|
2022-01-19 04:11:28 -05:00
|
|
|
export SSH_AUTH_SOCK
|
|
|
|
|
|
|
|
# see https://github.com/NixOS/nixpkgs/issues/14966#issuecomment-520083836
|
2022-01-21 08:38:27 -05:00
|
|
|
mkdir -p "$HOME"/.local/share/keyrings
|