From d742d9aa9c2ef3a2463ca030ee00c03ef8708aa6 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 2 Apr 2017 06:58:48 +1000 Subject: [PATCH] Disk: Add new option to only show dir name in subtitle --- config/config | 7 ++++++- neofetch | 9 ++++++++- neofetch.1 | 9 ++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/config/config b/config/config index d1621962..4ffbf027 100644 --- a/config/config +++ b/config/config @@ -328,7 +328,7 @@ disk_show=('/') # What to append to the Disk subtitle. # # Default: 'mount' -# Values: 'mount', 'name' +# Values: 'mount', 'name', 'dir' # Flag: --disk_subtitle # # Example: @@ -337,6 +337,11 @@ disk_show=('/') # # mount: '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" diff --git a/neofetch b/neofetch index 5d480cef..2c2238a0 100755 --- a/neofetch +++ b/neofetch @@ -1806,6 +1806,10 @@ get_disk() { # Subtitle. case "$disk_subtitle" in "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]}" ;; esac @@ -3844,12 +3848,15 @@ INFO: 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) '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 --song_shorthand on/off Print the Artist/Title on separate lines --install_time on/off Enable/Disable showing the time in Install Date output. diff --git a/neofetch.1 b/neofetch.1 index 245cbbb7..30fc4e92 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -1,5 +1,5 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.1. -.TH NEOFETCH "1" "March 2017" "Neofetch 3.0.2" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH NEOFETCH "1" "April 2017" "Neofetch 3.0.2" "User Commands" .SH NAME Neofetch \- A fast, highly customizable system info script .SH SYNOPSIS @@ -99,12 +99,15 @@ Possible values: '/', '/dev/sdXX', '/path/to/mount point' .IP NOTE: Multiple values can be given. (\fB\-\-disk_show\fR '/' '/dev/sdc1') .TP -\fB\-\-disk_subtitle\fR name/mount +\fB\-\-disk_subtitle\fR type What information to append to the Disk subtitle. +Takes: name, mount, dir .IP \&'name' shows the disk's name (sda1, sda2, etc) .IP \&'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 \fB\-\-ip_host\fR url URL to query for public IP