Giter VIP home page Giter VIP logo

yin-yang's Introduction

Yin & Yang logo Yin-Yang

Auto Night-mode for Linux, it supports popular Desktops like KDE, GNOME, Budgie and also themes your favourite editors like VSCode or Atom.

You might also want to take a look at our discussions page, where we talk about the future of the app and other cool stuff!

Visualization App configuration

Features

  • Changes your themes at certain times or sunrise and sunset
  • Supported Desktops:
    • GNOME
    • Budgie
    • KDE Plasma
  • Supported applications:
    • VSCode, Atom, gedit
    • Firefox & Brave
    • Kvantum
    • Konsole
    • OnlyOffice
    • and more...
  • Miscellaneous:
    • Wallpaper change
    • Notifications on theme change
    • Play a sound
    • Ability to run custom scripts

To see planned features and the development status, visit the project status page.

Installation

Arch-based distributions

Yin-Yang can be downloaded from AUR as yin-yang package.

Source

Yin-Yang depends on python-systemd and pyside6 from pypi. python-systemd requires you have installed the systemd-headers from your package manager. You also need python development headers (e.g. python3-devel).

For CentOS, RHEL, and Fedora:

sudo dnf install gcc systemd-devel python3-devel libnotify

For OpenSUSE:

sudo zypper refresh
sudo zypper install gcc systemd-devel libnotify

For Debian, Ubuntu, etc.

sudo apt update
sudo apt install libsystemd-dev gcc pkg-config python3-dev libnotify-bin

Then you can install Yin-Yang in a python virtual environment:

# bash is necessary to run the source command
bash
# Clones the code to your local machine
git clone https://github.com/oskarsh/Yin-Yang.git
cd Yin-Yang
# Installs Yin-Yang
./scripts/install.sh

For development, skip the install and instead create a venv in your home directory:

python -m venv .venv
source .venv/bin/activate  # this is for bash, there are similar scripts in the that directory for other shells like fish
pip install -r requirements.txt

Uninstall

Run scripts/uninstall.sh from a terminal and fill out the password.

Documentation

Want to help out? Check out the wiki to learn how to contribute translations, plugins and more!

Generic badge

Related or similar projects

Thanks to all Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Donate

yin-yang's People

Contributors

cathaysia avatar chase9 avatar cloudwindy avatar dependabot[bot] avatar flying-sheep avatar freelyn avatar heddxh avatar itachisan avatar jakub-jedrusiak avatar jlbaez avatar jokajukka avatar jordi-7 avatar kawashiro-ryofu avatar l0drex avatar leosfsm avatar linfindel avatar mayapony avatar monkeywithacupcake avatar mrhappycloud avatar neo14515 avatar olivertzeng avatar oskarsh avatar pierreavizou avatar robsonpeixoto avatar slownicofish avatar sp1ritcs avatar teeffelen avatar trigrab avatar vistaus avatar w568w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yin-yang's Issues

Python `setup.py` installation and GitHub releases

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!

pip3 not found

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.

install.sh: home directory not detected

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!

There is a typo in readme

opens the QT5 Gui and allows for further customization

$ yin-yang -Gui

should read:

opens the QT5 Gui and allows for further customization

$ yin-yang -gui

Atom switching doesn't work

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!

Not Working on Kde plasma 5.16

Hi there,
Ying Yang is not working/changing theme in my kubuntu os.
I'm using kubuntu 19.04
and Kde plasma 5.16.1

After clicking on light or dark button nothing happens,
I tried going in settings and selecting kde but nothing happend

image

Support for Firefox

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.

does not work at all on Ubuntu MATE

  • Nothing changes at all, including themes and wallpapers.
  • The scheduler also does not work.

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

Fix .desktop file

There are some issues in the .desktop file that is created on installation:

  • the app is called with the -gui option, although this option does not exist
  • the categories are weird, should be for example Utility; System
  • the icon doesn't look that good, very pixelated and has a non-transparent background.

Schedular won't work after restart (crontab & autostart) Ubuntu 19.04

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.

Error loading Python lib with AppImage

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)
'''

crashes with older preferences file

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.

Add a hook

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

Not using native widget style (there is a workaround)

GUI doesn't use native Qt widget style (Breeze by default in Plasma) but uses Fusion.

Uninstalling PyQt5 with PIP:

pip3 uninstall PyQt5

and installing PyQt5 with distro packages (tested on Ubuntu/KDE Neon, package name python3-pyqt5) is a workaround for now. See screenshot below:

immagine

Launching Issue

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

Fail reading the list of available Look&Feel packages

This is the output of lookandfeeltool -l:

it.alexl.breezeplus
it.alexl.breezeplusdark
org.kde.breeze.desktop
org.kde.breezedark.desktop

But this is what the setting show:
immagine

So it fails to parse the \n character but only for the first two lines/themes.

Illegal option - Debian 10

When I run the command to install it there is the problem that come back.
I have Debian 10 with Kde plasma 5.14.5 with kernel 4.19.0-12-amd64
install.sh: 3: set: Illegal option -o pipefail

yin-yang

Support for brave-browser

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

unrecognized arguments: -gui

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'

Dynamic Wallpaper Plugin

  • add a Button to use Dynamic Wallpapers
  • lets you specify a folder where you can place your wallpapers labled as 1-24.png
  • if Dynamic is set it will look into this Folder and change the wallpapers dynamically

HiDPI breaks layout

yingyang-hidpi-mess
Try forcing a custom font DPI in system settings, relogin and see for yourself. Here are 163 DPI on a 4K screen.

Cannot open Settings on GNOME

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

Support for gedit

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

Atom support

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.

Theme names don't fit

When selecting KDE themes on the settings option, some of the larger names don't fit the box.
example

Schedule doesn't work if time for dark theme is set after 00:00

System: Manjaro with KDE Plasma, but should be on every system

Expected behavior

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.

What happend

Dark theme is enabled before 00:00 and after time for light theme.

Proper application icon/logo

In case you are looking for a proper icon for the project instead of classic yin-yang symbol I just made this one in Breeze style:

immagine

Add Changing kde icons

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

Kvantum integration and settings

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?

Breeze Gtk Theme doesn't change

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.

License?

What is the license of this project?

Launch in background, don't show yin-yang dialog upon boot

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?

Support for nvim

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

Follow sunrise and sunset

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.

Toggle Vim Background Setting

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).

UI doesn't react well with global scaling

I'm running Manjaro with KDE Plasma. I have set global scaling to be at 125%. The UI now looks like this:

Main window:
grafik

Settings page:
grafik

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.

Force VS Code Window Reload?

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?

KDE not recognised

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.