mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 11:47:09 -04:00
(bin): remove unnecessary scripts
This commit is contained in:
parent
bd077a76f4
commit
484bfb18c8
|
@ -1,56 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
LOW_USED_COLOR="#a3be8c"
|
|
||||||
MEDIUM_USED_COLOR="#ebcb8b"
|
|
||||||
HIGH_USED_COLOR="#bf616a"
|
|
||||||
DEFAULT_USED_COLOR="#81a1c1"
|
|
||||||
UNUSED_COLOR="#5e81ac"
|
|
||||||
|
|
||||||
usage=$1
|
|
||||||
width=$2
|
|
||||||
usage_color=$3
|
|
||||||
|
|
||||||
command -v "$1" >/dev/null && usage=$($1)
|
|
||||||
|
|
||||||
low_used=$((width * 30 / 100))
|
|
||||||
medium_used=$((width * 60 / 100))
|
|
||||||
num_used_chars=$(printf 'scale=0; (%s * %s) / 100\n' "$usage" "$width" | bc -l)
|
|
||||||
|
|
||||||
if [ -n "$usage_color" ]; then
|
|
||||||
case "$num_used_chars" in
|
|
||||||
[0-$low_used]) used_color="$LOW_USED_COLOR" ;;
|
|
||||||
[$low_used-$medium_used]) used_color="$MEDIUM_USED_COLOR" ;;
|
|
||||||
*) used_color="$HIGH_USED_COLOR" ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
used_color="$DEFAULT_USED_COLOR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
prev_opened=0
|
|
||||||
any_used_width=0
|
|
||||||
i=1
|
|
||||||
while [ "$i" -le "$width" ]; do
|
|
||||||
if [ "$i" -le "$num_used_chars" ]; then
|
|
||||||
if [ "$prev_opened" -eq 0 ]; then
|
|
||||||
bar="$bar<fc=$used_color>"
|
|
||||||
prev_opened=1
|
|
||||||
any_used_width=1
|
|
||||||
fi
|
|
||||||
bar="$bar#"
|
|
||||||
else
|
|
||||||
if [ "$any_used_width" -eq 1 ]; then
|
|
||||||
bar="$bar</fc>"
|
|
||||||
prev_opened=0
|
|
||||||
any_used_width=0
|
|
||||||
fi
|
|
||||||
if [ "$prev_opened" -eq 0 ]; then
|
|
||||||
bar="$bar<fc=$UNUSED_COLOR>"
|
|
||||||
prev_opened=1
|
|
||||||
fi
|
|
||||||
bar="$bar:"
|
|
||||||
fi
|
|
||||||
i=$((i + 1))
|
|
||||||
done
|
|
||||||
bar="$bar</fc>"
|
|
||||||
|
|
||||||
printf '%s\n' "$bar"
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PIPES="volume now-playing"
|
|
||||||
|
|
||||||
for pipe in $PIPES; do
|
|
||||||
echo "" >"/tmp/pipe-$pipe"
|
|
||||||
pipe_"$pipe" &
|
|
||||||
done
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PIPE_FILE="/tmp/pipe-now-playing"
|
|
||||||
[ -p "$PIPE_FILE" ] || mkfifo "$PIPE_FILE"
|
|
||||||
|
|
||||||
monitors now_playing >"$PIPE_FILE"
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PIPE_FILE="/tmp/pipe-volume"
|
|
||||||
[ -p "$PIPE_FILE" ] || mkfifo "$PIPE_FILE"
|
|
||||||
|
|
||||||
monitors volume >"$PIPE_FILE"
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "${0##*/}: $1" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -f "$XDG_CACHE_HOME/lock.png" ] || die "file not found"
|
|
||||||
i3lock -i "$XDG_CACHE_HOME/lock.png"
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
killall "$1" || "$@"
|
|
Loading…
Reference in a new issue