literate-dotfiles/readme.org

53 KiB

Dotfiles - Manjaro Linux on Macbook Pro

Package Manager: yay

https://github.com/Jguer/yay

Installation

sudo pacman -S yay

CheatSheet

Command Usage
yay Perform system upgrade
yay -Ss <package> Search
yay -S <package> Install
yay -Si <package> Get informations
yay -Rs <package> Uninstall
yay -Yc <package> Clean unneeded dependencies

Git Setup

https://git-scm.com/

Installation

  yay -S git

Configuration

dotfiles/git.org

  • ~/.gitconfig
  • ~/.gitignore_global

Diff-So-Fancy

https://github.com/so-fancy/diff-so-fancy

Installation

  yay -S diff-so-fancy

Configuration

git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

Credential Helper setup with Pass

This is explained in a further part: Integration of Pass with Git.

Terminal

https://github.com/thestinger/termite

Termite

Installation

  yay -S termite

Configuration

termite.org

  • ~/.config/termite/config

Cheatsheet

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-shift-up scroll up a line
ctrl-shift-down scroll down a line
ctrl-+ increase font size
ctrl-- decrease font size
ctrl-= reset font size to default

TODO [C] Unicode Rxvt

Installation

  yay -S rxvt-unicode

Configuration

Most of Urxvt configuration is done in ~/.Xresources

TODO [B] Shell: Bash

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

Bash Completion

  yay -S bash-completion

TODO [B] Configuration

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

TODO [B] Terminal Multiplexer: Tmux

https://github.com/tmux/tmux

Installation

  yay -S tmux

Configuration

After configuration is generated.

  tmux source-file ~/.tmux.conf

Session Manager - Tmuxinator

https://github.com/tmuxinator/tmuxinator

Installation

  yay -S tmuxinator

Special sessions

Sessions are created using tmuxinator new session_name and edited using tmuxinator edit session_name.

Mux: run terminal and tmux session

~/bin/mux

To open a terminal and run tmux session automatically, run mux <session-name>. This is used with rofi.

TODO [A] Multiple Tmux configuration

  • one with no line for neomutt
  • one complete for coding

TODO [B] Configuration: theme

TODO [B] Cheatsheet

Command Usage

TODO [C] Fonts

Installation

  yay -S ttf-inconsolata nerd-fonts-complete ttf-linux-libertine ttf-emojione

TODO [C] Default fonts

SauceCodePro Nerd Font Mono

Maybe use:

  • Monospace Font: Inconsolata
  • Serif Font: Libertine
  • Sans Font: Linux Biolinum

Cheatsheet

Command Usage
fc-list List all fonts available

Text Editors

Emacs

https://www.gnu.org/software/emacs/

Installation

yay -S emacs

TODO Emacs Client/Server - I removed the systemd service to just run it with i3 startup

Add a systemd service to automatically run Emacs deamon in the background on startup: ~/.config/systemd/user/emacs.service

Then run:

  systemctl enable --user emacs
  systemctl start --user emacs

In order to open the emacs client: emacsclient -create-frame --alternate-editor""=

Then, add a shortcut to i3 config to open an emacsclient.

SpellCheck with Aspell

yay -S aspell aspell-en aspell-fr

SSH setup

Generating 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:

yay -S gnupg

Create a key pair

gpg --full-gen-key

Configure the gpg-agent to cache the passphrase

Edit the following file ~/.gnupg/gpg-agent.conf

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

Launcher - Rofi

https://github.com/DaveDavenport/rofi

Installation

  yay -S rofi

Setup rofi as a dmenu replacement

Setup rofi as a dmenu replacement in ~/.i3/config:

  bindsym $mod+d exec --no-startup-id rofi -show run

Run sudo commands with rofi

https://github.com/DaveDavenport/rofi/issues/584#issuecomment-384555551

Use sudo -A, that will open a rofi prompt to ask for the password.

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

  export SUDO_ASKPASS=~/bin/askpass-rofi

The askpass script is:

  #!/bin/sh

  # Take password prompt from STDIN, print password to STDOUT
  # the sed piece just removes the colon from the provided
  # prompt: rofi -p already gives us a colon
  rofi -dmenu \
       -password \
       -no-fixed-num-lines \
       -p "$(printf "$1" | sed s/://)"

Password Manager: Pass

https://www.passwordstore.org/

Install the pass package

yay -S pass

Initialize the password store as a git repository

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

Gui Manager

Integration with Rofi

