This repository was archived by the owner on Dec 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththemes.sh
More file actions
executable file
·72 lines (60 loc) · 2.94 KB
/
themes.sh
File metadata and controls
executable file
·72 lines (60 loc) · 2.94 KB
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
#! /usr/bin/env sh
export DMENU="dmenu -i -l 20 -p"
# list options
choice=$(printf \
"dt-xmonad\\
dt-qtile\\
palenight\\
huh-qtile\\
"\
| sed 's/\\//' | ${DMENU} "Select theme:") # pipe options into dmenu
# if choice is empty, DO NOT PROCEED
if [ -z $choice ]; then
exit
else # if choice is not empty, do the following:
backup=$(printf "Yes\nNo" | ${DMENU} "Backup existing configs?") # ask me if i want to backup the current configs
if [ $backup == "Yes" ]; then # if i said yes, do the following:
mv ~/.config/sketchybar ~/.config/sketchybar.old # move sketchybar config to sketchybar.old
mv ~/.config/nvim ~/.config/nvim.old # move nvim config to nvim.old
mv ~/.config/alacritty ~/.config/alacritty.old # move alacritty config to alacritty.old
mv ~/.config/yabai ~/.config/yabai.old # move yabai config to yabai.old
fi
# remove current configs
rm -r ~/.config/sketchybar # sketchybar
rm -r ~/.config/nvim/ # nvim
rm -r ~/.config/alacritty/ # alacritty
rm -r ~/.config/yabai/ # yabai
# if a theme that uses nvim with the onedark colorscheme is selected, use that colorscheme
if [ $choice == "dt-xmonad" ] || [ $choice == "dt-qtile" ] || [ $choice == "huh-qtile"]; then
cp -r /Users/itaysharir/dmenu\ scripts/themes/nvim/nvim-onedark ~/.config/nvim
fi
# if a theme that uses nvim with the palenight colorscheme is selected, use that colorscheme
if [ $choice == "palenight" ]; then
cp -r /Users/itaysharir/dmenu\ scripts/themes/nvim/nvim-palenight ~/.config/nvim
fi
# move desired configs to ~/.config
cp -r ~/dmenu\ scripts/themes/sketchybar/sketchybar-$choice ~/.config/sketchybar # sketchybar
cp -r ~/dmenu\ scripts/themes/yabai/yabai-$choice ~/.config/yabai # yabai
cp -r ~/dmenu\ scripts/themes/alacritty/alacritty-$choice ~/.config/alacritty # alacritty
# restart services
# if theme is palenight, stop sketchybar instead of restart (because this theme has no bar)
if [ $choice == "palenight" ]; then
brew services stop sketchybar
else
brew services restart sketchybar
fi
brew services restart yabai # restart yabai
# write the theme's number to a text file for other scripts to use
if [ $choice == "dt-xmonad" ]; then
echo 1 > /Users/itaysharir/dmenu\ scripts/themes/current
elif [ $choice == "dt-qtile" ]; then
echo 2 > /Users/itaysharir/dmenu\ scripts/themes/current
elif [ $choice == "huh-qtile" ]; then
echo 3 > /Users/itaysharir/dmenu\ scripts/themes/current
elif [ $choice == "palenight" ]; then
echo 4 > /Users/itaysharir/dmenu\ scripts/themes/current
fi
# set wallpaper
export wall=$(cat ~/dmenu\ scripts/themes/wallpapers/$choice) # see what is the applied wallpaper for the selected theme and save it in a variable
wal -i $wall # set the wallpaper saved in the "wall" variable
fi