Skip to content

Commit

Permalink
diskspace: add jq filter as option
Browse files Browse the repository at this point in the history
  • Loading branch information
x70b1 committed Nov 7, 2023
1 parent f6aa9b0 commit a4fbc0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion motd-on-acid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ MEMORY_ICON="#"
SWAP_ICON="#"

DISKSPACE_ICON="#"
DISKSPACE_FILTER="select( .mountpoint != null and .mountpoint != \"[SWAP]\" )"

SERVICES_UP_ICON="#"
SERVICES_UP_COLOR="32"
Expand Down Expand Up @@ -304,7 +305,7 @@ print_diskspace() {
printf '\n'
printf ' \033[1;37mDiskspace:\033[0m\n'

diskspace_devices=$(lsblk -Jlo NAME,MOUNTPOINT | jq -c '.blockdevices | sort_by(.mountpoint) | .[] | select( .mountpoint != null and .mountpoint != "[SWAP]" )')
diskspace_devices=$(lsblk -Jlo NAME,MOUNTPOINT | jq -c '.blockdevices | sort_by(.mountpoint) | .[] | select( '"$DISKSPACE_FILTER"' )')
diskspace_partitions=$(df -B M | sed -e "s/M//g")

diskspace_index=0
Expand Down

0 comments on commit a4fbc0e

Please sign in to comment.