melawy-skel-root/root/.local/bin/reset-layout.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

2023-11-22 11:29:04 +05:00
#!/bin/bash
2023-11-23 01:53:21 +05:00
theme="com.github.Melawy.Melawy-round-gray.Nier-A2.desktop"
2025-01-24 15:53:31 +05:00
# Force Zenity Status message box to always be on top.
(
sleep 30
echo "# Set theme"; sleep 1
2023-11-23 01:53:21 +05:00
plasma-apply-lookandfeel -a "$theme" --resetLayout
2025-01-24 15:53:31 +05:00
echo "25"
echo "# Remove unneeded link"; sleep 1
2023-11-22 11:29:04 +05:00
if [ "$(whoami)" != "liveuser" ]; then
sleep 5
2025-01-06 15:27:16 +05:00
if [ -f "$HOME/.config/autostart/reset-layout.desktop" ]; then
rm "$HOME/.config/autostart/reset-layout.desktop"
fi
2024-12-02 11:52:16 +05:00
# rm "$HOME/.local/bin/reset-layout.sh"
2023-11-22 11:29:04 +05:00
fi
2025-01-06 15:27:16 +05:00
2025-01-24 15:53:31 +05:00
echo "50"
echo "# Get status of plasmashell"; sleep 2
2025-01-06 15:27:16 +05:00
normal_process=$(ps -eo pcpu,stat,comm | grep plasmashell | grep 'S<sl')
2025-01-24 15:53:31 +05:00
echo "75"
2025-01-06 15:27:16 +05:00
if [ -z "$normal_process" ]; then
2025-01-24 15:53:31 +05:00
echo "# Restart plasma-plasmashell"; sleep 1
2025-01-06 15:27:16 +05:00
systemctl --user restart plasma-plasmashell
fi
2025-01-24 15:53:31 +05:00
echo "99"
echo "# All finished."; sleep 1
echo "100"
) |
zenity --progress \
--title="Waiting for the computer to complete setup. DO NOT CLOSE OR CANCEL!" \
--text="Run" \
--percentage=0 \
--auto-close \
--auto-kill
2025-01-06 15:27:16 +05:00
2025-01-24 15:53:31 +05:00
(( $? != 0 )) && zenity --error --text="Error in zenity command."
2025-01-06 15:27:16 +05:00
2025-01-24 15:53:31 +05:00
sleep 5
notify-send -t 5000 -a "Theme is" "$theme" "$(date '+%Y.%m.%d %H:%M:%S')"
2025-01-06 15:27:16 +05:00
echo "Ready"
2025-01-24 15:53:31 +05:00
exit 0