I would like to set my own commands to the system-tray-app for switching screens. Is this possible and where do I find the files to change these commands?
The thing is, when I switch to my second monitor from the system-tray-app, the wrong refresh-rate is set. If I switch via a shortcut that I gave the command xrandr --output DP-1 --mode 1920x1080 --rate 60 then everything is fine. So I would like to configure the system-tray-app to use this command, instead of the one it uses now.
I have copied the script, saved it into .bin at my home-folder, made it excutable and it works perfectly. But I donât understand how to drag it to the panel.
But in the end I want to know where to edit the commands being used by the system-tray app itself. Because I would like to use this one.
For now I have the miniature-application âtext-commandâ, that could also contain commands. But I donât want to have several buttons for - 1. monitor - 2. monitor - both monitors - but use this really nice system-tray app (I donât know how to attach screenshots, so I canât show you) that contains all in one.
But if you like to explain it anyway, how to âdrag this script to the panelâ, I would be glad and maybe replace the âtext commandâ-app in the meantime.
My sleeptimer is simply open a terminal and typing: shutdown -h +90
My first sleep timer would set RTCWake (inputting sudo password).
Interative Sleep timer - checks wakeup time
#!/bin/bash
commands () {
echo Wakeup time check: && echo masonnnn | sudo -S rtcwake -m show -l -v |rg alarm: | cut -c 12-30}
sleep 1;
date +"It's now %R" | cowthink
echo "How long until suspending?"
read TIME
echo $TIME set!; sleep $TIME;
xdotool getwindowfocus windowkill; amixer set Master 45%; systemctl suspend
}
export -f commands
konsole -e "bash -c 'commands'"
Dragging to the panel⌠you open the folder in Dolphin, click it with the mouse and drag it over the panel until you see a + symbol on your mouse cursorâŚ
Then if you want sleep now, you set something like 10s to give time to put the mouse away (so as not to wake it up) or 90m to give you 90 minutes.
After a rude awakening (loud music) I also put in the amixer volume reset command.
Should also work for shutting down - but that wonât wake up in the morning before my KAlarm wakeup call playing gentle musicâŚ
You should tell us exactly what widget youâre using - because you canât actually drag things to the systray itself.
Another thing - you donât need to keep the panel visible for such âextraâ items. You can make an extra, smaller panel - I have a hidden panel at the top for hidden entries and I actually kekep the script there (I just took this screenshot to show I could drag it there) - which you could not see in the original screenshot.
Thereâs also another option for this - if you are cool with shortcuts.
You can make two scripts display160.sh and display 260.sh and bind them to a mouse gesture.
Hereâs one I did for xKill (drawing âKâ brings up skull and crossbones window killer :P)
You could set one were you draw either a small âdâ or a capital âDâ to switch to two modes - enter command from mouse gesture⌠or you could set it to a keyboard shortcut, and also map that keyboard shortcut to a mouse gesture.
In german it is titled with âAnzeige-Einrichtungâ so in english I guess it is display-setting. When you klick on it, it opens an area (display arrangement) where you can choose to click on 5 different arrangements.
This is why I try to find out where kde does define what to do on mouseclick on one of the arrangements, and if there is a way to modify the command being executed.
Ah, tough one - those arenât widgets and I donât think itâs so easy to define stuff that comes up in the Tray icons.
Iâd definitely look at keyboard/mouse gestures for this one. They work well for restarting kwin, refreshing plasma, and setting Krohnkite to tiling/floating modes too.
As I said, I just have the âtext commandâ widget with the xrand command set. So if I now want to turn my second screen on, I can do it from there. (If I switch to the second screen from the system-tray while disabling the first screen simultaneously, the refresh-rate of the second screen is set properly).
Or I use a keyboard shortcut. This works fine also.
But I was curious whether I could customize the system-tray-widget in a way, that this would work as well. I think I would have to ask the kde-team how this works
Thank you very much for your suggestions. And for your insights in shell-scripts. Maybe I could use some of it later.