aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkd <kdam0@localhost.localdomain>2020-03-27 18:09:32 +0000
committerkd <kdam0@localhost.localdomain>2020-03-27 18:09:32 +0000
commit00997d20e5bf2a7f58775f1f3ab419bb6345f7cf (patch)
tree1cbf0530e84ff6638118b7aa7acfa0f5a9d37993
parent7a73d436072a322498f3b668a29e8731b0255f35 (diff)
added a couple new scrpit for wallpapers
-rwxr-xr-xScripts/.config/Scripts/setbg21
-rwxr-xr-xScripts/.config/Scripts/wp4
-rwxr-xr-xsxiv/.config/sxiv/exec/image-info20
-rwxr-xr-xsxiv/.config/sxiv/exec/key-handler38
4 files changed, 71 insertions, 12 deletions
diff --git a/Scripts/.config/Scripts/setbg b/Scripts/.config/Scripts/setbg
new file mode 100755
index 0000000..2487072
--- /dev/null
+++ b/Scripts/.config/Scripts/setbg
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# if given an argument, moves it there. This script without an
+# argument sets ~/.config/wall.png as the wallpaper, which is required on login
+# if you don't want a black screen.
+#
+# You may also give a directory name to select a random image from that
+# directory as a wallpaper. Be careful that the directory only has images.
+
+
+WALLPAPER_HOME="$HOME/Pictures/plasma_wal_hack"
+
+[ -f "$1" ] && rm -f $WALLPAPER_HOME/* && cp "$1" "$WALLPAPER_HOME" && notify-send -i "$WALLPAPER_HOME/$1" "Wallpaper changed."
+
+[ -d "$1" ] && rm -f $WALLPAPER_HOME/* && cp "$(find "$1" -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -type f | shuf -n 1)" "$WALLPAPER_HOME" && notify-send -i "$WALLPAPER_HOME/$1" "Random Wallpaper chosen."
+
+# If pywal is installed, use it.
+type wal >/dev/null 2>&1 && { wal -c
+ wal -i "$WALLPAPER_HOME/$i" -n
+ xsetroot -name "fsignal:xrdb" & } >/dev/null 2>&1
+
diff --git a/Scripts/.config/Scripts/wp b/Scripts/.config/Scripts/wp
new file mode 100755
index 0000000..e36b9e0
--- /dev/null
+++ b/Scripts/.config/Scripts/wp
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+find $HOME/Pictures/wallpapers -type f | shuf | sxiv -
+
diff --git a/sxiv/.config/sxiv/exec/image-info b/sxiv/.config/sxiv/exec/image-info
new file mode 100755
index 0000000..20c10c1
--- /dev/null
+++ b/sxiv/.config/sxiv/exec/image-info
@@ -0,0 +1,20 @@
+#!/usr/bin/sh
+
+# Example for $XDG_CONFIG_HOME/sxiv/exec/image-info
+# Called by sxiv(1) whenever an image gets loaded.
+# The output is displayed in sxiv's status bar.
+# Arguments:
+# $1: path to image file
+# $2: image width
+# $3: image height
+
+s=" " # field separator
+
+exec 2>/dev/null
+
+filename=$(basename -- "$1")
+filesize=$(du -Hh -- "$1" | cut -f 1)
+geometry="${2}x${3}"
+
+echo "${filesize}${s}${geometry}${s}${filename}"
+
diff --git a/sxiv/.config/sxiv/exec/key-handler b/sxiv/.config/sxiv/exec/key-handler
index ea57b25..d9f1825 100755
--- a/sxiv/.config/sxiv/exec/key-handler
+++ b/sxiv/.config/sxiv/exec/key-handler
@@ -1,18 +1,32 @@
-#!/bin/bash
-
+#!/usr/bin/env sh
while read file
do
case "$1" in
- "r")
- convert -rotate 90 "$file" "$file" ;;
+ "w") setbg "$file" & ;;
"c")
- echo -n "$file" | xclip -selection clipboard ;;
- "C")
- echo -n "${file##*/}" | xclip -selection clipboard ;;
- "w")
- cp "$file" ~/.config/wall1.jpg && wal -c -i "$file" && sudo make -C ~/st/ clean install & ;;
- "b")
- st -e cp "$file" ~/.config/wall1.jpg && wal -c -i "$file" && sudo make -C ~/st/ clean install & ;;
+ [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
+ [ -z "$destdir" ] && exit
+ cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
+ ;;
+ "m")
+ [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
+ [ -z "$destdir" ] && exit
+ mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
+ ;;
+ "r")
+ convert -rotate 90 "$file" "$file" ;;
+ "R")
+ convert -rotate -90 "$file" "$file" ;;
+ "f")
+ convert -flop "$file" "$file" ;;
+ "y")
+ echo -n "$file" | xclip -selection clipboard &&
+ notify-send "$file copied to clipboard" & ;;
+ "Y")
+ readlink -f "$file" | xclip -selection clipboard &&
+ notify-send "$(readlink -f "$file") copied to clipboard" & ;;
+ "d")
+ [ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
+ "g") ifinstalled gimp && gimp "$file" & ;;
esac
done
-