Files
literate-dotfiles/install.org
2023-10-13 12:30:13 +02:00

35 KiB

Installation

paru - Package Manager

Installation:

mkdir ~/.local/soft && cd ~/.local/soft
sudo pacman -S --needed base-devel
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si

After that, the paru folder may be removed.

git - Version Control System

Installation:

paru -S git

Git Configuration:

  • ~/.gitconfig
  • ~/.gitignore_global

alacritty - Terminal

Alacritty is a very nice keyboard-centric terminal.

It can be installed like so:

paru -S alacritty

Its configuration file is described here.

Command Usage
ctrl-shift-x activate url hints mode
ctrl-shift-c copy to CLIPBOARD
ctrl-shift-v paste from CLIPBOARD
ctrl-shift-space start selection mode
ctrl + increase font size
ctrl - decrease font size
alacritty - Cheatsheet

bash - Shell

https://wiki.archlinux.org/index.php/Bash

Installation:

paru -S bash bash-completion zsh

Bash configuration:

  • ~/.bashrc
  • ~/.bash_profile
  • ~/.config/bash/
  • ~/.profile

tmux - Terminal Multiplexer

https://github.com/tmux/tmux

Installation:

paru -S tmux

TMUX configuration

Ressources:

Command Usage
ctrl-spc Prefix
c New pane
/, - Split Vertically/Horizontally
s Change session
p, n Previous/Next Pane
ctrl-h,j,k,l Move between windows
tmux - Cheatsheet

Fonts

My font of choice is nerd-fonts-hack which can be installed as so:

paru -S nerd-fonts-hack

For emojis, use:

paru -S noto-fonts-emoji

Default font used:

  • Monospace Font: Hack Nerd Font Mono
  • Serif Font: Hack Nerd Font
  • Sans Font: Hack Nerd Font

To list all fonts available:

fc-list

To select fonts using a GUI, gtk2fontsel can be used:

paru -S gtk2fontsel

emacs and vim - Text Editors

Neovim

I use Neovim for all the small edits.

Installation:

paru -S neovim nodejs-neovim python-pynvim

The Neovim configuration can be found here.

Then install the plugin manager plug:

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
      https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

And to install/setup all the plugins:

nvim +PlugInstall
nvim +UpdateRemotePlugins

Emacs

I use Emacs and the Doom framework.

Install Emacs:

paru -S emacs-nativecomp

And then the Doom framework:

git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install

The Emacs configuration can be found here.

SpellCheck with Aspell:

paru -S aspell aspell-en aspell-fr

SSH setup

Generate a new SSH key:

ssh-keygen -t rsa -b 4096 -C "dehaeze.thomas@gmail.com"

Start the ssh-agent in the background:

eval "$(ssh-agent -s)"

Add the SSH key to the ssh-agent:

ssh-add ~/.ssh/id_rsa

GnuPG

https://gnupg.org/

Install the gnupg package:

paru -S gnupg

Create a key pair:

paru --full-gen-key

To configure the gpg-agent to cache the passphrase, edit the following file ~/.local/share/gnupg/gpg-agent.conf:

default-cache-ttl 60480000
max-cache-ttl 60480000

Install gnome-keyring to automatically unlock the GnuPG keys:

paru -S gnome-keyring

rofi - Application Launcher

Rofi is a very nice alternative to dmenu.

Installation:

paru -S dmenu rofi rofi-calc

To be able to run sudo commands with rofi (github issue), the command sudo -A can be used: it opens a rofi prompt to ask for the password.

For that to work, we need to add the following code to ~/.profile:

export SUDO_ASKPASS=~/.local/bin/askpass-rofi

The askpass script is:

#!/bin/sh

rofi -dmenu \
     -password \
     -no-fixed-num-lines \
     -p "$(printf "$1" | sed s/://)"

pass - Password Manager

https://www.passwordstore.org/

Installation:

paru -S pass
mkdir .config/pass

