Dotfiles - Manjaro Linux on Macbook Pro

Table of Contents

1 Ressources

2 Package Manager: yay

2.1 Installation

sudo pacman -S yay

2.2 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

3 Git Setup

3.1 Installation

yay -S git

3.2 Configuration

  • ~/.gitconfig
  • ~/.gitignore_global

3.3 Diff-So-Fancy

3.3.1 Installation

yay -S diff-so-fancy

3.3.2 Configuration

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

3.4 TODO Github interface - Hub

3.4.1 Installation

yay -S hub

3.5 Credential Helper setup with Pass

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

4 Terminal

4.1 Termite

4.1.1 Installation

yay -S termite

4.1.2 Configuration

  • ~/.config/termite/config

4.1.3 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

4.2 TODO Unicode Rxvt

4.2.1 Installation

yay -S rxvt-unicode

4.2.2 Configuration

Most of Urxvt configuration is done in ~/.Xresources

5 TODO Shell: Bash

5.1 Bash Completion

yay -S bash-completion

5.2 TODO Configuration

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

6 TODO Terminal Multiplexer: Tmux

6.1 Installation

yay -S tmux

6.2 Session Manager - Tmuxinator

6.2.1 Installation

yay -S tmuxinator

6.2.2 Special sessions

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

6.2.3 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.

6.3 TODO Multiple Tmux configuration

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

6.4 TODO Configuration: theme

6.6 TODO Cheatsheet

Command Usage
   

7 TODO Fonts

7.1 Installation

yay -S ttf-inconsolata nerd-font-complete ttf-linux-libertine

7.2 TODO Default fonts

SauceCodePro Nerd Font Mono

Maybe use:

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

7.4 Emojis

yay -S ttf-emojione

7.5 Cheatsheet

Command Usage
fc-list List all fonts available

8 Text Editors

8.1 Neovim

8.1.1 Installation

yay -S neovim

8.1.2 Configuration

8.1.3 Vim Anywhere with i3

https://github.com/cknadler/vim-anywhere

yay -S vim-anywhere-git

Then, add the following to the i3 config: bindsym $mod+t exec vim-anywhere nvim termite

8.2 Emacs

8.2.1 Installation

yay -S emacs

8.2.2 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.

8.2.3 Configuration

8.2.4 SpellCheck with Aspell

yay -S aspell aspell-en aspell-fr

9 SSH setup

9.1 Generating a new SSH key

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

9.2 Start the ssh-agent in the background

eval "$(ssh-agent -s)"

9.3 Add the SSH key to the ssh-agent

ssh-add ~/.ssh/id_rsa

10 GnuPG

10.1 Install the gnupg package:

yay -S gnupg

10.2 Create a key pair

gpg --full-gen-key

10.3 Configure the gpg-agent to cache the passphrase

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

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

11 Password Manager: Pass

11.1 Install the pass package

yay -S pass

11.2 TODO Connect the GPG key

11.3 Initialize the password store as a git repository

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

11.4 Gui Manager

11.5 Integration with Rofi

11.5.1 Installation

yay -S rofi-pass

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

11.5.2 Alternative

11.6 Integration with Browsers

This is explained here.

11.7 Integration with Git

11.7.1 Installation

yay -S pass-git-helper

11.7.2 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

11.8 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"

12 Bookmark Manager: Buku

12.1 Installation

yaourt -S buku

12.2 Integration with Rofi

12.2.1 Installation

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

12.2.2 Configuration

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

12.2.3 Key binding with i3

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

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

12.3 Integration with qutebrowser

12.4 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

12.5 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' ''

12.6 Web Interface

Run:

bukuserver run --host 127.0.0.1 --port 5001

And then browse to 127.0.0.1:5001.

12.7 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

13 TODO Browser: qutebrowser

13.1 Installation

yay -S qutebrowser

13.2 View Pdf inside qutebrowser with pdfjs

13.2.1 Installation

yay -S pdfjs

13.2.2 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

13.3 TODO Make it default browser

13.4 Integration with Pass: the password manager

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

config.bind('<Ctrl-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.

13.5 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}')

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

13.7 TODO Cast youtube to chromecast

13.8 Spell Checking

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

13.10 TODO Ressources

14 Monitors

14.1 TODO cscreen script

15 Music Setup

15.1 Sound Server - Pulse Audio

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

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/

15.2 Audio Server - MPD

15.2.1 Installation