https://github.com/carnager/rofi-pass

Installation

  yay -S rofi-pass

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

Alternative

Integration with Browsers

This is explained here.

Integration with Git

https://github.com/languitar/pass-git-helper

Installation

  yay -S pass-git-helper

Configuration

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"

Bookmark Manager: Buku

https://github.com/jarun/Buku

Installation

  yay -S buku

Integration with Rofi

https://github.com/carnager/buku_run

Installation

wget https://raw.githubusercontent.com/carnager/buku_run/master/buku_run -o ~/bin/buku_run
chmod +x ~/bin/buku_run

Configuration

The configuration file is here: ~/.config/buku_run/config

Key binding with i3

Custom key binding in i3 config file ~/.i3/config:

bindsym $mod+Shift+f exec --no-startup-id buku_run

Integration with qutebrowser

Synchronization with a git repository

The database is stored in ~/.local/share/buku/bookmarks.db.

We initialize a git repository in this folder:

cd ~/.local/share/buku/bookmarks.db
git init

Then we create a script that will automatically add bookmarks.db and push to some repository: ~/scripts/buku_git_push.sh.

To automatically run the script every day, a systemd unit is used: ~/.config/systemd/user/bukugit.timer and ~/.config/systemd/user/bukugit.service

systemctl start --user bukugit.timer
systemctl enable --user bukugit.timer

Import Bookmarks from Firefox and Chrome

From Firefox, export the bookmarks as html file. Then import the bookmark file using buku -i bookmarks.html. This will add a tag with current date to all bookmarks imported. To remove them, use: buku --replace '2018dec20' ''

Web Interface

Run:

bukuserver run --host 127.0.0.1 --port 5001

And then browse to 127.0.0.1:5001.

Cheatsheet

Command Usage
buku Run buku interactively
buku -p List all bookmarks
buku -w id Edit bookmark
buku -d id Delete bookmark
buku -s <> Search bookmarks

TODO Browser: qutebrowser

https://github.com/qutebrowser/qutebrowser

Installation

  yay -S qutebrowser

View Pdf inside qutebrowser with pdfjs

Installation

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

TODO Make it default browser

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.

TODO Integration with Buku

Custom key binding in ~/.config/qutebrowser/config.py

# Add current page to Buku (Bookmark Manager)
config.bind('B', 'spawn buku -a {url}')

TODO Add an option to specify title, modify url? add tags?

TODO Cast youtube to chromecast

Spell Checking

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

TODO Ressources

Sound Setup

  yay -S pulseaudio pavucontrol

Music Setup

Sound Server - Pulse Audio

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

Install

  yay -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/

Audio Server - MPD

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

Installation

  yay -S mpd

Automatic Startup

  systemctl start --user mpd.service
  systemctl enable --user mpd.service

Command line interface to MPD - MPC

https://github.com/MusicPlayerDaemon/mpc

To install mpc: yay -S mpc.

Command Usage
mpc update Update the library
mpc rescan Rescan the library

TODO [A] Audio Server with Spotify - Mopidy

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

  yay -S mopidy mopidy-spotify

To update local files:

  mopidy local scan

If mopidy is used, MPD should be disabled. (systemctl disable --user mpd.service) Also, when using mopidy, when pausing a song, playing it again does not work. => is there a fix for that?

MPD Client - ncmpcpp

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

Installation

yay -S ncmpcpp

Config

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

Cheatsheet

Library Manager - beets

https://github.com/beetbox/beets

Installation

  yay -S beets

Configuration

Configuration folder: ~/.config/beets/

Cheatsheet

Command Usage
beet import <folder> Import folder to Music folder

TODO [C] Movies

Media Player - MPV

Installation

yay -S mpv

Key Bindings

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

TODO CheatSheet

Command Usage

TODO Chromecast with CATT

https://github.com/skorokithakis/catt

Installation

  yay -S catt

Usage to cast videos to chromecast

Command Usage
catt cast "https://www.youtube.com/watch?v=dQw4w9WgXcQ" Cast youtube video
catt cast ./myvideo.mp4 Cast local video
catt add ./myvideo.mp4 Add a video to the queue
catt cast -s ./mysubtitle.srt /myvideo.mp4 Add sub title
catt cast_site https://en.wikipedia.org/wiki/Rickrolling Cast website

Usage for controlling the device

