-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
author: Major Hayden | ||
date: '2024-01-09' | ||
summary: | | ||
Dark mode lovers rejoice! It's possible to get (most) applications to show up | ||
in dark mode in the Sway window manager. π | ||
tags: | ||
- gnome | ||
- firefox | ||
- kde | ||
- linux | ||
- sway | ||
title: Dark mode in Sway | ||
coverAlt: Industrial area at night | ||
coverCaption: | | ||
[mos design](https://unsplash.com/photos/a-dark-street-with-a-large-industrial-building-in-the-background-ZrY7oJFUP3Y) | ||
via Unsplash | ||
--- | ||
|
||
Ah, dark mode! | ||
I savor my dark terminals, window decorations, and desktop wallpapers. | ||
It's so much easier on my eyes on those long work days. π | ||
|
||
However, I think the author [Mary Oliver](https://en.wikipedia.org/wiki/Mary_Oliver) said it best: | ||
|
||
> Someone I loved once gave me a box full of darkness. | ||
> It took me years to understand that this too, was a gift. | ||
In most window managers, such as GNOME or KDE, switching to dark mode involves a simple trip to the settings panels and clicking different themes. | ||
Sway doesn't offer us those types of comforts, but we can get dark mode there, too! | ||
|
||
![sunglasses-wiggle.gif](sunglasses-wiggle.gif) | ||
|
||
# GTK applications | ||
|
||
If you happen to have GNOME on your system alongside sway, go into **Settings**, then **Appearance** and select _Dark_. | ||
You can also get dark mode by applying a setting in `~/.config/gtk-3.0/settings.ini`: | ||
|
||
```ini | ||
[Settings] | ||
gtk-application-prefer-dark-theme=1 | ||
``` | ||
|
||
Restart whichever application you were using and it should pick up the new configuration. | ||
|
||
Firefox, for example, ships with an automatic appearance setting that follows the OS. | ||
That should be reflected immediately upon restart. | ||
If not, go into Firefox's settings, and look for dark mode under the **Language and Appearance** section of the general settings. | ||
|
||
# QT applications | ||
|
||
Most of my applications are GTK-based, but I have one or two which use QT. | ||
Again, just like the GTK example, if you have KDE installed along side Sway, you can configure dark mode there easily. | ||
Just open the system settings and look for _Breeze Dark_ in the **Plasma Style** section. | ||
|
||
You don't have KDE? | ||
Don't worry! | ||
There are a couple of commands which should work: | ||
|
||
```shell | ||
# This should work for all QT/KDE apps | ||
# if you have the Breeze Dark theme installed. | ||
lookandfeeltool -platform offscreen \ | ||
--apply "org.kde.breezedark.desktop" | ||
|
||
# You can set the theme for GTK apps here as well | ||
# if you run into problems. | ||
dbus-send --session --dest=org.kde.GtkConfig \ | ||
--type=method_call /GtkConfig org.kde.GtkConfig.setGtkTheme \ | ||
"string:Breeze-dark-gtk" | ||
``` | ||
|
||
# Alternate dark mode based on time | ||
|
||
Many window managers offer a method for adjusting dark and light modes based on the time of day. | ||
For example, some people love brighter interfaces during the day and darker ones at night. | ||
There's a great tool called [darkman](https://gitlab.com/WhyNotHugo/darkman) that makes this easier. π€ | ||
|
||
The darkman service runs in the background and runs various commands to change dark mode settings for all kinds of window managers. | ||
It also speaks to dbus directly to set the configurations if needed. | ||
|
||
It also has a [directory full of user contributed scripts](https://gitlab.com/WhyNotHugo/darkman/-/tree/main/examples/dark-mode.d?ref_type=heads) to change dark and light modes for various environments. | ||
You might be able to pull some commands from these files to test which configurations might work best on your system. | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+132 KB
...ode/feature_hu3d03a01dcc18bc5be0e67db3d8d209a6_738310_1024x0_resize_q75_box.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+234 KB
...ode/feature_hu3d03a01dcc18bc5be0e67db3d8d209a6_738310_1320x0_resize_q75_box.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.89 KB
...ature_hu3d03a01dcc18bc5be0e67db3d8d209a6_738310_160x120_fill_q75_box_smart1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13 KB
...ature_hu3d03a01dcc18bc5be0e67db3d8d209a6_738310_320x240_fill_q75_box_smart1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
...mode/feature_hu3d03a01dcc18bc5be0e67db3d8d209a6_738310_330x0_resize_q75_box.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.4 KB
...mode/feature_hu3d03a01dcc18bc5be0e67db3d8d209a6_738310_660x0_resize_q75_box.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23252cf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing this π