Dotfiles - Manjaro Linux on Macbook Pro
- Ressources
- Package Manager: yay
- Git Setup
- Dotfile Manager: yadm
- Terminal
- Shell: Bash
- Terminal Multiplexer: Tmux
- Fonts
- Text Editors
- SSH setup
- GnuPG
- Password Manager: Pass
- Bookmark Manager: Buku
- Browser: qutebrowser
- Monitors
- 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
- Launcher - Rofi
- 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/
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.
TODO [A] Dotfile Manager: yadm
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
TODO [C] Fonts
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.
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 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('<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.
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
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 Cast from qutebrowser on youtube
This is explained here: Chromecast integration.
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
Installation
yay -S weechat
Then we install some dependencies
yay -S tcl lua ruby
Enable mouse support:
/mouse enable
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
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 [B] Add custom modules
- show passwords
- show bibliography
- show bookmarks
- switch theme (dark/light)
- suspend, restart, hibernate, lock
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.
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
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/://)"
TODO [A] Advanced config
TODO [B] Webcam
https://github.com/patjak/bcwc_pcie/wiki/Get-Started
Explain how this is working now
TODO [A] Startup programs
Should I use i3 or systemd for that? https://www.reddit.com/r/linux/comments/132gle/eli5_the_systemd_vs_initupstart_controversy/
TODO [C] Printer
https://wiki.archlinux.org/index.php/CUPS http://localhost:631/
system-config-printer
TODO [A] Suspend / Hibernate
https://bbs.archlinux.org/viewtopic.php?id=215091 https://loicpefferkorn.net/2015/01/arch-linux-sur-macbook-pro-retina-2014-avec-dm-crypt-lvm-et-hibernation/
https://medium.com/@tigersoldier/macbook-pro-2015-with-arch-linux-4f8d3a2c0de5
To work around this problem, disable the driver before suspend: sudo rmmod brcmfmac
On wake up, re-enable the driver: sudo modprobe brcmfmac
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
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
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
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 [A] Calendar
TODO Vdirsyncer - Sync calendars
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
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:
Newboat
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
https://aur.archlinux.org/packages/nordvpn-bin/ https://wiki.archlinux.org/index.php/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
- 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 |