Disk: Add new option to only show dir name in subtitle

This commit is contained in:
Dylan Araps 2017-04-02 06:58:48 +10:00
parent e562e73387
commit d742d9aa9c
3 changed files with 20 additions and 5 deletions

View File

@ -328,7 +328,7 @@ disk_show=('/')
# What to append to the Disk subtitle. # What to append to the Disk subtitle.
# #
# Default: 'mount' # Default: 'mount'
# Values: 'mount', 'name' # Values: 'mount', 'name', 'dir'
# Flag: --disk_subtitle # Flag: --disk_subtitle
# #
# Example: # Example:
@ -337,6 +337,11 @@ disk_show=('/')
# #
# mount: 'Disk (/): 74G / 118G (66%)' # mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' # 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
#
# dir: 'Disk (/): 74G / 118G (66%)'
# 'Disk (Local Disk): 74G / 118G (66%)'
# 'Disk (Videos): 74G / 118G (66%)'
disk_subtitle="mount" disk_subtitle="mount"

View File

@ -1806,6 +1806,10 @@ get_disk() {
# Subtitle. # Subtitle.
case "$disk_subtitle" in case "$disk_subtitle" in
"name") disk_sub="${disk_info[0]}" ;; "name") disk_sub="${disk_info[0]}" ;;
"dir")
disk_sub="${disk_info[5]/*\/}"
[[ -z "$disk_sub" ]] && disk_sub="${disk_info[5]}"
;;
*) disk_sub="${disk_info[5]}" ;; *) disk_sub="${disk_info[5]}" ;;
esac esac
@ -3844,12 +3848,15 @@ INFO:
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. --disk_subtitle type What information to append to the Disk subtitle.
Takes: name, mount, dir
'name' shows the disk's name (sda1, sda2, etc) 'name' shows the disk's name (sda1, sda2, etc)
'mount' shows the disk's mount point (/, /mnt/Local Disk, etc) 'mount' shows the disk's mount point (/, /mnt/Local Disk, etc)
'dir' shows the basename of the disks's path. (/, 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.

View File

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.1. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
.TH NEOFETCH "1" "March 2017" "Neofetch 3.0.2" "User Commands" .TH NEOFETCH "1" "April 2017" "Neofetch 3.0.2" "User Commands"
.SH NAME .SH NAME
Neofetch \- A fast, highly customizable system info script Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS .SH SYNOPSIS
@ -99,12 +99,15 @@ Possible values: '/', '/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 \fB\-\-disk_subtitle\fR type
What information to append to the Disk subtitle. What information to append to the Disk subtitle.
Takes: name, mount, dir
.IP .IP
\&'name' shows the disk's name (sda1, sda2, etc) \&'name' shows the disk's name (sda1, sda2, etc)
.IP .IP
\&'mount' shows the disk's mount point (/, \fI\,/mnt/Local\/\fP Disk, etc) \&'mount' shows the disk's mount point (/, \fI\,/mnt/Local\/\fP Disk, etc)
.IP
\&'dir' shows the basename of the disks's path. (/, Local Disk, etc)
.TP .TP
\fB\-\-ip_host\fR url \fB\-\-ip_host\fR url
URL to query for public IP URL to query for public IP