Browse Source

Removed obsolete functions dir

patch-fontkeys
joestandring 5 years ago
parent
commit
fcadc00034
9 changed files with 0 additions and 242 deletions
  1. +0
    -34
      functions/dwm_alsa.sh
  2. +0
    -51
      functions/dwm_cmus.sh
  3. +0
    -23
      functions/dwm_countdown.sh
  4. +0
    -16
      functions/dwm_date.sh
  5. +0
    -17
      functions/dwm_keyboard.sh
  6. +0
    -23
      functions/dwm_mail.sh
  7. +0
    -34
      functions/dwm_pulse.sh
  8. +0
    -25
      functions/dwm_resources.sh
  9. +0
    -19
      functions/dwm_weather.sh

+ 0
- 34
functions/dwm_alsa.sh View File

@ -1,34 +0,0 @@
#!/bin/sh
# A dwm_bar function to show the master volume of ALSA
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: alsa-utils
dwm_alsa () {
VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
if [ "$IDENTIFIER" = "unicode" ]; then
if [ "$VOL" -eq 0 ]; then
printf "[🔇 %s]\n" "$VOL]\n"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "[🔈 %s]\n" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "[🔉 %s]\n" "$VOL"
else
printf "[🔊 %s]\n" "$VOL"
fi
else
if [ "$VOL" -eq 0 ]; then
printf "[VOL %s]\n" "$VOL]\n"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "[VOL %s]\n" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "[VOL %s]\n" "$VOL"
else
printf "[VOL %s]\n" "$VOL"
fi
fi
}
dwm_alsa

+ 0
- 51
functions/dwm_cmus.sh View File

@ -1,51 +0,0 @@
#!/bin/sh
# A dwm_bar function that shows the current artist, track, position, duration, and status from cmus
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: cmus
dwm_cmus () {
if ps -C cmus > /dev/null; then
ARTIST=$(cmus-remote -Q | grep -a '^tag artist' | awk '{gsub("tag artist ", "");print}')
TRACK=$(cmus-remote -Q | grep -a '^tag title' | awk '{gsub("tag title ", "");print}')
POSITION=$(cmus-remote -Q | grep -a '^position' | awk '{gsub("position ", "");print}')
DURATION=$(cmus-remote -Q | grep -a '^duration' | awk '{gsub("duration ", "");print}')
STATUS=$(cmus-remote -Q | grep -a '^status' | awk '{gsub("status ", "");print}')
SHUFFLE=$(cmus-remote -Q | grep -a '^set shuffle' | awk '{gsub("set shuffle ", "");print}')
if [ "$IDENTIFIER" = "unicode" ]; then
if [ "$STATUS" = "playing" ]; then
STATUS="▶"
else
STATUS="⏸"
fi
if [ "$SHUFFLE" = "true" ]; then
SHUFFLE=" 🔀"
else
SHUFFLE=""
fi
else
if [ "$STATUS" = "playing" ]; then
STATUS="PLA"
else
STATUS="PAU"
fi
if [ "$SHUFFLE" = "true" ]; then
SHUFFLE=" S"
else
SHUFFLE=""
fi
fi
printf "[%s %s - %s " "$STATUS" "$ARTIST" "$TRACK"
printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60))
printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60))
printf "%s]\n" "$SHUFFLE"
fi
}
dwm_cmus

+ 0
- 23
functions/dwm_countdown.sh View File

@ -1,23 +0,0 @@
#!/bin/sh
# A dwm_status function that displays the status of countdown.sh
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: https://github.com/joestandring/countdown
dwm_countdown () {
for f in /tmp/countdown.*; do
if [ -e "$f" ]; then
if [ "$IDENTIFIER" = "unicode" ]; then
printf "[⏳ %s]\n" "$(tail -1 /tmp/countdown.*)"
else
printf "[CDN %s]\n" "$(tail -1 /tmp/countdown.*)"
fi
break
fi
done
}
dwm_countdown

+ 0
- 16
functions/dwm_date.sh View File

@ -1,16 +0,0 @@
#!/bin/sh
# A dwm_bar function that shows the current date and time
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Date is formatted like like this: "[Mon 01-01-00 00:00:00]"
dwm_date () {
if [ "$IDENTIFIER" = "unicode" ]; then
printf "[📆 %s]\n" "$(date "+%a %d-%m-%y %T")"
else
printf "[DAT %s]\n" "$(date "+%a %d-%m-%y %T")"
fi
}
dwm_date

