2023-09-13 13:28:57 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit # crash the script when a command crash
|
|
|
|
set -o pipefail # same as above for piped command
|
|
|
|
set -o nounset # crash when a variable doesnt exist
|
|
|
|
|
|
|
|
# TRACE=1 for debug
|
|
|
|
if [[ "${TRACE-0}" == "1" ]]; then
|
|
|
|
set -o xtrace
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$(dirname "$0")" # change script directory
|
|
|
|
|
|
|
|
main() {
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo "No arguments supplied"
|
|
|
|
else
|
2023-09-13 14:22:11 +02:00
|
|
|
local GT_default
|
|
|
|
GT_default=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
|
2023-09-13 13:28:57 +02:00
|
|
|
case $1 in
|
2023-11-25 21:06:24 +01:00
|
|
|
"sunset" ) # Go to dark mode
|
|
|
|
# Terminal profile
|
|
|
|
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:"${GT_default}"/ \
|
|
|
|
visible-name "Dark"
|
|
|
|
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:"${GT_default}"/ \
|
|
|
|
foreground-color "rgb(211,208,200)"
|
|
|
|
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:"${GT_default}"/ \
|
|
|
|
background-color "rgb(45,45,45)"
|
|
|
|
|
2024-07-22 10:38:39 +02:00
|
|
|
# Shell theme
|
|
|
|
fish -c "update-theme dark"
|
2023-11-25 21:06:24 +01:00
|
|
|
|
2023-11-25 20:20:56 +01:00
|
|
|
# Keyboard backlight
|
2023-12-29 17:36:10 +01:00
|
|
|
busctl call --system org.freedesktop.UPower \
|
|
|
|
/org/freedesktop/UPower/KbdBacklight \
|
|
|
|
org.freedesktop.UPower.KbdBacklight SetBrightness 'i' 1
|
2023-11-25 21:06:24 +01:00
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
"sunrise" ) # Go to light mode
|
|
|
|
# Terminal profile
|
|
|
|
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:"${GT_default}"/ \
|
|
|
|
visible-name "Light"
|
|
|
|
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:"${GT_default}"/ \
|
|
|
|
foreground-color "rgb(23,20,33)"
|
|
|
|
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:"${GT_default}"/ \
|
|
|
|
background-color "rgb(253,246,227)"
|
|
|
|
|
2024-07-22 10:38:39 +02:00
|
|
|
# Shell theme
|
|
|
|
fish -c "update-theme light"
|
2023-11-25 21:06:24 +01:00
|
|
|
|
2023-11-25 20:20:56 +01:00
|
|
|
# Keyboard backlight
|
2023-12-29 17:36:10 +01:00
|
|
|
busctl call --system org.freedesktop.UPower \
|
|
|
|
/org/freedesktop/UPower/KbdBacklight \
|
|
|
|
org.freedesktop.UPower.KbdBacklight SetBrightness 'i' 0
|
2024-03-26 09:36:56 +01:00
|
|
|
|
2024-04-22 17:05:20 +02:00
|
|
|
# Gnome fix theme TODO: Is this necessary? need some research
|
|
|
|
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
|
2023-11-25 21:06:24 +01:00
|
|
|
;;
|
|
|
|
|
|
|
|
|
2023-09-13 13:28:57 +02:00
|
|
|
* )
|
2023-11-25 21:06:24 +01:00
|
|
|
echo "Can't interpret given argument"
|
|
|
|
;;
|
2023-09-13 13:28:57 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|