diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2018-12-27 18:47:48 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2018-12-27 18:47:48 +0100 |
commit | d165a641d16c181e6251737b9c86d6bf178370be (patch) | |
tree | b9e20f0ac05633285630c857f0d5b1056d6a902d | |
parent | 82cd5e57e2ecb878396e4703ee2eb4cc0bba3c9e (diff) | |
download | scripts-d165a641d16c181e6251737b9c86d6bf178370be.tar.gz scripts-d165a641d16c181e6251737b9c86d6bf178370be.zip |
jue dic 27 18:47:51 CET 2018
-rwxr-xr-x | bgBrowser.sh | 1 | ||||
-rwxr-xr-x | dmenuTerm.sh | 8 | ||||
-rwxr-xr-x | floats/floatBgBrowser.sh | 2 | ||||
-rwxr-xr-x | floats/floatMonths.sh (renamed from floatMonths.sh) | 0 | ||||
-rwxr-xr-x | floats/floatYears.sh (renamed from floatYears.sh) | 0 | ||||
-rwxr-xr-x | floats/mpvFloat.sh (renamed from mpvFloat.sh) | 0 | ||||
-rwxr-xr-x | floats/mpvFloatLoop.sh (renamed from mpvFloatLoop.sh) | 0 | ||||
-rwxr-xr-x | floats/youtube-dlFloat.sh (renamed from youtube-dlFloat.sh) | 0 | ||||
-rwxr-xr-x | floats/youtube-dlFloatAudio.sh (renamed from youtube-dlFloatAudio.sh) | 0 | ||||
-rwxr-xr-x | i3blocks/i3battery.sh | 6 | ||||
-rwxr-xr-x | i3blocks/i3cpu.sh | 5 | ||||
-rwxr-xr-x | i3blocks/i3date.sh | 5 | ||||
-rwxr-xr-x | i3blocks/i3disk.sh | 4 | ||||
-rwxr-xr-x | i3blocks/i3internet.sh | 34 | ||||
-rwxr-xr-x | i3blocks/i3mem.sh | 2 | ||||
-rwxr-xr-x | i3blocks/i3music.sh | 12 | ||||
-rwxr-xr-x | i3blocks/i3vol.sh | 2 |
17 files changed, 39 insertions, 42 deletions
diff --git a/bgBrowser.sh b/bgBrowser.sh index bddcd27..7c1ff74 100755 --- a/bgBrowser.sh +++ b/bgBrowser.sh @@ -20,6 +20,7 @@ function updateFiles { } function updateCurrentFile { + [[ $indexSet -lt 1 ]] && indexSet=1 && echo "First image!" i=0 for file in $files; do i=$(($i+1)) diff --git a/dmenuTerm.sh b/dmenuTerm.sh index 744cebc..73d170c 100755 --- a/dmenuTerm.sh +++ b/dmenuTerm.sh @@ -9,16 +9,16 @@ case "$chosen" in # floating windows neofetch) urxvt -title invisible -sh 100 -cr "#aaddff" -geometry "80x21+50+35" -e ~/scripts/neofetch.sh ;; showColors) urxvt -title floating -sh 10 -cr black -geometry 43x9 -e ~/scripts/showColors.sh ;; - years) ~/scripts/floatYears.sh ;; - months) ~/scripts/floatMonths.sh ;; - "bg selection") urxvt -title floating -sh 20 -cr black -geometry "45x6-5-5" -e ~/scripts/bgBrowser.sh "/home/inigo/images/wallpapers/" ;; + years) ~/scripts/floats/floatYears.sh ;; + months) ~/scripts/floats/floatMonths.sh ;; + "bg selection") ~/scripts/floats/floatBgBrowser.sh "/home/inigo/images/wallpapers/" ;; python) urxvt -title floating -geometry 80x28 -e python ;; #programs cmus) urxvt -cd ~/music -e cmus ;; "cmus (float)") urxvt -title floating -sh 20 -geometry "150x12+5-8" -cd ~/music -e cmus ;; newsboat) urxvt -e newsboat ;; neomutt) urxvt -e neomutt ;; - syncthing) qutebrowser && urxvt -e ~/scripts/syncthing.sh ;; + syncthing) urxvt -e ~/scripts/syncthing.sh ;; # sudo stuff brightFirst) urxvt -title floating -geometry 32x1 -e sudo ~/scripts/brightFirst.sh ;; resetConnection) urxvt -title floating -geometry 32x1 -e sudo ~/scripts/resetConnection.sh ;; diff --git a/floats/floatBgBrowser.sh b/floats/floatBgBrowser.sh new file mode 100755 index 0000000..a99eaaf --- /dev/null +++ b/floats/floatBgBrowser.sh @@ -0,0 +1,2 @@ +#!/bin/bash +urxvt -title floating -sh 20 -cr black -geometry "45x6-5-5" -e ~/scripts/bgBrowser.sh $1 diff --git a/floatMonths.sh b/floats/floatMonths.sh index 94a6f13..94a6f13 100755 --- a/floatMonths.sh +++ b/floats/floatMonths.sh diff --git a/floatYears.sh b/floats/floatYears.sh index f7176b6..f7176b6 100755 --- a/floatYears.sh +++ b/floats/floatYears.sh diff --git a/mpvFloat.sh b/floats/mpvFloat.sh index 566b0b4..566b0b4 100755 --- a/mpvFloat.sh +++ b/floats/mpvFloat.sh diff --git a/mpvFloatLoop.sh b/floats/mpvFloatLoop.sh index 88d6c39..88d6c39 100755 --- a/mpvFloatLoop.sh +++ b/floats/mpvFloatLoop.sh diff --git a/youtube-dlFloat.sh b/floats/youtube-dlFloat.sh index 56f5eb0..56f5eb0 100755 --- a/youtube-dlFloat.sh +++ b/floats/youtube-dlFloat.sh diff --git a/youtube-dlFloatAudio.sh b/floats/youtube-dlFloatAudio.sh index 1db5d23..1db5d23 100755 --- a/youtube-dlFloatAudio.sh +++ b/floats/youtube-dlFloatAudio.sh diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh index 0db8daf..735b1b4 100755 --- a/i3blocks/i3battery.sh +++ b/i3blocks/i3battery.sh @@ -24,15 +24,13 @@ elif [ "$capacity" -ge 20 ]; then color="#fe8019" else color="#fb4934" - warn="❗" + [ "$status" != "Charging" ] && warn="❗" fi -#[ ! "$capacity" -gt 15 ] && warn="❗" -[ -z $warn ] && warn="" +[ -z "$warn" ] && warn="" [ "$status" = "Charging" ] && color="#1fffaf" -#printf "%s%s%s%s" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" "$warn" printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" echo "" diff --git a/i3blocks/i3cpu.sh b/i3blocks/i3cpu.sh index a68130e..7c8c8c9 100755 --- a/i3blocks/i3cpu.sh +++ b/i3blocks/i3cpu.sh @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send -t 5000 "Highest CPU processes: + 1) notify-send -h string:x-canonical-private-synchronous:cpu -t 5000 "Highest CPU processes: $(ps axch -o cmd:18,%cpu --sort=-%cpu | sed 10q)" ;; esac @@ -14,10 +14,9 @@ elif [ "$temp" -lt 45 ]; then color="#1fffaf" elif [ "$temp" -lt 65 ]; then color="#b8bb26" - warn=❗ else color="#d1375d" - warn=❗❗ + warn=❗ fi printf "<span color='%s'>%s%s</span>" "$color" "$temp" "$warn" diff --git a/i3blocks/i3date.sh b/i3blocks/i3date.sh index 2f18e25..91af3ac 100755 --- a/i3blocks/i3date.sh +++ b/i3blocks/i3date.sh @@ -1,8 +1,9 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) ~/scripts/floatMonths.sh ;; - 3) ~/scripts/floatYears.sh ;; + 1) ~/scripts/floats/floatMonths.sh ;; + 2) notify-send -h string:x-canonical-private-synchronous:date -t 1000 "$(echo "scale=1; ($(date +%j)*100)/365" | bc)%" ;; + 3) ~/scripts/floats/floatYears.sh ;; esac dayofyear=$(date +%j) diff --git a/i3blocks/i3disk.sh b/i3blocks/i3disk.sh index 8ffec99..2d994af 100755 --- a/i3blocks/i3disk.sh +++ b/i3blocks/i3disk.sh @@ -1,9 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send "$(df -h | grep ^/dev/sda6 | awk '{print "/: Used "$3"/"$2" ("$5")"}')" -# 2) # Middle click -# 3) # Right click + 1) notify-send -h string:x-canonical-private-synchronous:disk -t 3000 "$(df -h | grep ^/dev/sda6 | awk '{print "/: Used "$3"/"$2" ("$5")"}')" esac df -h | grep ^/dev/sda6 | awk '{print $4"/"$2}' diff --git a/i3blocks/i3internet.sh b/i3blocks/i3internet.sh index 049a479..a148928 100755 --- a/i3blocks/i3internet.sh +++ b/i3blocks/i3internet.sh @@ -2,25 +2,23 @@ case $BLOCK_BUTTON in 1) i3-msg "exec urxvt -e nmtui" >/dev/null ;; - 3) pgrep -x dunst >/dev/null && notify-send "<b>🌐 Internet module:</b> -- Click for 'nmtui' for wifi access -📡: no wifi connection -📶: wifi connection with quality -❎: no ethernet -🌐: ethernet working -" ;; esac -# -#[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" -# -#[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') -# -#printf "%s %s" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")" wstatus=$(cat /sys/class/net/wlp2s0/operstate) estatus=$(cat /sys/class/net/enp3s0/operstate) -wifi="$(nmcli | grep "wlp2s0: conectado to " | cut -d' ' -f4-) ($(ip addr show wlp2s0 | grep "inet " | cut -d' ' -f6))" -en=$(ip addr show enp3s0 | grep "inet " | cut -d' ' -f6) -[ $wstatus = "down" ] && wifi="down" -[ $estatus = "down" ] && en="down" -echo "📶 $wifi | 🌐 $en" + +if [ $wstatus = "down" ]; then + wifi="❌" +else + # with IP + #wifi="$(nmcli | grep "wlp2s0: conectado to " | cut -d' ' -f4-) ($(ip addr show wlp2s0 | grep "inet " | cut -d' ' -f6)) ($(grep "^\s*w" /proc/net/wireless | awk '{print int($3 * 100 / 70)"%"}'))" + # no IP + wifi="$(nmcli | grep "wlp2s0: conectado to " | cut -d' ' -f4-) ($(grep "^\s*w" /proc/net/wireless | awk '{print int($3 * 100 / 70)"%"}'))" +fi +if [ $estatus = "down" ]; then + en="❌" +else + en=$(ip addr show enp3s0 | grep "inet " | cut -d' ' -f6) +fi + +echo "📶$wifi 🌐$en" diff --git a/i3blocks/i3mem.sh b/i3blocks/i3mem.sh index 31f12c5..7c50c72 100755 --- a/i3blocks/i3mem.sh +++ b/i3blocks/i3mem.sh @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send -t 5000 "Highest RAM processes: + 1) notify-send -h string:x-canonical-private-synchronous:mem -t 5000 "Highest RAM processes: $(ps axch -o cmd:18,%mem --sort=-%mem | sed 10q)" ;; esac diff --git a/i3blocks/i3music.sh b/i3blocks/i3music.sh index 8dfd408..4811e08 100755 --- a/i3blocks/i3music.sh +++ b/i3blocks/i3music.sh @@ -1,9 +1,9 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) pgrep -x cmus && cmus-remote -r ;; - 2) pgrep -x cmus && cmus-remote -u ;; - 3) pgrep -x cmus && cmus-remote -n ;; + 1) pgrep -x cmus >/dev/null && cmus-remote -r ;; + 2) pgrep -x cmus >/dev/null && cmus-remote -u ;; + 3) pgrep -x cmus >/dev/null && cmus-remote -n ;; esac symbol=🎵 @@ -11,12 +11,12 @@ pgrep -x cmus >/dev/null || (echo "$symbol" && exit) stat="$(cmus-remote -Q | grep "status " | awk '{print $2}')" artist="$(cmus-remote -Q | grep "tag artist " | cut -d' ' -f3-)" title="$(cmus-remote -Q | grep "tag title " | cut -d' ' -f3-)" -[[ -z "$artist" ]] && artist="(unknown)" -[[ -z "$title" ]] && title="$(cmus-remote -Q | grep "file " | cut -d'/' -f5-)" +[ -z "$artist" ] && artist="(unknown)" +[ -z "$title" ] && title="$(cmus-remote -Q | grep "file " | cut -d'/' -f5-)" if [ "$stat" = "playing" ]; then echo "$symbol $artist ─ $title" elif [ "$stat" = "paused" ]; then - echo "( $symbol $artist ─ $title )" + echo "$symbol ( $artist ─ $title )" else echo "$symbol $stat" fi diff --git a/i3blocks/i3vol.sh b/i3blocks/i3vol.sh index f702656..0e6311e 100755 --- a/i3blocks/i3vol.sh +++ b/i3blocks/i3vol.sh @@ -2,7 +2,7 @@ case $BLOCK_BUTTON in 1) i3-msg "exec urxvt -e alsamixer" >/dev/null ;; - 3) pgrep -x dunst >/dev/null && notify-send -t 2000 "Click for alsamixer" ;; + 3) pgrep -x dunst >/dev/null && notify-send -h string:x-canonical-private-synchronous:i3volHint -t 2000 "Click for alsamixer" ;; esac vol=$(pactl list sinks | grep Volumen: | awk '{print $5}') |