yay -S mpd

15.2.2 Automatic Startup

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

15.2.3 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

15.4 MPD Client - ncmpcpp

15.4.1 Installation

yay -S ncmpcpp

15.4.2 Config

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

15.4.3 Cheatsheet

15.5 Library Manager - beets

15.5.1 Installation

yay -S beets

15.5.2 Configuration

Configuration folder: ~/.config/beets/

15.5.3 Cheatsheet

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

16 TODO Movies

16.1 Media Player - MPV

16.1.1 Installation

yay -S mpv

16.1.2 Key Bindings

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

16.1.3 TODO CheatSheet

Command Usage

16.2 TODO Chromecast with CATT

16.2.1 Installation

yay -S catt

16.2.2 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 castsite https://en.wikipedia.org/wiki/Rickrolling Cast website

16.2.3 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

16.3 TODO Popcorn Time or similar

16.4 TODO Movie Collection Manager - Filebot

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

16.4.1 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

16.4.2 Usage

16.4.3 Configuration

Configuration folder: ~/.config/filebot/

16.4.4 Documentation

16.5 Subtitle Manager

16.5.1 subdl

17 TODO Contact Manager

17.1 GooBook - Contacts from Google

17.1.1 Installation

yay -S goobook-git

And Then

goobook authenticate

17.1.2 Usage

goobook query name

17.2 TODO lbdb

17.2.1 Installation

yay -S lbdb

17.3 TODO Use Vdirsyncer for contact synchronization

17.4 TODO Mu

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

17.5 TODO Integration with Mutt

18 TODO Chat Application

18.1 Gui Chat Application - Franz

18.1.1 Installation

Download the AppImage and run it.

18.2 Weechat

https://weechat.org/files/doc/stable/weechat_user.en.html

Installation

yay -S weechat

Then we install some dependencies

yay -S tcl lua ruby

Enable mouse support:

/mouse enable

18.2.1 TODO 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

18.2.3 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

18.2.4 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.

18.2.5 CheatSheet

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

18.2.6 Slack Integration

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

Dependency:

yay -S python2-websocket-client

18.3 TODO Terminal Based - Slack-Term

18.3.1 Installation

18.4 TODO Using Emacs

19 Redshift

19.1 Installation

yay -S redshift

20 TODO Mail Setup

20.1 Synchronize Mailboxes - Mbsync

20.1.1 Installation

yay -S isync

20.1.2 TODO Configuration

~/.mbsyncrc

20.1.3 Automation using systemd

20.1.3.1 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
20.1.3.2 Synchronize all the mailboxes
  • ~/.config/systemd/user/syncmail.service
  • ~/.config/systemd/user/syncmail.timer
systemctl --user enable syncmail.timer
systemctl --user start syncmail.timer

20.2 Send Mails - Msmtp

20.2.1 Installation

yay -S msmtp

20.3 Mail Indexer - Notmuch

20.3.1 Installation

yay -S notmuch

20.3.2 Configuration

Configuration file: ~/.notmuch-config

20.3.3 Cheatsheet

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

20.4 TODO Mail Index, Search and Tagging - Mu

20.5 TODO Mail Client - NeoMutt

20.5.1 Installation

yay -S neomutt

20.5.2 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

20.5.3 TODO Mailcap configuration

20.5.4 Display html mails

yay -S w3m

20.5.5 Open PDF from mail

~/scripts/openfile.sh

20.5.6 TODO Integrate with contact manager

20.5.9 Attachments

20.5.9.1 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

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

20.5.10 Open Url from mail

yay -S urlview

20.5.12 TODO Searching mails with notmuch

20.5.13 TODO Cheatsheet

Command Usage
   

20.5.14 TODO Integration with calendar application

20.6 TODO Mu4e

20.7 TODO Notification system

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

21 TODO File Manager

21.1 TODO Ranger

21.1.1 Installation

yay -S ranger

21.1.2 Configuration

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

21.1.3 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.

21.1.4 TODO Cheatsheet

Command Usage
X Extract archive
Z Compress file or folder

21.2 TODO nnn

21.2.1 Installation

yay -S nnn

21.3 TODO GUI File Manager: pcmanfm

22 TODO Image viewer

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

Filetype png pdf svg
Program feh zathura inkview

22.2 Feh - Minimal Image Viewer

22.2.1 Installation

yay -S feh

22.2.2 Cheatsheet

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

