Files
wechat-selkies/root/scripts/start.sh
Nick007 e18821f917 feat: auto-refresh menu on app install/uninstall and add third-party app docs
- Extract menu generation logic into standalone refresh-menu.sh script
- Use inotifywait to watch ~/Desktop/ for .desktop file changes and
  auto-refresh the openbox right-click menu on app install/uninstall
- Add inotify-tools to Dockerfile dependencies
- Add 'Installing Third-Party Applications' section to both READMEs
  documenting how to install apps like Telegram via sidebar panel
2026-02-28 10:06:08 +08:00

38 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# configure openbox dock mode for stalonetray
if [ ! -f /config/.config/openbox/rc.xml ] || grep -A20 "<dock>" /config/.config/openbox/rc.xml | grep -q "<noStrut>no</noStrut>"; then
mkdir -p /config/.config/openbox
[ ! -f /config/.config/openbox/rc.xml ] && cp /etc/xdg/openbox/rc.xml /config/.config/openbox/
sed -i '/<dock>/,/<\/dock>/s/<noStrut>no<\/noStrut>/<noStrut>yes<\/noStrut>/' /config/.config/openbox/rc.xml
openbox --reconfigure
fi
# generate openbox menu from defaults + ~/Desktop/*.desktop files
/scripts/refresh-menu.sh
# watch ~/Desktop/ for .desktop file changes and auto-refresh menu
mkdir -p "$HOME/Desktop"
if command -v inotifywait >/dev/null 2>&1; then
(while inotifywait -q -e create -e delete -e modify "$HOME/Desktop/" --include '\.desktop$'; do
sleep 1
/scripts/refresh-menu.sh
done) >/dev/null 2>&1 &
fi
nohup stalonetray --dockapp-mode simple > /dev/null 2>&1 &
# start WeChat application in the background if exists and auto-start enabled
if [ "$AUTO_START_WECHAT" = "true" ]; then
if [ -f /usr/bin/wechat ]; then nohup /usr/bin/wechat > /dev/null 2>&1 & fi
fi
# start QQ application in the background if exists and auto-start enabled
if [ "$AUTO_START_QQ" = "true" ]; then
if [ -f /usr/bin/qq ]; then nohup /usr/bin/qq --no-sandbox > /dev/null 2>&1 & fi
fi
# !deprecated: start window switcher application in the background
# start window switcher application in the background
# nohup sleep 2 && python /scripts/window_switcher.py > /dev/null 2>&1 &