dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 865cfdb0293f85c28d1ee54d76a11cc798bb7440
parent eb7ad7220af78d10be832a25ede1693669cd69c0
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun, 16 Dec 2018 16:50:42 -0500

Great Renaming, i3blocks officially changed

Diffstat:
M.config/i3/config | 2+-
M.config/i3blocks/config | 38+++++++++++---------------------------
A.scripts/statusbar/battery | 35+++++++++++++++++++++++++++++++++++
R.scripts/statusbar/i3date -> .scripts/statusbar/clock | 0
A.scripts/statusbar/cpu | 12++++++++++++
R.scripts/statusbar/i3disk -> .scripts/statusbar/disk | 0
R.scripts/statusbar/i3help -> .scripts/statusbar/help | 0
D.scripts/statusbar/i3battery | 34----------------------------------
D.scripts/statusbar/i3cpu | 12------------
D.scripts/statusbar/i3mpdupdate | 9---------
D.scripts/statusbar/i3news | 18------------------
D.scripts/statusbar/i3torrent | 6------
R.scripts/statusbar/i3internet -> .scripts/statusbar/internet | 0
R.scripts/statusbar/i3mail -> .scripts/statusbar/mailbox | 0
R.scripts/statusbar/i3mem -> .scripts/statusbar/memory | 0
R.scripts/statusbar/i3mpd -> .scripts/statusbar/music | 0
A.scripts/statusbar/news | 18++++++++++++++++++
R.scripts/statusbar/i3pacman -> .scripts/statusbar/pacpackages | 0
A.scripts/statusbar/torrent | 26++++++++++++++++++++++++++
R.scripts/statusbar/i3volume -> .scripts/statusbar/volume | 0
R.scripts/statusbar/i3weather -> .scripts/statusbar/weather | 0
21 files changed, 103 insertions(+), 107 deletions(-)

