-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch-light-dark
More file actions
executable file
·32 lines (25 loc) · 946 Bytes
/
Copy pathswitch-light-dark
File metadata and controls
executable file
·32 lines (25 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
# set -x
# https://ubuntu-mate.community/t/how-to-automatically-switch-between-light-and-dark-themes/23907/5
CURRENT_THEME=$( gsettings get org.mate.Marco.general theme )
if [[ "$CURRENT_THEME" = "'Yaru'" ]]
then
GtkTheme='Yaru-blue-dark'
MetacityTheme='Yaru-dark'
IconTheme='Yaru-blue-dark'
Background="$HOME/wallpapers/dark.png"
else
GtkTheme='Yaru-blue'
MetacityTheme='Yaru'
IconTheme='Yaru-blue'
Background="$HOME/wallpapers/light.png"
fi
echo "current theme is: $CURRENT_THEME"
echo "toggling it to: $MetacityTheme"
gsettings set org.mate.Marco.general theme "$MetacityTheme"
gsettings set org.mate.interface gtk-theme "$GtkTheme"
gsettings set org.gnome.desktop.interface gtk-theme "$GtkTheme"
gsettings set org.mate.interface icon-theme "$IconTheme"
gsettings set org.gnome.desktop.interface icon-theme "$IconTheme"
gsettings set org.mate.background picture-filename "$Background"