Initialize the password store as a git repository

cd .config/pass
pass git init
pass git remote add origin https://github.com/tdehaeze/pass.git

Gui Manager: qtpass

paru -S qtpass

Integration with Rofi: rofi-pass

paru -S rofi-pass

Then we can add a shortcut to rofi-pass on i3 config.

Integration with Git: pass-git-helper

paru -S pass-git-helper

First, add the relation between repository addresses and entries in pass. This is done in the following config file .config/pass-git-helper/git-pass-mapping.ini:

[github.com*]
target=github.com/tdehaeze

Then, add the credential helper on the git configuration file ~/.gitconfig and add the default username for the repositories adresses.

[credential]
    helper = !pass-git-helper $@

[credential "https://github.com"]
    username = tdehaeze

Integration with other programs

Integrate pass in other programs is usually very easy, here are few examples:

  • ~/.msmtprc:

    • passwordeval "pass email/dehaeze.thomas@gmail.com"
  • ~/.mbsyncrc

    • PassCmd "pass email/dehaeze.thomas@gmail.com"

Alternative - Bitwarden

Bitwarden https://github.com/bitwarden/cli

  paru -Ss bitwarden-bin bitwarden-cli-bin

qutebrowser - Browser

https://github.com/qutebrowser/qutebrowser

Installation

paru -S qutebrowser python-adblock

View Pdf inside qutebrowser with pdfjs

Installation

paru -S pdfjs

Usage

When opening a pdf file on qutebrowser, you'll be ask for options:

Command Usage
<return> Download the file
Ctrl-x Download and open
Ctrl-p Open with pdf.js
Alt-y Yank the url

Integration with Pass: the password manager

Add the key-binding on ~/.config/qutebrowser/config.py

  config.bind(',p', 'spawn --userscript password_fill')

The password_fill script can be found on github.com. It is configured using the ~/.config/qutebrowser/password_fill_rc file.

Spell Checking

/usr/share/qutebrowser/scripts/dictcli.py install fr-FR
/usr/share/qutebrowser/scripts/dictcli.py install en-US

firefox

paru -S firefox-developer-edition

Addons:

In order to have passwords:

paru -S passff-host

xrandr - Monitor Manager

paru -S xorg-xrandr arandr

Xrandr is used in shell scripts (mons could be used as a layer on top of Xrandr). Arandr is a GUI application to manage monitors.

Music Setup

pulseaudio - Sound Server

https://wiki.archlinux.org/index.php/PulseAudio

Installation:

paru -S pulseaudio pulseaudio-alsa pulseaudio-bluetooth

If sound is not working, should run pulseaudio --kill to kill the deamon and then pulseaudio --daemonize to run it again.

https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/

pavucontrol - Sound Manager

pavucontrol is used as a sound manager:

paru -S pavucontrol

mopidy - Audio Server

https://github.com/mopidy/mopidy https://medium.com/@theos.space/using-mopidy-with-spotify-and-ncmpcpp-44352f4a2ce8

paru -S mopidy
python3 -m pip install --user mopidy-mpd mopidy-jellyfin mopidy-spotify

If mopidy is used, MPD should be disabled. (systemctl disable --user mpd.service)

ncmpcpp - MPD Client

https://wiki.archlinux.org/index.php/Ncmpcpp

Installation:

paru -S ncmpcpp

The main config is located here: ~/.ncmpcpp/config. The key bindings can be configured here: ~/.ncmpcpp/bindings.

Movies

mpv - Media Player

Installation:

  paru -S mpv

The configuration is set in /.config/mpv/input.conf.

Contact Manager

khard - Google Conctacts

https://github.com/scheibler/khard

paru -S khard

This is the command line interface for contact management.

Contact synchronization: Vdirsyncer is used for contact synchronization with Google.

To search with Khard: khard <conctact-name>

mu - Index Emails

paru -S mu

