aboutsummaryrefslogtreecommitdiff
path: root/config/polybar/blocks/scripts/styles.sh
blob: 507f06931b01901e3884a1a5ccf3a5913be612ac (plain)
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
#!/usr/bin/env bash

# Color files
PFILE="$HOME/.config/polybar/blocks/colors.ini"
RFILE="$HOME/.config/polybar/blocks/scripts/rofi/colors.rasi"

# Change colors
change_color() {
	# polybar
	sed -i -e "s/background = #.*/background = $BG/g" $PFILE
	sed -i -e "s/background-alt = #.*/background-alt = $BGA/g" $PFILE
	sed -i -e "s/foreground = #.*/foreground = $FG/g" $PFILE
	sed -i -e "s/foreground-alt = #.*/foreground-alt = $FGA/g" $PFILE
	sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE
	
	# rofi
	cat > $RFILE <<- EOF
	/* colors */

	* {
	  al:   #00000000;
	  bg:   ${BG}FF;
	  bga:  ${BGA}FF;
	  fga:  ${FGA}FF;
	  fg:   ${FG}FF;
	  ac:   ${AC}FF;
	  se:   ${AC}40;
	}
	EOF
	
	polybar-msg cmd restart
}

if  [[ $1 = "--default" ]]; then
	BG="#2f343f"
	BGA="#C4C7C5"
	FGA="#C4C7C5"
	FG="#1C1E20"
	AC="#B4BC67"
	change_color
elif  [[ $1 = "--nord" ]]; then
	BG="#3B4252"
	BGA="#4C566A"
	FGA="#E5E9F0"
	FG="#ECEFF4"
	AC="#A3BE8C"
	change_color
elif  [[ $1 = "--gruvbox" ]]; then
	BG="#282828"
	BGA="#EBDBB2"
	FGA="#EBDBB2"
	FG="#282828"
	AC="#CC241D"
	change_color
elif  [[ $1 = "--adapta" ]]; then
	BG="#243035"
	BGA="#38444A"
	FGA="#FDF6E3"
	FG="#FFFFFF"
	AC="#4DD0E1"
	change_color
elif  [[ $1 = "--cherry" ]]; then
	BG="#1F1626"
	BGA="#423949"
	FGA="#FFFFFF"
	FG="#FFFFFF"
	AC="#D94085"
	change_color
else
	cat <<- _EOF_
	No option specified, Available options:
	--default    --nord    --gruvbox    --adapta    --cherry
	_EOF_
fi