-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch-theme.sh
executable file
·96 lines (79 loc) · 2.84 KB
/
switch-theme.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# -------------------------------
# Script to switch between themes
# -------------------------------
# -------------------------------
# Move $1 and $2 to more readable variables
# -------------------------------
from="$1"
to="$2"
# -------------------------------
# Unstow the theme that's currently used and stow the target theme.
# -------------------------------
stow -t "$HOME/" -d "$HOME/Sync/Programming/dotfiles/" -D "$from"
stow -t "$HOME/" -d "$HOME/Sync/Programming/dotfiles/" "$to"
# -------------------------------
# Restart i3 if on workstation, else reconfigure openbox.
# -------------------------------
if [ "$HOSTNAME" = "jrenslin-pc" ]; then
i3-msg restart
else
openbox --reconfigure
fi
# -------------------------------
# Kill dunst
# Kill all instances of conky to start the theme-specific ones later
# -------------------------------
killall dunst
killall conky
# -------------------------------
# Start theme-specific instances of conky
# -------------------------------
if [ "$to" = "juicy" ]; then
conkys=(
~/.config/conky/load-rarely/conky-clock.conf
~/.config/conky/conky-sys-stats.conf
~/.config/conky/load-rarely/conky-tasks-khal.conf
~/.config/conky/load-rarely/conky-mpd.conf
~/.config/conky/tiles/conky-files-sync.conf
~/.config/conky/tiles/conky-files-notes.conf
~/.config/conky/tiles/conky-files-pictures.conf
~/.config/conky/tiles/conky-files-cache.conf
)
elif [ "$to" = "summer" ]; then
conkys=(
~/.config/conky/load-rarely/conky-clock.conf
~/.config/conky/load-rarely/conky-mpd.conf
~/.config/conky/tiles/conky-files-sync.conf
~/.config/conky/tiles/conky-files-notes.conf
~/.config/conky/tiles/conky-files-pictures.conf
~/.config/conky/tiles/conky-files-cache.conf
)
elif [ "$to" = "comfy" ]; then
conkys=(
~/.config/conky/load-rarely/conky-clock.conf
~/.config/conky/load-rarely/conky-mpd.conf
~/.config/conky/tiles/conky-files-sync.conf
~/.config/conky/tiles/conky-files-notes.conf
~/.config/conky/tiles/conky-files-pictures.conf
~/.config/conky/tiles/conky-files-cache.conf
)
fi
for i in "${conkys[@]}"; do
sleep 1
conky -q -d -c "$i"
done
# -------------------------------
# Set user-specific background
# -------------------------------
if [ "$to" = "juicy" ]; then
feh --randomize --bg-scale ~/Sync/Images/Wallpapers/with_space_left/* &
elif [ "$to" = "summer" ]; then
feh --bg-scale ~/Sync/Images/Wallpapers/desktop_light/Bicycle\[Wenchieh_Yang\]\[PD\].jpg &
elif [ "$to" = "comfy" ]; then
feh --bg-tile ~/Sync/Images/Wallpapers/desktop_light/comfy_tiles.png &
fi
# -------------------------------
# Send notification that switch of theme is compleed
# -------------------------------
notify-send "Switched theme to $to"