This looks for contacts in all indexed emails. mu cfind <name>

redshift

http://jonls.dk/redshift/

paru -S redshift-minimal

Mail Setup

Link to the mail setup.

mbsync - Synchronize Mailboxes

http://isync.sourceforge.net/ https://wiki.archlinux.org/index.php/Isync

Installation

paru -S isync

Configuration

~/.mbsyncrc

Automation using systemd

Retreive New mails
  • checkmail
  • ~/.config/systemd/user/checkmail.service
  • ~/.config/systemd/user/checkmail.timer
systemctl --user enable checkmail.timer
systemctl --user start checkmail.timer
Synchronize all the mailboxes
  • ~/.config/systemd/user/syncmail.service
  • ~/.config/systemd/user/syncmail.timer
systemctl --user enable syncmail.timer
systemctl --user start syncmail.timer

msmtp - Send Mails

https://marlam.de/msmtp/

Installation

  paru -S msmtp

mu - Mail Index, Search and Tagging

https://github.com/djcb/mu

paru -S mu
mu init -m ~/.mail/
mu index

Notification system

A script (checkmail) is used to retreive new mails and use notify=send is there are new received mails.

ranger and pcmanfm - File Manager

Configuration files:

Ranger

https://github.com/ranger/ranger

Installation

paru -S ranger
paru -S dragon-drop

Configuration

The configuration file is ~/.config/ranger/rc.conf.

Display pdf

All the display of the files are defined in ~/.config/ranger/scope.sh.

It seems that Ranger is not working well with Termite. The screen is not refreshing after viewing one image (Github Issue).

It works better with Urxvt.

GUI File Manager: pcmanfm

sxiv - Image viewer

https://github.com/muennich/sxiv https://www.youtube.com/watch?v=GYW9i_u5PYs

Installation

paru -S sxiv

Open Gif

sxiv -a file.gif

Cheatsheet

Command Usage
-t Start in Thumbmail mode
f Toggle fullscreen
Return Switch to thumbmail mode
<, > Rotate the image
\vert, _ Flip the image
n, p Next, Previous image

sxhkd - HotKey Manager

paru -S sxhkd

Configuration file: SXHKD.

i3 - Windows Manager

Link to the documentation

Installation

paru -S i3-gaps

Configuration

~/.i3/config

polybar - Top Bar

https://polybar.github.io/

Link to the documentation.

Installation

paru -S polybar

picom - Compositor

https://wiki.archlinux.org/index.php/Picom

Link to the documentation.

Installation

paru -S picom

Configuration

~/.config/picom/picom.conf

Automatic run as daemon

Compton is run from .xprofile config in the background:

picom --daemon

dunst - Notification Manager

https://github.com/dunst-project/dunst https://wiki.archlinux.org/index.php/Dunst

Installation

paru -S dunst

Configuration

~/.config/dunst/dunstrc

Usage

dunstify --replace=16549 "AppName" "Message"

The number --replace can be used with an ID to merge notifications from the same application for instance.

Office Suite

libreoffice

paru -S libreoffice-fresh libreoffice-fresh-fr

only-office

paru -S onlyoffice-bin

blueman - Bluetooth Manager

Bluetooth manager: https://github.com/blueman-project/blueman

paru -S blueman

udiskie - Automatically Mount devices

