2020-01-30 11:33:19 +00:00
|
|
|
|
# -*- org-confirm-babel-evaluate: nil -*-
|
2020-05-17 13:04:07 +00:00
|
|
|
|
#+TITLE: Fish config
|
2020-07-16 12:25:18 +00:00
|
|
|
|
#+setupfile: headers
|
2020-01-15 11:38:29 +00:00
|
|
|
|
#+OPTIONS: auto-id:t
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's fish config" />
|
|
|
|
|
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's fish config" />
|
|
|
|
|
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the fish config file of Phundrak" />
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+PROPERTY: header-args:fish :tangle ~/.config/fish/config.fish :exports code :noweb yes
|
2020-01-30 11:33:19 +00:00
|
|
|
|
#+PROPERTY: header-args :exports code :tangle no
|
2020-03-15 11:24:46 +00:00
|
|
|
|
#+STARTUP: content
|
2019-10-23 11:02:59 +00:00
|
|
|
|
|
2020-06-07 15:36:02 +00:00
|
|
|
|
* Table of Contents :TOC:noexport:
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Table_of_Contents-06250a87
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
|
|
|
|
- [[#presentation][Presentation]]
|
2019-10-23 13:25:35 +00:00
|
|
|
|
- [[#fish-from-within-emacs][Fish from within Emacs]]
|
|
|
|
|
- [[#tramp-remote-access][Tramp remote access]]
|
|
|
|
|
- [[#regular-fish-shell-appearance][Regular fish shell appearance]]
|
|
|
|
|
- [[#global-variables][Global variables]]
|
2020-05-17 13:04:07 +00:00
|
|
|
|
- [[#development][Development]]
|
|
|
|
|
- [[#path][$PATH]]
|
2019-10-23 13:25:35 +00:00
|
|
|
|
- [[#abbreviations][Abbreviations]]
|
|
|
|
|
- [[#system-monitoring][System monitoring]]
|
|
|
|
|
- [[#system-management-packages-and-services][System management (packages and services)]]
|
2020-02-24 18:52:13 +00:00
|
|
|
|
- [[#package-management][Package management]]
|
2019-10-23 13:25:35 +00:00
|
|
|
|
- [[#service-management][Service management]]
|
2020-05-17 13:04:07 +00:00
|
|
|
|
- [[#development-1][Development]]
|
2019-10-23 13:25:35 +00:00
|
|
|
|
- [[#cmake][CMake]]
|
|
|
|
|
- [[#compilation][Compilation]]
|
|
|
|
|
- [[#docker][Docker]]
|
|
|
|
|
- [[#git][Git]]
|
|
|
|
|
- [[#prolog][Prolog]]
|
|
|
|
|
- [[#text-editors][Text editors]]
|
|
|
|
|
- [[#latex][LaTeX]]
|
|
|
|
|
- [[#some-security-measures][Some security measures]]
|
|
|
|
|
- [[#typos][Typos]]
|
|
|
|
|
- [[#misc][Misc]]
|
|
|
|
|
- [[#sudo][Sudo]]
|
|
|
|
|
- [[#exit][Exit]]
|
|
|
|
|
- [[#history][History]]
|
2020-01-15 11:38:29 +00:00
|
|
|
|
- [[#youtube-dl-related-commands][~youtube-dl~ related commands]]
|
|
|
|
|
- [[#song-download-from-youtube][Song download from YouTube]]
|
|
|
|
|
- [[#videos-download-from-youtube][Videos download from YouTube]]
|
2019-10-23 13:25:35 +00:00
|
|
|
|
- [[#mpv][MPV]]
|
|
|
|
|
- [[#compression][Compression]]
|
2020-04-06 11:33:23 +00:00
|
|
|
|
- [[#sxiv][Sxiv]]
|
|
|
|
|
- [[#exa][exa]]
|
2019-11-29 20:15:37 +00:00
|
|
|
|
- [[#network-management][Network Management]]
|
2020-02-24 18:52:13 +00:00
|
|
|
|
- [[#nordvpn][NordVPN]]
|
2020-03-15 18:17:46 +00:00
|
|
|
|
- [[#webcam][Webcam]]
|
2019-10-23 13:25:35 +00:00
|
|
|
|
- [[#wget][Wget]]
|
2019-10-23 11:02:59 +00:00
|
|
|
|
|
|
|
|
|
* Presentation
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Presentation-340195eb
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
|
|
|
|
The file present in =~/.config/fish/config.fish= is the configuration file for
|
|
|
|
|
the [[https://fishshell.com/][fish shell]]. It contains custom functions, environment variables and
|
|
|
|
|
abbreviations.
|
|
|
|
|
|
|
|
|
|
Just in case, we might need sometimes to declare the fish function
|
|
|
|
|
=fish_title= as =true=, so let’s do so.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
function fish_title
|
|
|
|
|
true
|
|
|
|
|
end
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
* Fish from within Emacs
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Fish_from_within_Emacs-360c0a74
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
I sometimes call fish from within emacs, with =M-x ansi-term=. In this case,
|
|
|
|
|
the variable =TERM= needs to have the value =eterm-color=.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
if test -n "$EMACS"
|
|
|
|
|
set -x TERM eterm-color
|
|
|
|
|
end
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
* Tramp remote access
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Tramp_remote_access-72aedec2
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
When accessing from a remote machine our computer from Emacs, tramp needs a
|
|
|
|
|
precise shell appearance: a simple =$= followed by a space after which to put
|
|
|
|
|
the commands it needs to execute, and nothing else. Due to this, let’s
|
|
|
|
|
deactivate and redefine some of the functions defining the appearance of
|
|
|
|
|
fish.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
if test "$TERM" = "dumb"
|
|
|
|
|
function fish_prompt
|
|
|
|
|
echo "\$ "
|
|
|
|
|
end
|
|
|
|
|
function fish_right_prompt; end
|
|
|
|
|
function fish_greeting; end
|
|
|
|
|
function fish_title; end
|
|
|
|
|
end
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
* Regular fish shell appearance
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Regular_fish_shell_appearance-c3e532e1
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
2020-04-06 11:34:27 +00:00
|
|
|
|
Now, there is only one function I modify when it comes to the appearance of
|
|
|
|
|
fish when I’m the one using it: the ~fish_greeting~ function. I use it to give
|
|
|
|
|
me an overview of my computer’s status, including its hostname, uptime, disks
|
|
|
|
|
usage, ram usage, swap usage, and networking.
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-04-06 11:34:27 +00:00
|
|
|
|
set RED '\033[0;31m'
|
|
|
|
|
set GREEN '\033[0;32m'
|
|
|
|
|
set NC '\033[0m'
|
|
|
|
|
|
|
|
|
|
function display_slider # used total
|
2020-05-28 09:57:14 +00:00
|
|
|
|
set -l slider_length 38
|
2020-04-09 10:59:03 +00:00
|
|
|
|
set -l used $argv[1]
|
|
|
|
|
set -l total $argv[2]
|
|
|
|
|
set -l used_slider (math -s0 "($used * $slider_length) / $total")
|
|
|
|
|
set -l unused_slider (math -s0 "$slider_length - $used_slider")
|
|
|
|
|
echo -en "["
|
|
|
|
|
echo -en $RED
|
|
|
|
|
echo -en (string repeat -n $used_slider '=')
|
|
|
|
|
echo -en $GREEN
|
|
|
|
|
echo -en (string repeat -n $unused_slider '=')
|
|
|
|
|
echo -en $NC
|
|
|
|
|
echo -en "]"
|
2020-04-06 11:34:27 +00:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function fish_greeting
|
2020-04-09 10:59:03 +00:00
|
|
|
|
set -l ruler_length 79
|
|
|
|
|
set -l ruler (string repeat -n $ruler_length "=")
|
|
|
|
|
|
|
|
|
|
set -l osname (cat /etc/os-release | grep -i pretty_name | sed 's/.*"\(.*\)".*/\1/')
|
2020-07-11 16:14:49 +00:00
|
|
|
|
set -l uptime (uptime | sed 's/up \(.*\)/\1/')
|
2020-04-09 10:59:03 +00:00
|
|
|
|
|
|
|
|
|
set -l root (df -Ph | grep -E "/\$")
|
|
|
|
|
set -l root_p (echo $root | awk '{print $5}' | tr -d '%')
|
|
|
|
|
set -l root_used (echo $root | awk '{print $3}')
|
|
|
|
|
set -l root_total (echo $root | awk '{print $2}')
|
|
|
|
|
|
|
|
|
|
set -l ram (free -tm | grep Mem)
|
|
|
|
|
set -l ram_total (echo $ram | awk '{print $2}')
|
|
|
|
|
set -l ram_used (echo $ram | awk '{print $3}')
|
|
|
|
|
set -l ram_p (math -s0 "$ram_used / $ram_total * 100")
|
|
|
|
|
|
|
|
|
|
set -l swap (free -tm | grep Swap)
|
|
|
|
|
set -l swap_total (echo $swap | awk '{print $2}')
|
|
|
|
|
set -l swap_used (echo $swap | awk '{print $3}')
|
|
|
|
|
set -l swap_p (math -s0 "$swap_used / $swap_total * 100")
|
|
|
|
|
|
|
|
|
|
set -l connections (nmcli c s | grep -E "wifi|ethernet" | grep -v '\-\-')
|
|
|
|
|
set -l wifi (echo $connections | grep "wifi" | awk '{print $1}')
|
|
|
|
|
set -l ethernet (test "$connections" = "*ethernet*" && echo -e $GREEN"UP"$NC || echo -e $RED"DOWN"$NC)
|
|
|
|
|
set -l wifi (test -n wifi && echo -e $GREEN$wifi$NC || echo - $RED"DOWN"$NC)
|
|
|
|
|
|
|
|
|
|
echo $ruler
|
|
|
|
|
printf "OS......: %-30sKernel: %s %s\n" $osname (uname -s) (uname -r)
|
|
|
|
|
printf "Hostname: %-30sUptime: %s\n" (hostname) $uptime
|
|
|
|
|
printf "Ethernet: %-41sWifi..: %s\n" $ethernet $wifi
|
2020-05-28 09:57:14 +00:00
|
|
|
|
printf "Disks...: %-6s %s %6s / %6s (%2d%%)\n" "/" (display_slider $root_p 100) $root_used $root_total $root_p
|
2020-04-09 10:59:03 +00:00
|
|
|
|
|
|
|
|
|
# loop other mountpoints
|
|
|
|
|
for mp in (df -Ph 2> /dev/null | egrep "sd|tank" | egrep -v "boot|/\$")
|
|
|
|
|
set -l mp_p (echo $mp | awk '{print $5}' | tr -d '%')
|
|
|
|
|
set -l mp_used (echo $mp | awk '{print $3}')
|
|
|
|
|
set -l mp_total (echo $mp | awk '{print $2}')
|
|
|
|
|
set -l mp_name (echo $mp | awk '{print $6}')
|
2020-05-28 09:57:14 +00:00
|
|
|
|
printf " %-6s %s %6s / %6s (%2d%%)\n" $mp_name (display_slider $mp_p 100) $mp_used $mp_total $mp_p
|
2020-04-09 10:59:03 +00:00
|
|
|
|
end
|
|
|
|
|
|
2020-05-28 09:57:14 +00:00
|
|
|
|
printf "Ram.....: %s %5dM / %5dM (%2d%%)\n" (display_slider $ram_used $ram_total) $ram_used $ram_total $ram_p
|
|
|
|
|
printf "Swap....: %s %5dM / %5dM (%2d%%)\n" (display_slider $swap_used $swap_total) $swap_used $swap_total $swap_p
|
2020-04-09 10:59:03 +00:00
|
|
|
|
echo $ruler
|
2020-04-06 11:34:27 +00:00
|
|
|
|
end
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
* Global variables
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Global_variables-1c84df8b
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
|
2020-03-25 11:33:19 +00:00
|
|
|
|
In order to keep some other code clean, I set the ~$BROWSER~ variable so I
|
|
|
|
|
don’t have to call my web browser directly but rather with this variable.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx BROWSER firefox
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it
|
|
|
|
|
can get the sudo password. So, let’s declare it.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx SUDO_ASKPASS ~/.local/bin/askpass
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-05-17 13:04:07 +00:00
|
|
|
|
** Development
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Global_variables-Development-76b3ff13
|
2020-05-17 13:04:07 +00:00
|
|
|
|
:END:
|
|
|
|
|
Now, let’s declare our editor of choice, EmacsClient; not Emacs itself since
|
|
|
|
|
it will most often be just quick edits, nothing too heavy, if it is called
|
|
|
|
|
from the =EDITOR= variable (from Git, for example).
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx EDITOR emacsclient -c
|
|
|
|
|
#+END_SRC
|
2019-10-23 11:02:59 +00:00
|
|
|
|
|
2020-05-17 13:04:07 +00:00
|
|
|
|
We also need to set the path to the Dart SDK.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx DART_SDK /opt/dart-sdk/bin
|
|
|
|
|
#+END_SRC
|
2019-11-23 16:55:52 +00:00
|
|
|
|
|
2020-05-17 13:04:07 +00:00
|
|
|
|
And we also need to specify where the Android SDK it located.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx ANDROID_HOME $HOME/Android/Sdk
|
|
|
|
|
#+END_SRC
|
2019-11-23 16:55:52 +00:00
|
|
|
|
|
2020-07-11 16:14:49 +00:00
|
|
|
|
Still related to Dart and Flutter development,
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx CHROME_EXECUTABLE /usr/bin/chromium
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-05-17 13:04:07 +00:00
|
|
|
|
Next, we have two variables from Deno, the Node.js destroyer. Its base
|
|
|
|
|
directory will be set in my XDG config directory, and its binaries will be
|
|
|
|
|
located in my local binaries directory (see below).
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx DENO_DIR $HOME/.config/deno
|
|
|
|
|
set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
Finally, some development packages require the =PKG_CONFIG_PATH= to be set,
|
|
|
|
|
so let’s do so.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** $PATH
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Global_variables-$PATH-e1320303
|
2020-05-17 13:04:07 +00:00
|
|
|
|
:END:
|
|
|
|
|
Some global variables might sometimes be needed and need to be modified. This
|
2020-05-28 09:57:41 +00:00
|
|
|
|
is for example the case with my ~PATH~ variable in which I add Rust’s Cargo’s
|
2020-05-17 13:04:07 +00:00
|
|
|
|
binaries, Go’s binaries and my own executables. And of course, don’t forget
|
2020-05-28 09:57:41 +00:00
|
|
|
|
to add the already existing ~PATH~.
|
2020-05-17 13:04:07 +00:00
|
|
|
|
|
|
|
|
|
#+NAME: extra-paths
|
|
|
|
|
| additional path | what it leads to |
|
|
|
|
|
|---------------------------+--------------------------------------|
|
|
|
|
|
| $HOME/.pub-cache/bin | Dart binaries and executables |
|
|
|
|
|
| $HOME/.local/bin | Custom executables, see [[file:bin.org]] |
|
|
|
|
|
| $HOME/go/bin | Go binaries and executables |
|
|
|
|
|
| $HOME/.cargo/bin | Rust binaries and executables |
|
|
|
|
|
| $HOME/.gem/ruby/2.6.0/bin | Ruby binaries and executables |
|
|
|
|
|
| $HOME/.cabal/bin | Haskel binaries |
|
|
|
|
|
|
|
|
|
|
#+NAME: generate-extra-paths
|
|
|
|
|
#+BEGIN_SRC emacs-lisp :var paths=extra-paths[,0] :exports none :cache yes
|
|
|
|
|
(mapconcat (lambda (x) x)
|
|
|
|
|
paths " ")
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-05-28 09:57:41 +00:00
|
|
|
|
#+RESULTS[f1fff053cb9e2239f35571249763683a4a62e643]: generate-extra-paths
|
|
|
|
|
: $HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin $HOME/.gem/ruby/2.6.0/bin $HOME/.cabal/bin
|
2020-05-17 13:04:07 +00:00
|
|
|
|
|
2020-05-28 09:57:41 +00:00
|
|
|
|
The code below ensures the ~PATH~ is updated only at login, and every
|
|
|
|
|
location is addded only once.
|
2020-05-17 13:04:07 +00:00
|
|
|
|
#+BEGIN_SRC fish :noweb yes
|
2020-05-28 09:57:41 +00:00
|
|
|
|
for p in <<generate-extra-paths()>>
|
|
|
|
|
if status is-login
|
|
|
|
|
contains $p $PATH || set PATH $PATH $p
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-05-17 13:04:07 +00:00
|
|
|
|
#+END_SRC
|
2019-10-23 13:25:35 +00:00
|
|
|
|
|
|
|
|
|
* Abbreviations
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-97537716
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: generate-abbr
|
2020-03-15 11:24:46 +00:00
|
|
|
|
#+BEGIN_SRC emacs-lisp :var table=[] :exports none :tangle no
|
|
|
|
|
(replace-regexp-in-string "\\\\vert[{}]*"
|
|
|
|
|
"|"
|
|
|
|
|
(mapconcat (lambda (x) (format "abbr %s '%s'" (car x) (cadr x)))
|
|
|
|
|
table
|
|
|
|
|
"\n")
|
|
|
|
|
t t)
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
** System monitoring
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-System_monitoring-bd909755
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2020-02-24 18:52:13 +00:00
|
|
|
|
Here I have some abbreviations which are quite useful when performing some
|
|
|
|
|
system monitoring. With =df=, we can get an overview of our filesystem usage,
|
|
|
|
|
while with =diskspace= we get some more precise information. =meminfo= is a
|
|
|
|
|
call to =free= with sane defaults, and similar to =meminfo=, we also have
|
|
|
|
|
=gpumeminfo= so we can get a quick look at the memory-related logs of our X
|
|
|
|
|
session. I also declared =cpuinfo= an alias of =lscpu= in order to keep
|
|
|
|
|
consistent with =meminfo=. =pscpu= gives us information on what the CPU is
|
|
|
|
|
running right now, and =pscpu10= limits that to the top 10 threads.
|
|
|
|
|
Similarly, =psmem= gives us information on the memory usage of the current
|
|
|
|
|
threads, and =psmem10= only the ten most important threads in terms of memory
|
|
|
|
|
usage.
|
|
|
|
|
#+NAME: mgmt-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+---------------------------------------------------|
|
|
|
|
|
| df | df -H |
|
|
|
|
|
| diskspace | sudo df -h \vert grep -E "sd\vert{}lv\vert{}Size" |
|
2020-04-11 18:27:46 +00:00
|
|
|
|
| du | du -ch |
|
2020-02-24 18:52:13 +00:00
|
|
|
|
| meminfo | free -m -l -t |
|
|
|
|
|
| gpumeminfo | grep -i --color memory /var/log/Xorg.0.log |
|
|
|
|
|
| cpuinfo | lscpu |
|
|
|
|
|
| pscpu | ps auxf \vert sort -nr -k 3 |
|
|
|
|
|
| pscpu10 | ps auxf \vert sort -nr -k 3 \vert head -10 |
|
|
|
|
|
| psmem | ps auxf \vert sort -nr -k 4 |
|
|
|
|
|
| psmem10 | ps auxf \vert sort -nr -k 4 \vert head -10 |
|
|
|
|
|
|
|
|
|
|
#+begin_SRC fish
|
|
|
|
|
<<generate-abbr(table=mgmt-abbr)>>
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
** System management (packages and services)
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-System_management_(packages_and_services)-7249fbb7
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
I added some of these abbreviations due to how often I have to write the
|
|
|
|
|
whole thing.
|
|
|
|
|
|
2020-02-24 18:52:13 +00:00
|
|
|
|
*** Package management
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-System_management_(packages_and_services)-Package_management-efbcdf0f
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2020-02-24 18:52:13 +00:00
|
|
|
|
The first command is =remove= which removes a package from my system, as
|
|
|
|
|
well as its dependencies no longer needed. =p=. =pacman='s or =yay='s. This
|
|
|
|
|
is why I simply type =purge=. And if I want to simply seach among the
|
|
|
|
|
=pacman= repos, I can type =search=. Otherwise, if I want to include AUR
|
|
|
|
|
results, I’ll use =yay=.
|
|
|
|
|
|
|
|
|
|
#+NAME: pm-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+--------------------|
|
|
|
|
|
| remove | sudo pacman -Rscnd |
|
|
|
|
|
| p | sudo pacman |
|
|
|
|
|
| purge | yay -Sc |
|
|
|
|
|
| search | yay -Ss |
|
2019-10-23 11:02:59 +00:00
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=pm-abbr)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
*** Service management
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-System_management_(packages_and_services)-Service_management-8c5ae482
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
I don’t have the muscle memory of =systemctl=. So instead, I simply type
|
|
|
|
|
=c= when I want to do something user service related.
|
|
|
|
|
And if I want to manipulate system services, I can instead type a simple
|
|
|
|
|
capital =S=.
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: service-abbr
|
2020-04-11 18:27:46 +00:00
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+-----------|
|
|
|
|
|
| s | systemctl |
|
2020-02-24 18:52:13 +00:00
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=service-abbr)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Development
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-d6050ca4
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
A good amount of these commands are development related, especially when it
|
|
|
|
|
comes to compilation or Docker.
|
|
|
|
|
|
|
|
|
|
*** CMake
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-CMake-f2951675
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
I have the following abbreviations so I can quickly run CMake and create a
|
|
|
|
|
configuration for debug or release profiles.
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: abbr-cmake
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+----------------------------------|
|
|
|
|
|
| cdebug | cmake -DCMAKE_BUILD_TYPE=Debug |
|
|
|
|
|
| crelease | cmake -DCMAKE_BUILD_TYPE=Release |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=abbr-cmake)>>
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
*** Compilation
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-Compilation-dd066050
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
By default, I set =clang=, =clang++=, =gcc= and =g++= to the latest
|
|
|
|
|
standard and with the =-Wall= flag activated.
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: abbr-comp
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+----------------------|
|
|
|
|
|
| clang | clang -Wall |
|
|
|
|
|
| clang++ | clang++ -Wall |
|
2020-05-17 13:04:07 +00:00
|
|
|
|
| g++ | g++ -Wall -std=c++20 |
|
2020-02-24 18:52:13 +00:00
|
|
|
|
| gcc | gcc -Wall -std=c18 |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish :tangle
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=abbr-comp)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
*** Docker
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-Docker-2d0a1288
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
And of course, when it comes to Docker Compose, I don’t have time to write
|
|
|
|
|
the full command, so I use these instead.
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: abbr-docker
|
2020-04-11 18:27:46 +00:00
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+------------------------------|
|
|
|
|
|
| dc | docker-compose |
|
2020-05-17 13:04:07 +00:00
|
|
|
|
| dcb | docker-compose build |
|
2020-04-11 18:27:46 +00:00
|
|
|
|
| dcd | docker-compose down |
|
2020-05-17 13:04:07 +00:00
|
|
|
|
| dcl | docker-compose logs |
|
2020-04-11 18:27:46 +00:00
|
|
|
|
| dcp | docker-compose pull |
|
|
|
|
|
| dcr | docker-compose run --rm |
|
|
|
|
|
| dcu | docker-compose up |
|
|
|
|
|
| dcub | docker-compose up --build |
|
|
|
|
|
| dcud | docker-compose up -d |
|
|
|
|
|
| dcudb | docker-compose up -d --build |
|
2020-02-24 18:52:13 +00:00
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=abbr-docker)>>
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
*** Git
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-Git-5e5055c1
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
And let’s face it: we all at one point just wanted to commit our code
|
|
|
|
|
without thinking about the message, to just get over with it. Don’t worry,
|
|
|
|
|
I got you covered.
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: abbr-git
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+-----------------------------------------------------|
|
|
|
|
|
| randcommit | git commit -m (curl -s whatthecommit.com/index.txt) |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish :tangle
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=abbr-git)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
*** Prolog
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-Prolog-72c9d2ef
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
When I launch =swipl=, I prefer to have my terminal cleaned before and
|
|
|
|
|
after it runs, I find it more clean.
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: abbr-prolog
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+----------------------------|
|
|
|
|
|
| swipl | clear && swipl -q && clear |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=abbr-prolog)>>
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
*** Text editors
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Development-Text_editors-5a23df47
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2020-02-24 18:52:13 +00:00
|
|
|
|
I greatly prefer to use Emacsclient as my main text editor; Emacs has
|
|
|
|
|
basically all I need. So, it’s only normal I have an abbreviation to launch
|
|
|
|
|
a new instance of it. However, in a graphical environment, this will launch
|
|
|
|
|
a new graphical window of Emacs. To launch a terminal instance, I’ll use
|
|
|
|
|
=enw= (=nw= stands for the option “nowindow” =-nw= of Emacs). I also wish to
|
|
|
|
|
completely stop using other text editors, such as =vi=, =vim=, =nano= and
|
|
|
|
|
=ed=, so let’s all add their command as an abbreviation for Emacs.
|
|
|
|
|
|
|
|
|
|
#+NAME: abbr-text-ed
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+--------------------|
|
|
|
|
|
| e | emacsclient -c |
|
|
|
|
|
| enw | emacsclient -c -nw |
|
|
|
|
|
| vi | emacsclient -c |
|
|
|
|
|
| vim | emacsclient -c |
|
|
|
|
|
| nano | emacsclient -c |
|
|
|
|
|
| ed | emacsclient -c |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
|
|
|
|
#+BEGIN_SRC fish :noweb yes
|
|
|
|
|
<<generate-abbr(table=abbr-text-ed)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** LaTeX
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-LaTeX-76865eb9
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
Yes, although I use org-mode, I still have some use for LaTeX, especially
|
|
|
|
|
when it comes to PDF exports of my org files. Hence why I use the LaTeX
|
|
|
|
|
package manager. It is recommended to use =tllocalmgr= instead of =tlmgr=,
|
|
|
|
|
but I can never remember the command, and the latter is faster to type, so
|
2020-02-24 18:52:13 +00:00
|
|
|
|
time for an abbreviation. Same goes for =texhash= which must be run as sudo.
|
|
|
|
|
#+NAME: latex-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+--------------|
|
|
|
|
|
| tlmgr | tllocalmgr |
|
|
|
|
|
| texhash | sudo texhash |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=latex-abbr)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Some security measures
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Some_security_measures-489cb521
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
2020-02-24 18:52:13 +00:00
|
|
|
|
Some commands can be quite dangerous when not used properly, which is why I
|
|
|
|
|
added default flags and options so I can get warnings before things get ugly.
|
|
|
|
|
The =-i= and =-I= add prompts in case we might not want to do what we asked
|
|
|
|
|
the shell to do. Notice =lns= which creates symlinks, =rmd= which removes
|
|
|
|
|
directories, =rmf= which forces deletion, and =rmdf= which forces the
|
|
|
|
|
delition of a directory. Notice also the =--preserve-root= which will prevent
|
|
|
|
|
me from accidentally removing the root folder. I added the same option to
|
|
|
|
|
=chgrp=, =chmod=, and =chown=.
|
|
|
|
|
#+NAME: sec-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+--------------------------|
|
|
|
|
|
| cp | cp -i |
|
|
|
|
|
| ln | ln -i |
|
|
|
|
|
| lns | ln -si |
|
|
|
|
|
| mv | mv -i |
|
|
|
|
|
| rm | rm -Iv |
|
|
|
|
|
| rmd | rm --preserve-root -Irv |
|
|
|
|
|
| rmdf | rm --preserve-root -Irfv |
|
|
|
|
|
| rmf | rm --preserve-root -Ifv |
|
|
|
|
|
| chgrp | chgrp --preserve-root -v |
|
|
|
|
|
| chmod | chmod --preserve-root -v |
|
|
|
|
|
| chown | chown --preserve-root -v |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=sec-abbr)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Typos
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Typos-370bbb27
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
2020-02-24 18:52:13 +00:00
|
|
|
|
Let’s admit it, we all make typos from time to time in the shell, and some
|
|
|
|
|
are recurrent enough we make abbreviations or aliases of the correct command.
|
|
|
|
|
Well, I have some of my abbreviations which were make exactly because of
|
|
|
|
|
this. Sometimes for some reasons, my brain makes me write =clean= instead of
|
|
|
|
|
=clear=. So, let’s just replace the former by the latter. I’m also very bad
|
|
|
|
|
at typing =exit=. And sometimes I suck at typing =htop=.
|
|
|
|
|
#+NAME: typo-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+---------|
|
|
|
|
|
| clean | clear |
|
|
|
|
|
| exi | exit |
|
|
|
|
|
| exti | exit |
|
|
|
|
|
| hotp | htop |
|
|
|
|
|
|
|
|
|
|
Here is the corresponding fish configuration:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=typo-abbr)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Misc
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-c2631eb6
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
Finally, some miscellaneous abbreviations that don’t really fit into any of
|
|
|
|
|
the above categories.
|
|
|
|
|
|
|
|
|
|
*** Sudo
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Sudo-aef0214a
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
First, I make it so that =sudo= comes with the =-A= switch in order to call
|
|
|
|
|
my custom graphical script for getting my password (see
|
|
|
|
|
[[file:~/.local/bin/askpass][.local/bin/askpass]]). I also made it so =please= is an equivalent to =sudo
|
|
|
|
|
-A= as a joke.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
abbr please 'sudo -A'
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
*** Exit
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Exit-e3482f5c
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
Sometimes I find it easier to just type =q= instead of =exit=.
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2019-10-23 13:25:35 +00:00
|
|
|
|
abbr q exit
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
*** History
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-History-a2124b23
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
I also find it more intuitive and faster to just write =hist= instead of
|
|
|
|
|
=history=, so let’s declare that.
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2019-10-23 13:25:35 +00:00
|
|
|
|
abbr hist history
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-01-15 11:38:29 +00:00
|
|
|
|
*** ~youtube-dl~ related commands
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-~youtube-dl~_related_commands-654caed1
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2020-01-15 11:38:29 +00:00
|
|
|
|
**** Song download from YouTube
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-~youtube-dl~_related_commands-Song_download_from_YouTube-ec2afa3c
|
2020-01-15 11:38:29 +00:00
|
|
|
|
:END:
|
|
|
|
|
When I want to download a song from YouTube, I’ll just use the command
|
|
|
|
|
=flac videoIdentifier= to get it through =youtube-dl=.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
**** Videos download from YouTube
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-~youtube-dl~_related_commands-Videos_download_from_YouTube-33910b0b
|
2020-01-15 11:38:29 +00:00
|
|
|
|
:END:
|
|
|
|
|
I download a LOT of videos from YouTube, generally educative videos that I
|
|
|
|
|
do not want to lose to YouTube one day who will decide that such channel is
|
|
|
|
|
unworthy of their platform, or if the original author decides to delete
|
|
|
|
|
their videos or whatever. So, I use the abbreviation ~ytdl~ to download
|
|
|
|
|
either one video, or a whole YouTube channel.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
abbr ytdl 'youtube-dl -f best -ciw -o "~/Videos/YouTube/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s"'
|
|
|
|
|
#+END_SRC
|
2019-10-23 13:25:35 +00:00
|
|
|
|
|
|
|
|
|
*** MPV
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-MPV-f99dd400
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
|
|
|
|
When it comes to mpv, I do not want to force it to open a graphical window
|
|
|
|
|
if for example I want to listen to an audio file. I also do not want any
|
|
|
|
|
border on that window. So, I declared this abbreviation.
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2019-10-23 13:25:35 +00:00
|
|
|
|
abbr mpv 'mpv --no-border --force-window=no'
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
*** Compression
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Compression-4fd4ffef
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
It seems it’s just like many other people, but I cannot for the life of me
|
|
|
|
|
remember the syntax of =tar=. So, I made the following abbreviations, and
|
|
|
|
|
one day hopefully, after seeing the abbreviations’ expansion over and over
|
|
|
|
|
I’ll remember the command like I did for the abbreviation of =remove= (see
|
2020-06-07 17:07:02 +00:00
|
|
|
|
[[#Abbreviations-System_management_(packages_and_services)-Package_management-efbcdf0f][Package management]]).
|
2020-02-24 18:52:13 +00:00
|
|
|
|
#+NAME: tar-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+-----------|
|
|
|
|
|
| compress | tar -czf |
|
|
|
|
|
| untar | tar -xvzf |
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=tar-abbr)>>
|
2019-10-23 13:25:35 +00:00
|
|
|
|
#+END_SRC
|
2019-10-23 11:02:59 +00:00
|
|
|
|
|
2020-04-06 11:33:23 +00:00
|
|
|
|
*** Sxiv
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Sxiv-1c0cf845
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
2020-04-06 11:33:23 +00:00
|
|
|
|
Some sane default options for =sxiv=, a simple X image Viewer. This includes
|
|
|
|
|
playing GIFs and not displaying the filename below. Sxiv will also open in
|
|
|
|
|
fullscreen and will fit the displayed image to the frame. I also abbreviated
|
|
|
|
|
~feh~ to sxiv, old habits die hard.
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-04-06 11:33:23 +00:00
|
|
|
|
abbr sxiv 'sxiv -abfs f'
|
|
|
|
|
abbr feh 'sxiv -abfs f'
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
*** exa
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-exa-e1b528b9
|
2020-04-06 11:33:23 +00:00
|
|
|
|
:END:
|
2020-04-11 18:27:46 +00:00
|
|
|
|
#+NAME: exa-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+--------------------------------------------|
|
|
|
|
|
| exa | exa -halg@ --group-directories-first --git |
|
|
|
|
|
| ls | exa -halg@ --group-directories-first --git |
|
|
|
|
|
| lsl | exa -halg@ --group-directories-first --git |
|
|
|
|
|
|
2020-04-06 11:33:23 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2020-04-11 18:27:46 +00:00
|
|
|
|
<<generate-abbr(table=exa-abbr)>>
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-11-29 20:15:37 +00:00
|
|
|
|
*** Network Management
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Network_Management-0b7fc91d
|
2019-10-23 13:25:35 +00:00
|
|
|
|
:END:
|
2019-11-29 20:15:37 +00:00
|
|
|
|
First, we have just =nmcli= with sane default options, that is a pretty output
|
2019-10-23 13:25:35 +00:00
|
|
|
|
with colors.
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+BEGIN_SRC fish
|
2019-10-23 13:25:35 +00:00
|
|
|
|
abbr nmcli 'nmcli -p -c auto'
|
2019-10-23 11:02:59 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-02-24 18:52:13 +00:00
|
|
|
|
*** NordVPN
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-NordVPN-09438638
|
2020-02-24 18:52:13 +00:00
|
|
|
|
:END:
|
2019-11-29 20:15:37 +00:00
|
|
|
|
Next, we have some NordVPN-related shortcuts. The first one is a simple
|
|
|
|
|
abbreviation to =nordvpn=. The second one is a shortcut to connect to a
|
2020-02-24 18:52:13 +00:00
|
|
|
|
server, and to disconnect from the current server. I also have a couple of
|
|
|
|
|
shortcuts to quickly connect to some preselected countries, mainly France,
|
|
|
|
|
Germany, Japan and the US.
|
|
|
|
|
#+NAME: nordvpn-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+-------------------------|
|
|
|
|
|
| n | nordvpn |
|
|
|
|
|
| nc | nordvpn c |
|
|
|
|
|
| nd | nordvpn d |
|
|
|
|
|
| ncf | nordvpn c France |
|
|
|
|
|
| ncg | nordvpn c Germany |
|
|
|
|
|
| ncj | nordvpn c Japan |
|
|
|
|
|
| ncu | nordvpn c United_States |
|
2019-11-29 20:15:37 +00:00
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC fish
|
2020-02-24 18:52:13 +00:00
|
|
|
|
<<generate-abbr(table=nordvpn-abbr)>>
|
2019-11-29 20:15:37 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-03-15 18:17:46 +00:00
|
|
|
|
*** Webcam
|
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Webcam-34eedb5a
|
2020-03-15 18:17:46 +00:00
|
|
|
|
:END:
|
|
|
|
|
#+NAME: webcam-abbr
|
|
|
|
|
| abbreviation | command |
|
|
|
|
|
|--------------+------------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
| webcam | mpv --no-border --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0 |
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
<<generate-abbr(table=webcam-abbr)>>
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2019-10-23 13:25:35 +00:00
|
|
|
|
*** Wget
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:PROPERTIES:
|
2020-06-07 15:36:02 +00:00
|
|
|
|
:CUSTOM_ID: Abbreviations-Misc-Wget-27f4bebf
|
2019-10-23 11:02:59 +00:00
|
|
|
|
:END:
|
2019-10-23 13:25:35 +00:00
|
|
|
|
By default, continue a download that was interupted.
|
|
|
|
|
#+BEGIN_SRC fish
|
|
|
|
|
abbr wget 'wget -c'
|
|
|
|
|
#+END_SRC
|