Dotfiles - Manjaro Linux on Macbook Pro
- Ressources
- Package Manager: yay
- Git Setup
- Terminal
- Shell: Bash
- Terminal Multiplexer: Tmux
- Fonts
- Text Editors
- SSH setup
- GnuPG
- Launcher - Rofi
- Password Manager: Pass
- Bookmark Manager: Buku
- Browser: qutebrowser
- Monitors
- Sound Setup
- Music Setup
- Movies
- Contact Manager
- Chat Application
- Redshift
- Mail Setup
- Synchronize Mailboxes - Mbsync
- Send Mails - Msmtp
- Mail Indexer - Notmuch
- Mail Index, Search and Tagging - Mu
- Mail Client - NeoMutt
- Installation
- Vim Bindings
- Mailcap configuration
- Display html mails
- Open PDF from mail
- Integrate with contact manager
- Integration with org-mode
- Send HTML mails using Markdown
- Attachments
- Open Url from mail
- View emails while composing
- Searching mails with notmuch
- Cheatsheet
- Integration with calendar application
- Ressources
- Mu4e
- Notification system
- File Manager
- Image viewer
- Windows Manager - i3
- Custom bar - Polybar
- Compositor - Compton
- Notification Manager - Dunst
- Office Suite - LibreOffice
- SpreadSheet - SC-IM
- Managing Theme
- Advanced config
- LaTeX
- Mathematical Software
- Cloud Backup / Sync - Rclone
- Download Manager
- Default Applications
- Desktop files
- Bibliography Management
- Calendar
- Presentation software
- RSS Reader
- Task Manager
- Background manager: nitrogen
- PDF Reader: Zathura
- Theme manager
- Graphical Editor
- System monitor: conky
- Bugs
- Games on Linux
- VPN Setup
- Others
- Usefull commands
- Custom scripts
- Bash Snippets
Ressources
Linux Softwares
- terminalare.sexy
- the big list of vim like software
- https://github.com/jlevy/the-art-of-command-line
- https://github.com/herrbischoff/awesome-command-line-apps
- https://github.com/luongvo209/Awesome-Linux-Software
- https://wiki.archlinux.org/index.php/List_of_applications
- https://ambrevar.xyz/power-apps/
- https://enchiridion.red/2019/1/18/desktop-apps/
Macbook Pro
- https://medium.com/@philpl/arch-linux-running-on-my-macbook-2ea525ebefe3
- https://lobotuerto.com/blog/how-to-setup-manjaro-linux-i3-on-a-macbook-pro/
- https://mchladek.me/post/arch-mbp/
- https://0xadada.pub/2016/03/05/install-encrypted-arch-linux-on-apple-macbook-pro/
- https://loicpefferkorn.net/2015/01/arch-linux-sur-macbook-pro-retina-2014-avec-dm-crypt-lvm-et-hibernation/
Others
- Font Art: http://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=config
- https://www.youtube.com/channel/UC2eYFnH61tmytImy1mTYvhA
Git Setup
Credential Helper setup with Pass
This is explained in a further part: Integration of Pass with Git.
Terminal
https://github.com/thestinger/termite
Termite
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 [B] Terminal Multiplexer: Tmux
Session Manager - Tmuxinator
Text Editors
Neovim
https://github.com/neovim/neovim
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
Emacs
https://www.gnu.org/software/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.
Launcher - Rofi
https://github.com/DaveDavenport/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/
Initialize the password store as a git repository
pass git init
pass git remote add origin https://github.com/tdehaeze/pass.git
Gui Manager
https://github.com/IJHack/qtpass
yay -S qtpass
Integration with Rofi
https://github.com/carnager/rofi-pass
Alternative
https://github.com/ibizaman/pass-clip
yay -S pass-clip
Integration with Git
https://github.com/languitar/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
Bookmark Manager: Buku
Integration with Rofi
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' ''
TODO Browser: qutebrowser
https://github.com/qutebrowser/qutebrowser
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
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
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 |
MPD Client - ncmpcpp
https://wiki.archlinux.org/index.php/Ncmpcpp
Config
The main config is located here: ~/.ncmpcpp/config
.
The key bindings can be configured here: ~/.ncmpcpp/bindings
.
Cheatsheet
https://pkgbuild.com/~jelle/ncmpcpp/
Command | Usage |
TODO [C] Movies
TODO Chromecast with CATT
https://github.com/skorokithakis/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 [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
TODO [A] Contact Manager
TODO Chat Application
Weechat
https://weechat.org/files/doc/stable/weechat_user.en.html
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}
TODO [A] Mail Setup
Synchronize Mailboxes - Mbsync
http://isync.sourceforge.net/ https://wiki.archlinux.org/index.php/Isync
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
Mail Indexer - Notmuch
TODO [A] Mail Client - NeoMutt
https://github.com/neomutt/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 [A] File Manager
TODO [A] Ranger
https://github.com/ranger/ranger
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] Image viewer
TODO Write a script to open any type of image using the corresponding program
Filetype | png | svg | |
---|---|---|---|
Program | feh | zathura | inkview |
TODO Vimiv
TODO [B] Windows Manager - i3
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.
TODO [B] Custom bar - Polybar
TODO [C] Compositor - Compton
TODO [C] Notification Manager - Dunst
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
TODO [A] Advanced config
TODO [C] Printer
https://wiki.archlinux.org/index.php/CUPS Web based administration: http://localhost:631/
system-config-printer
TODO [B] Mount devices
- udiskie - Mount and unmount disks (https://github.com/coldfix/udiskie)
https://wiki.archlinux.org/index.php/Udisks https://wiki.archlinux.org/index.php/USB_storage_devices https://wiki.manjaro.org/index.php?title=ExFAT_file_system AUR package: bash mount
TODO [B] Bluetooth
Bluetooth: Gui: https://github.com/blueman-project/blueman
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 [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
TODO [B] Custom script to select latex symbol
https://github.com/superluserdo/Latex-picker Maybe use that script for other things?
Mathematical Software
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.
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 |
Download Manager
TODO Torrent Client - deluge
https://github.com/deluge-torrent/deluge https://wiki.archlinux.org/index.php/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
.
TODO [A] Default Applications
TODO Presentation software
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
TODO RSS Reader
GUI:
With Emacs:
Newsboat
https://github.com/newsboat/newsboat https://wiki.archlinux.org/index.php/Newsboat
TODO Task Manager
Wunderlist
PDF Reader: Zathura
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:
- terminal: https://github.com/khamer/base16-termite. TODO: this does not seems to work. Some is takken from config of termite, some from xresources. Also when reload the terminal is does not make the colors well: https://github.com/thestinger/termite/issues/273
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")"
- shell: https://github.com/chriskempson/base16-shell
- ranger: uses colors of the shell
- vim: https://github.com/chriskempson/base16-vim
- emacs: https://github.com/belak/base16-emacs
- zathura: https://github.com/nicodebo/base16-zathura
- neomutt: https://github.com/josephholsten/base16-mutt
- ncmpcpp: uses colors of terminal (termite) defined in
~/.config/termite/config
- polybar: uses colors of Xresources:
~/.Xressources.d/colors
- dunst: https://github.com/khamer/base16-dunst
- fzf: https://github.com/nicodebo/base16-fzf
- i3: https://github.com/khamer/base16-i3
- qutebrowser: https://github.com/theova/base16-qutebrowser
- rofi: https://gitlab.com/0xdec/base16-rofi
- background: use custom script
- tmux
- GUI file manager?
Possible theme managers:
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 VPN Setup
NordVPN
TODO Usefull commands
Find files or directories
- https://github.com/sharkdp/fd
- https://github.com/BurntSushi/ripgrep
- https://github.com/ggreer/the\_silver\_searcher
- find
- fzf
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 |
Others
- tldr - Community-driven man pages
- transfer.sh - upload and share files from the command line
- ffsend - share files from the command line
- https://github.com/chubin/wttr.in - weather in terminal
- https://github.com/michael-lazar/rtv
- trans
yay -S translate-shell
- awk https://linuxhandbook.com/awk-command-tutorial/
- install the software to convert image to latex code => create script to take screenshot and automatically export latex
- https://github.com/rupa/z
- https://github.com/nvbn/thefuck
- bash-sensible
- Also check at the end of this readme
- awman - Arch Wiki man pages - Arch wiki offline
- https://www.tecmint.com/linux-commands-cheat-sheet/
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 |