feat(polybar): update polybar style
This commit is contained in:
parent
9f00495503
commit
c57e8ab185
604 changed files with 86703 additions and 181 deletions
65
config/polybar/cuts/scripts/pywal.sh
Executable file
65
config/polybar/cuts/scripts/pywal.sh
Executable file
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Color files
|
||||
PFILE="$HOME/.config/polybar/cuts/colors.ini"
|
||||
RFILE="$HOME/.config/polybar/cuts/scripts/rofi/colors.rasi"
|
||||
WFILE="$HOME/.cache/wal/colors.sh"
|
||||
|
||||
# Get colors
|
||||
pywal_get() {
|
||||
wal -i "$1" -q -t
|
||||
}
|
||||
|
||||
# Change colors
|
||||
change_color() {
|
||||
# polybar
|
||||
sed -i -e "s/background = #.*/background = #${BG}/g" $PFILE
|
||||
sed -i -e "s/background-alt = #.*/background-alt = #8C${BG}/g" $PFILE
|
||||
sed -i -e "s/foreground = #.*/foreground = #${FG}/g" $PFILE
|
||||
sed -i -e "s/foreground-alt = #.*/foreground-alt = #33${FG}/g" $PFILE
|
||||
sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE
|
||||
|
||||
# rofi
|
||||
cat > $RFILE <<- EOF
|
||||
/* colors */
|
||||
|
||||
* {
|
||||
al: #00000000;
|
||||
bg: #${BG}BF;
|
||||
bga: #${BG}FF;
|
||||
fg: #${FG}FF;
|
||||
ac: ${AC}FF;
|
||||
se: ${AC}1A;
|
||||
}
|
||||
EOF
|
||||
|
||||
polybar-msg cmd restart
|
||||
}
|
||||
|
||||
# Main
|
||||
if [[ -x "`which wal`" ]]; then
|
||||
if [[ "$1" ]]; then
|
||||
pywal_get "$1"
|
||||
|
||||
# Source the pywal color file
|
||||
if [[ -e "$WFILE" ]]; then
|
||||
. "$WFILE"
|
||||
else
|
||||
echo 'Color file does not exist, exiting...'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BGC=`printf "%s\n" "$background"`
|
||||
BG=${BGC:1}
|
||||
FGC=`printf "%s\n" "$foreground"`
|
||||
FG=${FGC:1}
|
||||
AC=`printf "%s\n" "$color1"`
|
||||
|
||||
change_color
|
||||
else
|
||||
echo -e "[!] Please enter the path to wallpaper. \n"
|
||||
echo "Usage : ./pywal.sh path/to/image"
|
||||
fi
|
||||
else
|
||||
echo "[!] 'pywal' is not installed."
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue