2020-05-17 13:04:07 +00:00
#+title : Neofetch configuration (WIP)
2020-07-16 12:25:18 +00:00
#+setupfile : headers
2020-05-17 13:04:07 +00:00
#+OPTIONS : auto-id:t
#+HTML_HEAD_EXTRA : <meta name="description" content="Phundrak's Neofetch config" />
#+HTML_HEAD_EXTRA : <meta property="og:title" content="Phundrak's Neofetch config" />
#+HTML_HEAD_EXTRA : <meta property="og:description" content="Description of the Neofetch config file of Phundrak" />
#+PROPERTY : header-args :noweb yes :exports code :tangle no :exports none
2020-08-28 22:27:24 +00:00
#+PROPERTY : header-args:sh :tangle ~/.config/neofetch/config.conf :exports code :noweb yes :padline no :mkdir yes :shebang "#!/usr/bin/env sh"
2020-05-17 13:04:07 +00:00
* Introduction
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Introduction-5942aea3
2020-05-17 13:04:07 +00:00
:END:
[[https://github.com/dylanaraps/neofetch ][Neofetch ]] is a CLI utility used to display system information. It was written
in Bash, and thus its configuration file is written as a Bash script too. This
document was written with org-mode, and my configuration file is tangled from
2020-08-28 22:27:24 +00:00
the source blocks you will see below to ~~/.config/neofetch/config.conf~ .
This configuration will only contain what I need. For any further information,
please refer to the [[https://github.com/dylanaraps/neofetch ][original repository ]] and [[https://github.com/dylanaraps/neofetch/wiki/Customizing-Info ][its documentation ]].
2020-05-17 13:04:07 +00:00
* The ~print_info~ functions
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: The_print_info_functions-bb30763f
2020-05-17 13:04:07 +00:00
:END:
The ~print_info~ function is the function called by Neofetch in order to print
the system information it could fetch. In this function, we’ ll choose what to
display, and how. This function looks like this:
2020-08-28 22:27:24 +00:00
#+BEGIN_SRC sh :tangle no
2020-05-17 13:04:07 +00:00
print_info() {
# Print information here…
}
#+END_SRC
Generally, what we will display will be shown through the ~info~ function,
redefined inside Neofetch (this is not ~info(1)~ ). This ~info~ function
accepts one or two arguments. With one argument, such as with ~info memory~ ,
we can get a result that looks like ~5136MiB / 15873MiB~ , while calling it
with two arguments will treat the first one as a prefix and the second one as
the interesting information; ~info "Memory" memory~ will look like
~Memory: 5136MiB / 15873MiB~ . Here is what we want to display:
#+NAME: info-elements-table
2020-08-28 22:27:24 +00:00
| Prefix | Information | What it does |
|----------+-------------+-----------------------------------|
| | title | Username and hostname |
| | line_break | Insert a blank line |
| | cols | System theme |
| | line_break | Insert a blank line |
| OS | distro | Distribution name |
| Kernel | kernel | Kernel version |
| Uptime | uptime | Machine uptime |
| Packages | packages | Number of installed packages |
| Shell | shell | User’ s default shell |
| WM | wm | User’ s Window Manager |
| Terminal | term | Default terminal |
| CPU | cpu | CPU information |
| GPU | gpu | GPU information |
| Memory | memory | RAM information |
2020-05-17 13:04:07 +00:00
#+NAME: info-elements-gen
#+BEGIN_SRC emacs-lisp :var table=info-elements-table :cache yes
(mapconcat (lambda (x)
(format "info %s%s"
(if (not (string= (car x) ""))
(format "\"%s\" " (car x))
"")
(cadr x)))
table
"\n")
#+END_SRC
2020-08-28 22:27:24 +00:00
#+RESULTS[1e66bf48472ad24006f0cb9dc9c86078764ba84e]: info-elements-gen
2020-05-17 13:04:07 +00:00
#+begin_example
info line_break
info title
info line_break
info cols
info line_break
info "OS" distro
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "WM" wm
info "Terminal" term
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
2020-08-28 22:27:24 +00:00
info "Disks" disks
2020-05-17 13:04:07 +00:00
#+end_example
Hence, the function looks like so:
#+BEGIN_SRC sh
print_info() {
<<info-elements-gen() >>
}
#+END_SRC
Each of these modules can be tuned with the variables presented below.
* Information settings
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-9d4cfe88
2020-05-17 13:04:07 +00:00
:END:
Each of the following variable tunes a function that can be called in
~print_info~ described above. It is possible to tune them by modifying this
document or the configuration file itself, and they can be overridden by the
command line with flags passed to ~neofetch~ . I will divide these variables in
two main categories: hardware and software-related properties.
** Software
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-59f4cb0f
2020-05-17 13:04:07 +00:00
:END:
*** OS
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-OS-67908fc4
2020-05-17 13:04:07 +00:00
:END:
2020-08-28 22:27:24 +00:00
**** Distro
2020-05-17 13:04:07 +00:00
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-OS-Distro-cd12bc4f
2020-05-17 13:04:07 +00:00
:END:
2020-08-28 22:27:24 +00:00
This variable can shorten the output of the ~distro~ function.
2020-05-17 13:04:07 +00:00
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--distro_shorthand~
- Supports :: Everything except Windows and Haiku
2020-05-17 13:04:07 +00:00
- Examples ::
2020-08-28 22:27:24 +00:00
- on :: ~Arch Linux~
- off :: ~Arch~
2020-05-17 13:04:07 +00:00
#+begin_src sh
2020-08-28 22:27:24 +00:00
distro_shorthand="off"
2020-05-17 13:04:07 +00:00
#+end_src
2020-08-28 22:27:24 +00:00
It is possible to display when the distro has been installed on the computer.
**** Kernel
2020-05-17 13:04:07 +00:00
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-OS-Kernel-658cedce
2020-05-17 13:04:07 +00:00
:END:
2020-08-28 22:27:24 +00:00
The variable below can shorten the output ofh the ~kernel~ function.
2020-05-17 13:04:07 +00:00
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--kernel_shorthand~
- Supports :: Everything except *BSDs (except PacBSD and PC-BSD)
2020-05-17 13:04:07 +00:00
- Examples ::
2020-08-28 22:27:24 +00:00
- on :: ~4.8.9-1-ARCH~
- off :: ~Linux 4.8.9-1-ARCH~
2020-05-17 13:04:07 +00:00
#+begin_src sh
2020-08-28 22:27:24 +00:00
kernel_shorthand="off"
2020-05-17 13:04:07 +00:00
#+end_src
**** OS Architecture
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-OS-OS_Architecture-2f60c93c
2020-05-17 13:04:07 +00:00
:END:
This variable can show or hide the OS architecture in the ~distro~ output.
- Default value :: ~"off"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--os_arch~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~Arch Linux x86_64~
- off :: ~Arch Linux~
#+begin_src sh
os_arch="off"
#+end_src
2020-08-28 22:27:24 +00:00
**** Packages
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-OS-Packages-f836a58d
:END:
It is possible to show or hide Package Manager names.
- Default :: ~'tiny'~
- Values :: ~'on'~ / ~'tiny'~ / ~'off'~
- Flag :: ~--package_managers~
- Example ::
- on :: ~'998 (pacman), 8 (flatpak), 4 (snap)'~
- tiny :: ~'908 (pacman, flatpak, snap)'~
- off :: ~'908'~
#+BEGIN_SRC sh
package_managers="on"
#+END_SRC
**** Shell
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Shell-76439406
:END:
***** Shell path
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Shell-Shell_path-9eda636d
:END:
This allows to show either the path of the user’ s shell, or simply its
name.
- Default value :: ~"off"~
- Values ::
- ~"on"~
- ~"off"~
- Flag :: ~--shell_path~
- Examples ::
- on :: ~/bin/bash~
- off :: ~bash~
#+begin_src sh
shell_path="off"
#+end_src
***** Shell version
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Shell-Shell_version-03964bb3
:END:
This allows to show the shell’ s version in the output of ~shell~ .
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
- Flag :: ~--shell_version~
- Examples ::
- on :: ~bash 4.4.5~
- off :: ~bash~
#+begin_src sh
shell_version="off"
#+end_src
*** Uptime
2020-05-17 13:04:07 +00:00
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-Uptime-a7b5361a
2020-05-17 13:04:07 +00:00
:END:
This variable can shorten the output of the ~uptime~ function. ~on~ shortens
it a bit, while ~tiny~ shortens it greatly.
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"tiny"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--uptime_shorthand~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~2 days, 10 hours, 3 mins~
- off :: ~2 days, 10 hours, 3 minutes~
- tiny :: ~2d 10h 3m~
#+begin_src sh
uptime_shorthand="on"
#+end_src
2020-08-28 22:27:24 +00:00
*** IP address
2020-05-17 13:04:07 +00:00
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-IP_address-26df5e1d
2020-05-17 13:04:07 +00:00
:END:
2020-08-28 22:27:24 +00:00
It is possible to display the machine’ s public IP address with the function
~ip~ . The value below allows the user to change the website used to fetch
it.
- Default value :: ~"http://ident.me"~
- Value :: ~"url"~
- Flag :: ~--ip_host~
2020-05-17 13:04:07 +00:00
#+begin_src sh
2020-08-28 22:27:24 +00:00
public_ip_host="http://ident.me"
2020-05-17 13:04:07 +00:00
#+end_src
2020-08-28 22:27:24 +00:00
- Default value :: ~""~
2020-05-17 13:04:07 +00:00
- Values ::
2020-08-28 22:27:24 +00:00
- ~""~
- ~""~
- Flag :: ~""~
- Supports ::
2020-05-17 13:04:07 +00:00
- Examples ::
2020-08-28 22:27:24 +00:00
- on :: ~~
- off :: ~~
2020-05-17 13:04:07 +00:00
#+begin_src sh
#+end_src
*** Theming
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-Theming-ba7f1ccd
2020-05-17 13:04:07 +00:00
:END:
This section will allow the user to modify what Neofetch can and cannot
display about the machine’ s theming —by this, I mean its GTK theme, its
icons and its default font.
**** Shorten output
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-Theming-Shorten_output-cbef1fa4
2020-05-17 13:04:07 +00:00
:END:
With this value, it is possible to shorten the output of the computer’ s
theming.
- Default value :: ~"off"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--gtk_shorthand~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~Numix, Adwaita~
- off :: ~Numix [GTK2], Adwaita [GTK3]~
#+begin_src sh
gtk_shorthand="on"
#+end_src
**** Enable or disable theming display for GTK2
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-Theming-Enable_or_disable_theming_display_for_GTK2-f4398571
2020-05-17 13:04:07 +00:00
:END:
It is possible to explicitely show or hide the computer’ s theming with GTK2
with this variable.
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--gtk2~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~Numix [GTK2], Adwaita [GTK3]~
- off :: ~Adwaita [GTK3]~
#+begin_src sh
gtk2="off"
#+end_src
**** Enable or disable theming display for GTK3
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Software-Theming-Enable_or_disable_theming_display_for_GTK3-c4070e66
2020-05-17 13:04:07 +00:00
:END:
The same variable as above is also available for GTK3.
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--gtk3~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~Numix [GTK2], Adwaita [GTK3]~
- off :: ~Numix [GTK2]~
#+begin_src sh
#+end_src
** Hardware
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-de7ed990
2020-05-17 13:04:07 +00:00
:END:
*** CPU
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-eb0bcd7d
2020-05-17 13:04:07 +00:00
:END:
**** CPU brand
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_brand-5b25776b
2020-05-17 13:04:07 +00:00
:END:
With this variables, it is possible to show or hide the brand of a CPU in
the ~cpu~ output.
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--cpu_brand~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~Intel i7-6500U~
- off :: ~i7-6500U~
#+begin_src sh
cpu_brand="off"
#+end_src
**** CPU speed
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_speed-2bf6e5f7
2020-05-17 13:04:07 +00:00
:END:
With this variable, it is possible to show or hide the speed of the CPU.
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--cpu_speed~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~Intel i7-6500U (4) @ 3.1GHz~
- off :: ~Intel i7-6500U (4)~
#+begin_src sh
cpu_speed="off"
#+end_src
**** CPU speed type
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_speed_type-a24de48f
2020-05-17 13:04:07 +00:00
:END:
This allows Neofetch to know what type of speed it has to fetch regarding
the machine’ s CPU. Any file in ~/sys/devices/system/cpu/cpu0/cpufreq~ can
be used as a value.
- Default value :: ~"bios_limit"~
- Values ::
- ~"scaling_cur_freq"~
- ~"scaling_min_freq"~
- ~"scaling_max_freq"~
- ~"bios_limit"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--speed_type~
2020-05-17 13:04:07 +00:00
- Supports :: Linux with ~cpufreq~
#+begin_src sh
speed_type="bios_limit"
#+end_src
**** CPU speed shorthand
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_speed_shorthand-0d15fe08
2020-05-17 13:04:07 +00:00
:END:
This value allows to show sorter CPU speed with less digits. This flag is
not supported in systems with CPU speed below 1GHz.
- Default value :: ~"off"~
- Values ::
- ~"on"~
- ~"on"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--speed_shorthand~
2020-05-17 13:04:07 +00:00
- Examples ::
- on :: ~i7-6500U (4) @ 3.1GHz~
- off :: ~i7-6500U (4) @ 3.100GHz~
#+begin_src sh
speed_shorthand="on"
#+end_src
**** CPU cores
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_cores-30177354
2020-05-17 13:04:07 +00:00
:END:
With this variable, it is possible to display the number of cores that are
available in the CPU.
- Default value :: ~"logical"~
- Values ::
- ~"logical"~
- ~"physical"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--cpu_cores~
2020-05-17 13:04:07 +00:00
- Supports :: ~physical~ does not work on BSD.
- Examples ::
- logical :: ~Intel i7-6500U (4) @ 3.1GHz~ (All virtual cores)
- physical :: ~Intel i7-6500U (2) @ 3.1GHz~ (All physical cores)
- off :: ~Intel i7-6500U @ 3.1GHz~
#+begin_src sh
cpu_cores="off"
#+end_src
**** CPU temperature
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_temperature-a22e522c
2020-05-17 13:04:07 +00:00
:END:
This variable allows the user to hide or show the CPU’ s temperature, and if
shown, the user can display it in Celcius or Farenheit degrees. For FreeBSD
and NetBSD-based systems, you’ ll need to enable the ~coretemp~ kernel
module. This only supports newer Intel processors.
- Default value :: ~"off"~
- Values ::
- ~"C"~
- ~"F"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--cpu_temp~
2020-05-17 13:04:07 +00:00
- Supports :: Linux, BSD
- Examples ::
- C :: ~Intel i7-6500U (4) @ 3.1GHz [27.2°C]~
- F :: ~Intel i7-6500U (4) @ 3.1GHz [82.0°F]~
- off :: ~Intel i7-6500U (4) @ 3.1GHz~
#+begin_src sh
cpu_temp="off"
#+end_src
*** GPU
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-GPU-2c842575
2020-05-17 13:04:07 +00:00
:END:
The function responsible for displaying information regarding the GPUs is
~gpu~ . It will try to list all available GPUs and display what it knows
about them.
**** GPU brand
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-GPU-GPU_brand-6e2da615
2020-05-17 13:04:07 +00:00
:END:
This value allows the user to hide or show the brand of their GPU in the
output of ~gpu~ .
- Default value :: ~"on"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--gpu_brand~
2020-05-17 13:04:07 +00:00
- Supports ::
- Examples ::
- on :: ~AMD HD 7950~
- off :: ~HD 7950~
#+begin_src sh
gpu_brand="off"
#+end_src
**** Which GPU to display
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-GPU-Which_GPU_to_display-f40d3aac
2020-05-17 13:04:07 +00:00
:END:
This allows the user to choose which GPU appears in the output of the
function ~gpu~ .
- Default value :: ~"all"~
- Values ::
- ~"all"~
- ~"dedicated"~
- ~"integrated"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--gpu_type~
2020-05-17 13:04:07 +00:00
- Supports :: Linux
- Examples ::
- all ::
#+BEGIN_SRC text
GPU1: AMD HD 7950
GPU2: Intel Integrated Graphics
#+END_SRC
- dedicated :: ~GPU1: AMD HD 7950~
- integrated :: ~GPU1: Intel Integrated Graphics~
#+begin_src sh
gpu_type="all"
#+end_src
*** Resolution
:PROPERTIES:
2020-08-28 22:27:24 +00:00
:CUSTOM_ID: Information_settings-Hardware-Resolution-b768f865
2020-05-17 13:04:07 +00:00
:END:
This will try to list all the connected screens and display their resolution
individually. It is possible to display the refresh rate or to hide it.
- Default value :: ~"off"~
- Values ::
- ~"on"~
- ~"off"~
2020-08-28 22:27:24 +00:00
- Flag :: ~--refresh_rate~
2020-05-17 13:04:07 +00:00
- Supports :: Does not work on Windows
- Examples ::
- on :: ~1920x1080 @ 60Hz~
- off :: ~1920x1080~
#+begin_src sh
refresh_rate="off"
#+end_src