Command Usage
ffwd Fastforward a video by TIME duration
rewind Rewind a video by TIME duration
seek Seek the video to TIME position
scan Scan the local network and show all Chromecasts and their IPs
status Show some information about the currently-playing video
pause Pause a video
play Resume a video after it has been paused
stop Stop playing
skip Skip to end of content
save Save the current state of the Chromecast for later use
restore Return Chromecast to saved state
volume Set the volume to LVL [0-100]
volumedown Turn down volume by a DELTA increment
volumeup Turn up volume by a DELTA increment

TODO Popcorn Time or similar

TODO [C] Movie Collection Manager - Filebot

https://github.com/filebot/filebot This is paid software, I should uninstall it and find alternative

Installation

yay -S bilebot

When runing filebot, if you obtain the following error: /usr/bin/filebot: line 22: /usr/lib/jvm/java-8-openjdk/bin/java: No such file or directory. You can simlink the java binary:

sudo ln -s /usr/lib/jvm/java-8-openjdk/jre/bin/java /usr/lib/jvm/java-8-openjdk/bin/java

Usage

Configuration

Configuration folder: ~/.config/filebot/

Subtitle Manager

subdl

TODO [A] Contact Manager

https://wiki.archlinux.org/index.php/mutt#Contact_management https://gitlab.com/goobook/goobook https://github.com/hensmith/ppl https://github.com/scheibler/khard http://abook.sourceforge.net/

GooBook - Contacts from Google

Installation

yay -S goobook-git

And Then

goobook authenticate

Usage

goobook query name

TODO lbdb

Installation

yay -S lbdb

TODO Use Vdirsyncer for contact synchronization

TODO Mu

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

TODO Integration with Mutt

TODO Chat Application

Weechat

https://weechat.org/files/doc/stable/weechat_user.en.html https://wiki.archlinux.org/index.php/WeeChat

Installation

  yay -S weechat

Then we install some dependencies

  yay -S tcl lua ruby

Enable mouse support

  /mouse enable

Scripts

highmon.pl
colorize_nicks.py
go.py
autosort.py
buddylist.pl
colorize_lines.pl
multiline.pl

Theme

https://www.bfoliver.com/technology/2017/07/15/weechat/ https://alexjj.com/blog/2016/9/setting-up-weechat/

/set weechat.look.prefix_same_nick "⤷"
/set weechat.look.prefix_error "⚠"
/set weechat.look.prefix_action "⚡"
/set weechat.look.bar_more_down "▼▼"
/set weechat.look.bar_more_left "◀◀"
/set weechat.look.bar_more_right "▶▶"
/set weechat.look.bar_more_up "▲▲"
/set weechat.look.prefix_suffix "╡"
/set weechat.color.chat_nick_colors red,green,brown,blue,magenta,cyan,white,lightred,lightgreen,yellow,lightblue,lightmagenta,lightcyan
/set weechat.color.separator 31
/set buffers.color.current_fg 31
/set buffers.color.current_bg white
/set buffers.color.hotlist_message_fg 229
/set buffers.color.hotlist_private_fg 121
/set buffers.color.hotlist_highlight_fg 163
/set buffers.color.number 239
/set buffers.color.number_char 245
/set weechat.bar.title.conditions "${inactive}"
/set weechat.bar.title.color_fg black
/set weechat.bar.title.color_bg 31         #Or white if 31 does nothing

Multi-line messages

Solution is provided here: https://github.com/wee-slack/wee-slack/issues/118 It uses multiline.pl script. Then alt-enter is bound to insert a new line:

  /set plugins.var.perl.multiline.magic_paste_only on
  /key bind meta-ctrl-M /input insert \x0a

And enter is bound to magic_enter that directly sends the message if its one line, and if its multiple line, waits a little bit and then sends the message:

  /key bind ctrl-M /input magic_enter

Send message using $EDITOR

https://github.com/keith/edit-weechat

  mkdir -p ~/.weechat/python/autoload
  cd ~/.weechat/python/autoload
  wget https://raw.githubusercontent.com/keith/edit-weechat/master/edit.py

Then, on weechat, type /edit.

CheatSheet

Command Usage
Ctlr-N Next channel
Ctlr-P Previous channel
Esc-n Toggle nicklist
alt-ent New line

Slack Integration

https://github.com/wee-slack/wee-slack

Installation
  yay -S python2-websocket-client
  cd ~/.weechat/python
  wget https://raw.githubusercontent.com/wee-slack/wee-slack/master/wee_slack.py
  ln -s ../wee_slack.py autoload
Add your Slack API key(s)

Log in to Slack:

  /slack register