22.3 TODO Vimiv

22.3.1 Installation

yay -S vimiv

22.4 TODO sxiv

22.4.1 Installation

yay -S sxiv

23 TODO Windows Manager - i3

23.1 TODO Installation

yay -S i3-gaps

23.2 TODO Packages to install/understand

artwork-i3 i3-wallpapers

23.3 TODO Configuration

~/.i3/config

23.4 TODO 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.

23.4.1 Figures / Matlab

23.5 TODO Scratchpad

This mode is activated using cmd-s.

Command Usage
p Music Player - ncmpcpp
m Mail Reader - neomutt
c Calculator - insect

To close the current Scratchpad, use cmd-bsp

23.6 TODO CheatSheet

Command Usage

24 TODO Custom bar - Polybar

24.1 Installation

yay -S polybar

24.2 TODO Configuration

~/.config/polybar/config

Polybar is launched automatically from i3 config.

24.3 TODO Add custom modules

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

24.4 Display unread emails

Let's say we want to display unread emails, and when clicking on that we open our mail client.

[module/unread_mail]
type = custom/script

label-font = 2
format-underline = ${colors.background}
click-left = termite -e "tmuxinator start neomutt" &
format = <label>
exec = ~/.config/polybar/scripts/unread_mails.sh
interval = 1

A custom script ~/.config/polybar/scripts/unread_mails.sh is just returning the unread emails.

24.6 TODO Add Conky to polybar

25 TODO Compositor - Compton

25.1 Installation

yay -S compton

25.2 TODO Configuration

~/.config/compton.conf

25.3 GUI Configuration

To install:

yay -S compton-conf

Then run compton-conf

25.4 Automatic run as daemon

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

exec --no-startup-id compton -b

26 TODO Notification Manager - Dunst

26.1 Installation

yay -S dunst

26.2 Configuration

~/.config/dunst/dunstrc

26.3 TODO Special notifications

  • [ ] Mails
  • [ ] New messages on slack

26.4 TODO How to merge similar notifications like new mails?

27 Office Suite - LibreOffice

yay -S libreoffice-fresh

28 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

29 Managing Theme

29.1 GTK Themes

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

29.1.1 Gui Manager

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

Installation:

yay -S lxappearance

29.1.2 Icons and themes

yay -S zukitwo-themes faenza-icon-theme

29.2 QT Themes

Run qt5ct to manage QT Themes.

29.3 XFT Themes

Some configuration are located in ~/.Xresources.

30 Launcher - Rofi

30.1 Installation

yay -S rofi

30.2 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

30.3 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/://)"

31 TODO Advanced config

31.1 TODO Deactivate startup mac sound

sudo nvram SystemAudioVolume=%80

31.2 TODO Webcam

31.3 TODO Trackpad

The configuration is here: /etc/X11/xorg.conf.d/30-touchpad.conf

31.4 TODO Startup programs

31.5 TODO Printer

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

system-config-printer

31.5.1 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

31.5.2 TODO CheatSheet

Command Usage

31.6 TODO Kernel Management

31.6.1 TODO Cheatsheet

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

31.9 TODO Suspend / Hibernate

31.9.1 Current behavior

Actually, it seems that the first suspend is working. After that the macbook go out of the suspend after few seconds

31.10 TODO Lid open/close

Should automatic show lock screen

/etc/systemd/logind.conf

31.12 TODO NAS Synology

31.12.2 TODO Automatic Backup of folders?

AUR package: synology backup

31.12.4 TODO Install beets on the nas?

31.13 TODO Format disks

https://gparted.org/

sudo gparted to format disks ()

31.14 TODO Bluetooth

31.14.2 TODO Bluetooth headset

31.16 TODO Temperature and Fan control

https://github.com/dgraziotin/mbpfan https://0xadada.pub/2016/03/05/install-encrypted-arch-linux-on-apple-macbook-pro/#fine-tuning 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

31.18 TODO Lock Screen

31.18.1 Installation

yay -S betterlockscreen

32 TODO LaTeX

32.1 Installation

yay -S texlive-most

Biber support for the bibliography:

yay -S biber

Support for source code using minted:

yay -S minted

32.2 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.

32.3 TODO From screenshot to latex math formula

32.3.1 Installation

yay -S mathpix-snipping-tool

32.3.2 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.

32.3.3 TODO 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.

32.4 TODO Custom script to select latex symbol

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

33 Mathematical Software

