Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bimlas/xfce4-night-mode
XFCE4 GenMon plugin: Switch between light and dark variants of a theme
https://github.com/bimlas/xfce4-night-mode
dark-mode night-mode xfce xfce4 xfce4-genmon-plugin xfce4-panel-plugin
Last synced: 1 day ago
JSON representation
XFCE4 GenMon plugin: Switch between light and dark variants of a theme
- Host: GitHub
- URL: https://github.com/bimlas/xfce4-night-mode
- Owner: bimlas
- Created: 2020-04-10T20:28:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T05:36:09.000Z (3 months ago)
- Last Synced: 2025-01-21T17:07:05.990Z (9 days ago)
- Topics: dark-mode, night-mode, xfce, xfce4, xfce4-genmon-plugin, xfce4-panel-plugin
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 97
- Watchers: 6
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= XFCE Night Mode
Shell script that allows you to easily *switch between dark and light variants
of the currently used themes*. When used as a
https://docs.xfce.org/panel-plugins/xfce4-genmon-plugin[Generic Monitor
(Genmon)] plugin, it will automatically switch at the times specified.image::https://i.imgur.com/UVSz6QB.gif[]
*It is important to set the desired color schemes before use* (see Settings).
* https://github.com/bimlas/xfce4-night-mode (*please star if you like the plugin*)
== Command line usage
....
$ xfce4-night-mode.sh [day|night|toggle]
....*Parameters*
`day`:: Use light variant
`night`:: Use dark variant
`toggle`:: Switch between light and dark variantsWithout parameters, it will use dark variant from sunset to sunrise according
to the settings (see later).== Generic Monitor (Genmon) plugin usage
* First you have to install `xfce4-genmon-plugin` package if it is not on your system
* Add the monitor to the panel
** Right click on the panel
** Select _Panel -> Add new items_
** Add _Generic Monitor_ plugin
* Set up the generic monitor to use with night mode
** Right click on the newly added generic monitor -> _Properties_
** Command: `/path/to/xfce4-night-mode.sh`
** Uncheck the checkbox of _Label_
** Set _Period_ to `300` seconds (5 minutes)== Settings
For settings, open the XFCE Settings Editor -> `night-mode` channel.
To find out what values to enter, set the color schemes you want and copy them
from the appropriate location:* GTK theme
** `xsettings/Net/ThemeName`
* Icon theme
** `xsettings/Net/IconThemeName`
* Cursor theme
** `xsettings/Gtk/CursorThemeName`
* Window manager theme
** `xfwm4/general/theme`The specified `UserScript` will be executed when switching the mode, you can use
this for example to change the theme of the terminal, set desktop wallpaper,
etc. You can use the variable `XFCE_NIGHT_MODE` in your script if you want to
use the same script in both cases, for example:....
#!/bin/bash
notify-send --icon "dialog-info" "Mode: $XFCE_NIGHT_MODE"
....=== Example `UserScript`
==== Change wallpaper
First you have to find the property of the wallpaper (this could be different on
multi-monitor setup) by executing the command below then changing the wallpaper
in _Desktop_ setting.```
xfconf-query --channel xfce4-desktop --monitor
```You have to execute the command below to set up the wallpaper for this desktop.
```
xfconf-query --channel xfce4-desktop --property --set
```==== Change panel dark mode
You have to execute the command below to change the panel mode opposite to the
windows mode (light windows, dark panel).```
xfconf-query --channel xfce4-panel --property /panels/dark-mode --set "$([ "$XFCE_NIGHT_MODE" = "day" ] && echo true || echo false)"
```=== Switch at a time specified by antoher program
For example, to use http://jonls.dk/redshift/[Redshift] or another program to
determine when it is night, use `xfce4-night-mode-redshift.sh` (or a modified
version of it) instad of `xfce4-night-mode.sh` in "Generic Monitor plugin
usage".== Changes
=== https://github.com/bimlas/xfce4-night-mode/-/compare/v1.0.0\...v2.0.0[2.0.0]
* Add options to change GTK, mouse, icon, and window manager theme
** *Breaking change*: You must set these before use