aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-03-01 12:27:22 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2019-03-01 12:27:22 +0100
commit7d45921d60b06b0c958e9c1dc92ec6075a310fdb (patch)
treea62e212db4b307002af03bef22b57e4f6d5d4064
parent5b280423acbc7d2ed74887cb92c42016fd03adf5 (diff)
downloadconfigs-7d45921d60b06b0c958e9c1dc92ec6075a310fdb.tar.gz
configs-7d45921d60b06b0c958e9c1dc92ec6075a310fdb.zip
Added sxiv image-info and key-handler.
-rw-r--r--files/i3/config1
-rw-r--r--files/i3blocks/config5
-rw-r--r--files/ranger/rc.conf2
-rw-r--r--files/rcs/dunstrc7
-rwxr-xr-xfiles/sxiv/image-info18
-rwxr-xr-xfiles/sxiv/key-handler75
-rw-r--r--files/sxiv/path.txt2
7 files changed, 105 insertions, 5 deletions
diff --git a/files/i3/config b/files/i3/config
index 839fe8d..3cad285 100644
--- a/files/i3/config
+++ b/files/i3/config
@@ -344,3 +344,4 @@ bar {
#exec_always bash ~/scripts/pkmBgSelector.sh
exec feh --bg-fill ~/images/wallpapers/bg*
#exec transmission-gtk
+exec setxkbmap -option caps:swapescape
diff --git a/files/i3blocks/config b/files/i3blocks/config
index 155aba4..274fb89 100644
--- a/files/i3blocks/config
+++ b/files/i3blocks/config
@@ -8,6 +8,11 @@ color=#bceebc
command=echo "🥠 $(fortune -n 55 -s | sed 's/\n/ \/ /g')"
interval=once
+[screenRec]
+command=~/scripts/i3blocks/i3rec.sh
+interval=once
+signal=13
+
[music]
color=#a5acff
#background=#696eff
diff --git a/files/ranger/rc.conf b/files/ranger/rc.conf
index 587d5d3..d7d7938 100644
--- a/files/ranger/rc.conf
+++ b/files/ranger/rc.conf
@@ -245,7 +245,7 @@ alias travel scout -aefiklst
# ===================================================================
# Custom
-map ,w shell feh --bg-max %f
+map ,w shell setBG.sh %f &
map ,W console shell ~/scripts/floats/floatBgBrowser.sh %d/ &
map ,p shell asPDF.sh %f
map ,P shell lowriter --convert-to pdf %f
diff --git a/files/rcs/dunstrc b/files/rcs/dunstrc
index dc70c18..b1f09cc 100644
--- a/files/rcs/dunstrc
+++ b/files/rcs/dunstrc
@@ -16,8 +16,7 @@
idle_threshold = 120
### Text ###
-
- font = Monospace 8
+ font = Monospace 9
line_height = 0
markup = full
format = "<b>%s</b>\n%b"
@@ -31,8 +30,8 @@
show_indicators = yes
### Icons ###
- #icon_position = right
- #max_icon_size = 32
+ icon_position = right
+ max_icon_size = 64
#icon_path = /usr/share/icons/hicolor/16x16/status/:/usr/share/icons/hicolor/16x16/devices/
### History ###
diff --git a/files/sxiv/image-info b/files/sxiv/image-info
new file mode 100755
index 0000000..be503d8
--- /dev/null
+++ b/files/sxiv/image-info
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# 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 "${filename}${s}${geometry}${s}${filesize}"
+
diff --git a/files/sxiv/key-handler b/files/sxiv/key-handler
new file mode 100755
index 0000000..bc1cf92
--- /dev/null
+++ b/files/sxiv/key-handler
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+case "$1" in
+ "s")
+ width=$(echo "" | dmenu -p "Width of new files?")
+ [ "$width" ] || exit 0
+ height=$(echo "" | dmenu -p "Height of new files?")
+ [ "$height" ] || exit 0
+ modifier=""
+ [ "$(printf "Yes\nNo" | dmenu -i -p "Maintain aspect ratio?")" = "No" ] && modifier="!"
+ while read file
+ do
+ convert "$file" -resize "$width"x"$height""$modifier" "$width"x"$height""$modifier"_"$file"
+ done ;;
+ "h")
+ notify-send "\
+w: Set as wallpaper. .
+r: Rotate clockwise. .
+R: Rotate counter-clockwise. .
+f: Flop (horizontally). .
+f: Flop (vertically). .
+y: Yank filename to clipboard. .
+Y: Yank file path to clipboard. .
+d: Delete file (with confirmation prompt). .
+c: Rename file. .
+g: Open in gimp. .
+s: Create new image with different size. .
+S: Search image online. .
+h: Show help. ." ;;
+esac
+
+while read file
+do
+ case "$1" in
+ "w") setBG.sh "$file" ;;
+ "r")
+ convert -rotate 90 "$file" "$file" &&
+ notify-send "$file rotated clockwise" ;;
+ "R")
+ convert -rotate -90 "$file" "$file" &&
+ notify-send "$file rotated counter-clockwise" ;;
+ "f")
+ convert -flop "$file" "$file" &&
+ notify-send "$file flopped" ;;
+ "F")
+ convert -flip "$file" "$file" &&
+ notify-send "$file flipped" ;;
+ "y")
+ echo -n "$file" | xclip -selection clipboard &&
+ notify-send "$file copied to clipboard" & ;;
+ "Y")
+ echo -n "$(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." ;;
+ "c")
+ newname="$(dmenu -p "New name of $file?")"
+ [ "$newname" ] && newname="$newname"'.'"${file##*.}" && [ "$(printf "No\nYes" | dmenu -i -p "Rename $file to $newname?")" = "Yes" ] && mv "$file" "$newname" && notify-send "$file renamed to $newname." ;;
+ "g")
+ gimp "$file" & ;;
+ "S")
+ echo -n "$(readlink -f "$file")" | xclip -selection clipboard && notify-send "$(readlink -f "$file") copied to clipboard"
+ $BROWSER https://tineye.com/ ;;
+ # "c")
+ # [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | 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" ~/.bmdirs | 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." &
+ # ;;
+ esac
+done
diff --git a/files/sxiv/path.txt b/files/sxiv/path.txt
new file mode 100644
index 0000000..6579b91
--- /dev/null
+++ b/files/sxiv/path.txt
@@ -0,0 +1,2 @@
+image-info path: ~/.config/sxiv/exec/image-info
+key-handler path: ~/.config/sxiv/exec/key-handler