Reply to topic

How to change KDE colourscsheme from within a script

petrosyan
Registered Member
Posts
1
Karma
0
Hi all,

I want to implement a scheduled colourscheme changer. The idea is to set a kalarm script that edits a file and changes the colourscheme.

For example to automatically change the colourscheme to Breeze dark past 20:00, and to set uit back to Breeze at 19:00.

I tried to find a filethat defines the colourscheme, but it seems near impossible: the settings are duplicated all over the place and I don't know how to make the system refresh without logging out: the whole idea is to do this seamlessly.

Another possibility is to use
Code: Select all
kcmshell5 --args <something something=Breeze Dark> colors
trouble is to pass an argument that tells what to change the colorscheme to - Breeze Dark. Is there any documentation on supported arguments and or functions?

A third possibility is to implement this in the KCM colors itself, problem is I can't seem to find the repository and not everyone might like the change. It would still be a feature - changing colour contrast throughout the day, but you never know.

Last resort is to call
Code: Select all
kcmshell colors
and pass it a number of keypresses that changes the colourscheme. A terrible idea, but it might work for some simple usecases.

Any help would be much appreciated.
ztara
Registered Member
Posts
1
Karma
0
ganders wrote:I use this script for me Plasma 5:
https://unix.stackexchange.com/question ... ell-script

Once I even used this script on the site, where you can get homework assignment help, for the term paper.
But I often use the console to change the color -Phenq for me, it's easier and more convenient. How to do it:
https://abdussamad.com/archives/503-Cha ... n-KDE.html

thank you this script ...its very help full
sonalimohol
Registered Member
Posts
5
Karma
0
The K Desktop Environment (KDE) includes a great terminal program called Konsole. Using Konsole you can access the Linux command line from within KDE. With Konsole you can change the background and foreground colors of your terminal window, and one of the best features is the ability to set the colors using the command line or Linux shell. This allows you to do some cool things like change the color scheme depending on the program you are running.
Changing the color scheme is as simple as typing:
konsoleprofile colors=ColorSchemeName
For example:
konsoleprofile colors=WhiteOnBlack
You can create your own custom color scheme by selecting Settings menu > Configure Profiles > choose “Shell” and click on “Edit” button > Appearance tab.
Changing color scheme on a per program basis
Say you login to a remote server via SSH. It would be helpful if the color profile changed to reflect that you were actually logged into a remote server. You can do that with konsoleprofile.
First you setup a bash alias that resets the color profile to your default one:
alias resetcolors='konsoleprofile colors=WhiteOnBlack;'
Then setup aliases that change the color profile and log you into the remote server:
alias sshadmin='konsoleprofile colors=WhiteOnDarkBlue;ssh admin@example.com; resetcolors'
Now if you type sshadmin the color scheme will be changed and you will be logged in via SSH. When you log out, the color scheme will reset back to the default!
This technique is especially helpful when you want to differentiate between different SSH accounts. For example if you are logged in as root you can have it change the background color to red so that you know you have to be careful what you type.
sonalimohol
Registered Member
Posts
5
Karma
0
Hello Ganders,
Thank you for your solution..!!!
jeanbarkley
Registered Member
Posts
1
Karma
0
Easy! I have used the script below severally in the past and trust me, It has always worked. Thank me later:

#!/bin/bash

CONFIG=$HOME/.config/kcminputrc
CURRENT=`kreadconfig --file $CONFIG --group Mouse --key XLbInptLeftHanded`

if [ $CURRENT = "true" ]; then
kwriteconfig --file $CONFIG --group Mouse --key XLbInptLeftHanded false
elif [ $CURRENT = "false" ]; then
kwriteconfig --file $CONFIG --group Mouse --key XLbInptLeftHanded true
fi

kcminit mouse

For your dissertation help, check out the dissertation consultancy services by the Smart Custom . https://smartcustomessays.com/dissertation-consulting/
eliasir
Registered Member
Posts
2
Karma
0
nice one Jean Barkley,
Makes a lot of sense,
Thanks,
Had really been troubled by the same
jtren
Registered Member
Posts
1
Karma
0
jeanbarkley wrote:Easy! I have used the script below severally in the past and trust me, It has always worked. Thank me later:

#!/bin/bash

CONFIG=$HOME/.config/kcminputrc
CURRENT=`kreadconfig --file $CONFIG --group Mouse --key XLbInptLeftHanded`

if [ $CURRENT = "true" ]; then
kwriteconfig --file $CONFIG --group apk Mouse --key XLbInptLeftHanded false
elif [ $CURRENT = "false" ]; then
kwriteconfig --file $CONFIG --group Mouse --key XLbInptLeftHanded true
fi

kcminit mouse


Thank you so much. It helped me a lot ;D
eliasir
Registered Member
Posts
2
Karma
0
Howdy!
The freezing issue mainly affects individuals using Optimus laptops.
I had the same issue too, and it happened mostly when I tried window snapping with the mouseBy going to kcmshell5 qtquick settings and setting the render loop to “basic”.
Also, try downgrading to KWin 5 . 15 . 3.
Additionally, you can get dissertation consulting assistance or
You can try fixing the issue by opening the compositor system settings and changing the rendering backed to OpenGL 3.1 and rebooting your system.

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Majestic-12 [Bot], Peter Evans, Snudl, Sogou [Bot], TristanDee, wind_rose_2, Yahoo [Bot]