This command prints a link you should open in your browser to authorize WeeChat with Slack. Once you've accomplished this, copy the "code" portion of the URL in the browser and pass it to this command:

  /slack register [CODE_FROM_URL]

Your Slack team is now added, and you can complete setup by restarting the wee-slack script.

  /python reload slack

If you don't want to store your API token in plaintext you can use the secure features of weechat:

  /secure passphrase this is a super secret password
  /secure set slack_token [YOUR_SLACK_TOKEN]
  /set plugins.var.python.slack.slack_api_token ${sec.data.slack_token}

Deamon and Client

Weechat is started with the systemd service weechat. It runs weechat inside tmux.

TODO Using Emacs

Redshift

http://jonls.dk/redshift/

Installation

yay -S redshift

TODO [A] Mail Setup

Synchronize Mailboxes - Mbsync

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

Installation

  yay -S isync

TODO Configuration

~/.mbsyncrc

Automation using systemd

Retreive New mails
  • ~/scripts/checkmail.sh
  • ~/.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

Send Mails - Msmtp

https://marlam.de/msmtp/

Installation

  yay -S msmtp

Mail Indexer - Notmuch

https://notmuchmail.org/ https://wiki.archlinux.org/index.php/Notmuch

Installation

yay -S notmuch

Configuration

Configuration file: ~/.notmuch-config

Cheatsheet

Command Usage
notmuch setup Initial Setup
notmuch new Incorporate new email into notmuch database

TODO [B] Mail Index, Search and Tagging - Mu

TODO [A] Mail Client - NeoMutt

https://github.com/neomutt/neomutt

Installation

yay -S neomutt

TODO Vim Bindings

