show desktop
wwith kdotool is there any way to get the equivalent of wmctrl -k on on plasma wayland? e.g. working in a cron script
There is a slotToggleShowDesktop function in kwin, so a corresponding command can be added to kdotool. But it's a toggle, and there seems to be no way to query the current state, so not exactly the same as -k on|off.
In theory this should work:
qdbus org.kde.KWin /KWin org.kde.KWin.showDesktop true
To query current state:
qdbus org.kde.KWin /KWin org.kde.KWin.showingDesktop
Unfortunately the showDesktop method doesn't seem to work properly on my system for some reason (when invoked like this), it only flickers the windows.
As a workaround you could also set a global shortcut for the "Peek at Desktop" function and invoke it using ydotool.
I've found this is working:
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Show Desktop"
wwith kdotool is there any way to get the equivalent of
wmctrl -k onon plasma wayland? e.g. working in a cron script
Out of curiosity; why do you need to show desktop in a cron script?
I have a script that updates the desktop background, and I would like it to show me it upon change
otherwise I would not notice :)
btw, it's just a bing image of the day, upscaled with upscayl and with a descriptive text superimposed using imagemagick. I can share it if you are interested
Are you aware of Picture of the Day plugin which supports Bing and scaling?
And to notice wallpaper change wouldn't system notification be better (less intrusive) than showing desktop?
I am aware of it, and used it for a while, but I was every time wondering what places are shown in the picture, so I've made the script to get that information superimposed:
also, the bing images are 1920x1080, which visualized on my 1440p monitor result a bit blurred. So I have added upscayl in my script. The result is much better of what Picture of the Day plugin provides.
I could notice wallpaper change using kdialog, but I prefer to see it straightforwardly. That's a matter of tastes. In another machine I call the script upon wake from standby (typically every morning).
I've made the script to get that information superimposed
Nice! If you can please share the script (maybe as a gist at https://gist.github.com/ ?).
sure https://gist.github.com/cipitaua/c5dc39b069b264f671d7ce92f3be4c7b
In another machine I call the script upon wake from standby (typically every morning).
What do you hook into to know that system has just woke up?
What do you hook into to know that system has just waked up?
if you use systemd, you create a script /usr/lib/systemd/system-sleep/myprepost.sh with the following content (adjust it):
#!/bin/bash
case $1 in
pre)
# commands to be executed before suspend, hibernate, etc. goes below
killall -q ssh
;;
post)
# commands to be executed after wakeup goes below
service bluetooth restart #helps gamepad reconnection
sudo -u taco /home/taco/bin/bing_image_of_the_day.sh force
;;
esac
otherwise if you use Networkmanager you can create a script /etc/NetworkManager/dispatcher.d/myprepost.sh with the following content (adjust it):
#!/bin/bash
[ "$1" == "enp7s0" ] && [ "$2" == "up" ] && sudo -u taco --set-home --preserve-env /home/taco/bin/bing_image_of_the_day.sh
exit 0
so that it will be executed upon network connection.