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.
#
# 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"

View File

@ -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
@ -3853,12 +3857,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.

View File

@ -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