r/kde • • 1d ago

Question Activities in shell scripts

Hey so ive been trying to customize my desktop in a way where i have multiple activities and on startup i have autostart programs which start in different activities so i have, every time i boot, a system monitor activity, a music activity etc. problem is i have no idea how to put in to the shell script on which activity the program should be placed. They just start on the last one. i also cannot find the api reference for stuff like that.

just to make things clear, i dont want widgets or plasmoids or something like that. i want btop to start in my system monitor activity every time i start my laptop.

Im on fedora kde, if that is important.

Really gratefull for any kind of pointers.

Im pretty sure there must be a way since applets are able to connect to activities. If anything isnt clear ill do my best to explain.

Thanks

3 Upvotes

5 comments sorted by

•

u/AutoModerator 1d ago

Thank you for your submission.

Consider donating to KDE and help the project thrive!

The KDE community supports the Fediverse and open source social media platforms over proprietary and user-abusing outlets. Consider visiting our community on Mastodon (Lemmy will be back shortly). Tag us in your toots! You can also visit our forum at KDE Discuss to talk about KDE stuff, brainstorm ideas and get the answers to your KDE-related issue.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/GiggleSamurai 1d ago

For btop, assign the terminal window to the activity with a KWin Window Rule: match that window and set Activities to your system-monitor activity with Apply Initially. Make the match specific to that terminal's title rather than all terminal windows, so your other terminals aren't sent there too.

1

u/Kallefinn 1d ago

okay thanks that works mostly. one issue i have is that i would like to be able to adjust those options through a shell script. So is there some kind of api i can follow to get that to work? or at least a place where those settings for kwin window rules are stored?

1

u/mystica5555 1d ago

https://askubuntu.com/questions/1427439/open-a-program-into-a-specific-kde-activity

Gemini mentions creating temporary window rules during the script, or perhaps using dbus to change the activity in the script before launching the application.