From 41fa4263c042bcef66918092efcdbb6a991bc84f Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Mon, 13 Dec 2021 16:34:55 -0500 Subject: more renames --- dot_dzen/battery.sh | 49 ++++++++++ dot_dzen/dzen.sh | 156 ++++++++++++++++++++++++++++++++ dot_dzen/icons/arrow_down.xbm | 4 + dot_dzen/icons/arrow_up.xbm | 4 + dot_dzen/icons/bluetooth.xbm | 4 + dot_dzen/icons/corner.xbm | 5 + dot_dzen/icons/cpu.xbm | 6 ++ dot_dzen/icons/down.xbm | 6 ++ dot_dzen/icons/fwd.xbm | 4 + dot_dzen/icons/layout-full-black.xbm | 5 + dot_dzen/icons/layout-full.xbm | 8 ++ dot_dzen/icons/layout-gimp.xbm | 8 ++ dot_dzen/icons/layout-im-full.xbm | 8 ++ dot_dzen/icons/layout-im-mirror.xbm | 8 ++ dot_dzen/icons/layout-im-tall.xbm | 8 ++ dot_dzen/icons/layout-im.xbm | 8 ++ dot_dzen/icons/layout-mirror-black.xbm | 5 + dot_dzen/icons/layout-mirror-bottom.xbm | 8 ++ dot_dzen/icons/layout-mirror-top.xbm | 8 ++ dot_dzen/icons/layout-tall-black.xbm | 5 + dot_dzen/icons/layout-tall-left.xbm | 8 ++ dot_dzen/icons/layout-tall-right.xbm | 8 ++ dot_dzen/icons/layout-threecol.xbm | 8 ++ dot_dzen/icons/load.xbm | 6 ++ dot_dzen/icons/mail.xbm | 4 + dot_dzen/icons/mem.xbm | 6 ++ dot_dzen/icons/mpd.xbm | 6 ++ dot_dzen/icons/net-wifi.xbm | 6 ++ dot_dzen/icons/net-wifi3.xbm | 6 ++ dot_dzen/icons/net-wifi4.xbm | 6 ++ dot_dzen/icons/net-wifi5.xbm | 6 ++ dot_dzen/icons/net-wired.xbm | 6 ++ dot_dzen/icons/net-wired2.xbm | 6 ++ dot_dzen/icons/next.xbm | 4 + dot_dzen/icons/pause.xbm | 4 + dot_dzen/icons/phones.xbm | 4 + dot_dzen/icons/play.xbm | 4 + dot_dzen/icons/plus.xbm | 5 + dot_dzen/icons/power-ac.xbm | 6 ++ dot_dzen/icons/power-bat.xbm | 6 ++ dot_dzen/icons/power-bat2.xbm | 6 ++ dot_dzen/icons/prev.xbm | 4 + dot_dzen/icons/rwd.xbm | 4 + dot_dzen/icons/spkr_hi.xbm | 4 + dot_dzen/icons/spkr_mute.xbm | 4 + dot_dzen/icons/square.xbm | 5 + dot_dzen/icons/stop.xbm | 4 + dot_dzen/icons/temp.xbm | 6 ++ dot_dzen/icons/up.xbm | 6 ++ dot_dzen/icons/vol-hi.xbm | 6 ++ dot_dzen/icons/vol-mute.xbm | 6 ++ dot_dzen/icons/wifi_01.xbm | 4 + dot_dzen/icons/wifi_02.xbm | 4 + dot_dzen/temperature.sh | 26 ++++++ 54 files changed, 521 insertions(+) create mode 100755 dot_dzen/battery.sh create mode 100755 dot_dzen/dzen.sh create mode 100644 dot_dzen/icons/arrow_down.xbm create mode 100644 dot_dzen/icons/arrow_up.xbm create mode 100644 dot_dzen/icons/bluetooth.xbm create mode 100644 dot_dzen/icons/corner.xbm create mode 100644 dot_dzen/icons/cpu.xbm create mode 100644 dot_dzen/icons/down.xbm create mode 100644 dot_dzen/icons/fwd.xbm create mode 100644 dot_dzen/icons/layout-full-black.xbm create mode 100644 dot_dzen/icons/layout-full.xbm create mode 100644 dot_dzen/icons/layout-gimp.xbm create mode 100644 dot_dzen/icons/layout-im-full.xbm create mode 100644 dot_dzen/icons/layout-im-mirror.xbm create mode 100644 dot_dzen/icons/layout-im-tall.xbm create mode 100644 dot_dzen/icons/layout-im.xbm create mode 100644 dot_dzen/icons/layout-mirror-black.xbm create mode 100644 dot_dzen/icons/layout-mirror-bottom.xbm create mode 100644 dot_dzen/icons/layout-mirror-top.xbm create mode 100644 dot_dzen/icons/layout-tall-black.xbm create mode 100644 dot_dzen/icons/layout-tall-left.xbm create mode 100644 dot_dzen/icons/layout-tall-right.xbm create mode 100644 dot_dzen/icons/layout-threecol.xbm create mode 100644 dot_dzen/icons/load.xbm create mode 100644 dot_dzen/icons/mail.xbm create mode 100644 dot_dzen/icons/mem.xbm create mode 100644 dot_dzen/icons/mpd.xbm create mode 100644 dot_dzen/icons/net-wifi.xbm create mode 100644 dot_dzen/icons/net-wifi3.xbm create mode 100644 dot_dzen/icons/net-wifi4.xbm create mode 100644 dot_dzen/icons/net-wifi5.xbm create mode 100644 dot_dzen/icons/net-wired.xbm create mode 100644 dot_dzen/icons/net-wired2.xbm create mode 100644 dot_dzen/icons/next.xbm create mode 100644 dot_dzen/icons/pause.xbm create mode 100644 dot_dzen/icons/phones.xbm create mode 100644 dot_dzen/icons/play.xbm create mode 100644 dot_dzen/icons/plus.xbm create mode 100644 dot_dzen/icons/power-ac.xbm create mode 100644 dot_dzen/icons/power-bat.xbm create mode 100644 dot_dzen/icons/power-bat2.xbm create mode 100644 dot_dzen/icons/prev.xbm create mode 100644 dot_dzen/icons/rwd.xbm create mode 100644 dot_dzen/icons/spkr_hi.xbm create mode 100644 dot_dzen/icons/spkr_mute.xbm create mode 100644 dot_dzen/icons/square.xbm create mode 100644 dot_dzen/icons/stop.xbm create mode 100644 dot_dzen/icons/temp.xbm create mode 100644 dot_dzen/icons/up.xbm create mode 100644 dot_dzen/icons/vol-hi.xbm create mode 100644 dot_dzen/icons/vol-mute.xbm create mode 100644 dot_dzen/icons/wifi_01.xbm create mode 100644 dot_dzen/icons/wifi_02.xbm create mode 100755 dot_dzen/temperature.sh (limited to 'dot_dzen') diff --git a/dot_dzen/battery.sh b/dot_dzen/battery.sh new file mode 100755 index 0000000..c50e53d --- /dev/null +++ b/dot_dzen/battery.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# +# original script by lyon8 +# modifications from original by +# show your laptop battery state in dzen +# Taken from http://www.webframp.com/2008/08/17/switchdzen/ and modified by Ryan +# Kavanagh to add support for a missing battery and use +# /sys instead of /proc/acpi/battery + +BG='#000000' # dzen backgrounad +FG='#008dd5' # dzen foreground +W=114 # width of the dzen bar +GW=50 # width of the gauge +GFG='#33ccff' # color of the gauge +GH=7 # height of the gauge +GBG='#333' # color of gauge background +X=0 # x position +Y=0 # y position +FN='-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1' # font + +LOWBAT=10 # percentage of battery life marked as low +LOWCOL='#ff4747' # color when battery is low +CHGCOL='#60da11' # color when battery is charging +TIME_INT=2 # time interval in seconds to hold display +TIME_ITER=5 # no of iterations in which time is displayed + +PREBAR="^i(${HOME}/.dzen/icons/power-bat.xbm) " # caption (also icons are possible) + +echo -n $PREBAR #uncomment for an icon + +PRESENT=`acpi -b`; +if [ "${PRESENT}" ]; then + STATUS=`echo ${PRESENT} | grep Charging`; + + RPERC=`echo ${PRESENT} | cut -d, -f2 | sed -e 's/[^0-9]//g'`; + + # draw the bar and pipe everything into dzen + if [ $RPERC -le $LOWBAT ]; then + GFG=$LOWCOL; + fi + if [ "${STATUS}" ]; then + GFG=$CHGCOL; + else + GFG='#33ccff'; + fi + echo $RPERC +else + echo '??' +fi diff --git a/dot_dzen/dzen.sh b/dot_dzen/dzen.sh new file mode 100755 index 0000000..0d2b8e4 --- /dev/null +++ b/dot_dzen/dzen.sh @@ -0,0 +1,156 @@ +#!/bin/sh + +typeset -A DISKS +### +# Config +### +DATE_FORMAT="%a %d %b, %Y" +TIME_ZONES=("America/Toronto" "UTC") +DISKS=(home /home root /) +SEPERATOR=' ^fg(#86AA3F)^c(3)^fg() ' +BAR_BG='#7DA926' +BAR_FG='#B9D56E' +BAR_HH=6 +BAR_HW=40 +BAR_VH=12 +BAR_VW=3 +BAR_ARGS="-bg $BAR_BG -fg $BAR_FG -w $BAR_HW -h $BAR_HH" +ICON_DIR="$HOME/.dzen/icons/" +NETWORK_INTERFACE=eth0 +NET_DOWN_MAX=55 +NET_UP_MAX=14 +MAILDIR=~/.maildb/GMAIL/ + +GLOBALIVAL=1m +DATEIVAL=60 +TIMEIVAL=1 +DISKIVAL=1 +#CPUTEMPIVAL=5 +#CPUIVAL=1 +#NPIVAL=3 +NETIVAL=1 + + +### +# Functions +### +_date() +{ + date +${DATE_FORMAT} +} + +_time() +{ + local zone + print_space=0 + for zone in $TIME_ZONES; do + [[ $print_space -eq 1 ]] && print -n " " + print -n "${zone:t}: $(TZ=$zone date '+%H:%M')" + print_space=1 + done +} + +# +# Format: label1 mountpoint1 label2 mountpoint2 ... labelN mountpointN +# Copied and modified from Rob +get_disk_usage() { + local rstr; local tstr; local i; local sep + for i in ${(k)DISKS}; do + tstr=$(print `df -h $DISKS[$i]|sed -ne 's/^.* \([0-9]*\)% .*/\1/p'` 100 | \ + dzen2-gdbar -h $BAR_HH -w $BAR_HW -fg $BAR_FG -bg $BAR_BG -l "${i}" -nonl | \ + sed 's/[0-9]\+%//g;s/ / /g') + if [ ! -z "$rstr" ]; then + sep=${SEPERATOR} + fi + rstr="${rstr}${sep}${tstr}" + done + print -n $rstr +} + +# Requires mesure +get_net_rates() { + local up; local down + up=`mesure -K -l -c 3 -t -o $NETWORK_INTERFACE` + down=`mesure -K -l -c 3 -t -i $NETWORK_INTERFACE` + echo "$down $up" +} + +#cpu_temp() +#{ +# print -n ${(@)$( +# modifications from original by +# show your laptop battery state in dzen +# Taken from http://www.webframp.com/2008/08/17/switchdzen/ and modified by Ryan +# Kavanagh to add support for a missing battery and use +# /sys instead of /proc/acpi/battery + +BG='#171717' # dzen backgrounad +FG='#11DD11' # dzen foreground +W=130 # width of the dzen bar +GW=50 # width of the gauge +GFG='#33ccff' # color of the gauge +GH=7 # height of the gauge +GBG='#333' # color of gauge background +X=922 # x position +Y=0 # y position +FN='snap' # font +TIME_INT=10 + +TEMPERATURE=`acpi -t` + +while true; do + echo $TEMPERATURE | sed -e 's/.*ok, //g' && sleep $TIME_INT +done | dzen2 -ta c -tw $W -y $Y -x $X -fg $FG -bg $BG #-fn $FN -- cgit v1.2.3