Merge pull request #688 from dylanaraps/disk_dir

Disk: Add new option to only show dir name in subtitle.
This commit is contained in:
Dylan Araps 2017-04-04 08:54:11 +10:00 committed by GitHub
commit cedc3846d1
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
@ -3853,12 +3857,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