sway:dark-mode
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sway [2020/10/12 19:24] – admin | sway:dark-mode [2021/01/07 23:54] (current) – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== On themes, sway, emacs and kitty - the dark-mode script ==== | ==== On themes, sway, emacs and kitty - the dark-mode script ==== | ||
+ | |||
Unlike Desktop Environments like Gnome and KDE, Window Managers like | Unlike Desktop Environments like Gnome and KDE, Window Managers like | ||
- | sway do not come with all the tools you might need or want. It's up to | + | **sway** do not come with all the tools you might need or want. It's up to |
the user to perceive a need, do the research and then install, | the user to perceive a need, do the research and then install, | ||
configure and use the appropriate tools for the job. Notwithstanding | configure and use the appropriate tools for the job. Notwithstanding | ||
Line 10: | Line 11: | ||
satisfaction of knowing what's going on. | satisfaction of knowing what's going on. | ||
- | In my own history through fvwm, fluxbox, i3wm and now sway I've never | + | In my own history through |
really wanted to bother with themes. I just made terminals and emacs | really wanted to bother with themes. I just made terminals and emacs | ||
have a black background and other programs could do what ever they | have a black background and other programs could do what ever they | ||
Line 28: | Line 29: | ||
customising and a script that I use to do the flick. | customising and a script that I use to do the flick. | ||
- | All of this is on Fedora-31. | + | All of this is on Fedora-31 |
Apologies if this is all obvious and well documented elsewhere. It was a journey for me and non-trivial. | Apologies if this is all obvious and well documented elsewhere. It was a journey for me and non-trivial. | ||
Line 44: | Line 45: | ||
The hard part was understanding how to get running programs to notice | The hard part was understanding how to get running programs to notice | ||
- | the change. **lxappearance**(1) is a program from the LXDE desktop | + | the change. |
environment that does both jobs. Unfortunately, | environment that does both jobs. Unfortunately, | ||
interface so it can only be used in the pointy-clicky mode and not in | interface so it can only be used in the pointy-clicky mode and not in | ||
a script. | a script. | ||
- | By using **strace**(1) on the different components, I was able to track this | + | By using '' |
- | down to a new (for me) system call **eventfd**(2) which GTK2 uses as a | + | down to a new (for me) system call '' |
signalling mechanism. With a bit more research I found this script | signalling mechanism. With a bit more research I found this script | ||
fragment at [[https:// | fragment at [[https:// | ||
Line 85: | Line 86: | ||
I just wonder if this could be replaced by a simple script like the | I just wonder if this could be replaced by a simple script like the | ||
- | GK2 one? | + | GTK2 one? |
But that appears to be not the entire story. | But that appears to be not the entire story. | ||
Line 114: | Line 115: | ||
===emacs=== | ===emacs=== | ||
- | emacs. Hmmm. I've grown up with that program and am unlikely to | + | '' |
wean myself off it. There are ' | wean myself off it. There are ' | ||
experiments but they are yet to hit the Fedora repositories outside | experiments but they are yet to hit the Fedora repositories outside | ||
Line 120: | Line 121: | ||
GTK signals. | GTK signals. | ||
- | In any case, for emacs I need to also modify the internal text areas | + | In any case, for '' |
- | and emacs has its own themes spelled out in elisp. I decided on a | + | and '' |
couple of good themes and added some code to my script to flip from | couple of good themes and added some code to my script to flip from | ||
one theme to another. The script should be self explanatory. The | one theme to another. The script should be self explanatory. The | ||
Line 130: | Line 131: | ||
===kitty=== | ===kitty=== | ||
- | Now for my favorite wayland terminal emulator, | + | Now for my favorite wayland terminal emulator, |
own unique configuration language and can have its colour changed on | own unique configuration language and can have its colour changed on | ||
the fly like this: | the fly like this: | ||
Line 140: | Line 141: | ||
===bash=== | ===bash=== | ||
- | My bash prompt contains colours and I have a separate script | + | My '' |
(actually a function in '' | (actually a function in '' | ||
setting of '' | setting of '' | ||
Line 150: | Line 151: | ||
- | ... ' | + | ... ' |
that's what gets eval' | that's what gets eval' | ||
- | These final 2 steps are the reason I don't put dark-mode into a cron | + | These final 2 steps are the reason I don't put '' |
- | job - it needs to run in my stack of kitty terminal tabs. | + | job - it needs to run in my stack of '' |
===KDE=== | ===KDE=== | ||
Line 160: | Line 161: | ||
KDE/ | KDE/ | ||
- | Here be dragons. | + | Thanks to redditor r/progandy for this: |
- | script | + | |
+ | '' | ||
+ | |||
+ | < | ||
+ | sudo dnf install qt5ct | ||
+ | </ | ||
+ | |||
+ | This needs to be in the session environment: | ||
+ | |||
+ | < | ||
+ | export QT_QPA_PLATFORMTHEME=qt5ct | ||
+ | </ | ||
+ | |||
+ | After running '' | ||
+ | |||
+ | < | ||
+ | style=Adwaita | ||
+ | </ | ||
+ | |||
+ | ... I can hit that with my script | ||
+ | |||
+ | Oddly, there' | ||
+ | |||
+ | I also built [[https:// | ||
+ | |||
+ | ===dark-mode=== | ||
+ | Here is the result of all this rambling: https:// | ||
sway/dark-mode.txt · Last modified: 2021/01/07 23:54 by admin