hopefully this works
This commit is contained in:
parent
c4e20ef151
commit
f094bef7d4
3 changed files with 13 additions and 77 deletions
24
scripts/cal
24
scripts/cal
|
@ -1,24 +0,0 @@
|
|||
#!/bin/sh
|
||||
FUNC="$1"
|
||||
MODE="$2"
|
||||
|
||||
all() {
|
||||
printf "\033[1m\033[34m=== %s ===\033[0m\n%s\n" "$DATE" "$(calcurse -a -t)"
|
||||
}
|
||||
|
||||
apts() {
|
||||
[ -z "$MODE" ] && apts="$(calcurse -a)"
|
||||
[ "$MODE" = "count" ] && apts="$(calcurse -a | grep -c '\*')"
|
||||
if [ "$apts" = "0" -o "$apts" = "" ] ; then return 0 ; fi
|
||||
echo " $apts"
|
||||
}
|
||||
|
||||
todo() {
|
||||
[ -z "$MODE" ] && todo="$(calcurse -t)"
|
||||
[ "$MODE" = "count" ] && todo="$(calcurse -t | wc -l)"
|
||||
if [ "$todo" = "0" -o "$todo" = "" ] ; then return 0 ; fi
|
||||
echo " $todo"
|
||||
}
|
||||
|
||||
[ -z "$FUNC" ] && all && exit 0
|
||||
$FUNC $MODE
|
|
@ -1,56 +1,16 @@
|
|||
#!/bin/sh
|
||||
separator=" "
|
||||
|
||||
get_vol() {
|
||||
vol=$(amixer | grep "Playback" | grep -o '[0-9]*[0-9]%' | head -n 1)
|
||||
vol="${vol%\%*}" # Remove percentage sign
|
||||
|
||||
if amixer scontents | grep "Playback" | grep -q "\[off\]"; then
|
||||
echo " ──────────"
|
||||
exit
|
||||
fi
|
||||
|
||||
case 1 in
|
||||
$((vol >= 100)) ) bar="━━━━━━━━━━" ;;
|
||||
$((vol >= 90)) ) bar="━━━━━━━━━─" ;;
|
||||
$((vol >= 80)) ) bar="━━━━━━━━──" ;;
|
||||
$((vol >= 70)) ) bar="━━━━━━━───" ;;
|
||||
$((vol >= 60)) ) bar="━━━━━━────" ;;
|
||||
$((vol >= 50)) ) bar="━━━━━─────" ;;
|
||||
$((vol >= 40)) ) bar="━━━━──────" ;;
|
||||
$((vol >= 30)) ) bar="━━━───────" ;;
|
||||
$((vol >= 20)) ) bar="━━────────" ;;
|
||||
$((vol >= 10)) ) bar="━─────────" ;;
|
||||
$((vol >= 0)) ) bar="──────────" ;;
|
||||
esac
|
||||
|
||||
echo " $bar"
|
||||
get_todo() {
|
||||
todo="$(calcurse -t | wc -l)"
|
||||
[ "$todo" = "0" ] && return 0
|
||||
echo " $todo"
|
||||
}
|
||||
|
||||
get_mic() {
|
||||
vol=$(amixer | grep "Capture" | grep -o '[0-9]*[0-9]%' | tail -n 1)
|
||||
vol="${vol%\%*}" # Remove percentage sign
|
||||
|
||||
if amixer scontents | grep "Capture" | grep -q "\[off\]"; then
|
||||
echo " ──────────"
|
||||
exit
|
||||
fi
|
||||
|
||||
case 1 in
|
||||
$((vol >= 100)) ) bar="━━━━━━━━━━" ;;
|
||||
$((vol >= 90)) ) bar="━━━━━━━━━─" ;;
|
||||
$((vol >= 80)) ) bar="━━━━━━━━──" ;;
|
||||
$((vol >= 70)) ) bar="━━━━━━━───" ;;
|
||||
$((vol >= 60)) ) bar="━━━━━━────" ;;
|
||||
$((vol >= 50)) ) bar="━━━━━─────" ;;
|
||||
$((vol >= 40)) ) bar="━━━━──────" ;;
|
||||
$((vol >= 30)) ) bar="━━━───────" ;;
|
||||
$((vol >= 20)) ) bar="━━────────" ;;
|
||||
$((vol >= 10)) ) bar="━─────────" ;;
|
||||
$((vol >= 0)) ) bar="──────────" ;;
|
||||
esac
|
||||
|
||||
echo " $bar"
|
||||
get_apts() {
|
||||
apts="$(calcurse -a | grep -c '\*')"
|
||||
[ "$apts" = "0" ] && return 0
|
||||
echo " $apts"
|
||||
}
|
||||
|
||||
get_layout() {
|
||||
|
@ -60,20 +20,19 @@ get_layout() {
|
|||
echo " $layout"
|
||||
}
|
||||
|
||||
|
||||
while true ; do
|
||||
status=""
|
||||
|
||||
todo="$(cal todo count)"
|
||||
todo="$(get_todo)"
|
||||
! [ -z "$todo" ] && status="$status$separator$todo"
|
||||
|
||||
apts="$(cal apts count)"
|
||||
apts="$(get_apts)"
|
||||
! [ -z "$apts" ] && status="$status$separator$apts"
|
||||
|
||||
volume="$(get_vol)"
|
||||
volume="$(volstat)"
|
||||
! [ -z "$volume" ] && status="$status$separator$volume"
|
||||
|
||||
microphone="$(get_mic)"
|
||||
microphone="$(micstat)"
|
||||
! [ -z "$microphone" ] && status="$status$separator$microphone"
|
||||
|
||||
network="$(netstat)"
|
||||
|
|
|
@ -30,6 +30,7 @@ alias \
|
|||
# Command shortcuts
|
||||
alias \
|
||||
mgr-all="mgr pacman_upgrade apt_upgrade flatpak_update distrobox_update pip_update configs passmgr" \
|
||||
cal='printf "\033[1m\033[34m=== %s ===\033[0m\n%s\n" "$DATE" "$(calcurse -a -t)"' \
|
||||
df-short="df -h | grep -v '\s/dev.*$\|\s/run.*$\|\s/boot.*$'" \
|
||||
wacom-setup-menu="wacom-setup menu" \
|
||||
swayimg="swayimg -s fit -w 000000 -m" \
|
||||
|
|
Loading…
Reference in a new issue