sxmo, plugins: restart Conky on time/timezone/wallpaper/logout and shorten # Input mode hints
This commit is contained in:
@@ -80,25 +80,41 @@ else
|
||||
xset s off s noblank s 0 0 -dpms >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
xrdb -merge "$HOME/.Xresources" >/dev/null 2>&1 || true
|
||||
WP_FILE="/usr/share/wallpapers/bananarchy.png"
|
||||
if [ -f "$XDG_CONFIG_HOME/sxmo/wallpaper" ]; then
|
||||
custom_wp="$(head -n 1 "$XDG_CONFIG_HOME/sxmo/wallpaper" 2>/dev/null)"
|
||||
[ -n "$custom_wp" ] && [ -f "$custom_wp" ] && WP_FILE="$custom_wp"
|
||||
fi
|
||||
WP_FLAG="--bg-fill"
|
||||
if [ -f "$XDG_CONFIG_HOME/sxmo/wallpaper_mode" ]; then
|
||||
wp_mode="$(head -n 1 "$XDG_CONFIG_HOME/sxmo/wallpaper_mode" 2>/dev/null)"
|
||||
case "$wp_mode" in
|
||||
scale|--bg-scale) WP_FLAG="--bg-scale" ;;
|
||||
max|--bg-max) WP_FLAG="--bg-max" ;;
|
||||
center|--bg-center) WP_FLAG="--bg-center" ;;
|
||||
tile|--bg-tile) WP_FLAG="--bg-tile" ;;
|
||||
*) WP_FLAG="--bg-fill" ;;
|
||||
esac
|
||||
fi
|
||||
feh --no-fehbg "$WP_FLAG" "$WP_FILE" >/dev/null 2>&1 </dev/null &
|
||||
pidof -s conky >/dev/null 2>&1 || CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
|
||||
(DISPLAY=:0 CONKY_DPY=:0 setsid conky -c /home/user/.config/sxmo/conky.conf >/dev/null 2>&1 </dev/null &)
|
||||
pidof -s fcitx5 >/dev/null 2>&1 || fcitx5 -d >/tmp/fcitx5.log 2>&1 </dev/null &
|
||||
sxmo_hook_start.sh >/tmp/sxmo_hook_start.log 2>&1 </dev/null &
|
||||
exec dwm >/tmp/dwm.log 2>&1
|
||||
|
||||
first_iter=1
|
||||
while :; do
|
||||
xrdb -merge "$HOME/.Xresources" >/dev/null 2>&1 || true
|
||||
WP_FILE="/usr/share/wallpapers/bananarchy.png"
|
||||
if [ -f "$XDG_CONFIG_HOME/sxmo/wallpaper" ]; then
|
||||
custom_wp="$(head -n 1 "$XDG_CONFIG_HOME/sxmo/wallpaper" 2>/dev/null)"
|
||||
[ -n "$custom_wp" ] && [ -f "$custom_wp" ] && WP_FILE="$custom_wp"
|
||||
fi
|
||||
WP_FLAG="--bg-fill"
|
||||
if [ -f "$XDG_CONFIG_HOME/sxmo/wallpaper_mode" ]; then
|
||||
wp_mode="$(head -n 1 "$XDG_CONFIG_HOME/sxmo/wallpaper_mode" 2>/dev/null)"
|
||||
case "$wp_mode" in
|
||||
scale|--bg-scale) WP_FLAG="--bg-scale" ;;
|
||||
max|--bg-max) WP_FLAG="--bg-max" ;;
|
||||
center|--bg-center) WP_FLAG="--bg-center" ;;
|
||||
tile|--bg-tile) WP_FLAG="--bg-tile" ;;
|
||||
*) WP_FLAG="--bg-fill" ;;
|
||||
esac
|
||||
fi
|
||||
feh --no-fehbg "$WP_FLAG" "$WP_FILE" >/dev/null 2>&1 </dev/null &
|
||||
if [ "$first_iter" = "0" ]; then
|
||||
pkill -x conky >/dev/null 2>&1 || true
|
||||
sleep 0.05
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
|
||||
(DISPLAY=:0 CONKY_DPY=:0 setsid conky -c /home/user/.config/sxmo/conky.conf >/dev/null 2>&1 </dev/null &)
|
||||
pidof -s fcitx5 >/dev/null 2>&1 || fcitx5 -d >/tmp/fcitx5.log 2>&1 </dev/null &
|
||||
fi
|
||||
first_iter=0
|
||||
dwm >/tmp/dwm.log 2>&1 || true
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
@@ -157,11 +157,13 @@ case "$1" in
|
||||
;;
|
||||
logout)
|
||||
sxmo_hook_logout.sh || true
|
||||
case "$SXMO_WM" in
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
|
||||
case "${SXMO_WM:-dwm}" in
|
||||
"i3") i3-msg exit ;;
|
||||
"sway") swaymsg exit ;;
|
||||
"river") riverctl exit ;;
|
||||
"dwm") pkill dwm ;;
|
||||
"dwm") pkill -x dwm || pkill dwm ;;
|
||||
esac
|
||||
;;
|
||||
togglewm) sxmo_togglewm.sh ;;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
change_alpine() {
|
||||
echo "Changing timezone to $1"
|
||||
|
||||
doas setup-timezone -z "$1"
|
||||
doas -n setup-timezone -z "$1" 2>/dev/null || doas setup-timezone -z "$1"
|
||||
sxmo_hook_statusbar.sh time
|
||||
|
||||
echo "Timezone changed ok"
|
||||
|
||||
Reference in New Issue
Block a user