udiskie - Mount and unmount disks (https://github.com/coldfix/udiskie)

paru -S udiskie

Automatically run udiskie on startup.

LaTeX

Installation

paru -S texlive-most tllocalmgr-git

Biber support for the bibliography:

paru -S biber

Support for source code using minted:

paru -S minted

Every custom class or packages can be put under ~/.local/share/texmf/tex/latex/local/ folder. In order for LaTeX to be aware of new packages/classes, run sudo texhash each time a new custom package is added.

Matrix - Gomuks

paru -S gomuks

Syncthing

paru -S syncthing
systemctl --user enable --now syncthing

Gotify

paru -S gotify-dunst-git

Custom Systemd Services

Tangle everything in the Systemd config file.

Then enable and start all the services:

systemctl --user enable --now homelab-tunnel
systemctl --user enable --now esrf-tunnel
systemctl --user enable --now syncthing
systemctl --user enable --now vdirsyncer.timer
systemctl --user enable --now syncmail.timer
systemctl --user enable --now checkmail.timer

Mathematical Software

Insect

https://github.com/sharkdp/insect

Installation

  paru -S insect
Command Usage
3 m/s to km/h Convert Unit

Matlab

Link to the configuration.

Download Matlab here: https://fr.mathworks.com/downloads/ Unzip, and run ./install. Then, choose the install directory to be ~/.local/soft/Matlab/R2019b.

If there is a problem when opening a Simulink file, check the solution here or here.

Also, there might be a problem with displaying multi-body models. In such case type opengl('save', 'software') (see here).

To install a new package, run ./install in ~/.local/soft/Matlab_Install.

Python and Jupyter-notebook

paru -S python ipython python-pip

Download Manager

stig

paru -S stig

youtube-dl

paru -S youtube-dl

Default Applications

https://wiki.archlinux.org/index.php/Default_applications https://www.guyrutenberg.com/2018/01/20/set-default-application-using-xdg-mime/

~/.config/mimeapps.list

xdg-mime default qutebrowser.desktop x-scheme-handler/http
xdg-mime default qutebrowser.desktop x-scheme-handler/https

Desktop files

Desktop Applications

~/.local/share/applications/

Calendar

Link to configuration

vdirsyncer - Sync calendars

https://github.com/pimutils/vdirsyncer

Installation:

paru -S vdirsyncer
Command Usage
vdirsyncer sync Synchronize

And start the systemd timer that automatically synchronize the calendars;

systemctl --user enable --now vdirsyncer.timer

To check the status of the service:

systemctl --user status vdirsyncer.service

khal - Calendar Client

https://github.com/pimutils/khal

Installation:

paru -S khal

Import ICS files:

khal import even.ics

zathura - PDF Reader

https://pwmt.org/projects/zathura/

Installation

paru -S zathura

Then add dependecies to view specific files:

paru -S zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb

It seems that mupdf is better that poppler to view pdf.

Configuration

~/.config/zathura/zathurarc

Cheatsheet

Command Usage
p Print the current pdf
tab Show the outline
r Reload
J/K Next/previous page
H/L Zoom in/out
a Fit height
s Fit width
D Double page
f Follow link
i Night Mode
<n>gg Go to page n
mm Mark current location to m
'm Goto location m

Multi-monitor pdf presentation - pdfpc

https://github.com/pdfpc/pdfpc

pdfpc is a great tool for showing pdf presentations. It support:

  • screen splitting
  • support for videos in pdf presentations
  • support for notes
  • support for annotations

Installation

  paru -S pdfpc

Video support

  paru -S gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav

Usage

  pdfpc filename.pdf

gtk=/=qt - Managing Theme

GTK Themes

Gtk2 themes are managed using the file ~/.gtkrc-2.0 while Gtk3 themes are managed using ~/.config/gtk-3.0/settings.ini.

Gui Manager

To customize the look of the system using GUI application, run lxappearance.

Installation:

paru -S lxappearance

Icons and themes

paru -S zukitwo-themes faenza-icon-theme
paru -S arc-gtk-theme

QT Themes

Run qt5ct to manage QT Themes.

inkscape - Graphical Editor

paru -S inkscape

Docker

paru -S docker docker-compose

Add current user to docker group:

sudo gpasswd -a thomas docker

wireguard - VPN

paru -S wireguard-tools

nordvpn - VPN

https://aur.archlinux.org/packages/nordvpn-bin/ https://wiki.archlinux.org/index.php/NordVPN

sudo groupadd -r nordvpn
sudo gpasswd -a $USER nordvpn

Installation:

paru -S nordvpn-bin

Configuration:

sudo systemctl enable --now nordvpnd.service
Command Usage
nordvpn login
nordvpn connect country
nordvpn disconnect
nordvpn status
nordvpn countries

Others

Useful utils

paru -S sshfs poppler mpd xwallpaper sof-firmware usbutils xautolock atool unzip xsel man-db npm highlight-pointer-git xorg-xkill

ESRF related

paru -S zoom

maim=/=flameshot - Take Screenshots

screenkey - Show pressed keys

paru -S screenkey

croc - File transfer

Find Files

paru -S fd ripgrep fzf

Trash

trash-cli is used to manage the trash. It is integrated with ranger and pcmanFM.

paru -S trash-cli

Show information about the machine

neofetch

paru -S neofetch

Printer

CUPS

https://wiki.archlinux.org/index.php/CUPS

paru -S cups

Web based administration: http://localhost:631/

system-config-printer

Check the queue

lpq
lpq -a # on all queues

Clear the queue

lprm   # remove last entry only
lprm - # remove all entries

Print a file

lpr -P printer_name filename.pdf

List available printers

lpstat -a

Stats about the printer

lpstat -p printer_name

Network Lexmark

paru -S sane simple-scan lexmark-network-scan

Kernel Management

https://wiki.manjaro.org/index.php/Manjaro_Kernels

Command Usage
mhwd-kernel -li Determine which kernel is used
sudo mhwd-kernel -i linux419 Install new kernel
sudo mhwd-kernel -i linux419 rmc Install new kernel and remove old one

Theme

paru -S arc-gtk-theme
paru -S xcursor-breeze

Useful commands

Readline

https://wiki.archlinux.org/index.php/Keyboard_shortcuts

Keyboard Shortcut Description
Ctrl+l Clear the screen

Cursor Movement

Keyboard Shortcut Description
Ctrl+b Move cursor one character to the left
Ctrl+f Move cursor one character to the right
Alt+b Move cursor one word to the left
Alt+f Move cursor one word to the right
Ctrl+a Move cursor to start of the line
Ctrl+e Move cursor to end of the line

Copy & Paste

Keyboard Shortcut Description
Ctrl+u Cut everything from line start to cursor
Ctrl+k Cut everything from the cursor to end of the line
Alt+d Cut the current word after the cursor
Ctrl+w Cut the current word before the cursor
Ctrl+y Paste the previous cut text
Alt+y Paste the second latest cut text
Alt+Ctrl+y Paste the first argument of the previous command
Alt+./ Paste the last argument of the previous command

History

Keyboard Shortcut Description
Ctrl+p Move to the previous line
Ctrl+n Move to the next line
Ctrl+s Search
Ctrl+r Reverse search
Ctrl+j End search
Ctrl+g Abort search (restores original line)
Alt+r Restores all changes made to line

Completion

Keyboard Shortcut Description
Tab Auto-complete a name
Alt+? List all possible completions
Alt+* Insert all possible completions

Others

tldr Community-driven man pages
wttr.in weather in terminal
rtv Reddit in terminal
awk https://linuxhandbook.com/awk-command-tutorial/
z Jump around
thefuck Magnificent app which corrects your previous console command
s-tui Terminal based CPU stress and monitoring utility
glances A top/htop alternative
asciinema Reccord you terminal
ncdu See what takes place on the disk
bat cat alternative
procs ps alternative
sd sed alternative
meteo Get the meteo
sudo cputhrottle PID %PROC Limiter l'accès au proc pour un processus
nmap -sP “192.168.1.*" Check all ip addresses on local netword
du -sh folder Return the size of the folder
df -h Report disk usage

Archive and Extract

Use apack and aunpack:

aunpack foobar.tar.gz extract all files from archive
apack myarchive.zip foo bar create a zip archive of two files

Hardware

dmesg Detected hardware and boot messages
lshw Display information on hardware
lsusb -tv Show usb devices

Network

ip addr show Show all network interfaces and ip address
ethtooo eth0 Tool to show ethernet status
netstat -tulp List all active listening ports

After Install

Enable TRIM (SSD only)

sudo systemctl enable --now fstrim.timer

Set the fastest mirror for Pacman

sudo pacman-mirrors --fasttrack

Configuration for Laptops

Power Management Tool: Powertop

https://wiki.archlinux.org/index.php/Powertop https://wiki.manjaro.org/index.php?title=Power_Savings

PowerTop a diagnostic tool used to identify and report issues with power consumption and management.

paru -S powertop

TLP is used for Power Management.

paru -S tlp
sudo systemctl enable tlp
sudo systemctl start tlp
sudo systemctl enable tlp-sleep
sudo systemctl start tlp-sleep
sudo tlp start

Thermald is used to automatically handle CPU frequency scaling according to system load.

paru -S thermald
sudo systemctl enable thermald
sudo systemctl start thermald

Lid open/close

https://wiki.archlinux.org/index.php/Power_management

Should automatic show lock screen

/etc/systemd/logind.conf

Some notes - Systemd

To improve the startup time.

sudo systemctl disable apparmor
sudo systemctl disable snapd
sudo systemctl disable systemd-backlight@backlight\:intel_backlight.service

To see next timers

systemctl --user list-timers

List of all the install programs

Mutt

neomutt Teaching an Old Dog New Tricks
msmtp SMTP client that can be used as an SMTP plugin for Mutt
isync Synchronize a maildir with an IMAP server
vdirsyncer Synchronize calendars and contacts
abook Address book with mutt support
urlview URL extractor/launcher
w3m Pager/text based browser
lynx Text mode web browser
lbdb Little brother's database for the mutt mail reader
mu Tool for searching e-mail messages stored in the maildir-format
ripmime Extract attachments out of MIME encoded email packages
shared mime-info - Database of common MIME types

Micro controllers

avrdude Atmel AVR MCU programmer
bootloadhid USB boot loader for AVR microcontrollers
dfu programmer - Device firmware update based USB programmer for Atmel chips
platformio Ecosystem for IoT development (Arduino and ARM mbed compatible)
micropython Python implementation for microcontrollers and constrained systems
arduino mk - Makefile for Arduino sketches

File Management

grep GNU grep, egrep and fgrep
pdfgrep Search PDFs for strings matching a regular expression
the_platinum_searcher Multi-platform code-search similar to ack and ag
the_silver_searcher Code-search similar to ack
fdupes Identify or delete duplicate files
findutils Collection of GNU find, xargs, and locate
ranger File browser
vifm Ncurses based file manager with vi like keybindings
tree Display directories as trees (with optional color/HTML output)
p7zip 7-Zip (high compression file archiver) implementation
unrar Extract, view, and test RAR archives
atool zip script for managing file archives of various types

File Downloader

wget Internet file retriever
htop Improved top (interactive process viewer)
httpie User-friendly cURL replacement (command-line HTTP client)
curl Get a file from an HTTP, HTTPS or FTP server

Utils

binutils GNU Binary Utilities
coreutils GNU File, Shell, and Text utilities
gnome doc-utils - Documentation utilities for the GNOME project
moreutils Collection of tools that nobody wrote when UNIX was young

https://gitlab.com/bztsrc/usbimager

A trier

asciinema Terminal session recorder
automake tool for automatically generating Makefile
cmake Cross-platform make
cputhrottle Limit the CPU usage of a process
ctags Reimplementation of ctags
gdb GNU debugger
ghostscript Interpreter for PostScript and PDF
go Open source programming language to build simple/reliable/efficient software
hugo Configurable static site generator
markdown Text-to-HTML conversion tool
pandoc Swiss-army knife of markup format conversion
uni Query the Unicode database from the commandline