Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Ability to switch Konsole color scheme through Profile #89

Open
QuakeString opened this issue Jun 27, 2024 · 4 comments
Open
Labels
Feature Request Requests for new features or feedback Unfeasible This will not be worked on due to lack of skills, resources or interest

Comments

@QuakeString
Copy link

please add support to change color scheme of Konsole terminal emulator so with dark and light switching of color it also swith the profile of konsole.
Screenshot_20240627_174935-1

@MartinVonReichenberg MartinVonReichenberg added Unfeasible This will not be worked on due to lack of skills, resources or interest Feature Request Requests for new features or feedback labels Jun 27, 2024
@MartinVonReichenberg
Copy link
Collaborator

Hello,

You can use a custom Bash script in Koi 0.4 for that . . .

@MartinVonReichenberg MartinVonReichenberg changed the title Ability to switch Konsole color scheme through Profile [REQUEST] Ability to switch Konsole color scheme through Profile Dec 15, 2024
@acovaci
Copy link

acovaci commented Dec 20, 2024

@MartinVonReichenberg We can actually do this, through the dbus interface. I'm not great at picking up codebases, but here's the gist:

$ qdbus org.kde.konsole-`pidof -s konsole` /Sessions/1 setProfile "Breeze Dark"

So via the pidof -s konsole, you grab the first pid of a Konsole running. Now naturally, we'd want to get all pids and iterate through them, but that shouldn't be horrible to do.

Then you can get all active Sessions if you run

$ qdbus org.kde.konsole-`pidof -s konsole`
...
/Sessions
/Sessions/1
/Sessions/2
...

After this, we iterate through each, and set the profile like in the first command I showed

@acovaci
Copy link

acovaci commented Dec 20, 2024

Oh, and to populate the drop-down, we can use

$ qdbus org.kde.konsole-`pidof -s konsole` /Windows/1 profileList
Breeze Dark
Breeze Light

I'm not sure why this is on /Windows and the set is on /Sessions but oh well :)

@acovaci
Copy link

acovaci commented Dec 20, 2024

Oh and one last thing. We also need to set the default profile, so any new window is launched with the new theme. Once again, this is on /Windows strangely enough.

$ qdbus org.kde.konsole-`pidof -s konsole` /Windows/1 setDefaultProfile "Breeze Light"

Though, looks like setting it just once, does it globally, from my little messing around. So maybe we don't have to do it for every window.

Finally, as an extra tidbit, the default option in the dropdown could be

$ qdbus org.kde.konsole-`pidof -s konsole` /Windows/1 defaultProfile
Breeze Light

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Requests for new features or feedback Unfeasible This will not be worked on due to lack of skills, resources or interest
Projects
None yet
Development

No branches or pull requests

3 participants