Disk: Added --disk_subtitle

This commit is contained in:
Dylan Araps 2017-01-08 14:23:55 +11:00
parent 1241f839f7
commit 2e69b7f64c
3 changed files with 37 additions and 1 deletions

View File

@ -316,6 +316,21 @@ public_ip_host="http://ident.me"
# #
disk_show=('/') disk_show=('/')
# Disk subtitle.
# What to append to the Disk subtitle.
#
# Default: 'mount'
# Values: 'mount', 'name'
# Flag: --disk_subtitle
#
# Example:
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
#
# mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
disk_subtitle="mount"
# Song # Song

View File

@ -1642,6 +1642,12 @@ get_disk() {
disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)" disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)"
# Subtitle
case "$disk_subtitle" in
"name") disk_sub="${disk_info[0]}" ;;
*) disk_sub="${disk_info[5]}" ;;
esac
# Bar. # Bar.
case "$disk_display" in case "$disk_display" in
"bar") disk="$(bar "$disk_perc" "100")" ;; "bar") disk="$(bar "$disk_perc" "100")" ;;
@ -1651,7 +1657,7 @@ get_disk() {
esac esac
# Append '(disk mount point)' to the subtitle. # Append '(disk mount point)' to the subtitle.
prin "${subtitle} (${disk_info[5]})" "$disk" prin "${subtitle} (${disk_sub})" "$disk"
done done
} }
@ -3552,6 +3558,13 @@ INFO:
Takes: '/', '/dev/sdXX', '/path/to/mount point' Takes: '/', '/dev/sdXX', '/path/to/mount point'
NOTE: Multiple values can be given. (--disk_show '/' '/dev/sdc1') NOTE: Multiple values can be given. (--disk_show '/' '/dev/sdc1')
--disk_subtitle name/mount What information to append to the Disk subtitle.
'name' shows the disk's name (sda1, sda2, etc)
'mount' shows the disk's mount point (/, /mnt/Local Disk, etc)
--ip_host url URL to query for public IP --ip_host url URL to query for public IP
--song_shorthand on/off Print the Artist/Title on separate lines --song_shorthand on/off Print the Artist/Title on separate lines
--install_time on/off Enable/Disable showing the time in Install Date output. --install_time on/off Enable/Disable showing the time in Install Date output.
@ -3716,6 +3729,7 @@ get_args() {
[[ "$cpu_temp" == "on" ]] && cpu_temp="C" [[ "$cpu_temp" == "on" ]] && cpu_temp="C"
;; ;;
"--disk_subtitle") disk_subtitle="$2" ;;
"--disk_show") "--disk_show")
unset disk_show unset disk_show
for arg in "$@"; do for arg in "$@"; do

View File

@ -96,6 +96,13 @@ Takes: '/', '/dev/sdXX', '/path/to/mount point'
.IP .IP
NOTE: Multiple values can be given. (\fB\-\-disk_show\fR '/' '/dev/sdc1') NOTE: Multiple values can be given. (\fB\-\-disk_show\fR '/' '/dev/sdc1')
.TP .TP
\fB\-\-disk_subtitle\fR name/mount
What information to append to the Disk subtitle.
.IP
\&'name' shows the disk's name (sda1, sda2, etc)
.IP
\&'mount' shows the disk's mount point (/, \fI\,/mnt/Local\/\fP Disk, etc)
.TP
\fB\-\-ip_host\fR url \fB\-\-ip_host\fR url
URL to query for public IP URL to query for public IP
.TP .TP