+ 0
- 17
functions/dwm_keyboard.sh View File

@ -1,17 +0,0 @@
#!/bin/sh
# A dwm_bar function that displays the current keyboard layout
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: xorg-setxkbmap
dwm_keyboard () {
if [ "$IDENTIFIER" = "unicode" ]; then
printf "[⌨ %s]\n" "$(setxkbmap -query | awk '/layout/{print $2}')"
else
printf "[KEY %s]\n" "$(setxkbmap -query | awk '/layout/{print $2}')"
fi
}
dwm_keyboard

+ 0
- 23
functions/dwm_mail.sh View File

@ -1,23 +0,0 @@
#!/bin/sh
# A dwm_bar function to display the number of emails in an inbox
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# To count mail in an inbox, change "/path/to/inbox" below to the location of your inbox. For example, "/home/$USER/.mail/new"
dwm_mail () {
MAILBOX=$(ls /path/to/inbox | wc -l)
if [ "$IDENTIFIER" = "unicode" ]; then
if [ "$MAILBOX" -eq 0 ]; then
printf "[📪 %s]\n" "$MAILBOX"
else
printf "[📫 %s]\n" "$MAILBOX"
fi
else
printf "[MAI %s]\n" "$MAILBOX"
fi
}
dwm_mail

+ 0
- 34
functions/dwm_pulse.sh View File

@ -1,34 +0,0 @@
#!/bin/sh
# A dwm_bar function to show the master volume of PulseAudio
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: pamixer
dwm_pulse () {
VOL=$(pamixer --get-volume)
if [ "$IDENTIFIER" = "unicode" ]; then
if [ "$VOL" -eq 0 ]; then
printf "[🔇 %s]\n" "$VOL]\n"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "[🔈 %s]\n" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "[🔉 %s]\n" "$VOL"
else
printf "[🔊 %s]\n" "$VOL"
fi
else
if [ "$VOL" -eq 0 ]; then
printf "[VOL %s]\n" "$VOL]\n"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "[VOL %s]\n" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "[VOL %s]\n" "$VOL"
else
printf "[VOL %s]\n" "$VOL"
fi
fi
}
dwm_pulse

+ 0
- 25
functions/dwm_resources.sh View File

@ -1,25 +0,0 @@
#!/bin/sh
# A dwm_bar function to display information regarding system memory, CPU temperature, and storage
# Joe Standring <git@joestandring.com>
# GNU GPLv3
dwm_resources () {
# Used and total memory
MEMUSED=$(free -h | awk '(NR == 2) {print $3}')
MEMTOT=$(free -h |awk '(NR == 2) {print $2}')
# CPU temperature
CPU=$(sysctl -n hw.sensors.cpu0.temp0 | cut -d. -f1)
# Used and total storage in /home (rounded to 1024B)
STOUSED=$(df -h | grep '/home$' | awk '{print $3}')
STOTOT=$(df -h | grep '/home$' | awk '{print $2}')
STOPER=$(df -h | grep '/home$' | awk '{print $5}')
if [ "$IDENTIFIER" = "unicode" ]; then
printf "[💻 MEM %s/%s CPU %s STO %s/%s: %s]\n" "$MEMUSED" "$MEMTOT" "$CPU" "$STOUSED" "$STOTOT" "$STOPER"
else
printf "[STA | MEM %s/%s CPU %s STO %s/%s: %s]\n" "$MEMUSED" "$MEMTOT" "$CPU" "$STOUSED" "$STOTOT" "$STOPER"
fi
}
dwm_resources

+ 0
- 19
functions/dwm_weather.sh View File

@ -1,19 +0,0 @@
#!/bin/sh
# A dwm_bar function to print the weather from wttr.in
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: curl
# Change the value of LOCATION to match your city
dwm_weather() {
LOCATION=city
if [ "$IDENTIFIER" = "unicode" ]; then
printf "[%s]\n" "$(curl -s wttr.in/$LOCATION?format=1)"
else
printf "[WEA %s]\n" "$(curl -s wttr.in/$LOCATION?format=1 | grep -o "[0-9].*")"
fi
}
dwm_weather

Loading…
Cancel
Save