diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2024-07-24 21:12:09 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2024-07-24 21:12:09 +0400 |
commit | 9f60a2b5ec9ae08d846bc7d3b61612aacadf82c8 (patch) | |
tree | e19b0956f0163e77573b6dff8b9e4736b045dcb8 /scripts/setwp | |
parent | 994ef6afb490f5119a43fc7ae6c6b78e1c0445e4 (diff) |
Wallpaper and volume scrips were renamed
Diffstat (limited to 'scripts/setwp')
-rwxr-xr-x | scripts/setwp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/scripts/setwp b/scripts/setwp deleted file mode 100755 index 24994d8..0000000 --- a/scripts/setwp +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -err() { - echo "${0}": "${1}" - exit 1 -} - - -help() { -cat << EOF -$0: Wrapper script to set wallpapers - -options: - -d [File] Select a wallpaper or a directory - -h Print this message and exit - -c Remove the current wallpaper - -NOTE: default wallpaper directory is ~/.config/wallpapers -EOF -} - -waldir="${XDG_CONFIG_HOME:-$HOME}/.config/wallpapers" - -while getopts "hcd:" option; do - case "${option}" in - h) - help - exit 0 - ;; - c) - xwallpaper --clear > /dev/null 2>&1 \ - || err "Couldn't clear wallpaper" - exit 0 - ;; - d) buf="${OPTARG}" ;; - *) err 'add -h for help' ;; - esac -done - - -if [ -n "${buf}" ]; then - case $(file -b --mime-type "${buf}") in - image/*) image="${buf}" ;; - inode/directory) waldir="${buf}" ;; - *) err "Couldn't read given file" ;; - esac -fi - -if [ -z "${image}" ]; then - image=$(find "${waldir}" -iregex '.*\.jpeg\|.*\.jpng\|.*\.png' 2>/dev/null \ - | shuf -n 1 2>/dev/null) -fi - -xwallpaper --zoom "${image}" > /dev/null 2>&1 || err "Couldn't set wallpaper" - -echo "${image}" |