diff --git a/.config/i3/config b/.config/i3/config @@ -60,7 +60,7 @@ exec --no-startup-id remaps # Unclutter makes the mouse invisible after a brief period exec --no-startup-id unclutter # Run the script to update the mpd i3block on change. -exec_always --no-startup-id i3mpdupdate +exec_always --no-startup-id mpdupdate # mpd startup exec --no-startup-id mpd # Podboat automatic queue and download diff --git a/.config/i3blocks/config b/.config/i3blocks/config @@ -1,4 +1,4 @@ -command=/usr/lib/i3blocks/$BLOCK_NAME +command=~/.scripts/statusbar/$BLOCK_NAME separator_block_width=15 markup=pango @@ -7,79 +7,63 @@ command=cat ~/.recordingicon interval=once signal=9 -[mpd] +[music] label=🎼 -command=i3mpd interval=once signal=11 [news] label=📰 -command=i3news interval=once signal=6 -[pacman] +[pacpackages] label=📦 -command=i3pacman interval=once signal=8 -[torrents] -command=i3torrent +[torrent] interval=20 signal=7 [weather] -command=i3weather interval=3600 -[mail] +[mailbox] label=📬 -command=i3mail interval=180 signal=12 #[memory] -#command=i3mem #interval=30 #label=🧠 #[cpu] -#command=i3cpu #interval=15 #label=💻 [volume] interval=once -command=i3volume signal=10 -#[diskspace] +#[disk] #interval=60 -#command=i3disk / +#command=disk / -#[diskspace] +#[disk] #interval=60 -#command=i3disk /home 🏠 +#command=disk /home 🏠 [battery] -command=i3battery BAT1 +command=battery BAT0 interval=5 -[battery] -command=i3battery BAT0 -interval=5 - -[time] +[clock] label=📅 -command=i3date interval=30 [internet] -command=i3internet interval=10 [help] -command=i3help interval=once diff --git a/.scripts/statusbar/battery b/.scripts/statusbar/battery @@ -0,0 +1,35 @@ +#!/bin/sh +# Give a battery name (e.g. BAT0) as an argument. + +# get xresources colors +for x in "$(xrdb -query | sed "s/.*\./export /g;s/:\s*/=\"/g;s/$/\"/g")"; do eval "$x"; done + +case $BLOCK_BUTTON in + 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> +🔋: discharging +♻: stagnant charge +🔌: charging +⚡: charged +❗: battery very low! +- Text color reflects charge left" ;; +esac + +capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit +status=$(cat /sys/class/power_supply/"$1"/status) + +if [ "$capacity" -ge 75 ]; then + color="$color10" +elif [ "$capacity" -ge 50 ]; then + color="$color15" +elif [ "$capacity" -ge 25 ]; then + color="$color11" +else + color="$color9" + warn="❗" +fi + +[ -z $warn ] && warn=" " + +[ "$status" = "Charging" ] && color="$color15" + +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/$/%/')" diff --git a/.scripts/statusbar/i3date b/.scripts/statusbar/clock diff --git a/.scripts/statusbar/cpu b/.scripts/statusbar/cpu @@ -0,0 +1,12 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) notify-send "<b>🖥 CPU hogs</b>: +$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; + 3) notify-send "<b>🖥 CPU module:</b> +- Shows CPU temperature. +- Click to show intensive processes. +- % is of single core." ;; +esac + +sensors | awk '/Core 0/ {print $3}' diff --git a/.scripts/statusbar/i3disk b/.scripts/statusbar/disk diff --git a/.scripts/statusbar/i3help b/.scripts/statusbar/help diff --git a/.scripts/statusbar/i3battery b/.scripts/statusbar/i3battery @@ -1,34 +0,0 @@ -#!/bin/sh -# Give a battery name (e.g. BAT0) as an argument. - -case $BLOCK_BUTTON in - 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> -🔋: discharging -♻: stagnant charge -🔌: charging -⚡: charged -❗: battery very low! -- Text color reflects charge left" ;; -esac - -capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit -status=$(cat /sys/class/power_supply/"$1"/status) - -if [ "$capacity" -ge 80 ]; then - color="#b8bb26" -elif [ "$capacity" -ge 60 ]; then - color="#ebdbb2" -elif [ "$capacity" -ge 40 ]; then - color="#fabd2f" -elif [ "$capacity" -ge 20 ]; then - color="#fe8019" -else - color="#fb4934" - warn="❗" -fi - -[ -z $warn ] && warn=" " - -[ "$status" = "Charging" ] && color="#FFF" - -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/$/%/')" diff --git a/.scripts/statusbar/i3cpu b/.scripts/statusbar/i3cpu @@ -1,12 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) notify-send "<b>🖥 CPU hogs</b>: -$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; - 3) notify-send "<b>🖥 CPU module:</b> -- Shows CPU temperature. -- Click to show intensive processes. -- % is of single core." ;; -esac - -sensors | awk '/^temp1/ {print $2}' diff --git a/.scripts/statusbar/i3mpdupdate b/.scripts/statusbar/i3mpdupdate @@ -1,9 +0,0 @@ -#!/bin/sh - -[ "$(pgrep -x i3mpdupdate | wc -l)" -gt 2 ] && exit - -while : ; do - pgrep -x mpd || exit - mpc idle > /dev/null - pkill -RTMIN+11 i3blocks ; -done diff --git a/.scripts/statusbar/i3news b/.scripts/statusbar/i3news @@ -1,18 +0,0 @@ -#!/bin/sh - -# i3blocks newsboat module. -# Displays number of unread news items and an loading icon if updating. -# When clicked, brings up `newsboat`. - -case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e newsboat ;; - 2) setsid newsup >/dev/null ;; - 3) pgrep -x dunst >/dev/null && notify-send "<b>📰 News module:</b> -- Shows unread news items -- Shows 🔃 if updating with \`newsup\` -- Left click opens newsboat -- Middle click syncs RSS feeds -<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; -esac - -echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" diff --git a/.scripts/statusbar/i3torrent b/.scripts/statusbar/i3torrent @@ -1,6 +0,0 @@ -#!/bin/sh -case $BLOCK_BUTTON in - 1) $TERMINAL -e transmission-remote-cli -esac - -transmission-remote -l | grep % | sed -e "s/.*100%.*/Z/g;s/.*Idle.*/A/g;s/.*%.*/M/g" | sort -h | uniq -c | sed -e "s/Z/🌱/g;s/M/⬇️/g;s/A/⌛️/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" diff --git a/.scripts/statusbar/i3internet b/.scripts/statusbar/internet diff --git a/.scripts/statusbar/i3mail b/.scripts/statusbar/mailbox diff --git a/.scripts/statusbar/i3mem b/.scripts/statusbar/memory diff --git a/.scripts/statusbar/i3mpd b/.scripts/statusbar/music diff --git a/.scripts/statusbar/news b/.scripts/statusbar/news @@ -0,0 +1,18 @@ +#!/bin/sh + +# i3blocks newsboat module. +# Displays number of unread news items and an loading icon if updating. +# When clicked, brings up `newsboat`. + +case $BLOCK_BUTTON in + 1) setsid "$TERMINAL" -e newsboat ;; + 2) setsid newsup >/dev/null & exit ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>📰 News module:</b> +- Shows unread news items +- Shows 🔃 if updating with \`newsup\` +- Left click opens newsboat +- Middle click syncs RSS feeds +<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; +esac + +echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" diff --git a/.scripts/statusbar/i3pacman b/.scripts/statusbar/pacpackages diff --git a/.scripts/statusbar/torrent b/.scripts/statusbar/torrent @@ -0,0 +1,26 @@ +#!/bin/sh + +transmission-remote -l | grep % | + sed " # This first sed command is to ensure a desirable order with sort + s/.*Stopped.*/A/g; + s/.*Seeding.*/Z/g; + s/.*100%.*/N/g; + s/.*Idle.*/B/g; + s/.*%.*/M/g" | + sort -h | uniq -c | sed " # Now we replace the standin letters with icons. + s/A/🛑/g; + s/B/⌛️/g; + s/M/🔽/g; + s/N/✅/g; + s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" + +case $BLOCK_BUTTON in + 1) $TERMINAL -e transmission-remote-cli ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>Torrent module:</b> +🛑: paused +⏳: waiting +🔽: downloading +✅: done +🌱: done and seeding" ;; +esac + diff --git a/.scripts/statusbar/i3volume b/.scripts/statusbar/volume diff --git a/.scripts/statusbar/i3weather b/.scripts/statusbar/weather