Unding toutes les touches (https://github.com/iagox86/mutt/blob/master/keybindings.conf) et rebind tout pour faire un truc coherent et documenté Rajouter les keybindings de vim https://github.com/neomutt/neomutt/issues/56#issuecomment-250780838

TODO Mailcap configuration

Display html mails

yay -S w3m

Open PDF from mail

~/scripts/openfile.sh

TODO [B] Integrate with contact manager

Attachments

Attach multiple files at once

First, tag the files you want to send using t, then ; to apply the action on all tagged files and finally <enter> to add them all

TODO Add attachment using GUI file manager
Cheatsheet
Command Usage
<spc> Open the file

Open Url from mail

yay -S urlview

TODO Searching mails with notmuch

TODO Cheatsheet

Command Usage

TODO [C] Mu4e

TODO [C] Notification system

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

TODO [A] File Manager

TODO [A] Ranger

https://github.com/ranger/ranger

Installation

yay -S ranger

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.

TODO [B] Cheatsheet

Command Usage
X Extract archive
Z Compress file or folder

TODO [C] GUI File Manager: pcmanfm

TODO [B] Image viewer

TODO Write a script to open any type of image using the corresponding program

Filetype png pdf svg
Program feh zathura inkview

Feh - Minimal Image Viewer

https://feh.finalrewind.org/

Installation

yay -S feh

Cheatsheet

Command Usage
f Fullscreen
m Show menu
spc next image
bspc previous image
w Fit image

TODO [B] Windows Manager - i3

TODO Installation

  yay -S i3-gaps

TODO Packages to install/understand

artwork-i3 i3-wallpapers

TODO Configuration

~/.i3/config

TODO [C] Specific config per workspace

https://github.com/i3/i3/blob/next/contrib/per-workspace-layout.pl For instance, default to tabbed windows for workspace dealing with matlab figures.

Figures / Matlab

TODO [B] CheatSheet

Command Usage

TODO [B] Custom bar - Polybar

https://polybar.github.io/

Installation

  yay -S polybar

TODO [C] Configuration

~/.config/polybar/config

Polybar is launched automatically from i3 config.

TODO [B] Add custom modules

  • show passwords
  • show bibliography
  • show bookmarks
  • switch theme (dark/light)
  • suspend, restart, hibernate, lock

TODO [C] Add Conky to polybar

TODO [C] Compositor - Compton

https://wiki.archlinux.org/index.php/Compton https://github.com/chjj/compton

Installation

  yay -S compton

TODO [B] Configuration

~/.config/compton.conf

TODO GUI Configuration

To install:

  yay -S compton-conf

Then run compton-conf

Automatic run as daemon

Compton is run from i3 config in the background (-b option)

  exec --no-startup-id compton -b

TODO [C] Notification Manager - Dunst

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

Installation

yay -S dunst

Configuration

~/.config/dunst/dunstrc

TODO [C] Special notifications

  • Mails
  • New messages on slack

TODO [C] How to merge similar notifications like new mails?

Office Suite - LibreOffice

  yay -S libreoffice-fresh

SpreadSheet - SC-IM

https://github.com/andmarti1424/sc-im https://www.youtube.com/watch?v=K_8_gazN7h0

It permits to open Excel files on the terminal very quickly.

  yay -S sc-im

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:

  yay -S lxappearance

Icons and themes

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

QT Themes

Run qt5ct to manage QT Themes.

XFT Themes

Some configuration are located in ~/.Xresources.

TODO [A] Advanced config

TODO [C] Printer

https://wiki.archlinux.org/index.php/CUPS Web based administration: http://localhost:631/

system-config-printer

Check and Clear the Queue

Check the queue

lpq
lpq -a # on all queues

Clear the queue

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

TODO CheatSheet

Command Usage

TODO [C] Kernel Management

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

TODO Cheatsheet

Command Usage
mhwd-kernel -li Determine which kernel is used
Change current kernel

TODO [A] Lid open/close

Should automatic show lock screen

/etc/systemd/logind.conf

TODO [C] Format disks

https://gparted.org/

sudo gparted to format disks ()

TODO [B] Bluetooth

TODO [B] Temperature and Fan control

https://github.com/dgraziotin/mbpfan Fan are controlled by mbpfan. The config file is /etc/mbpfan.conf

# Enable Automated Power Regulation
sudo pacman -S tlp
sudo systemctl enable tlp
sudo systemctl enable tlp-sleep
sudo tlp start

# Enable thermald (overheat shutoff)
yaourt -S thermald
sudo systemctl enable thermald
sudo systemctl start thermald

TODO [B] Lock Screen

https://github.com/pavanjadhaw/betterlockscreen

Installation

  yay -S betterlockscreen

TODO [C] LaTeX

Installation

  yay -S texlive-most

Biber support for the bibliography:

  yay -S biber

Support for source code using minted:

  yay -S minted

Personnal classes/packages

Every custom class or packages can be put under ~/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.

TODO [C] From screenshot to latex math formula

https://mathpix.com/

Installation

yay -S mathpix-snipping-tool

Usage

First, you have to run mathpix-snipping-tool. That will add something in the tray.

Then, use <ctrl><alt>m and then select a part of the screen to convert that area to latex formula.

TODO [C] Think of a better way to run that program. Maybe disable the tray icon and add some polybar script that automatically run the program, and ask for selection of the screen.

TODO [B] Custom script to select latex symbol

https://github.com/superluserdo/Latex-picker Maybe use that script for other things?

Mathematical Software

Insect

https://github.com/sharkdp/insect

Installation

yay -S insect

Usage

Command Usage
3 m/s to km/h Convert Unit

Matlab

https://wiki.archlinux.org/index.php/MATLAB#Installation

Installation

yay -S matlab

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

TODO [A] Cloud Backup / Sync - Rclone

https://github.com/ncw/rclone https://rclone.org/docs/ gui: https://martins.ninja/RcloneBrowser/

Rclone is used to manage the online drives like Google Drive and Dropbox.

Installation

yay -S rclone

Cheatsheet

Command Usage
rclone config Configuration
rclone listremotes List configured remotes
rclone about Informations about the remote
rclone copy Copy files from source to dest
rclone sync Make source and dest identical, modifying destination only
rclone check Check if the files in the source and destination match
rclone ls List all the objects in the path
rclone size Return the total size and number of objects in remote:path
rclone cleanup Clean up the remote if possible

Usefull commands

Command Usage
rclone sync ~/gdrive/ gdrive:/ -P Make Google Drive files to same as local ones
rclone copy gdrive:/directory/ ~/gdrive/directory/ -P Copy directory from Google Drive to local
rclone lsf gdrive:/ --max-depth 1 List files and directory

Progress bar for long synchronizations

Use --progress --stats-one-line.

Download Manager

TODO CLI Download Manager - Aria2

Installation

yay -S aria2

Usage

TODO Torrent Client - deluge

https://github.com/deluge-torrent/deluge https://wiki.archlinux.org/index.php/Deluge

Installation

yay -S deluge

Configuration

~/.config/deluge/

Command Line Interface

https://whatbox.ca/wiki/deluge_console_documentation

Start the daemon using deluge -d. Then run the CLI client using deluge-console.

GUI Client

deluge

TODO CLI Torrent Client - btpd

TODO Youtube-dl

yay -S youtube-dl

Download best audio

  youtube-dl -f bestaudio url

Download best video with audio

  youtube-dl -f best url

Download playlist

TODO [A] Default Applications

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

Mailcap file

TODO [A] XDG-OPEN

~/.config/mimeapps.list

TODO Make QuteBrowser the default browser

TODO Desktop files

~/.local/share/applications/

TODO Calendar

Vdirsyncer - Sync calendars

https://github.com/pimutils/vdirsyncer

Installation

  yay -S vdirsyncer
  sudo pip install requests-oauthlib

Cheatsheet

Command Usage
vdirsyncer sync Synchronize

Automation - Systemd

  systemctl --user enable vdirsyncer.timer
  systemctl --user start vdirsyncer.timer

To check the status of the service:

  systemctl --user status vdirsyncer.service

TODO Calendar Client - Khal

https://github.com/pimutils/khal

Installation

  yay -S khal

TODO Cheatsheet

Command Usage

TODO Presentation software

Beamer

Presentation setup on computer

PowerPoint Viewer

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

Installation

yay -S pdfpc

Video support

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

Usage

pdfpc filename.pdf

TODO Task Manager

OrgMode and Emacs

Wunderlist

https://itsfoss.com/linux-client-wunderlist/

Wunderline

http://wayneashleyberry.github.io/wunderline/

Installation
  yay -S wunderline
Cheatsheet

wunderline list

Background manager: nitrogen

https://github.com/l3ib/nitrogen/

Configuration

~/.config/nitrogen/nitrogen.cfg

Wallpapers

~/scripts/wallpaper.sh: script to automatically change wallpaper each x minutes.

PDF Reader: Zathura

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

Installation

  yay -S zathura

Then add dependecies to view specific files:

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

TODO Theme manager

The idea would be to have a command that changes the theme of all the system.

There would be at least one light and one dark theme. Applications that could change:

It seems the color is due to this part of the script. Should then source this file somehow.

BASE16_SHELL="$HOME/.base16-manager/chriskempson/base16-shell/"
[ -n "$PS1" ] && \
    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
        eval "$("$BASE16_SHELL/profile_helper.sh")"

Possible theme managers:

TODO Theme script

~/bin/theme

TODO Base16

https://github.com/chriskempson/base16 http://chriskempson.com/projects/base16/ https://www.youtube.com/watch?v=QcOxU1sOOuw

Base16 Philosophy

Define colors according to rules: http://chriskempson.com/projects/base16/ Then we can use these colors multiple applications.

Base16-shell

https://github.com/chriskempson/base16-shell

This changes the shell colors. This should be added to ~/.bashrc:

# Base16 Shell
BASE16_SHELL="$HOME/.config/base16-shell/"
[ -n "$PS1" ] && \
    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
        eval "$("$BASE16_SHELL/profile_helper.sh")"

Base16-manager

https://github.com/AuditeMarlow/base16-manager

This help changes many applications colors at once.

TODO Bugs

TODO Why the cursor is turning when on the background image?

TODO VPN Setup

NordVPN

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

Installation

  yay -S nordvpn-bin

Configuration

  sudo systemctl enable nordvpnd.service
  sudo systemctl start nordvpnd.service

Usage

Command Usage
nordvpn login
nordvpn connect country
nordvpn disconnect
nordvpn status
nordvpn countries

Others

Reddit on terminal: rtv

yay -S rtv

TODO Usefull commands

Show informations about the machine

Work with PDF

pdftk

Separate PDF

pdfseparate -f 1 -l 6 file.pdf split%d.pdf Will create split1.pdf to split6.pdf files corresponding to correct pages of file.pdf.

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

Google translate from the command line

  yay -S translate-shell
  trans englishwork en:fr

Others

Command Description
glances Moniteur d'activité
meteo Get the meteo
sudo cputhrottle PID %PROC Limiter l'accès au proc pour un processus
asciinema Reccord you terminal
nmap -sP “192.168.1.*" Check all ip addresses on local netword
ncdu See what takes place on the disk
rsync -a --progress source dest Copy folders with stats
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

TODO Custom scripts

TODO [A] Password completion with fzf

Make a script to use FZF for autocompletion of password (with pass program) and then send to current line or copy. Maybe use tmux pane for that.

TODO Bash Snippets

For loop

for file in ./*; do
  command ${file};
done