From be5af012502d136b0cf97167efc0ca9b0ef7d689 Mon Sep 17 00:00:00 2001 From: elena Date: Mon, 27 Nov 2017 06:12:58 +0200 Subject: [PATCH] updated wally script to accept custom colorschemes, use wal-steam to generate a matching steam theme and also create a backup of all linked files before changing anything Former-commit-id: 72e9980f02d9ccc6f1f8acdd4db6dbdda9163971 Former-commit-id: adcf74baf70bdb757c3da50ed79bd4de39412f38 Former-commit-id: 2dba07848f7167b745c4982d8d844dbf3ed8ce9a --- Scripts/wally | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/Scripts/wally b/Scripts/wally index 1082310..74b6280 100755 --- a/Scripts/wally +++ b/Scripts/wally @@ -7,6 +7,7 @@ # wally ~/Pictures/Wallpapers # wally . # wally ~/Pictures/Wallpapers/pape.jpg +# wally -f ~/path/to/color/file ~/path/to/wallpaper # Arguments checking if [ $# == 0 ]; then @@ -14,6 +15,12 @@ if [ $# == 0 ]; then exit 0; fi +# Create backup of linked files +echo "> Backing up linked files" +TIMESTAMP="$(date +%F-%H:%M:%S)" +cp -r -L ~/.wally/links ~/.wally/wally_backup-$TIMESTAMP +cp ~/.wally/path_to_wallpaper ~/.wally/wally_backup-$TIMESTAMP + # Declare arrays declare -a color declare -a XCOLOR_OLD @@ -26,10 +33,19 @@ for (( i = 0; i < 8; i++ )); do done # Call wal to generate new colors -ARG=$1 -echo "> Calling wal at $ARG... toot toot..." -wal -i $ARG -echo "> New colorscheme generated!" +if [[ "$1" = "-f" ]]; then + COLORS_PATH=$2 + echo "> Applying custom terminal colorscheme from $COLORS_PATH..." + wal -f $COLORS_PATH + PAPE_PATH=$3 + echo "> Setting $PAPE_PATH as wallpaper..." + feh --bg-fill $3 +else + ARG=$1 + echo "> Calling wal at $ARG... toot toot..." + wal -i $ARG + echo "> New colorscheme generated!" +fi # Apply new colors to Xresources echo "> Setting .Xresources..." @@ -58,8 +74,18 @@ echo "> tint2 has restarted!" openbox --reconfigure echo "> Openbox is reconfigured!" +# Create steam theme +cp ~/.cache/wal/colors ~/.cache/wal/colors.steam +python3 ~/Programs/wal_steam/mywalsteam.py -w +echo "> Generated steam theme!" + # Copy new wallpaper path to wally's directory -cp ~/.cache/wal/wal ~/.wally/path_to_wallpaper +if [[ "$1" = "-f" ]]; then + CUSTOMPAPEPATH="$(readlink -f $3)" + echo $CUSTOMPAPEPATH > ~/.wally/path_to_wallpaper +else + cp ~/.cache/wal/wal ~/.wally/path_to_wallpaper +fi WALLPAPER="$(cat ~/.wally/path_to_wallpaper)" # Display new colors with a color script