From 052966fda8d6d0d35cd51e1ad78735d387138ff4 Mon Sep 17 00:00:00 2001
From: Valeria Fadeeva <valeria.fadeeva.me@gmail.com>
Date: Mon, 6 Jan 2025 02:09:29 +0500
Subject: [PATCH] Update

---
 skel/.local/bin/reset-layout.sh    | 21 ++++++++++++++++++---
 skel/.local/bin/restart-effects.sh |  5 +++++
 skel/.local/bin/restart-plasma.sh  |  5 +++++
 3 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100755 skel/.local/bin/restart-effects.sh
 create mode 100755 skel/.local/bin/restart-plasma.sh

diff --git a/skel/.local/bin/reset-layout.sh b/skel/.local/bin/reset-layout.sh
index 5b736ea..d3f1a20 100755
--- a/skel/.local/bin/reset-layout.sh
+++ b/skel/.local/bin/reset-layout.sh
@@ -6,10 +6,25 @@ theme="com.github.Melawy.Melawy-round-gray.Nier-A2.desktop"
 
 plasma-apply-lookandfeel -a "$theme" --resetLayout
 
-notify-send -t 5000 -a "Theme is" "$theme" "$(date '+%Y.%m.%d %H:%M:%S')"
-
 if [ "$(whoami)" != "liveuser" ]; then
     sleep 5
-    rm "$HOME/.config/autostart/reset-layout.desktop"
+    if [ -f "$HOME/.config/autostart/reset-layout.desktop" ]; then
+        rm "$HOME/.config/autostart/reset-layout.desktop"
+    fi
 #     rm "$HOME/.local/bin/reset-layout.sh"
 fi
+
+sleep 1
+
+normal_process=$(ps -eo pcpu,stat,comm | grep plasmashell | grep 'S<sl')
+
+if [ -z "$normal_process" ]; then
+    echo "Restart plasma-plasmashell"
+    systemctl --user restart plasma-plasmashell
+fi
+
+sleep 1
+
+notify-send -t 5000 -a "Theme is" "$theme" "$(date '+%Y.%m.%d %H:%M:%S')"
+
+echo "Ready"
diff --git a/skel/.local/bin/restart-effects.sh b/skel/.local/bin/restart-effects.sh
new file mode 100755
index 0000000..6f88b81
--- /dev/null
+++ b/skel/.local/bin/restart-effects.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+qdbus org.kde.KWin /KWin reconfigure
+
+echo "Ready"
diff --git a/skel/.local/bin/restart-plasma.sh b/skel/.local/bin/restart-plasma.sh
new file mode 100755
index 0000000..3ad74b5
--- /dev/null
+++ b/skel/.local/bin/restart-plasma.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+systemctl --user restart plasma-plasmashell
+
+echo "Ready"