aboutsummaryrefslogtreecommitdiff
path: root/config/polybar/pwidgets/scripts/pywal.sh
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-08-12 15:19:57 +0200
committerWilliam Hergès <william@herges.fr>2025-08-12 15:19:57 +0200
commit4a21ae6fcdfcd0051a2e6fee641cd344c01dac83 (patch)
treea3741ca7f848d0f5213915d82f78fd0039a874f9 /config/polybar/pwidgets/scripts/pywal.sh
parentfed5ed81fbf64942dab81e7afd1eac5651290631 (diff)
Reset everything
Diffstat (limited to 'config/polybar/pwidgets/scripts/pywal.sh')
-rwxr-xr-xconfig/polybar/pwidgets/scripts/pywal.sh59
1 files changed, 0 insertions, 59 deletions
diff --git a/config/polybar/pwidgets/scripts/pywal.sh b/config/polybar/pwidgets/scripts/pywal.sh
deleted file mode 100755
index 7fba92a..0000000
--- a/config/polybar/pwidgets/scripts/pywal.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env bash
-
-# Color files
-PFILE="$HOME/.config/polybar/pwidgets/colors.ini"
-RFILE="$HOME/.config/polybar/pwidgets/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/bg = #.*/bg = ${BG}/g" $PFILE
- sed -i -e "s/fg = #.*/fg = ${FG}/g" $PFILE
- sed -i -e "s/fga = #.*/fga = ${RFG}/g" $PFILE
- sed -i -e "s/ac = #.*/ac = ${AC}/g" $PFILE
-
- # rofi
- cat > $RFILE <<- EOF
- /* colors */
-
- * {
- al: #00000000;
- bg: ${BG}FF;
- fg: ${RFG}FF;
- ac: ${AC}FF;
- }
- EOF
-}
-
-# 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
-
- BG=`printf "%s\n" "$background"`
- FG=`printf "%s\n" "$foreground"`
- RFG=`printf "%s\n" "$color8"`
- 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