aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-10-29 19:51:58 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2019-10-29 19:51:58 +0100
commit38110ef852373765de0c738aa54587b9ee640389 (patch)
treeddab8ea8b2338235b969d90665d1cd3fcc668cae
parent756f1c152ef3ca8f34a6f419b19b3ac254a5ada2 (diff)
downloadscripts-38110ef852373765de0c738aa54587b9ee640389.tar.gz
scripts-38110ef852373765de0c738aa54587b9ee640389.zip
Random changes.
-rwxr-xr-xi3blocks/i3battery.sh4
-rwxr-xr-xi3blocks/i3mailbox.sh5
-rwxr-xr-xi3blocks/i3moon.sh16
-rwxr-xr-xi3lock.sh3
-rwxr-xr-xripme.sh2
-rwxr-xr-xshowURLimage.sh6
-rwxr-xr-xsyncMail.sh2
-rwxr-xr-xtouchpad.sh3
8 files changed, 22 insertions, 19 deletions
diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh
index 1278eeb..51dfa37 100755
--- a/i3blocks/i3battery.sh
+++ b/i3blocks/i3battery.sh
@@ -12,8 +12,8 @@ case $BLOCK_BUTTON in
esac
status=$(cat /sys/class/power_supply/"$1"/status)
-capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit
-remaining=$(acpi | cut -d' ' -f5 | cut -d':' -f-2)
+capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit 0
+[ -f "/bin/acpi" ] && remaining="$(acpi | cut -d' ' -f5 | cut -d':' -f-2)" || remaining="missing acpi"
if [ "$capacity" -ge 80 ]; then
color="#b8bb26"
diff --git a/i3blocks/i3mailbox.sh b/i3blocks/i3mailbox.sh
index 89fb49a..70343c8 100755
--- a/i3blocks/i3mailbox.sh
+++ b/i3blocks/i3mailbox.sh
@@ -13,8 +13,11 @@ case $BLOCK_BUTTON in
- Middle click syncs mail" ;;
esac
+syncIcon=""
+[ -n "$(pgrep mbsync)" ] && syncIcon="🔃"
gmailN="$(du -a ~/.mail/gmail/INBOX/new/* 2>/dev/null | sed -n '$=')"
[ "$gmailN" ] || gmailN="0"
unioviN="$(du -a ~/.mail/uniovi/INBOX/new/* 2>/dev/null | sed -n '$=')"
[ "$unioviN" ] || unioviN="0"
-echo "$(cat /tmp/imapsyncicon) Gmail: $gmailN uniovi: $unioviN"
+#echo "$(cat /tmp/imapsyncicon) Gmail: $gmailN uniovi: $unioviN"
+echo "$syncIcon Gmail: $gmailN uniovi: $unioviN"
diff --git a/i3blocks/i3moon.sh b/i3blocks/i3moon.sh
index e86c4ca..d691e8d 100755
--- a/i3blocks/i3moon.sh
+++ b/i3blocks/i3moon.sh
@@ -3,14 +3,14 @@
# Shows an emoji with the phase of the moon
[ ! -f "/bin/pom" ] && echo "🌜 bsd-games not installed. 🌛" && exit 0
-pom | grep -q "New" && moon=🌚
-pom | grep -q "Waxing Crescent" && moon=🌒
-pom | grep -q "First Quarter" && moon=🌓
-pom | grep -q "Waxing Gibbous" && moon=🌔
-pom | grep -q "Full" && moon=🌝
-pom | grep -q "Waning Gibbous" && moon=🌖
-pom | grep -q "Last Quarter" && moon=🌗
-pom | grep -q "Waning Crescent" && moon=🌘
+pom | fgrep -q "New" && moon=🌚
+pom | fgrep -q "Waxing Crescent" && moon=🌒
+pom | fgrep -q "First Quarter" && moon=🌓
+pom | fgrep -q "Waxing Gibbous" && moon=🌔
+pom | fgrep -q "is Full" && moon=🌝
+pom | fgrep -q "Waning Gibbous" && moon=🌖
+pom | fgrep -q "Last Quarter" && moon=🌗
+pom | fgrep -q "Waning Crescent" && moon=🌘
echo "$moon"
diff --git a/i3lock.sh b/i3lock.sh
index 1625684..ca752fd 100755
--- a/i3lock.sh
+++ b/i3lock.sh
@@ -13,5 +13,6 @@ maim "$imgTemp"
#[ -e "$imgLock" ] && convert "$imgTemp" -colors 2 -mode 2x5 "#00001f,000000" "$imgFinal"
#[ -e "$imgLock" ] && convert "$imgTemp" -median 10x5 "#00001f,000000" "$imgFinal"
#[ -e "$imgLock" ] && convert "$imgTemp" -polaroid 0 +level-colors "#00001f,000000" "$imgFinal"
-[ -e "$imgLock" ] && convert "$imgTemp" -colors 2 -motion-blur 5x5 +level-colors "#00001f,000000" "$imgFinal"
+#[ -e "$imgLock" ] && convert "$imgTemp" -colors 2 -motion-blur 5x5 +level-colors "#00001f,000000" "$imgFinal"
+[ -e "$imgLock" ] && convert "$imgTemp" -median 2x2 -colors 8 "$imgFinal"
i3lock -i "$imgFinal" -f || i3lock -i "$imgTemp" -f
diff --git a/ripme.sh b/ripme.sh
index c975483..10ac8b4 100755
--- a/ripme.sh
+++ b/ripme.sh
@@ -1,4 +1,4 @@
#!/bin/sh
notify-send -t 1400 "Ripping $1..."
-java -jar ~/programs/ripme*.jar -u "$1" && notify-send "Finished ripping $1."
+java -jar "/home/taamas/programs/ripme.jar" -l "/home/taamas/images/rips" -u "$1" && dunstify "Finished ripping $1."
diff --git a/showURLimage.sh b/showURLimage.sh
index 9ad0a6d..2d5b485 100755
--- a/showURLimage.sh
+++ b/showURLimage.sh
@@ -2,6 +2,6 @@
# Downloads an url to /tmp and opens it with sxiv.
-filename=/tmp/showURLimage$(date +%H%M%S)
-curl $1 > $filename
-sxiv -b -N sxivfloat $filename || notify-send "No image found at $1"
+filename="/tmp/showURLimage$(date +%H%M%S)"
+curl "$1" > "$filename"
+sxiv -b -N "sxivfloat" "$filename" || notify-send "No image found at $1"
diff --git a/syncMail.sh b/syncMail.sh
index ecaa05a..dfc4ee6 100755
--- a/syncMail.sh
+++ b/syncMail.sh
@@ -2,9 +2,7 @@
# Calls mbsync (isync binary) to syncronize mailboxes
-echo "🔃" > /tmp/imapsyncicon
pkill -SIGRTMIN+15 i3blocks
mbsync -c ~/.config/isync/gmmbsyncrc -a
mbsync -c ~/.config/isync/uombsyncrc -a
-rm /tmp/imapsyncicon
pkill -SIGRTMIN+15 i3blocks
diff --git a/touchpad.sh b/touchpad.sh
index 0d30c4c..377dc1f 100755
--- a/touchpad.sh
+++ b/touchpad.sh
@@ -2,5 +2,6 @@
# Toggles the touchpad
-device="PS/2 Generic Mouse"
+ device="ETPS/2 Elantech Touchpad"
+#device="PS/2 Generic Mouse"
[ "$(xinput --list-props "$device" | grep -e "Device Enabled (.*):.*1")" ] && xinput disable "$device" || xinput enable "$device"