Skip to content

Instantly share code, notes, and snippets.

@ihipop
Last active April 14, 2023 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihipop/aa4ccb4e0dc8bfa8d3e7bedc38c88bfd to your computer and use it in GitHub Desktop.
Save ihipop/aa4ccb4e0dc8bfa8d3e7bedc38c88bfd to your computer and use it in GitHub Desktop.
use DBUS to reload KWIN or PlasmaShell
#!/bin/bash
[ "$XDG_SESSION_DESKTOP" = "KDE" ] || exit
#dbus-send --session --print-reply --dest=org.kde.kded5 \
# /kded \
# org.kde.kded5.unloadModule \
# string:"kscreen"
{
dbus-send --session --type=method_call --print-reply --dest=org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.refreshCurrentShell ||
{ killall plasmashell -u ${USER:-$(whoami)} && echo killed plasmashell ; kstart5 -- plasmashell >/dev/null 2>&1 & }
} &
{
dbus-send --session --type=signal --print-reply --dest=org.kde.KWin /KWin org.kde.KWin.reloadConfig ||
{ kstart5 -- kwin_x11 --replace >/dev/null 2>&1 & }
} &
#killall spectacle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment