configuration form the arch linux stored

This commit is contained in:
filipriec
2025-09-22 08:27:51 +02:00
commit 3e6d1a0d61
166 changed files with 807076 additions and 0 deletions

21
polybar/scripts/showtray.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
##old
#polybar traybar &
#sleep 10
#kill $(pgrep polybar | tail -n 1)
##old
# Path to a file where the Polybar tray PID will be stored
PID_FILE="/tmp/polybar_tray.pid"
# Check if the PID file exists and if the process is running
if [ -f "$PID_FILE" ] && kill -0 $(cat "$PID_FILE") 2>/dev/null; then
# If so, kill the process and remove the PID file
kill $(cat "$PID_FILE") && rm -f "$PID_FILE"
else
# Otherwise, launch polybar and store its PID
polybar traybar & echo $! > "$PID_FILE"
# After 10 seconds, remove the PID file if the user hasn't already closed the tray
sleep 10 && [ -f "$PID_FILE" ] && kill $(cat "$PID_FILE") && rm -f "$PID_FILE"
fi