33.1 Insect

33.1.1 Installation

yay -S insect

33.1.2 Usage

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

33.2 Matlab

33.2.1 Installation

yay -S matlab

34 TODO 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.

34.1 Installation

yay -S rclone

34.2 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

34.3 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

34.3.1 Progress bar for long synchronizations

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

35 Download Manager

35.1 TODO CLI Download Manager - Aria2

35.1.1 Installation

yay -S aria2

35.1.2 Usage

35.2 TODO Torrent Client - deluge

35.2.1 Installation

yay -S deluge

35.2.2 Configuration

~/.config/deluge/

35.2.3 Command Line Interface

https://whatbox.ca/wiki/deluge_console_documentation

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

35.2.4 GUI Client

deluge

35.3 TODO CLI Torrent Client - btpd

35.4 TODO Youtube-dl

yay -S youtube-dl

35.4.1 Download best audio

youtube-dl -f bestaudio url

35.4.2 Download best video with audio

youtube-dl -f best url

35.4.3 Download playlist

36 TODO Default Applications

36.1 Mailcap file

36.2 TODO XDG-OPEN

~/.config/mimeapps.list

36.3 TODO Make QuteBrowser the default browser

37 TODO Desktop files

~/.local/share/applications/

38 TODO Bibliography Management

38.2 Papis

38.2.1 Installation

sudo pip3 install papis

39 TODO Calendar

39.1 TODO Vdirsyncer - Sync calendars

39.1.1 Installation

yay -S vdirsyncer
sudo pip install requests-oauthlib

39.1.2 Cheatsheet

Command Usage
vdirsyncer sync Synchronize

39.1.3 Automation - Systemd

http://vdirsyncer.pimutils.org/en/stable/tutorials/systemd-timer.html?highlight=systemd

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

To check the status of the service:

systemctl --user status vdirsyncer.service

39.2 TODO Calendar Client - Khal

39.2.1 Installation

yay -S khal

39.2.2 TODO Cheatsheet

Command Usage

39.3 TODO Calendar Client - Calcurse

39.3.1 Installation

yay -S calcurse

40 TODO Presentation software

40.1 Beamer

40.3 Presentation setup on computer

40.4 PowerPoint Viewer

40.5 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

40.5.1 Installation

yay -S pdfpc

40.5.2 Video support

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

40.5.3 Usage

pdfpc filename.pdf

41 TODO RSS Reader

41.1 Newboat

41.1.1 Installation

yay -S newboat

41.1.2 Configuration

41.1.3 TODO Automatic Retrival of Feeds

Make a systemd service.

41.1.4 TODO Add reddit personnal RSS

42 TODO Task Manager

42.1 OrgMode and Emacs

42.2 Wunderlist

42.2.1 Wunderline

42.2.1.1 Installation
yay -S wunderline
42.2.1.2 Cheatsheet

wunderline list

43 Background manager: nitrogen

43.1 Configuration

~/.config/nitrogen/nitrogen.cfg

43.2 Wallpapers

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

44 PDF Reader: Zathura

44.1 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.

44.2 Configuration

~/.config/zathura/zathurarc

44.3 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

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

45.1 TODO Theme script

~/bin/theme

45.2 TODO Base16

45.2.1 Base16 Philosophy

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

45.2.2 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")"

45.2.3 Base16-manager

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

This help changes many applications colors at once.

46 TODO Graphical Editor

47 TODO System monitor: conky

48 TODO Bugs

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

49 TODO Games on Linux

50 TODO VPN Setup

50.1 NordVPN

50.1.1 Installation

yay -S nordvpn-bin

50.1.2 Configuration

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

50.1.3 Usage

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

50.1.4 TODO Integration with Polybar

51 Others

51.1 Reddit on terminal: rtv

yay -S rtv

52 TODO Usefull commands

52.2 Show informations about the machine

52.3 Work with PDF

pdftk

52.4 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.

52.5 Readline

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

Keyboard Shortcut Description
Ctrl+l Clear the screen

52.5.1 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

52.5.2 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

52.5.3 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

52.5.4 Completion

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

52.6 Google translate from the command line

yay -S translate-shell
trans englishwork en:fr

52.7 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

52.8 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

53 TODO Custom scripts

53.1 TODO 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.

54 TODO Bash Snippets

54.1 For loop

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

Author: Thomas Dehaeze

Created: 2019-04-01 lun. 18:13

Validate