oskarsh / yin-yang Goto Github PK
View Code? Open in Web Editor NEWAuto Nightmode for KDE, Gnome, Budgie, VSCode, Atom and more
License: MIT License
Auto Nightmode for KDE, Gnome, Budgie, VSCode, Atom and more
License: MIT License
It would be nice if Yin-Yang can toggle Vim background
setting between light
and dark
as well.
As a bonus, it would be nice if Yin-Yang can toggle between light and dark Vim themes (configurable by the user based on what themes they have installed and what they prefer).
When trying atom to switch, I give in the standard one-dark and one-light themes in settings.
On switching, I get this error:
"""
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/opt/yin-yang/src/yin_yang.py", line 42, in run
atom.switchToLight()
File "/opt/yin-yang/src/plugins/atom.py", line 64, in switchToLight
inplace_change(path+"config.cson", currentTheme, atomTheme)
File "/opt/yin-yang/src/plugins/atom.py", line 21, in inplace_change
if old_string not in s:
TypeError: 'in ' requires string as left operand, not NoneType
"""
Wish I could help, but I have no idea nor time to look into resolving it. Glad to test it though, would be nice if you can get it working.
FYI
On atom, there is a package called theme-switcher, this lets someone switch atom-theme with a hotkey. It works really well for me, but yin-yang integration would be even nicer. Thanks again for your work!
I thought it would be a nice feature that the schedule is following the natural sunrise/sunset. I found code that does return thoose values if you are interested.
I don't know how to use github to "push" code so you'll have to explain me.
I think that yin-yang
could be improved by not only changing the Look & Feel but also the window manager theme, the icon theme and the plasma theme separately.
I installed this months ago, and wanted to try it out again. It crashes when clicking the settings-button:
Traceback (most recent call last):
File "/opt/yin-yang/src/gui.py", line 331, in open_settings
self.secwindow = SettingsWindow()
File "/opt/yin-yang/src/gui.py", line 23, in __init__
self.sync_with_config()
File "/opt/yin-yang/src/gui.py", line 108, in sync_with_config
self.ui.kvantum_line_light.setText(config.get("kvantumLightTheme"))
File "/opt/yin-yang/src/config.py", line 195, in get
return config[key]
KeyError: 'kvantumLightTheme'
Also, clicking the dark/light buttons triggers:
Exception in thread Thread-25:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/yin-yang/src/yin_yang.py", line 53, in run
if config.get("gnomeEnabled"):
File "/opt/yin-yang/src/config.py", line 195, in get
return config[key]
KeyError: 'gnomeEnabled'
(note the thread count too, with each click it increased)
Starting with a fresh settings file helped. That is my old one: https://pastebin.com/5HfV9Ua0
Btw, I cannot terminate the program from the terminal I started it using CTRL + C / SIGINT.
At the moment it only changes the application theme but not the shell theme in Gnome.
$ yin-yang -Gui
should read:
$ yin-yang -gui
There are some issues in the .desktop file that is created on installation:
-gui
option, although this option does not existUtility; System
It's great to update the VS code config to update the theme, but what about forcing VS Code to do the equivalent of CTRL + SHIFT + P Developer: Reload Window
to actually activate the changed VS Code theme?
I have created bash scripts to change programs between light and dark mode. I'm listing lines from these scripts with the intention of adding support for these programs once I understand how Yin-Yang is structured. If someone else wants to add it first, be my guest. The commands below have only been tested on Fedora Linux.
To change brave-browser to light mode:
sed -i 's/"theme":{"type":[[:digit:]],/"theme":{"type":2,/' ~/.config/BraveSoftware/Brave-Browser/Default/Preferences
To change brave-browser to dark mode:
sed -i 's/"theme":{"type":[[:digit:]],/"theme":{"type":1,/' ~/.config/BraveSoftware/Brave-Browser/Default/Preferences
It would be cool if I could give some terminal commands that can be ran as yin yang changes from dark to light.
I am using a light and dark mode userContent.css
and userChrome.css
for firefox and cronjob/systemd timers are the only other way to achieve switching them on schedule
What is the license of this project?
install.sh: 42: cannot create /home//.local/share/applications/Yin-Yang.desktop: Directory nonexistent
Maybe it should use ${HOME}
instead of /home/${SUDO_USER}
just like earlier in the script.
Thank you!
I have created bash scripts to change programs between light and dark mode. I'm listing lines from these scripts with the intention of adding support for these programs once I understand how Yin-Yang is structured. If someone else wants to add it first, be my guest. The commands below have only been tested on Fedora Linux.
To change gedit to light mode:
gsettings set org.gnome.gedit.preferences.editor 'scheme' 'solarized-light'
To change gedit to dark mode:
gsettings set org.gnome.gedit.preferences.editor 'scheme' 'solarized-dark
I have created bash scripts to change programs between light and dark mode. I'm listing lines from these scripts with the intention of adding support for these programs once I understand how Yin-Yang is structured. If someone else wants to add it first, be my guest. The commands below have only been tested on Fedora Linux.
To change nvim to light mode:
sed -i 's/set background=.*/set background=light/g' ~/.config/nvim/init.vim
To change nvim to dark mode:
sed -i 's/set background=.*/set background=dark/g' ~/.config/nvim/init.vim
The AUR version does not show any configuration fields for the Kvantum settings in the GUI.
The config file (.config/yin_yang/yin_yang.json
) does show some Kvantum settings:
"kvantumEnabled": false,
"kvantumLightTheme": "",
"kvantumDarkTheme": ""
I have tried to edit the JSON file to try and see if it would change the current theme (McMojave is installed, but it didn't work):
"kvantumEnabled": true,
"kvantumLightTheme": "McMojave-light",
"kvantumDarkTheme": "McMojave"
Is there something that I am missing or is it just a beta feature that is not fully added yet?
I have tried launching this from my apps menu, with no success. So I then tried running it via terminal and I get this as my output : $ yin-yang
Traceback (most recent call last):
File "/opt/yin-yang/main.py", line 9, in
from bin.ui.mainwindow import Ui_MainWindow
ModuleNotFoundError: No module named 'bin.ui' :
Was wondering how to correct this?
I am using KDE Neon 5.15
Thank you
Thank a lot for this simple application.
Is it possible to add atom support? I switch between dark and light using the F12 hotkey of the package 'theme-switcher'. It works nice, but having this automated would be even more awesome!
I'd help out if I could, but I have no idea how to get started.
I'm very happy that issue #27 is resolved. I added Yin-Yang to the startup/ shutdown section under system settings. I added the option -s for launching. This triggers the window for yin-yang to be shown as well. Can an option be added to launch in the background without the pop-up window?
you can use the plasma-changeicons
as the executbale was added in the cmakelist.txt of kcm icons [here](https://github.com/KDE/plasma-desktop/tree/master/kcms/icons
it is not added in PATH by default in kde
its path is in /usr/bin/plasma-changeicons
or you can use "locate plama-changeicons" to find the path in the distro
would have made a pull request but don't know c++ to make the ui
script showing how it was used https://github.com/Da-Viper/kde_theme_script/blob/master/dark.sh
I just built with dcef1e0 and cannot open Settings on Manjaro GNOME:
$ env QT_AUTO_SCREEN_SCALE_FACTOR=1 sh /usr/bin/yin-yang -gui
qt5ct: using qt5ct plugin
0
Traceback (most recent call last):
File "/opt/yin-yang/src/gui.py", line 223, in openSettings
self.secwindow = SettingsWindow()
File "/opt/yin-yang/src/gui.py", line 24, in __init__
self.syncWithConfig()
File "/opt/yin-yang/src/gui.py", line 76, in syncWithConfig
self.getKdeThemes()
File "/opt/yin-yang/src/gui.py", line 125, in getKdeThemes
if (config.get("desktop") == "kde"):
File "/opt/yin-yang/src/config.py", line 146, in get
return config[key]
KeyError: 'desktop'
/usr/bin/yin-yang: line 2: 1656 Aborted (core dumped) python3 /opt/yin-yang/main.py $@
GNOME 3.32.0
python-pyqt5 5.12.1
python-qtpy 1.6.0
System: Manjaro with KDE Plasma, but should be on every system
Dark theme should be enabled after time for dark theme, even if the time is set to after 00:00 and before the time for light theme.
Dark theme is enabled before 00:00 and after time for light theme.
Just installed latest master.
Before starting yin-yang, there is no file yin_yang.json. It gets created on first GUI startup.
I believe this is normal behaviour?
When I go to settings, i enable KDE and get the reply
"""
Traceback (most recent call last):
File "/opt/yin-yang/src/gui.py", line 147, in toggleKdeFields
self.getKdeThemes()
File "/opt/yin-yang/src/gui.py", line 138, in getKdeThemes
["notify-send", "It looks like you are not running KDE"])
File "/usr/lib/python3.6/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] Bestand of map bestaat niet: 'notify-send': 'notify-send'
"""
If I then go back, I can't open settings anymore.
This problem is resolved by manually adding 'kde' in yin_yang.json.
I believe it would be easier to create the json on installation and check for DE at that point in time?
Hey there,
today I tried your program on a new machine (Sabayon Linux).
Want to give you some feedback before I forget.
In install.sh, you're currently assuming pip3
to be available.
https://github.com/daehruoydeef/Yin-Yang/blob/f7e1d7680ea476802c330d29a7999a2ba63f264d/install.sh#L18-L20
This is not always the case. However, it didn't result in an error message either.
Perhaps it also makes sense to check for a system-wide installed presence first (e.g. via python -m
) before running this code?
My distribution showed a prompt to install via pip3 install --user
, but then, the code wouldn't be found.
I went with system-wide installed deps now.
The install.sh ran in either way.
Would be really nice to switch the theme automatically according to environment brightness. This is what Clight can do.
In the Clight wiki, there is a small example script to do this.
I just built with the latest commit c34ac9d:
$ env QT_AUTO_SCREEN_SCALE_FACTOR=1 sh /usr/bin/yin-yang -gui
usage: main.py [-h] [-t] [-s]
main.py: error: unrecognized arguments: -gui
$ yin-yang
qt5ct: using qt5ct plugin
Traceback (most recent call last):
File "/opt/yin-yang/main.py", line 59, in <module>
main()
File "/opt/yin-yang/main.py", line 37, in main
window = gui.MainWindow()
File "/opt/yin-yang/src/gui.py", line 184, in __init__
self.ui.setupUi(self)
File "/opt/yin-yang/src/ui/mainwindow.py", line 71, in setupUi
sys._MEIPASS+"/assets/yin-yang.svg"))
AttributeError: module 'sys' has no attribute '_MEIPASS'
The list of themes is populated when checking the combo box and not at application start.
I have noticed that any changes I makes to yin_yang.json are reset every time I run the application. This means that I cannot change "desktop" from unknown to gtk Also, when running the appimage from the terminal, I get the following output:
/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so: undefined symbol: g_task_set_name
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so: undefined symbol: g_task_set_name
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so
/usr/lib/x86_64-linux-gnu/gio/modules/libgiognomeproxy.so: undefined symbol: g_task_set_name
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgiognomeproxy.so
I also notice that you are supposed to be able to assign commands to keybinds but I don't see how this is possible since the application is just a portable appimage, and not installed.
System: Ubuntu MATE 19.10
Desktop: Mate
I think that it's clearer what it does this way.
I'd like an option to mute Ying Yang, it's a bit annoying for me ๐
It'd be nice if you could switch between installed colour schemes, and not just between breeze and breeze-dark.
Hi, thanks for making an AppImage. However, it is missing the .DirIcon
file. Please see electron-userland/electron-builder#3988.
Reference:
AppImage/appimage.github.io#2007
I'm running Manjaro with KDE Plasma. I have set global scaling to be at 125%. The UI now looks like this:
It still works as expected, but doesn't look so good. Also, with more plugins in the settings page, I think this will get even worse. The wallpaper setting is already pretty small and parts of the version info are cropped.
In the new version of Breeze-GTK, there is no dark and bright mode anymore. Instead, it seems to apply the colors directly from the selected Qt theme, which in turn gets selected from the global theme.
However, when the global theme switches to light mode, the Qt theme switches as expected but not the GTK theme - it stays in dark mode.
A solution could be to change the Qt theme separately, as requested in issue #47
I'm using Manjaro KDE with the latest stable updates. I selected the Breeze themes in the settings (global theme, qt and GTK) and set Yin-Yang to change only the global theme.
The at this time latest release v1.0 does not run on my updated KDE Neon. Launching the AppImage from the cmdline gives:
'''
[39493] Error loading Python lib '/tmp/_MEIMrEuob/libpython3.6m.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /tmp/_MEIMrEuob/libpython3.6m.so.1.0)
'''
When I start Yin-Yang and overstep the time for the scheduler it will change the mode fine :)
Now let's assume i shutdown the computer when it's in darkmode, i've put Yin-Yang in Autostart, schedular enabled (i tried gnome tweaks autostart, crontab @reboot yin-yang -s and crontab @reboot yin-yang, yin-yang is running after the reboot). I turn the pc on, it's 8AM, schedular is set to lightmode on 7AM, gtk theme won't change.
PEP 8 is the accepted coding style for Python. This project has to be reworked to make it PEP 8 compliant.
Hi, I see this is a really promising project. I wonder if I can package it for openSUSE/SLE. Usually Python applications have setup.py
as installation script. It makes packaging easy. Also GitHub releases is also useful for packaging. Package maintainers can watch releases to update their packages.
Thanks for the great work!
I created a plugin for Firefox, which changes the theme over an extension, switches the settings and dev tools theme and lets other websites and extension see if you are using a dark theme.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.