-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: theme: support auto choose dark mode
Now wiliwili boot use script, please see: xfangfang/wiliwili#177 xfangfang/wiliwili#181
- Loading branch information
Showing
4 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
!PKGBUILD | ||
!.SRCINFO | ||
!.gitignore | ||
|
||
!wiliwili.sh |
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
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,39 @@ | ||
#!/bin/env bash | ||
# | ||
# org.freedesktop.appearance color-scheme | ||
# | ||
# Indicates the system's preferred color scheme. | ||
# Supported values are: | ||
# | ||
# 0: No preference | ||
# 1: Prefer dark appearance | ||
# 2: Prefer light appearance | ||
# | ||
# Unknown values should be treated as 0 (no preference). | ||
|
||
wiliwili_path=/usr/share/wiliwili/wiliwili | ||
|
||
scheme=$( | ||
gdbus call --session --timeout=1000 \ | ||
--dest=org.freedesktop.portal.Desktop \ | ||
--object-path /org/freedesktop/portal/desktop \ | ||
--method org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme | ||
) | ||
|
||
wiliwili_boot_dark () { | ||
BOREALIS_THEME=DARK $wiliwili_path | ||
} | ||
|
||
wiliwili_boot_light () { | ||
BOREALIS_THEME=LIGHT $wiliwili_path | ||
} | ||
|
||
wiliwili_boot_default () { | ||
wiliwili_boot_light | ||
} | ||
|
||
case $scheme in | ||
( '(<<uint32 1>>,)' ) wiliwili_boot_dark;; | ||
( '(<<uint32 2>>,)' ) wiliwili_boot_light;; | ||
( * ) wiliwili_boot_default;; | ||
esac |