Last active
August 3, 2020 05:04
-
-
Save olivatooo/6ac33f5f499f66a7968bc3373cbb07c4 to your computer and use it in GitHub Desktop.
Bash script to randomly select an wallpaper and use wal to set the system colorscheme. Useful for i3+wal!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Author : Aditya Shakya | |
## Github : adi1090x | |
## Edited by me | |
PDIR="$HOME/.config/polybar" | |
LAUNCH="polybar-msg cmd restart" | |
# Replacing colors | |
sed -i -e "s/bground = .*/bground = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/modulefg-alt = .*/modulefg-alt = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/accent = .*/accent = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade1 = .*/shade1 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade2 = .*/shade2 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade3 = .*/shade3 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade4 = .*/shade4 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade5 = .*/shade5 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade6 = .*/shade6 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade7 = .*/shade7 = #$1/g" $PDIR/colors.ini | |
shift | |
sed -i -e "s/shade8 = .*/shade8 = #$1/g" $PDIR/colors.ini | |
# Restarting polybar | |
$LAUNCH & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Overkill way to change my polybar color | |
import os | |
home = "/home/user/" | |
colors = open(home+".cache/wal/colors").readlines() | |
colors = list(map((lambda x: x.rstrip("\n").strip("#")), colors)) | |
cmd = '/opt/walran/polybar.sh '+' '.join(colors) | |
os.system(cmd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH="/home/USER/PATH/Wallpapers" | |
FILE=$(ls $PATH| shuf -n 1) | |
wal -i $PATH/$FILE | |
python /opt/walran/polywal.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
depends on:
python-pywal
feh