Created
June 25, 2024 15:07
-
-
Save skyone-wzw/36b18888ac28838113b51f76ac62e810 to your computer and use it in GitHub Desktop.
KDE 6 Light/Dark mode toggle
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
#!/bin/bash | |
current_scheme=$(LANG=C.UTF-8 plasma-apply-colorscheme --list-schemes | awk -F' \\(|\\)' '/current color scheme/ {gsub(/^[ \*]+/, "", $1); print $1}') | |
# if no awk, use grep | |
# current_scheme=$(LANG=C.UTF-8 plasma-apply-colorscheme --list-schemes | grep "current color scheme" | sed 's/^[ \*]*\([^ ]*\) .*/\1/') | |
if [ "$current_scheme" == "BreezeDark" ]; then | |
target_scheme="BreezeLight" | |
elif [ "$current_scheme" == "BreezeLight" ]; then | |
target_scheme="BreezeDark" | |
else | |
echo "Current color scheme is neither BreezeDark nor BreezeLight. Exiting." | |
exit 1 | |
fi | |
plasma-apply-colorscheme $target_scheme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment