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 /i3blocks | |
parent | 82cd5e57e2ecb878396e4703ee2eb4cc0bba3c9e (diff) | |
download | scripts-d165a641d16c181e6251737b9c86d6bf178370be.tar.gz scripts-d165a641d16c181e6251737b9c86d6bf178370be.zip |
jue dic 27 18:47:51 CET 2018
Diffstat (limited to 'i3blocks')
-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 |
8 files changed, 32 insertions, 38 deletions
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}') |