aboutsummaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-12 22:05:30 -0400
committeriamcheeseman <[email protected]>2026-05-12 22:05:30 -0400
commit3d67ce5f6c293b023aa3cd6d9dc720b1635b9ca7 (patch)
tree8dd368b2606d5486f71198d743a336fb8746b484 /.local/bin
parent0b0ca928bba7bd45ef09e7068f85c96eefc6116b (diff)
switch back to dwm
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/audio_vis.sh31
-rwxr-xr-x.local/bin/dwmstatus.sh11
-rwxr-xr-x.local/bin/tsarbar_status.sh94
3 files changed, 11 insertions, 125 deletions
diff --git a/.local/bin/audio_vis.sh b/.local/bin/audio_vis.sh
deleted file mode 100755
index 62bb76c..0000000
--- a/.local/bin/audio_vis.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/bash
-
-# bar='_▁▂▃▄▅▆▇█#'
-bar=".'-,~^*&#@"
-dict='s/;//g;'
-
-# creating "dictionary" to replace char with bar
-i=0
-while [ $i -lt ${#bar} ]
-do
- dict="${dict}s/$i/${bar:$i:1}/g;"
- i=$((i=i+1))
-done
-
-# write cava config
-config_file="/tmp/polybar_cava_config"
-echo "
-[general]
-bars = 12
-
-[output]
-method = raw
-raw_target = /dev/stdout
-data_format = ascii
-ascii_max_range = 6
-" > $config_file
-
-# read stdout from cava
-cava -p $config_file | while read -r line; do
- echo $line | sed $dict
-done
diff --git a/.local/bin/dwmstatus.sh b/.local/bin/dwmstatus.sh
new file mode 100755
index 0000000..22dd9bd
--- /dev/null
+++ b/.local/bin/dwmstatus.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+while true; do
+ ram="ram $(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2}')"
+ cpu="load $(top -n1 | awk 'NR==1{printf "%g", $10}')"
+ clock="$(date +'%a %b %d, %r')"
+ volume="vol $(pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}')"
+
+ sleep 1
+ xsetroot -name " $ram ~ $cpu ~ $volume ~ $clock "
+done
diff --git a/.local/bin/tsarbar_status.sh b/.local/bin/tsarbar_status.sh
deleted file mode 100755
index b1eeb83..0000000
--- a/.local/bin/tsarbar_status.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#! /bin/bash
-
-tsarc config -font "CommitMono:pixelsize=15"
-tsarc config -height 20
-tsarc config -bg "#101010"
-tsarc config -gap 10
-
-tsarc set ~ -text "~"
-
-tsarc set ~ -fg "#888888"
-tsarc set ram -fg "#888888"
-tsarc set vol -fg "#888888"
-tsarc set player -fg "#888888"
-
-tsarc set window -bg "#FFFFFF"
-tsarc set window -fg "#000000"
-tsarc set window -margin 25
-
-tsarc set cwkspace -bg "#FFFFFF"
-tsarc set cwkspace -fg "#000000"
-tsarc set cwkspace -margin 2
-
-tsarc layout \
- -left lwkspace cwkspace rwkspace ~ player \
- -center window \
- -right ram ~ vol ~ clock
-
-trim() {
- read -r text
- echo "$text" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
-}
-
-workspace() {
- focused_ws=`bspc query -D --names -d focused`
- ws=`bspc query -D --names | tr '\n' ' '`
- lws=`echo $ws | awk -F$focused_ws '{print $1}'`
- rws=`echo $ws | awk -F$focused_ws '{print $2}'`
- tsarc set lwkspace -text " $lws"
- tsarc set cwkspace -text "$focused_ws"
- tsarc set rwkspace -text "$rws"
-}
-
-window_name() {
- win_id=$(bspc query -N -n focused)
- if [[ -n "$win_id" ]]; then
- title=`xtitle $win_id \
- | awk 'length > 64{$0=substr($0,0,64)"..."}1' \
- | tr '[:upper:]' '[:lower:]'`
- tsarc set window -text "$title" -fg "#000000" -bg "#FFFFFF"
- else
- tsarc set window -text "no window focused" -fg "#CCCCCC" -bg "#404040"
- fi
-}
-
-bspc subscribe desktop_focus desktop_add desktop_remove \
-| while read -r _; do
- workspace
-done &
-
-volume() {
- tsarc set vol -text \
- "vol `pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{printf "%s", $5}'`"
-}
-
-volume
-
-pactl subscribe \
-| while read -r line; do
- case "$line" in *"Event 'change' on sink #"*|*"Event 'change' on source #"*)
- volume
- while read -t 0.01 -r _; do :; done
- esac
-done &
-
-playerctl -F metadata -f "{{lc(status)}} {{lc(title)}} - {{lc(artist)}}" \
-| while read -r line; do
- status=`echo $line | awk '{ print $1 }'`
- case "$status" in
- "paused")
- tsarc set player -text "no media"
- ;;
- "playing")
- tsarc set player -text \
- "`echo $line | awk 'match($0, $1) {print substr($0, RSTART+RLENGTH)}' | trim`"
- ;;
- esac
-done &
-
-while true; do
- tsarc set ram -text "ram `free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2}'`"
- tsarc set clock -text "`date +"%a %b %d, %r" | tr '[:upper:]' '[:lower:]'` "
- window_name
- sleep 1
-done