Moved org files to single directory, Polybar config now in org file
This commit is contained in:
@@ -1 +0,0 @@
|
||||
/home/phundrak/.config/fish/README.org
|
||||
@@ -1 +0,0 @@
|
||||
/home/phundrak/.config/i3/README.org
|
||||
@@ -1 +0,0 @@
|
||||
/home/phundrak/.local/bin/README.org
|
||||
@@ -1 +0,0 @@
|
||||
/home/phundrak/README.org
|
||||
1304
org/config-website/bin.org
Normal file
1304
org/config-website/bin.org
Normal file
File diff suppressed because it is too large
Load Diff
591
org/config-website/fish.org
Normal file
591
org/config-website/fish.org
Normal file
@@ -0,0 +1,591 @@
|
||||
#+TITLE: Phundrak’s fish config
|
||||
#+INCLUDE: ~/org/config-website/headers.org
|
||||
#+OPTIONS: auto-id:t
|
||||
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's fish config" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's fish config" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the fish config file of Phundrak" />
|
||||
#+PROPERTY: header-args:fish :tangle ~/.config/fish/config.fish :exports code
|
||||
#+PROPERTY: header-args :exports code
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c7ab05d0-4c5f-4a4c-8603-4c79e264141c
|
||||
:END:
|
||||
- [[#presentation][Presentation]]
|
||||
- [[#fish-from-within-emacs][Fish from within Emacs]]
|
||||
- [[#tramp-remote-access][Tramp remote access]]
|
||||
- [[#regular-fish-shell-appearance][Regular fish shell appearance]]
|
||||
- [[#global-variables][Global variables]]
|
||||
- [[#theme-customization][Theme customization]]
|
||||
- [[#abbreviations][Abbreviations]]
|
||||
- [[#system-monitoring][System monitoring]]
|
||||
- [[#system-management-packages-and-services][System management (packages and services)]]
|
||||
- [[#package-mangaement][Package mangaement]]
|
||||
- [[#service-management][Service management]]
|
||||
- [[#development][Development]]
|
||||
- [[#cmake][CMake]]
|
||||
- [[#compilation][Compilation]]
|
||||
- [[#docker][Docker]]
|
||||
- [[#git][Git]]
|
||||
- [[#prolog][Prolog]]
|
||||
- [[#text-editors][Text editors]]
|
||||
- [[#latex][LaTeX]]
|
||||
- [[#some-security-measures][Some security measures]]
|
||||
- [[#typos][Typos]]
|
||||
- [[#misc][Misc]]
|
||||
- [[#sudo][Sudo]]
|
||||
- [[#exit][Exit]]
|
||||
- [[#history][History]]
|
||||
- [[#youtube-dl-related-commands][~youtube-dl~ related commands]]
|
||||
- [[#song-download-from-youtube][Song download from YouTube]]
|
||||
- [[#videos-download-from-youtube][Videos download from YouTube]]
|
||||
- [[#mpv][MPV]]
|
||||
- [[#compression][Compression]]
|
||||
- [[#feh][Feh]]
|
||||
- [[#network-management][Network Management]]
|
||||
- [[#wget][Wget]]
|
||||
|
||||
* Presentation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c2560b46-7f97-472f-b898-5ab483832228
|
||||
:END:
|
||||
The file present in =~/.config/fish/config.fish= is the configuration file for
|
||||
the [[https://fishshell.com/][fish shell]]. It contains custom functions, environment variables and
|
||||
abbreviations.
|
||||
|
||||
Just in case, we might need sometimes to declare the fish function
|
||||
=fish_title= as =true=, so let’s do so.
|
||||
#+BEGIN_SRC fish
|
||||
function fish_title
|
||||
true
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Fish from within Emacs
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-97d738f4-1ea0-4f64-a31d-19643486a951
|
||||
:END:
|
||||
I sometimes call fish from within emacs, with =M-x ansi-term=. In this case,
|
||||
the variable =TERM= needs to have the value =eterm-color=.
|
||||
#+BEGIN_SRC fish
|
||||
if test -n "$EMACS"
|
||||
set -x TERM eterm-color
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Tramp remote access
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-6cad2cc9-aef6-4df4-90f9-97053e82072a
|
||||
:END:
|
||||
When accessing from a remote machine our computer from Emacs, tramp needs a
|
||||
precise shell appearance: a simple =$= followed by a space after which to put
|
||||
the commands it needs to execute, and nothing else. Due to this, let’s
|
||||
deactivate and redefine some of the functions defining the appearance of
|
||||
fish.
|
||||
#+BEGIN_SRC fish
|
||||
if test "$TERM" = "dumb"
|
||||
function fish_prompt
|
||||
echo "\$ "
|
||||
end
|
||||
function fish_right_prompt; end
|
||||
function fish_greeting; end
|
||||
function fish_title; end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Regular fish shell appearance
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-a8434b29-c146-4141-b8f8-1b446c791907
|
||||
:END:
|
||||
Now, there is only one function I modify when it comes to the appearance of
|
||||
fish when I’m the one using it: I simply “delete” the =fish_greeting=
|
||||
function.
|
||||
#+BEGIN_SRC fish
|
||||
function fish_greeting; end
|
||||
#+END_SRC
|
||||
|
||||
* Global variables
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-0eff37da-af9f-4546-8ad3-201961a2200f
|
||||
:END:
|
||||
Some global variables might sometimes be needed and need to be modified. This
|
||||
is for example the case with my =PATH= variable in which I add Rust’s Cargo’s
|
||||
binaries, Go’s binaries and my own executables. And of course, don’t forget
|
||||
to add the already existing =PATH=.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx PATH \
|
||||
$HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin \
|
||||
$HOME/.gem/ruby/2.6.0/bin $PATH
|
||||
#+END_SRC
|
||||
|
||||
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it
|
||||
can get the sudo password. So, let’s declare it.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx SUDO_ASKPASS ~/.local/bin/askpass
|
||||
#+END_SRC
|
||||
|
||||
Now, let’s declare our editor of choice, EmacsClient; not Emacs itself since
|
||||
it will most often be just quick edits, nothing too heavy, if it is called
|
||||
from the =EDITOR= variable (from Git, for example).
|
||||
#+BEGIN_SRC fish
|
||||
set -gx EDITOR emacsclient -c
|
||||
#+END_SRC
|
||||
|
||||
We also need to set the path to the Dart SDK.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx DART_SDK /opt/dart-sdk/bin
|
||||
#+END_SRC
|
||||
|
||||
And we also need to specify where the Android SDK it located.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx ANDROID_HOME $HOME/Android/Sdk
|
||||
#+END_SRC
|
||||
|
||||
Finally, some development packages require the =PKG_CONFIG_PATH= to be set,
|
||||
so let’s do so.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
|
||||
#+END_SRC
|
||||
|
||||
* Theme customization
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e9dccb31-8350-459d-b688-b5b7cbeab272
|
||||
:END:
|
||||
The theme I use is =bobthefish=. Although its default configuration is quite
|
||||
alright, it allows some customization. The first thing I want to enable is the
|
||||
support for =nerd-fonts=:
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_nerd_fonts_support yes
|
||||
#+END_SRC
|
||||
|
||||
Next, I want the name of the current process to be shown in the terminal
|
||||
title.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_title_display_process yes
|
||||
#+END_SRC
|
||||
|
||||
I also wish to display the current host in the prompt, but only when I am
|
||||
connected through an SSH session.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_display_hostname ssh
|
||||
#+END_SRC
|
||||
|
||||
I also want the sudo username to be displayed, as a warning that I am indeed
|
||||
running a session as root.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_display_sudo_user yes
|
||||
#+END_SRC
|
||||
|
||||
The exit status can be sometimes really useful, hence why I want it activated.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_show_exit_status yes
|
||||
#+END_SRC
|
||||
|
||||
I also want to have proper git worktree support.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_git_worktree_support yes
|
||||
#+END_SRC
|
||||
|
||||
* Abbreviations
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-740bd904-3e32-4c09-b0a4-bde16ae2e116
|
||||
:END:
|
||||
** System monitoring
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-ec910a8c-9154-48a4-b4cd-df28cb4e54d9
|
||||
:END:
|
||||
Here I have some abbreviations which are quite useful when performing some
|
||||
system monitoring. With =df=, we can get an overview of our filesystem
|
||||
usage, while with =diskspace= we get some more precise information.
|
||||
#+BEGIN_SRC fish
|
||||
abbr df 'df -H'
|
||||
abbr diskspace 'sudo df -h | grep -E "sd|lv|Size"'
|
||||
#+END_SRC
|
||||
|
||||
=meminfo= is a call to =free= with sane defaults.
|
||||
#+BEGIN_SRC fish
|
||||
abbr meminfo 'free -m -l -t'
|
||||
#+END_SRC
|
||||
|
||||
Similar to =meminfo=, we also have =gpumeminfo= so we can get a quick look
|
||||
at the memory-related logs of our X session.
|
||||
#+BEGIN_SRC fish
|
||||
abbr gpumeminfo 'grep -i --color memory /var/log/Xorg.0.log'
|
||||
#+END_SRC
|
||||
|
||||
I also declared =cpuinfo= an alias of =lscpu= in order to keep consistent
|
||||
with =meminfo=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr cpuinfo lscpu
|
||||
#+END_SRC
|
||||
|
||||
=pscpu= gives us information on what the CPU is running right now, and
|
||||
=pscpu10= limits that to the top 10 threads.
|
||||
#+BEGIN_SRC fish
|
||||
abbr pscpu 'ps auxf | sort -nr -k 3'
|
||||
abbr pscpu10 'ps auxf | sort -nr -k 3 | head -10'
|
||||
#+END_SRC
|
||||
|
||||
Similarly, =psmem= gives us information on the memory usage of the current
|
||||
threads, and =psmem10= only the ten most important threads in terms of
|
||||
memory usage.
|
||||
#+BEGIN_SRC fish
|
||||
abbr psmem 'ps auxf | sort -nr -k 4'
|
||||
abbr psmem10 'ps auxf | sort -nr -k 4 | head -10'
|
||||
#+END_SRC
|
||||
|
||||
** System management (packages and services)
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-78ac23f0-960d-4f56-9cba-64413fd61885
|
||||
:END:
|
||||
I added some of these abbreviations due to how often I have to write the
|
||||
whole thing.
|
||||
|
||||
*** Package mangaement
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-281a59aa-4ea0-47ab-a4cc-33fff8d38165
|
||||
:END:
|
||||
The first command is =remove= which removes a package from my system, as
|
||||
well as its dependencies no longer needed.
|
||||
#+BEGIN_SRC fish
|
||||
abbr remove 'sudo pacman -Rscnd'
|
||||
#+END_SRC
|
||||
|
||||
But if I just want to run =pacman= as sudo, then I could always just type
|
||||
=p=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr p 'sudo -A pacman'
|
||||
#+END_SRC
|
||||
|
||||
Sometimes, I just want to purge my package manager’s cache, be it
|
||||
=pacman='s or =yay='s. This is why I simply type =purge=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr purge 'yay -Sc'
|
||||
#+END_SRC
|
||||
|
||||
And if I want to simply seach among the =pacman= repos, I can type
|
||||
=search=. Otherwise, if I want to include AUR results, I’ll use =yay=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr search 'pacman -Ss'
|
||||
#+END_SRC
|
||||
|
||||
To update everything from the official repos, I’ll sometimes type =update=
|
||||
instead of the full command.
|
||||
#+BEGIN_SRC fish
|
||||
abbr update 'sudo pacman -Syu'
|
||||
#+END_SRC
|
||||
|
||||
*** Service management
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3a734119-ccee-4cdf-b04c-d55a37dea571
|
||||
:END:
|
||||
I don’t have the muscle memory of =systemctl=. So instead, I simply type
|
||||
=c= when I want to do something user service related.
|
||||
#+BEGIN_SRC fish
|
||||
abbr s 'systemctl --user'
|
||||
#+END_SRC
|
||||
|
||||
And if I want to manipulate system services, I can instead type a simple
|
||||
capital =S=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr S 'sudo systemctl'
|
||||
#+END_SRC
|
||||
|
||||
** Development
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-32ae38a2-41ad-438e-b619-220a63166115
|
||||
:END:
|
||||
A good amount of these commands are development related, especially when it
|
||||
comes to compilation or Docker.
|
||||
|
||||
*** CMake
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-887c87aa-b100-4b27-9006-778fd7e3329c
|
||||
:END:
|
||||
I have the following abbreviations so I can quickly run CMake and create a
|
||||
configuration for debug or release profiles.
|
||||
#+BEGIN_SRC fish
|
||||
abbr cdebug 'cmake -DCMAKE_BUILD_TYPE=Debug'
|
||||
abbr crelease 'cmake -DCMAKE_BUILD_TYPE=Release'
|
||||
#+END_SRC
|
||||
|
||||
*** Compilation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-0beb47e5-d76a-4037-8f58-e8de141e3761
|
||||
:END:
|
||||
By default, I set =clang=, =clang++=, =gcc= and =g++= to the latest
|
||||
standard and with the =-Wall= flag activated.
|
||||
#+BEGIN_SRC fish :tangle
|
||||
abbr clang 'clang -Wall'
|
||||
abbr clang++ 'clang++ -Wall'
|
||||
abbr g++ 'g++ -Wall -std=c++17'
|
||||
abbr gcc 'gcc -Wall -std=c18'
|
||||
#+END_SRC
|
||||
|
||||
*** Docker
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-91c7ff90-7b43-4802-be69-5d102281c6d3
|
||||
:END:
|
||||
And of course, when it comes to Docker Compose, I don’t have time to write
|
||||
the full command, so I use these instead.
|
||||
#+BEGIN_SRC fish
|
||||
abbr dc docker-compose
|
||||
abbr dcd 'docker-compose down'
|
||||
abbr dcr 'docker-compose run --rm'
|
||||
abbr dcu 'docker-compose up'
|
||||
abbr dcub 'docker-compose up --build'
|
||||
#+END_SRC
|
||||
|
||||
*** Git
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e72347d4-590e-448c-bc33-0a70fa8ab35b
|
||||
:END:
|
||||
And let’s face it: we all at one point just wanted to commit our code
|
||||
without thinking about the message, to just get over with it. Don’t worry,
|
||||
I got you covered.
|
||||
#+BEGIN_SRC fish :tangle
|
||||
abbr randcommit 'git commit -m (curl -s whatthecommit.com/index.txt)'
|
||||
#+END_SRC
|
||||
|
||||
*** Prolog
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-cbb6c31e-faaa-48c3-a83a-d1f143fdcb8d
|
||||
:END:
|
||||
When I launch =swipl=, I prefer to have my terminal cleaned before and
|
||||
after it runs, I find it more clean.
|
||||
#+BEGIN_SRC fish
|
||||
abbr swipl 'clear && swipl -q && clear'
|
||||
#+END_SRC
|
||||
|
||||
*** Text editors
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-51155e06-872d-4a12-9bf7-ae5eabc256ad
|
||||
:END:
|
||||
I greatly prefer to use Emacsclient as my main text editor; Emacs has
|
||||
basically all I need. So, it’s only normal I have an abbreviation to launch
|
||||
a new instance of it.
|
||||
#+BEGIN_SRC fish
|
||||
abbr e 'emacsclient -c'
|
||||
#+END_SRC
|
||||
However, in a graphical environment, this will launch a new graphical
|
||||
window of Emacs. To launch a terminal instance, I’ll use =enw= (=nw= stands
|
||||
for the option “nowindow” =-nw= of Emacs).
|
||||
#+BEGIN_SRC fish
|
||||
abbr enw 'emacsclient -c -nw'
|
||||
#+END_SRC
|
||||
|
||||
I also have the abbreviation =vi= which refers to =vim=. I really should
|
||||
learn =vi=, but I also really don’t feel like it.
|
||||
#+BEGIN_SRC fish
|
||||
abbr vi vim
|
||||
#+END_SRC
|
||||
|
||||
** LaTeX
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-a8f8a707-90d7-4784-982d-d959b183148e
|
||||
:END:
|
||||
Yes, although I use org-mode, I still have some use for LaTeX, especially
|
||||
when it comes to PDF exports of my org files. Hence why I use the LaTeX
|
||||
package manager. It is recommended to use =tllocalmgr= instead of =tlmgr=,
|
||||
but I can never remember the command, and the latter is faster to type, so
|
||||
time for an abbreviation.
|
||||
#+BEGIN_SRC fish
|
||||
abbr tlmgr tllocalmgr
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC fish
|
||||
abbr texhash 'sudo texhash'
|
||||
#+END_SRC
|
||||
|
||||
** Some security measures
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-dd97ea71-c43f-4b79-8bb7-1f857284b1b4
|
||||
:END:
|
||||
Some commands can be quite dangerous when not used properly, which is why I
|
||||
added default flags and options so I can get warnings before things get
|
||||
ugly.
|
||||
#+BEGIN_SRC fish
|
||||
abbr cp 'cp -i'
|
||||
abbr ln 'ln -i'
|
||||
abbr lns 'ln -si'
|
||||
abbr mv 'mv -i'
|
||||
abbr rm 'rm -I'
|
||||
abbr rmd 'rm --preserve-root -Ir'
|
||||
abbr rmdf 'rm --preserve-root -Irf'
|
||||
abbr rmf 'rm --preserve-root -If'
|
||||
#+END_SRC
|
||||
The =-i= and =-I= add prompts in case we might not want to do what we asked
|
||||
the shell to do. Notice =lns= which creates symlinks, =rmd= which removes
|
||||
directories, =rmf= which forces deletion, and =rmdf= which forces the
|
||||
delition of a directory. Notice also the =--preserve-root= which will
|
||||
prevent me from accidentally removing the root folder. I added the same
|
||||
option to =chgrp=, =chmod=, and =chown=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr chgrp 'chgrp --preserve-root'
|
||||
abbr chmod 'chmod --preserve-root'
|
||||
abbr chown 'chown --preserve-root'
|
||||
#+END_SRC
|
||||
|
||||
** Typos
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4c5a03cd-20a8-437e-87b7-af990780084e
|
||||
:END:
|
||||
Let’s admit it, we all make typos from time to time in the shell, and some
|
||||
are recurrent enough we make abbreviations or aliases of the correct
|
||||
command. Well, I have some of my abbreviations which were make exactly
|
||||
because of this.
|
||||
|
||||
Sometimes for some reasons, my brain makes me write =clean= instead of
|
||||
=clear=. So, let’s just replace the former by the latter.
|
||||
#+BEGIN_SRC fish
|
||||
abbr clean clear
|
||||
#+END_SRC
|
||||
|
||||
I’m also very bad at typing =exit=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr exi exit
|
||||
abbr exti exit
|
||||
#+END_SRC
|
||||
|
||||
And sometimes I suck at typing =htop=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr hotp htop
|
||||
#+END_SRC
|
||||
|
||||
** Misc
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3a237ec0-c535-42c7-9c60-3d083745b643
|
||||
:END:
|
||||
Finally, some miscellaneous abbreviations that don’t really fit into any of
|
||||
the above categories.
|
||||
|
||||
*** Sudo
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-0955e2fc-ec25-41b6-814a-929fa3718dda
|
||||
:END:
|
||||
First, I make it so that =sudo= comes with the =-A= switch in order to call
|
||||
my custom graphical script for getting my password (see
|
||||
[[file:~/.local/bin/askpass][.local/bin/askpass]]). I also made it so =please= is an equivalent to =sudo
|
||||
-A= as a joke.
|
||||
#+BEGIN_SRC fish
|
||||
abbr please 'sudo -A'
|
||||
#+END_SRC
|
||||
|
||||
*** Exit
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-8cf0e895-b919-41a8-ad3d-c5294dc507fd
|
||||
:END:
|
||||
Sometimes I find it easier to just type =q= instead of =exit=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr q exit
|
||||
#+END_SRC
|
||||
|
||||
*** History
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-162052c5-63c4-435a-b973-422346522c69
|
||||
:END:
|
||||
I also find it more intuitive and faster to just write =hist= instead of
|
||||
=history=, so let’s declare that.
|
||||
#+BEGIN_SRC fish
|
||||
abbr hist history
|
||||
#+END_SRC
|
||||
|
||||
*** ~youtube-dl~ related commands
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-177d56dc-39a6-4f4c-a7ba-179dd5c6cac8
|
||||
:END:
|
||||
**** Song download from YouTube
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4bc663a9-b609-4c86-9a4d-a220013c67f9
|
||||
:END:
|
||||
When I want to download a song from YouTube, I’ll just use the command
|
||||
=flac videoIdentifier= to get it through =youtube-dl=.
|
||||
#+BEGIN_SRC fish
|
||||
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
|
||||
#+END_SRC
|
||||
|
||||
**** Videos download from YouTube
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e6e45b59-7620-4d17-ba32-67a33f39cc4b
|
||||
:END:
|
||||
I download a LOT of videos from YouTube, generally educative videos that I
|
||||
do not want to lose to YouTube one day who will decide that such channel is
|
||||
unworthy of their platform, or if the original author decides to delete
|
||||
their videos or whatever. So, I use the abbreviation ~ytdl~ to download
|
||||
either one video, or a whole YouTube channel.
|
||||
#+BEGIN_SRC fish
|
||||
abbr ytdl 'youtube-dl -f best -ciw -o "~/Videos/YouTube/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s"'
|
||||
#+END_SRC
|
||||
|
||||
*** MPV
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3fd5a7eb-4ed4-4b0b-87ca-28f36fb22793
|
||||
:END:
|
||||
When it comes to mpv, I do not want to force it to open a graphical window
|
||||
if for example I want to listen to an audio file. I also do not want any
|
||||
border on that window. So, I declared this abbreviation.
|
||||
#+BEGIN_SRC fish
|
||||
abbr mpv 'mpv --no-border --force-window=no'
|
||||
#+END_SRC
|
||||
|
||||
*** Compression
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-05919be3-360a-45c6-8c89-76836375d55b
|
||||
:END:
|
||||
It seems it’s just like many other people, but I cannot for the life of me
|
||||
remember the syntax of =tar=. So, I made the following abbreviations, and
|
||||
one day hopefully, after seeing the abbreviations’ expansion over and over
|
||||
I’ll remember the command like I did for the abbreviation of =remove= (see
|
||||
[[#h-281a59aa-4ea0-47ab-a4cc-33fff8d38165][Package management]]).
|
||||
#+BEGIN_SRC fish
|
||||
abbr compress 'tar -czf'
|
||||
abbr untar 'tar -xvzf'
|
||||
#+END_SRC
|
||||
|
||||
*** Feh
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-41cfc583-14ba-4f15-9578-bc37b432a3ce
|
||||
:END:
|
||||
Some sane default options for =feh=, including auto-zoom to fit the picture
|
||||
to the window, a borderless window, and again scale the image to fit the
|
||||
window geometry.
|
||||
#+BEGIN_SRC fish
|
||||
abbr feh 'feh -Zx.'
|
||||
#+END_SRC
|
||||
|
||||
*** Network Management
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-5f9d4866-3086-4ed9-9ff3-d80a0af36593
|
||||
:END:
|
||||
First, we have just =nmcli= with sane default options, that is a pretty output
|
||||
with colors.
|
||||
#+BEGIN_SRC fish
|
||||
abbr nmcli 'nmcli -p -c auto'
|
||||
#+END_SRC
|
||||
|
||||
Next, we have some NordVPN-related shortcuts. The first one is a simple
|
||||
abbreviation to =nordvpn=. The second one is a shortcut to connect to a
|
||||
server, and to disconnect from the current server.
|
||||
#+BEGIN_SRC fish
|
||||
abbr n 'nordvpn'
|
||||
abbr nc 'nordvpn c'
|
||||
abbr nd 'nordvpn d'
|
||||
#+END_SRC
|
||||
|
||||
I also have a couple of shortcuts to quickly connect to some preselected
|
||||
countries, mainly France, Germany, Japan and the US.
|
||||
#+BEGIN_SRC fish
|
||||
abbr ncf 'nordvpn c France'
|
||||
abbr ncg 'nordvpn c Germany'
|
||||
abbr ncj 'nordvpn c Japan'
|
||||
abbr ncu 'nordvpn c United_States'
|
||||
#+END_SRC
|
||||
|
||||
*** Wget
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-74f84f1c-433d-488a-88a7-89915c1a3bd5
|
||||
:END:
|
||||
By default, continue a download that was interupted.
|
||||
#+BEGIN_SRC fish
|
||||
abbr wget 'wget -c'
|
||||
#+END_SRC
|
||||
927
org/config-website/i3.org
Normal file
927
org/config-website/i3.org
Normal file
@@ -0,0 +1,927 @@
|
||||
# -*- org-confirm-babel-evaluate: nil -*-
|
||||
#+TITLE: Phundrak’s i3 config
|
||||
#+INCLUDE: ~/org/config-website/headers.org
|
||||
#+OPTIONS: auto-id:t
|
||||
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's i3 config" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's i3 config" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the i3 config file of Phundrak" />
|
||||
#+PROPERTY: header-args :noweb yes :exports code :tangle ~/.config/i3/config##yadm.j2
|
||||
#+PROPERTY: header-args:python :exports none :tangle no
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c7ab05d0-4c5f-4a4c-8603-4c79e264141c
|
||||
:END:
|
||||
|
||||
- [[#presentation][Presentation]]
|
||||
- [[#variables-declaration][Variables declaration]]
|
||||
- [[#global][Global]]
|
||||
- [[#floating-windows][Floating windows]]
|
||||
- [[#i3-global-settings][i3 global settings]]
|
||||
- [[#mouse-settings][Mouse settings]]
|
||||
- [[#popup-handling][Popup handling]]
|
||||
- [[#behavior-of-workspace-changes][Behavior of workspace changes]]
|
||||
- [[#gaps-and-window-appearance][Gaps and window appearance]]
|
||||
- [[#assigning-windows-to-workspaces][Assigning windows to workspaces]]
|
||||
- [[#shortcuts][Shortcuts]]
|
||||
- [[#terminal-shortcuts][Terminal shortcuts]]
|
||||
- [[#i3-shortcuts][i3 shortcuts]]
|
||||
- [[#window-and-workspace-management][Window and workspace management]]
|
||||
- [[#managing-how-windows-will-split][Managing how windows will split]]
|
||||
- [[#focus-windows][Focus windows]]
|
||||
- [[#focus-workspaces][Focus workspaces]]
|
||||
- [[#moving-windows][Moving windows]]
|
||||
- [[#moving-containers][Moving containers]]
|
||||
- [[#moving-workspaces][Moving workspaces]]
|
||||
- [[#close-windows][Close windows]]
|
||||
- [[#manage-the-size-of-the-current-window][Manage the size of the current window]]
|
||||
- [[#manage-floating-windows][Manage floating windows]]
|
||||
- [[#scratchpad-and-window-display][Scratchpad and window display]]
|
||||
- [[#gaps-management][Gaps management]]
|
||||
- [[#launching-software][Launching software]]
|
||||
- [[#software-and-command-launcher][Software and command launcher]]
|
||||
- [[#internet-software][Internet software]]
|
||||
- [[#screenshots][Screenshots]]
|
||||
- [[#screen-brightness][Screen brightness]]
|
||||
- [[#media-control][Media control]]
|
||||
- [[#rofi-utilities][Rofi utilities]]
|
||||
- [[#miscellaneous][Miscellaneous]]
|
||||
- [[#screen-management][Screen management]]
|
||||
- [[#software-autolaunch][Software autolaunch]]
|
||||
|
||||
* Presentation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-2b02cfba-4ada-4f75-b522-bfcb8512119c
|
||||
:END:
|
||||
=i3= is a window manager for GNU/Linux which automatically tiles windows in
|
||||
workspaces. This configuration was ade to automatically handle some tasks such
|
||||
as which software allowed where, autostart, and launching software with
|
||||
shortcuts.
|
||||
|
||||
It is to be noted I am using [[https://github.com/resloved/i3][resloved’s fork of i3]], =i3-gaps-rounded=. Some
|
||||
configuration will not work with =i3-gaps=, and some will not work with
|
||||
vanilla =i3= either.
|
||||
|
||||
#+BEGIN_SRC conf :exports none
|
||||
# -*- mode: conf -*-
|
||||
#+END_SRC
|
||||
|
||||
* Variables declaration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-27f4474a-e037-4e40-b33a-7fe34ca012e3
|
||||
:END:
|
||||
** Global
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-dda00dd9-90e4-460b-b49c-8939c1ae11ce
|
||||
:END:
|
||||
The first I do is declaring the modifier key and the alt key —I don’t find
|
||||
the names =Mod1= and =Mod4= to be explicit enough. This will map =$mod= to
|
||||
the Super key (or as some people unfortunately call it, the /Windows/ key)
|
||||
and =$alt= to the Alt key.
|
||||
|
||||
Let’s also bind the =$up=, =$down=, =$left= and =$right= variables to
|
||||
respectively the up, down, left, and right arrows on the keyboard. Why bind
|
||||
them to variables? If I ever want to modify the arrow keys to some other
|
||||
keys, like =é=, =a=, =u=, and =i= (the equivalent of =wqsd= on the bépo
|
||||
layout) or =c=, =t=, =s=, and =r= (the equivalent of =hjkl= on the bépo
|
||||
layout), I will just have to modify these four lines.
|
||||
|
||||
I’ll also set the =$term= variable. A lot of shortcuts in my i3 config rely
|
||||
on the terminal emulator itself to launch commands in the terminal, and thus
|
||||
call the terminal itself. If I ever need to move from my current terminal, I
|
||||
will just have to change the name of the executable here.
|
||||
|
||||
#+NAME: variable-table
|
||||
| variable | value |
|
||||
|-------------+--------------------------------------------------------------------------|
|
||||
| $mod | Mod4 |
|
||||
| $alt | Mod1 |
|
||||
| $up | Up |
|
||||
| $down | Down |
|
||||
| $left | Left |
|
||||
| $right | Right |
|
||||
| $term | st |
|
||||
|
||||
#+NAME: variable-sh
|
||||
| variable | value |
|
||||
|-------------+--------------------------------------------------------------------------|
|
||||
| $exiti3 | i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit' |
|
||||
| $lockscreen | Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89 |
|
||||
| $rofiexec | rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons |
|
||||
| $gnus | emacsclient --create-frame --eval '(gnus)' -n |
|
||||
| $ec | emacsclient --create-frame -n |
|
||||
| $walset | wal -i ~/Pictures/Wallpapers -o wal-set |
|
||||
|
||||
Variables will be set like so.
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
set $term st
|
||||
#+END_SRC
|
||||
|
||||
#+NAME: generate-variables
|
||||
#+BEGIN_SRC python :var variables=variable-table :cache yes
|
||||
result = ''
|
||||
for line in variables:
|
||||
result += "set {0} {1}\n".format(line[0], line[1])
|
||||
return result
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS[58c517fe29b63f631ff0ba754d5d9ec4ea673388]: generate-variables
|
||||
: set $mod Mod4
|
||||
: set $alt Mod1
|
||||
: set $up Up
|
||||
: set $down Down
|
||||
: set $left Left
|
||||
: set $right Right
|
||||
: set $term st
|
||||
|
||||
Finally, some variables hold some long strings for commands I don’t want to
|
||||
have to type multiple times.
|
||||
#+NAME: generate-variables2
|
||||
#+BEGIN_SRC python :var variables=variable-sh :cache yes
|
||||
result = ''
|
||||
for line in variables:
|
||||
result += "set {0} \"{1}\"\n".format(line[0], line[1])
|
||||
return result
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS[13a3244099ec9233a8b7003c1874b3c92cb19e34]: generate-variables2
|
||||
: set $exiti3 "i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit'"
|
||||
: set $lockscreen "Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89"
|
||||
: set $rofiexec "rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons"
|
||||
: set $gnus "emacsclient --create-frame --eval '(gnus)' -n"
|
||||
: set $ec "emacsclient --create-frame -n"
|
||||
: set $walset "wal -i ~/Pictures/Wallpapers -o wal-set"
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf :noweb yes
|
||||
<<generate-variables()>>
|
||||
<<generate-variables2()>>
|
||||
#+END_SRC
|
||||
|
||||
Now comes the font for the window tiles. Honestly, this setting is useless
|
||||
since we do not see it, but let’s set it anyway.
|
||||
#+BEGIN_SRC conf
|
||||
font Fira Sans Book:style=Book:pixelsize=10
|
||||
#+END_SRC
|
||||
|
||||
** Floating windows
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-944b65df-c5c6-4f9a-9824-08e063ba20dd
|
||||
:END:
|
||||
Floating windows are windows that are not tiled with other windows, but
|
||||
rather are free to go anywhere on your screen, with any size. A bit like what
|
||||
you would get with any other non-tiling window manager or desktop environment
|
||||
(though most of them support minimal tiling features).
|
||||
|
||||
Let’s declare our floading modyfier. With floating windows, you can move them
|
||||
around by clicking on the window’s borders; but since we don’t have any with
|
||||
this config, we will have instead to press the floating modifier while
|
||||
clicking on the window (anywhere on the window is fine) to move them around.
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
floating_modifier $mod
|
||||
#+END_SRC
|
||||
|
||||
* i3 global settings
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-d9bc7729-d325-4071-8ad9-043ea5b80430
|
||||
:END:
|
||||
Some settings affect i3 globally, such as its aspect or how it handles the
|
||||
mouse. Hence, here are some settings I set in my configuration.
|
||||
|
||||
** Mouse settings
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3ab33a7a-6a31-4a76-a59f-baf7913279b4
|
||||
:END:
|
||||
First of all, I do not want i3 to warp my mouse each time I change windows;
|
||||
my mouse stays where it is.
|
||||
#+BEGIN_SRC conf
|
||||
mouse_warping none
|
||||
#+END_SRC
|
||||
I also to not want the window focus to follow my mouse, because sometimes I
|
||||
will just knock my physical mouse out of the way of my hand, and when I do
|
||||
that the software mouse will most likely end up in another window I do not
|
||||
want to focus.
|
||||
#+BEGIN_SRC conf
|
||||
focus_follows_mouse no
|
||||
#+END_SRC
|
||||
|
||||
** Popup handling
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-64ef3c3b-bc70-4839-9bee-e113df4ee848
|
||||
:END:
|
||||
While in fullscreen, some software might generate a popup. In that case, I
|
||||
want to be aware of that, and any popup will make me leave fullscreen in
|
||||
order to be presented with said popup.
|
||||
#+BEGIN_SRC conf
|
||||
popup_during_fullscreen leave_fullscreen
|
||||
#+END_SRC
|
||||
|
||||
** Behavior of workspace changes
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-192d7269-eba7-4684-80c7-cb01c32c5f38
|
||||
:END:
|
||||
When changing workspace as described below, we often want to go back to the
|
||||
previous workspace we were working on, but we might not remember immediately
|
||||
which one it was, or we might still have our fingers ready to fire the
|
||||
shortcut which made us make the first workspace change. Hence, if we type the
|
||||
same workspace change shortcut, instead of doing nothing it will bring us
|
||||
back to the previous workspace we were on.
|
||||
#+BEGIN_SRC conf
|
||||
workspace_auto_back_and_forth yes
|
||||
#+END_SRC
|
||||
|
||||
** Gaps and window appearance
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-52a82bb4-42b0-4740-aae6-79636072dc62
|
||||
:END:
|
||||
As mentioned in at the beginning of this document, I am using
|
||||
i3-gaps-rounded, which brings rounded corners to i3-gaps, a fork of i3 which
|
||||
brings spacing (gaps) between tiled windows.
|
||||
|
||||
First, I want space around my windows only when there are several containers
|
||||
on the same screen, otherwise they will be maximized.
|
||||
#+BEGIN_SRC conf
|
||||
smart_gaps on
|
||||
#+END_SRC
|
||||
|
||||
I also do not want to see any window border, so I will be turning this
|
||||
setting off.
|
||||
#+BEGIN_SRC conf
|
||||
smart_borders on
|
||||
#+END_SRC
|
||||
|
||||
By the way, the default border is invisible, since it is zero pixels wide.
|
||||
#+BEGIN_SRC conf
|
||||
default_border pixel 0
|
||||
#+END_SRC
|
||||
|
||||
Then comes the size of these gaps. I made the outer gap negative so the space
|
||||
between my windows and the border of my screens is smaller than the gap
|
||||
between my containers.
|
||||
#+BEGIN_SRC conf
|
||||
gaps inner 20
|
||||
gaps outer -10
|
||||
#+END_SRC
|
||||
|
||||
And I am not using i3-gaps-rounded for nothing: my containers that are not
|
||||
tiled will get their corners rounded with a radius of five pixels.
|
||||
#+BEGIN_SRC conf
|
||||
border_radius 5
|
||||
#+END_SRC
|
||||
|
||||
Some parameters are also available when it comes to the colors i3 uses.
|
||||
Honestly, we won’t see these colors much, so let’s simply keep the default
|
||||
values.
|
||||
#+BEGIN_SRC conf
|
||||
set_from_resource $fg i3wm.color7 #f0f0f0
|
||||
set_from_resource $bg i3wm.color2 #f0f0f0
|
||||
|
||||
# class border backgr. text indicator child_border
|
||||
client.focused $bg $bg $fg $bg $bg
|
||||
client.focused_inactive $bg $bg $fg $bg $bg
|
||||
client.unfocused $bg $bg $fg $bg $bg
|
||||
client.urgent $bg $bg $fg $bg $bg
|
||||
client.placeholder $bg $bg $fg $bg $bg
|
||||
#+END_SRC
|
||||
|
||||
* Assigning windows to workspaces
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-21870449-7730-4164-8add-167cb4e75218
|
||||
:END:
|
||||
I decided to bind some windows to some workspaces in order to have a better
|
||||
organization of my desktop.
|
||||
|
||||
#+NAME: assignment-table
|
||||
| Application | Class | Workspace |
|
||||
|-------------+-------------+-----------|
|
||||
| Emacs | Emacs | 2 |
|
||||
| Chromium | Chromium | 3 |
|
||||
| Firefox | firefox | 3 |
|
||||
| Nemo | Nemo | 4 |
|
||||
| Wonderdraft | Godot | 5 |
|
||||
| Gimp | Gimp* | 6 |
|
||||
| Gnome Boxes | gnome-boxes | 8 |
|
||||
| Steam | Steam | 9 |
|
||||
| Discord | discord | 10 |
|
||||
|
||||
The class table is used in the assignment in the i3 config file. For instance,
|
||||
Gimp’s assignment will look like this:
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
assign [class="Gimp*"] 6
|
||||
#+END_SRC
|
||||
|
||||
#+NAME: generate-workspaces
|
||||
#+BEGIN_SRC python :var workspaces=assignment-table
|
||||
results = ''
|
||||
for line in workspaces:
|
||||
results += 'assign [class="{0}"] {1}\n'.format(line[1],line[2])
|
||||
return results
|
||||
#+END_SRC
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf :noweb yes
|
||||
<<generate-workspaces()>>
|
||||
#+END_SRC
|
||||
|
||||
And although this is not specifically assigning a window to a workspace, I
|
||||
also want to have the tenth workspace assigned to a specific output in case I
|
||||
have two screens — and since this is the case when I am using only one
|
||||
computer, Marpa, I can make it a conditional thanks to yadm’s jinja2 syntax.
|
||||
|
||||
#+BEGIN_SRC conf
|
||||
{% if YADM_HOSTNAME == 'Marpa' -%}
|
||||
workspace 10 output eDP-1
|
||||
{% endif -%}
|
||||
#+END_SRC
|
||||
|
||||
* Shortcuts
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-b364743d-2ff0-4548-805e-9a9e6efdaddd
|
||||
:END:
|
||||
I use *A LOT* of shortcuts when it comes to my workflow. Like, all the time.
|
||||
So, expect this chapter to be a bit long, and I’ll try to make it readable
|
||||
still.
|
||||
|
||||
Shortcuts are set like so:
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
bindsym shortcut command
|
||||
#+END_SRC
|
||||
|
||||
#+NAME: generate-shortcuts
|
||||
#+BEGIN_SRC python :exports none :var table=[] :eval yes :tangle no
|
||||
results = ''
|
||||
for line in table:
|
||||
results += "bindsym {0} {1}\n".format(line[0], line[1])
|
||||
return results
|
||||
#+END_SRC
|
||||
|
||||
** Terminal shortcuts
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-7dbb2902-29ca-48a7-bfa3-a831b72549f3
|
||||
:END:
|
||||
I have a couple of shortcuts which are related to my terminal. For instance,
|
||||
~$mod+Return~ opens a regular terminal instance while ~$mod+$alt+M~ opens an
|
||||
SSH instance on my Mila host.
|
||||
#+NAME: terminal-shortcuts
|
||||
| shortcut | command | What it does |
|
||||
|-------------------+----------------------+--------------------------------------------------|
|
||||
| $mod+Return | exec $term | Opens a regular terminal console |
|
||||
| $mod+$alt+Return | split h;; exec $term | Opens a terminal console below the current one |
|
||||
| $mod+Shift+Return | split v;; exec $term | Opens a terminal on the right of the current one |
|
||||
| $mod+$alt+m | exec $term ssh Mila | Opens an SSH instance in my Mila host |
|
||||
| $mod+$alt+n | exec $term ssh Naro | Opens an SSH instance in my Naro host |
|
||||
| $mod+Shift+h | exec $term htop | Opens a terminal with ~htop~ |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=terminal-shortcuts)>>
|
||||
#+END_SRC
|
||||
|
||||
** i3 shortcuts
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-22855720-e388-463a-a941-fa8bad2c89c0
|
||||
:END:
|
||||
A couple of shortcuts are dedicated to i3 itself.
|
||||
#+NAME: i3-sh
|
||||
| shortcut | command | what it does |
|
||||
|--------------+---------------------------------+----------------------------------|
|
||||
| $mod+Shift+c | exec yadm alt && i3-msg reload | Reload the i3 configuration file |
|
||||
| $mod+Shift+r | exec yadm alt && i3-msg restart | Restart i3 inplace |
|
||||
| $mod+Shift+e | exec $exiti3 | Quit i3 |
|
||||
|
||||
And although this is not really an i3 shortcut per se, I add here the
|
||||
shortcut for launching pywal, which will set one of my wallpapers as the
|
||||
wallpaper and will generate my system’s color configuration from it.
|
||||
#+NAME: wal-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------+--------------+--------------------------------------------------------------|
|
||||
| $mod+Ctrl+w | exec $walset | Set a random wallpaper and generates a color profile from it |
|
||||
|
||||
We also have some shortcuts to lock our screen, sleep, hibernate and shut
|
||||
down our computer.
|
||||
#+NAME: computer-sh
|
||||
| shortcut | command | what it does |
|
||||
|---------------+----------------------------+------------------------|
|
||||
| $mod+l | exec i3lock -fol | Lock the screen |
|
||||
| $mod+$alt+h | exec "systemctl suspend" | Suspend the computer |
|
||||
| $mod+Ctrl+h | exec "systemctl hibernate" | Hibernate the computer |
|
||||
| $mod+Shift+F4 | exec poweroff | Power off the computer |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=i3-sh)>>
|
||||
<<generate-shortcuts(table=wal-sh)>>
|
||||
<<generate-shortcuts(table=computer-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
** Window and workspace management
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-cf3b4010-e937-473b-a0c9-9b25b2d3a0ec
|
||||
:END:
|
||||
*** Managing how windows will split
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e4e57280-91d2-4140-9295-7117cf85ed04
|
||||
:END:
|
||||
It is possible to indicate to i3 how windows interact with one another, and
|
||||
especially how they are organized by spawning new windows either to the
|
||||
right or below the current window.
|
||||
#+NAME: split-win-sh
|
||||
| shortcuts | command | what it does |
|
||||
|-----------+---------+--------------------------------------------------------|
|
||||
| $mod+h | split h | Next window to spawn will spawn below the current one |
|
||||
| $mod+v | split v | Next window to spawn will spawn beside the current one |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=split-win-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Focus windows
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-570eda16-ed4b-4684-a54f-9202e8409ed9
|
||||
:END:
|
||||
To change window focus, you can use one of the following shortcuts:
|
||||
#+NAME: window-focus-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------+-------------+-------------------------------------------|
|
||||
| $mod+$left | focus left | Focus the window left of the current one |
|
||||
| $mod+$down | focus down | Focus the window down of the current one |
|
||||
| $mod+$up | focus up | Focus the window up of the current one |
|
||||
| $mod+$right | focus right | Focus the windof right of the current one |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=window-focus-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Focus workspaces
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-333da167-e91c-48a7-99ef-d45b2af4c220
|
||||
:END:
|
||||
Just like windows, it is also possible to change focus between workspaces,
|
||||
because let’s be honest, most people won’t have ten screens to display all
|
||||
ten workspaces at the same time, and frankly that would be impractical.
|
||||
#+NAME: ws-focus-sh
|
||||
| shortcut | window | what it does |
|
||||
|----------+--------------+-------------------------|
|
||||
| $mod+1 | workspace 1 | Focus first workspace |
|
||||
| $mod+2 | workspace 2 | Focus second workspace |
|
||||
| $mod+3 | workspace 3 | Focus third workspace |
|
||||
| $mod+4 | workspace 4 | Focus fourth workspace |
|
||||
| $mod+5 | workspace 5 | Focus fifth workspace |
|
||||
| $mod+6 | workspace 6 | Focus sixth workspace |
|
||||
| $mod+7 | workspace 7 | Focus seventh workspace |
|
||||
| $mod+8 | workspace 8 | Focus eighth workspace |
|
||||
| $mod+9 | workspace 9 | Focus ninth workspace |
|
||||
| $mod+0 | workspace 10 | Focus tenth workspace |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=ws-focus-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Moving windows
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-0322384a-6a23-48c9-989b-7ecae53a4e06
|
||||
:END:
|
||||
To move windows, a couple of shortcuts are available:
|
||||
#+NAME: window-move-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------------+------------+-------------------------------|
|
||||
| $mod+Shift+$left | move left | Move the focused window left |
|
||||
| $mod+Shift+$down | move down | Move the focused window down |
|
||||
| $mod+Shift+$up | move up | Move the focused window up |
|
||||
| $mod+Shift+$right | move right | Move the focused window right |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=window-move-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Moving containers
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-834b2b46-1684-478b-a4d3-1cff8ec2ad2d
|
||||
:END:
|
||||
To move containers between the available screens, you have the following
|
||||
shortcuts:
|
||||
#+NAME: containers-move-sh
|
||||
| shortcut | command | what it does |
|
||||
|------------------+--------------------------------+------------------------------------------------------------|
|
||||
| $mod+Ctrl+$left | move container to output left | Moves the container to the screen left of the current one |
|
||||
| $mod+Ctrl+$down | move container to output down | Moves the container to the screen down of the current one |
|
||||
| $mod+Ctrl+$up | move container to output up | Moves the container to the screen above the current one |
|
||||
| $mod+Ctrl+$right | move container to output right | Moves the container to the screen right of the current one |
|
||||
|
||||
You can also send containers to other workspaces by their number.
|
||||
#+NAME: containers-ws-sh
|
||||
| shortcut | command | what it does |
|
||||
|--------------+--------------------------------+--------------------------------------------|
|
||||
| $mod+Shift+1 | move container to workspace 1 | Move current container to the workspace 1 |
|
||||
| $mod+Shift+2 | move container to workspace 2 | Move current container to the workspace 2 |
|
||||
| $mod+Shift+3 | move container to workspace 3 | Move current container to the workspace 3 |
|
||||
| $mod+Shift+4 | move container to workspace 4 | Move current container to the workspace 4 |
|
||||
| $mod+Shift+5 | move container to workspace 5 | Move current container to the workspace 5 |
|
||||
| $mod+Shift+6 | move container to workspace 6 | Move current container to the workspace 6 |
|
||||
| $mod+Shift+7 | move container to workspace 7 | Move current container to the workspace 7 |
|
||||
| $mod+Shift+8 | move container to workspace 8 | Move current container to the workspace 8 |
|
||||
| $mod+Shift+9 | move container to workspace 9 | Move current container to the workspace 9 |
|
||||
| $mod+Shift+0 | move container to workspace 10 | Move current container to the workspace 10 |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=containers-move-sh)>>
|
||||
<<generate-shortcuts(table=containers-ws-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Moving workspaces
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4f79905e-e8e2-4675-918b-1bbe9846b088
|
||||
:END:
|
||||
|
||||
It is also possible to move workspaces. The related shortcuts available are
|
||||
the following:
|
||||
|
||||
#+NAME: workspace-move-sh
|
||||
| shortcut | command | what it does |
|
||||
|------------------------+--------------------------------+------------------------------------------------------------|
|
||||
| $mod+Ctrl+Shift+$left | move workspace to output left | Moves the workspace to the screen left of the current one |
|
||||
| $mod+Ctrl+Shift+$down | move workspace to output down | Moves the workspace to the screen down of the current one |
|
||||
| $mod+Ctrl+Shift+$up | move workspace to output up | Moves the workspace to the screen above the current one |
|
||||
| $mod+Ctrl+Shift+$right | move workspace to output right | Moves the workspace to the screen right of the current one |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=workspace-move-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Close windows
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-05e30514-86c2-42af-8712-dc0bdc30cd3d
|
||||
:END:
|
||||
To close windows, we have two main shortcuts: Alt+F4 and mod+q. The first
|
||||
one is here due to habits, but I don’t really use it anymore due to my main
|
||||
keyboard which doesn’t have any easy access to the functions keys, hence
|
||||
mod+q.
|
||||
#+NAME: close-win-sh
|
||||
| shortcut | command | what it does |
|
||||
|----------+---------+-------------------------|
|
||||
| $mod+q | kill | kill the current window |
|
||||
| $alt+F4 | kill | kill the current window |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=close-win-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Manage the size of the current window
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f730b4c8-8602-426b-a2bc-7dfbbe42e711
|
||||
:END:
|
||||
It is possible to change the size of the current window, even if it is a
|
||||
floating one. The first shortcut that might interest you is $mod+f which
|
||||
switches your current window to fullscreen. But to resize a window, you will
|
||||
need to enter the ~resize~ mode.
|
||||
#+NAME: size-win-sh
|
||||
| shortcut | command | what it does |
|
||||
|----------+-------------------+---------------------------------------------------|
|
||||
| $mod+f | fullscreen toggle | Puts the current window in fullscreen or exits it |
|
||||
| $mod+r | mode "resize" | Enter resize mode |
|
||||
|
||||
When it comes to modes, they are defined as follows:
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
mode "nameofyourmode" {
|
||||
here go your shortcuts
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
So, all the following shortcuts will be inserted in a mode called ~resize~.
|
||||
Note that not only are the resizing shortcuts bound to the arrow keys, they
|
||||
are also bound to ~ctsr~, which is the bépo equivalent of ~hjkl~.
|
||||
#+NAME: resize-win-sh
|
||||
| shortcut | command | what it does |
|
||||
|----------+-------------------------------------+-------------------------------------------|
|
||||
| $right | resize grow width 20 px or 10 ppt | Increase the width of the current window |
|
||||
| r | resize grow width 20 px or 10 ppt | Increase the width of the current window |
|
||||
| $left | resize shrink width 10 px or 5 ppt | Decrease the width of the current window |
|
||||
| c | resize shrink width 10 px or 5 ppt | Decrease the width of the current window |
|
||||
| $down | resize grow height 10 px or 5 ppt | Increase the height of the current window |
|
||||
| t | resize grow height 10 px or 5 ppt | Increase the height of the current window |
|
||||
| $up | resize shrink height 10 px or 5 ppt | Decrease the height of the current window |
|
||||
| s | resize shrink height 10 px or 5 ppt | Decrease the height of the current window |
|
||||
| Return | mode "default" | Return to the default mode |
|
||||
| Escape | mode "default" | Return to the default mode |
|
||||
If you prefer, you can think of these shortcuts not as increasing or
|
||||
decreasing the width or height of the current window, but rather as how the
|
||||
bottom or right limit of the windows will be moved relative to the top left
|
||||
corner.
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=size-win-sh)>>
|
||||
mode "resize" {
|
||||
<<generate-shortcuts(table=resize-win-sh)>>
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
*** Manage floating windows
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-08f738b7-3369-4dbd-98e6-df6d6aa381b8
|
||||
:END:
|
||||
As said above, your windows can be floating windows instead of being tiled
|
||||
like they are by default. For this too we have a couple of shortcuts:
|
||||
#+NAME: float-win-sh
|
||||
| shortcut | command | what it does |
|
||||
|------------------+----------------------+------------------------------------------------------|
|
||||
| $mod+Shift+space | floating toggle | Toggles the window between tiled and floating mode |
|
||||
| $mod+space | focus mode_toggle | Toggles the focus between tiled and floating windows |
|
||||
| $mod+Ctrl+c | move position center | Centers the focused floating window |
|
||||
If you want to move around your floating window, you can do it with your
|
||||
mouse while holding down the floating modifier declared [[#h-944b65df-c5c6-4f9a-9824-08e063ba20dd][here]].
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=float-win-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Scratchpad and window display
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-92e67454-eccb-4465-8d47-947a1a5d55d9
|
||||
:END:
|
||||
You can think of i3’s scratchpad as some sort of extra workspace in which
|
||||
you can hide your windows you are not using, or as if you want to reduce a
|
||||
window to the taskbar of other window managers or desktop environments. You
|
||||
have basically two shortcuts for the scratchpad: one that sends the current
|
||||
window to the scratchpad, and one that cicles through the windows sent to
|
||||
the scratchpad and shows them to you sequencially. If you go through all of
|
||||
them, they will be hidden again. You can get a window out of the scratchpad
|
||||
by tiling it to the current workspace with the shortcut described above.
|
||||
|
||||
You also have the possibility of making a floating window a sticky window.
|
||||
This means not only will it show on all workspaces, it will also be on top
|
||||
of every other window. It can be useful if you have some notes you want to
|
||||
keep an eye on for instance.
|
||||
#+NAME: scratchpad-sh
|
||||
| shortcut | command | what it does |
|
||||
|--------------+-----------------+------------------------------------------------------|
|
||||
| $mod+Shift+s | move scratchpad | Sends the current window to the scratchpad |
|
||||
| $mod+s | scratchpad show | Shows and cycles through windows from the scratchpad |
|
||||
| $mod+Ctrl+s | sticky toggle | Toggles sticky mode on current window |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=scratchpad-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Gaps management
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-20c6fc10-984e-411c-acc9-8bc057d2aaa6
|
||||
:END:
|
||||
It is possible to dynamically change the gaps between containers if we want
|
||||
to change a bit the appearance of i3. For that, we obviously have some
|
||||
shortcuts.
|
||||
#+NAME: gaps-resize-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------------+-----------------------------------------------+------------------------------|
|
||||
| $mod+g | gaps inner current plus 5 | Increase the inner gap size |
|
||||
| $mod+Shift+g | gaps inner current minus 5 | Decrease the inner gap size |
|
||||
| $mod+Ctrl+g | gaps outer current plus 5 | Increase the outer gap size |
|
||||
| $mod+Ctrl+Shift+g | gaps outer current minus 5 | Decrease the outer gap size |
|
||||
| $mod+$alt+g | gaps inner all set 20; gaps outer all set -10 | Reset gaps |
|
||||
|
||||
Here is the corresponding configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=gaps-resize-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
** Launching software
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4839dab5-1cd3-450b-8fb9-2992dd0c4d22
|
||||
:END:
|
||||
A big part of my i3 shortcuts though are related to launching various
|
||||
software. I’ll try to sort them by category here, but do take a look even at
|
||||
categories which you might not be interested in, they might actually have
|
||||
something useful for you.
|
||||
|
||||
*** Software and command launcher
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c5e8b03a-a46d-4eef-b514-96794c42621d
|
||||
:END:
|
||||
These commands will allow the user to launch applications which provide
|
||||
~.desktop~ files or user-defined ~.desktop~ files, as well as commands with
|
||||
the help of rofi.
|
||||
#+NAME: launcher-sh
|
||||
| shortcut | command | what it does |
|
||||
|--------------+---------------------------------------+-------------------------------------------------------|
|
||||
| $mod+Shift+d | exec --no-startup-id j4-dmenu-desktop | Launch a registered application |
|
||||
| $mod+d | exec --no-startup-id $rofiexec | Launch a terminal command or a registered application |
|
||||
|
||||
Here is the configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=launcher-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Internet software
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e27be13a-4085-4f09-ae90-c48ceb1c4c6f
|
||||
:END:
|
||||
I have a couple of Internet-related software I can launch easily.
|
||||
#+NAME: internet-sh
|
||||
| shortcut | command | what it does |
|
||||
|--------------+---------------------+-----------------------------|
|
||||
| $mod+b | exec firefox | Launch browser |
|
||||
| $mod+m | exec $gnus | Launch Gnus, my mail client |
|
||||
| Ctrl+Shift+d | exec discord-canary | Launch Discord |
|
||||
|
||||
Hence this configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=internet-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Screenshots
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3e87379d-8476-4d05-b756-b7ee68130390
|
||||
:END:
|
||||
A couple of shortcuts are available for taking screenshots.
|
||||
#+NAME: screenshot-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------+-----------------------------------+----------------------------------------------------------|
|
||||
| Print | exec --no-startup-id scrot | Takes a screenshot of the entire desktop |
|
||||
| Ctrl+Print | exec --no-startup-id "scrot -s" | Takes a screenshot of a region or the selected window |
|
||||
| Shift+Print | exec --no-startup-id "scrot -d 3" | takes a screenshot of the desktop three in three seconds |
|
||||
|
||||
This gives us this configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=screenshot-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Screen brightness
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f583f796-c287-4e4f-a88a-205cc1837ff6
|
||||
:END:
|
||||
Here we have four commands for managing our screen’s brightness (this is
|
||||
useful for laptops, not so much with desktops), and two of them are actually
|
||||
duplicates of the other two in case a laptop doesn’t have dedicated keys or
|
||||
we are using a keyboard which doesn’t provide them.
|
||||
#+NAME: brightness-sh
|
||||
| shortcut | command | what it does |
|
||||
|-----------------------+------------------------+---------------------------------------|
|
||||
| XF86MonBrightnessUp | exec xbacklight -inc 5 | Increase the brightness of the screen |
|
||||
| $mod+$alt+Next | exec xbacklight -inc 5 | Increase the brightness of the screen |
|
||||
| XF86MonBrightnessDown | exec xbacklight -dec 5 | Decrease the brightness of the screen |
|
||||
| $mod+$alt+Prev | exec xbacklight -dec 5 | Decrease the brightness of the screen |
|
||||
|
||||
This gives us this configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=brightness-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Media control
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4002e136-ffab-4819-ae93-1a72b9f995ae
|
||||
:END:
|
||||
Some shortcuts are dedicated to media control, especially when it comes to
|
||||
controlling music. All of these media control shortcuts will be calls to
|
||||
~mpc~ which will in turn send commands to ~mpd~, which is the music server I
|
||||
use on my computers.
|
||||
#+NAME: media-sh
|
||||
| shortcut | command | what it does |
|
||||
|---------------------------+--------------------+--------------------------------|
|
||||
| XF86AudioNext | exec mpc next | Forward to the next track |
|
||||
| $alt+XF86AudioRaiseVolume | exec mpc next | Forward to the next track |
|
||||
| $mod+Next | exec mpc next | Forward to the next track |
|
||||
| XF86AudioPrev | exec mpc prev | Backward to the previous track |
|
||||
| $alt+XF86AudioLowerVolume | exec mpc prev | Backward to the previous track |
|
||||
| $mod+Prior | exec mpc prev | Backward to the previous track |
|
||||
| XF86AudioPlay | exec mpc toggle | Play or pause the music |
|
||||
| $mod+p | exec mpc toggle | Play or pause the music |
|
||||
| $mod+$alt+p | exec mpc stop | Completely stop the music |
|
||||
| XF86AudioStop | exec mpc stop | Completely stop the music |
|
||||
| $alt+XF86AudioPlay | exec mpc stop | Completely stop the music |
|
||||
| $mod+$alt+7 | exec mpc volume +5 | Increase the volume from mpd |
|
||||
| $mod+$alt+8 | exec mpc volume -5 | Decrease the volume from mpd |
|
||||
|
||||
We also have two shortcuts for launching ncmpcpp, my mpd frontend, either
|
||||
with the playlist open by default, or the visualizes open.
|
||||
#+NAME: ncmpcpp-sh
|
||||
| shortcut | command | what it does |
|
||||
|--------------+-----------------------------------+----------------------------------|
|
||||
| $mod+Shift+n | exec $term ncmpcpp -q | Launch ncmpcpp’s playlist editor |
|
||||
| $mod+Shift+v | exec $term ncmpcpp -qs visualizer | Launch ncmpcpp’s visualizer |
|
||||
|
||||
We also have more general shortcuts, like how to manipulate the general
|
||||
volume level.
|
||||
#+NAME: volume-sh
|
||||
| shortcut | command | what it does |
|
||||
|----------------------+----------------------------------------+----------------------|
|
||||
| XF86AudioMute | exec "amixer set Master 1+ toggle" | Mute or unmute audio |
|
||||
| Ctrl+$mod+Prior | exec "amixer -q set Master 2%+ unmute" | Raise volume |
|
||||
| XF86AudioRaiseVolume | exec "amixer -q set Master 2%+ unmute" | Raise volume |
|
||||
| Ctrl+$mod+Next | exec "amixer -q set Master 2%- unmute" | Reduce volume |
|
||||
| XF86AudioLowerVolume | exec "amixer -q set Master 2%- unmute" | Reduce volume |
|
||||
|
||||
This gives us this configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=media-sh)>>
|
||||
<<generate-shortcuts(table=ncmpcpp-sh)>>
|
||||
<<generate-shortcuts(table=volume-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Rofi utilities
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-15f2639e-52d2-467e-83e2-6ab085fa7710
|
||||
:END:
|
||||
We also have some utilities I’ve written and which are interfaced with rofi.
|
||||
Here are said shortcuts.
|
||||
#+NAME: rofi-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------------+-----------------------+-----------------------------------------------------------------------|
|
||||
| $mod+Shift+p | exec rofi-pass --type | Types the selected password available from ~pass~ where the cursor is |
|
||||
| $mod+Ctrl+Shift+p | exec rofi-pass | Copies in the clipboard the selected password from ~pass~ for 45 sec |
|
||||
| $mod+Ctrl+m | exec rofi-mount | Volume mounting helper |
|
||||
| $mod+Ctrl+u | exec rofi-umount | Volume unmounting helper |
|
||||
| $mod+$alt+e | exec rofi-emoji | Emoji picker, copies it in the clipboard |
|
||||
| $mod+w | exec wacom-setup | Sets my Wacom Bamboo tablet as being active on the selected screen |
|
||||
| $mod+Shift+w | exec connect-wifi | Connect to an available WiFi network |
|
||||
|
||||
This gives us the following configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=rofi-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Miscellaneous
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-7f9ef1f7-da6b-4428-9d8c-f5a5f004c495
|
||||
:END:
|
||||
And last but not least, I have some other shortcuts for various software,
|
||||
some of them which I use quite a lot like the shortcut for launching Emacs.
|
||||
#+NAME: misc-sh
|
||||
| shortcut | command | what it does |
|
||||
|-------------+------------------+---------------------------------|
|
||||
| $mod+e | exec $ec | Launch Emacs client |
|
||||
| $mod+n | exec nemo | Launch Nemo (file manager) |
|
||||
| $mod+$alt+c | exec speedcrunch | Launch Speedcrunch (calculator) |
|
||||
| $mod+F3 | exec arandr | Launch arandr |
|
||||
|
||||
This gives us the following configuration:
|
||||
#+BEGIN_SRC conf
|
||||
<<generate-shortcuts(table=misc-sh)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Screen management
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-ea5bab8e-cb7c-4ccb-8594-c2c319d1f7eb
|
||||
:END:
|
||||
Additionally, we have a shortcut for entering presentation mode on the
|
||||
additional screen of the computer; on my main computer, Mila, the additional
|
||||
screen is HDMI-1, while it is VGA1 on my travel laptop. We’ll use yadm’s
|
||||
jinja2 syntax to manage that.
|
||||
#+BEGIN_SRC conf
|
||||
{% if YADM_HOSTNAME == 'Marpa' -%}
|
||||
bindsym $mod+Ctrl+p xrandr --output HDMI-1 --mode 1024x768 --right-of eDP-1
|
||||
{% else -%}
|
||||
bindsym $mod+Ctrl+p xrandr --output VGA1 --mode 1024x768 --right-of LVDS1
|
||||
{% endif -%}
|
||||
#+END_SRC
|
||||
|
||||
* Software autolaunch
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-18769c14-2ec0-41a2-9450-dae71714d0f4
|
||||
:END:
|
||||
When i3 is launched, I want it to also launch some software automatically.
|
||||
Here is what we will launch:
|
||||
#+NAME: autolaunch
|
||||
| always execute it? | command | what it is |
|
||||
|--------------------+----------------------------------------------------------+----------------------------------------|
|
||||
| yes | wal -i "$(< "${HOME}/.cache/wal/wal")" | Sets the wallpaper from last session |
|
||||
| no | xss-lock -- i3lock -fol | Launch power management |
|
||||
| no | dunst -config ~/.config/dunst/dunstrc | Launch notification manager |
|
||||
| no | xrdb $HOME/.Xresources | Load Xresources files |
|
||||
| no | compton -F --opengl --config ~/.config/compton.conf -e 1 | Launch compton |
|
||||
| yes | polybar-launch | Launch polybar |
|
||||
| yes | enable_touch | Set correct touchpad values |
|
||||
| no | syndaemon -i 1.0 -t -k | Set touchpad values |
|
||||
| no | mpd | Launch music server |
|
||||
| no | mpc stop | Stop music from mpd |
|
||||
| no | mpd_discord_richpresence --no-idle --fork | Launch mpd status sharing with Discord |
|
||||
| no | nm-applet | NetworkManager system tray |
|
||||
|
||||
#+NAME: generate-autolaunch
|
||||
#+BEGIN_SRC python :exports none :tangle no :var table=autolaunch
|
||||
results = ''
|
||||
for line in table:
|
||||
results += 'exec_always ' if line[0] == 'yes' else 'exec '
|
||||
results += '--no-startup-id ' + line[1] + '\n'
|
||||
return results
|
||||
#+END_SRC
|
||||
|
||||
My travel laptop has a fingerprint reader which can be used as an
|
||||
authentification method when the root password is asked. Let’s launch our
|
||||
policy kit manager if that is the case:
|
||||
#+BEGIN_SRC conf
|
||||
{% if YADM_HOSTNAME == 'Gampo' -%}
|
||||
exec --no-startup-id /usr/lib/mate-polkit/polkit-mate-authentication-agent-1
|
||||
{% endif -%}
|
||||
<<generate-autolaunch()>>
|
||||
#+END_SRC
|
||||
@@ -1 +0,0 @@
|
||||
/home/phundrak/img
|
||||
BIN
org/config-website/img/emacs.png
Normal file
BIN
org/config-website/img/emacs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 484 KiB |
BIN
org/config-website/img/neofetch.png
Normal file
BIN
org/config-website/img/neofetch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1011 KiB |
BIN
org/config-website/img/rofi.png
Normal file
BIN
org/config-website/img/rofi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 936 KiB |
326
org/config-website/index.org
Normal file
326
org/config-website/index.org
Normal file
@@ -0,0 +1,326 @@
|
||||
#+TITLE: Phundrak’s dotfiles
|
||||
#+INCLUDE: ~/org/config-website/headers.org
|
||||
#+OPTIONS: auto-id:t
|
||||
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's dotfiles" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's dotfiles" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the dotfiles of Phundrak" />
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-400070eb-725f-4416-a4c6-da3053df750b
|
||||
:END:
|
||||
- [[#presentation][Presentation]]
|
||||
- [[#screenshots][Screenshots]]
|
||||
- [[#features][Features]]
|
||||
- [[#custom-scripts-in-path][Custom scripts in =PATH=]]
|
||||
- [[#emacs-configuration][Emacs configuration]]
|
||||
- [[#email-signature][Email signature]]
|
||||
- [[#fish-configuration-with-useful-abbreviations][Fish configuration with useful abbreviations]]
|
||||
- [[#global-gitignore][Global gitignore]]
|
||||
- [[#i3-configuration][i3 configuration]]
|
||||
- [[#nano][Nano]]
|
||||
- [[#rustfmt][Rustfmt]]
|
||||
- [[#tmux-configuration][Tmux configuration]]
|
||||
- [[#xresources][Xresources]]
|
||||
- [[#dependencies][Dependencies]]
|
||||
- [[#installation][Installation]]
|
||||
- [[#licence][Licence]]
|
||||
|
||||
* Presentation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-536e69f5-c012-4b7d-8a45-3a340d3bc7ee
|
||||
:END:
|
||||
[[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]
|
||||
|
||||
This is my collection of dotfiles for my daily GNU/Linux environment, tweaked
|
||||
to my liking. If you wish to get the same setup as mine, follow the
|
||||
instructions below.
|
||||
|
||||
As you can see, I personally use [[https://fishshell.com/][fish]] as my shell of choice, and [[https://www.gnu.org/software/emacs/][Emacs]] using
|
||||
[[http://spacemacs.org][Spacemacs]] (still with Emacs keybinding) as my main text editor.
|
||||
|
||||
I also use [[https://github.com/resloved/i3][Resloved]]’s [[https://github.com/resloved/i3][fork]] of [[https://github.com/Airblader/i3][i3-gaps]] with two [[https://github.com/jaagr/polybar][polybar]] bars and [[https://github.com/tryone144][Tryone144]]’s
|
||||
[[https://github.com/tryone144/compton][fork]] of [[https://github.com/chjj/compton][Compton]]. The colors scheme for [[https://github.com/davatorium/rofi][rofi]], Emacs and polybar are chosen from
|
||||
the wallpapers using [[https://github.com/dylanaraps/pywal][pywal]].
|
||||
|
||||
* Screenshots
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-ee37502b-09a4-4668-88e2-1d4406252bd2
|
||||
:END:
|
||||
|
||||
#+ATTR_HTML: :width 100%
|
||||
#+CAPTION: Desktop with Neofetch in the terminal
|
||||
[[./img/neofetch.png]]
|
||||
|
||||
#+CAPTION: Desktop with Emacs opened
|
||||
#+ATTR_HTML: :width 100%
|
||||
[[./img/emacs.png]]
|
||||
|
||||
#+CAPTION: Desktop with Rofi
|
||||
#+ATTR_HTML: :width 100%
|
||||
[[./img/rofi.png]]
|
||||
|
||||
* Features
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-8539dd6f-4fcb-4dc7-a3ef-b8ad198c91d4
|
||||
:END:
|
||||
- Emacs configuration perfectly tailored for my own use
|
||||
- Beautiful and comfy i3 and polybar configuration
|
||||
- And enough information below to get basically the same distro install as I
|
||||
have on my main computer and my travel laptop.
|
||||
|
||||
Most of the org files you will find in this repos are the actual source code
|
||||
of much of my config files. For instance, the bootstrap found in
|
||||
[[file:installation.org][installation.org]] exports almost all of its code snippets to
|
||||
[[file:.config/yadm/bootstrap][.config/yadm/bootstrap]] thanks to =M-x org-babel-tangle= from within Emacs.
|
||||
Below I will also present and comment some of my short config files which do
|
||||
not deserve to have a full org file dedicated to them.
|
||||
|
||||
** Custom scripts in =PATH=
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-d582e107-fa66-4f79-869e-2b49116ed1ec
|
||||
:END:
|
||||
I have written some scripts that help me daily accomplish some simple tasks,
|
||||
like mounting and unmounting a drive or Android device, an emoji picker, a
|
||||
utility to set up my Wacom tablet, and so on. You can find them stored in
|
||||
[[file:.local/bin/README.org][.local/bin]] along with their detailed explanation in the README placed in the
|
||||
same folder —which is actually their source code once the org-mode file gets
|
||||
tangled.
|
||||
|
||||
** Emacs configuration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f6d2561f-5c02-4540-8287-4acf3037b3d5
|
||||
:END:
|
||||
Emacs is my main text editor, which I use for almost everything. Because, you
|
||||
know…
|
||||
#+begin_quote
|
||||
Emacs is a great operating system, it just lacks a good text editor.
|
||||
#+end_quote
|
||||
You can find my Emacs config, based on Spacemacs, in my [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/.spacemacs][.spacemacs]] file, and
|
||||
my user configuration in my [[file:~/org/config-website/spacemacs.org][spacemacs.org]] file.
|
||||
|
||||
** Email signature
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f6c48286-a320-493f-b330-ee0a697e6d79
|
||||
:HEADER-ARGS: :tangle ~/.signature
|
||||
:END:
|
||||
This file gets inserted automatically at the end of my emails.
|
||||
#+BEGIN_SRC text
|
||||
Lucien “Phundrak” Cartier-Tilet
|
||||
https://phundrak.com (Français)
|
||||
https://en.phundrak.com (English)
|
||||
|
||||
Pensez à notre planète, avez-vous vraiment besoin d’imprimer ce courriel ?
|
||||
Please mind our planet, do you really need to print this email?
|
||||
#+END_SRC
|
||||
|
||||
** Fish configuration with useful abbreviations
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f35ed9a3-c9fc-458c-8a62-693f679f6992
|
||||
:END:
|
||||
You can also find in my Fish shell configuration in my [[file:~/org/config-website/fish.org][fish.org]] file, which
|
||||
contains my usual abbreviations.
|
||||
|
||||
** Global gitignore
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4f92eb29-7cfa-48ec-b39d-39037ace3682
|
||||
:HEADER-ARGS: :tangle ~/.gitignore_global
|
||||
:END:
|
||||
Sometimes, there are some lines that always reappear in gitignores. So,
|
||||
instead of always adding them, let git now that some elements are to be
|
||||
ignored by default, hence the [[file:.gitignore_global][~/.gitignore_global]] file. First, we don’t want
|
||||
nano’s backup files.
|
||||
#+BEGIN_SRC text
|
||||
~*
|
||||
#+END_SRC
|
||||
|
||||
And output binaries generated by =gcc= and the likes aren’t welcome either.
|
||||
#+BEGIN_SRC text
|
||||
,*.out
|
||||
#+END_SRC
|
||||
|
||||
** i3 configuration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c918e370-d867-412c-8b0e-078e4e3772e0
|
||||
:END:
|
||||
The i3 configuration is detailed in its corresponding README which you can
|
||||
find at [[file:.config/i3/README.org][.config/i3/README.org]].
|
||||
|
||||
** Nano
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-1724166b-55b7-4a64-9ff1-47c2a9e76f46
|
||||
:END:
|
||||
Although it is a very simple piece of software, nano does offer some
|
||||
customization. Mine can be found in my [[file:~/org/config-website/nano.org][nano.org]] file.
|
||||
|
||||
** Rustfmt
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-0ae9005c-76a6-49f6-947c-0c8464616e10
|
||||
:HEADER-ARGS: :tangle ~/.rustfmt.toml
|
||||
:END:
|
||||
In my [[file:.rustfmt.toml][.rustfmt.toml]], you can find some custom rules on how my Rust code
|
||||
should be formatted.
|
||||
|
||||
First, we are using the 2018 edition of Rust.
|
||||
#+BEGIN_SRC toml
|
||||
edition = "2018"
|
||||
#+END_SRC
|
||||
|
||||
The maximum length of enum variant having discriminant, that gets vertically
|
||||
aligned with others. Variants without discriminants would be ignored for the
|
||||
purpose of alignment.
|
||||
|
||||
Note that this is not how much whitespace is inserted, but instead the
|
||||
longest variant name that doesn't get ignored when aligning.
|
||||
#+BEGIN_SRC toml
|
||||
enum_discrim_align_threshold = 20
|
||||
#+END_SRC
|
||||
|
||||
Put single-expression functions on a single line.
|
||||
#+BEGIN_SRC toml
|
||||
fn_single_line = true
|
||||
#+END_SRC
|
||||
|
||||
Format code snippet included in doc comments.
|
||||
#+BEGIN_SRC toml
|
||||
format_code_in_doc_comments = true
|
||||
#+END_SRC
|
||||
|
||||
Format string literals where necessary.
|
||||
#+BEGIN_SRC toml
|
||||
format_strings = true
|
||||
#+END_SRC
|
||||
|
||||
Use tab characters for indentation, spaces for alignment.
|
||||
#+BEGIN_SRC toml
|
||||
hard_tabs = true
|
||||
#+END_SRC
|
||||
|
||||
Maximum width of each line
|
||||
#+BEGIN_SRC toml
|
||||
max_width = 80
|
||||
#+END_SRC
|
||||
|
||||
Merge multiple imports into a single nested import.
|
||||
#+BEGIN_SRC toml
|
||||
merge_imports = true
|
||||
#+END_SRC
|
||||
|
||||
My newline style will always be Unix.
|
||||
#+BEGIN_SRC toml
|
||||
newline_style = Unix
|
||||
#+END_SRC
|
||||
|
||||
Convert =/* */= comments to =//= comments where possible.
|
||||
#+BEGIN_SRC toml
|
||||
normalize_comments = true
|
||||
#+END_SRC
|
||||
|
||||
Convert =#![doc]= and =#[doc]= attributes to =//!= and =///= doc comments.
|
||||
#+BEGIN_SRC toml
|
||||
normalize_doc_attributes = true
|
||||
#+END_SRC
|
||||
|
||||
Reorder impl items. =type= and =const= are put first, then macros and
|
||||
methods.
|
||||
#+BEGIN_SRC toml
|
||||
reorder_impl_items = true
|
||||
#+END_SRC
|
||||
|
||||
Report =FIXME= items in comments.
|
||||
#+BEGIN_SRC toml
|
||||
report_fixme = "Always"
|
||||
#+END_SRC
|
||||
|
||||
Report =TODO= items in comments.
|
||||
#+BEGIN_SRC toml
|
||||
todo = "Always"
|
||||
#+END_SRC
|
||||
|
||||
The maximum diff of width between struct fields to be aligned with each
|
||||
other.
|
||||
#+BEGIN_SRC toml
|
||||
struct_field_align_threshold = 20
|
||||
#+END_SRC
|
||||
|
||||
Number of spaces per tab.
|
||||
#+BEGIN_SRC toml
|
||||
tab_spaces = 2
|
||||
#+END_SRC
|
||||
|
||||
Break comments to fit on the line.
|
||||
#+BEGIN_SRC toml
|
||||
wrap_comments = true
|
||||
#+END_SRC
|
||||
|
||||
** Tmux configuration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-4f48b912-b67b-4549-a671-802e76221f46
|
||||
:END:
|
||||
You can find my tmux configuration in [[file:tmux.org][tmux.org]]. It depends on the submodule
|
||||
[[https://github.com/gpakosz/.tmux.git][.tmux]] by [[https://pempek.net/][Gregory Pakosz]].
|
||||
|
||||
** Xresources
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e6f48975-3b86-4a75-a7e5-5cc9edbd9869
|
||||
:HEADER-ARGS: :tangle ~/.Xresources :exports code
|
||||
:END:
|
||||
My Xresources file is very short. Indeed, it only contains two lines which
|
||||
are dedicated to my =st= terminal to set its font and shell. The font is set
|
||||
as follows.
|
||||
#+BEGIN_SRC conf
|
||||
st.font: Source Code Pro for Powerline:style=book
|
||||
#+END_SRC
|
||||
And I will set my shell like this:
|
||||
#+BEGIN_SRC conf
|
||||
st.shell: /usr/bin/fish
|
||||
#+END_SRC
|
||||
|
||||
I used to have lines dedicated to UXTerm and URxvt, but I cast them out of my
|
||||
system.
|
||||
|
||||
* Dependencies
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-5849dbcf-a650-4323-9a90-bec549a7b982
|
||||
:END:
|
||||
Of course, some dependencies are needed for my dotfiles to work well. Here is
|
||||
a non-exhaustive list of software needed by these configuration files:
|
||||
- [[https://www.gnu.org/software/emacs/][GNU/Emacs]] >= 26.2
|
||||
- [[http://spacemacs.org][Spacemacs]] (develop branch)
|
||||
- My [[https://labs.phundrak.com/phundrak/conlang-layer][conlanging layer]]
|
||||
- [[https://github.com/venmos/w3m-layer][Venmos]]’ [[https://github.com/venmos/w3m-layer][w3m layer]]
|
||||
- The [[https://fishshell.com/][Fish shell]], using [[https://github.com/jorgebucaran/fisher][fisher]]
|
||||
- [[https://lukesmith.xyz/][Luke Smith]]’s [[https://github.com/LukeSmithxyz/st][fork]] of [[https://st.suckless.org/][st]]
|
||||
- [[https://resloved.info/][Resloved]]’s [[https://github.com/resloved/i3][i3-gaps-rounded]] fork of [[https://github.com/Airblader/i3][Airblader]]’s [[https://github.com/Airblader/i3][i3-gaps]], itself a fork of [[https://i3wm.org/][i3]]
|
||||
- [[https://github.com/yshui/compton][Compton]], more specificaly [[https://github.com/tryone144/compton][Tryone]]’s [[https://github.com/tryone144/compton][fork]]
|
||||
- [[https://github.com/dylanaraps/pywal/][pywal]]
|
||||
- [[https://tools.suckless.org/dmenu/][dmenu]]
|
||||
- [[https://github.com/enkore/j4-dmenu-desktop][j4-dmenu-desktop]]
|
||||
- [[https://github.com/davatorium/rofi][Rofi]]
|
||||
- [[https://github.com/gpoore/minted][minted]]
|
||||
- [[https://www.rust-lang.org/][Rust]] (stable and nightly)
|
||||
- [[https://www.latex-project.org/][LaTeX]] and [[http://xetex.sourceforge.net/][XeTeX]] (=texlive= packages on Arch Linux)
|
||||
- [[https://github.com/tmux/tmux][tmux]], based on [[https://github.com/gpakosz/.tmux][this repo]]’s configuration by [[https://pempek.net/][Grégory Pakosz]].
|
||||
- And a bunch of other stuff, see below
|
||||
And some other stuff scattered around in my dotfiles.
|
||||
|
||||
BTW, I use Arch.
|
||||
|
||||
* Installation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-bfb2e09b-d5d7-4d6f-8b29-763c49b3fd09
|
||||
:END:
|
||||
For an installation walkthrough of my Arch Linux installation, check out my
|
||||
[[file:installation.org][installation.org]] file where I walk you through the first manual steps and
|
||||
through the bootstrap you can execute to automatically take care of a lot of
|
||||
elements.
|
||||
|
||||
* Licence
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-a3438126-ee60-4f11-a2f6-f52e49dade59
|
||||
:END:
|
||||
All of my dotfiles (and my dotfiles only) are available under the GNU GPLv3
|
||||
Licence. Please consult [[file:LICENCE.md]] for more information. In short: you
|
||||
are free to access, edit and redistribute all of my dotfiles under the same
|
||||
licence and as allowed by the licence, and if you fuck up something, it’s your
|
||||
own responsibility.
|
||||
@@ -1 +0,0 @@
|
||||
/home/phundrak/installation.org
|
||||
726
org/config-website/installation.org
Normal file
726
org/config-website/installation.org
Normal file
@@ -0,0 +1,726 @@
|
||||
#+TITLE: Install a Phundrak-flavored Arch Linux
|
||||
#+INCLUDE: ~/org/config-website/headers.org
|
||||
#+OPTIONS: auto-id:t
|
||||
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak-flavored Arch Linux" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak-flavored Arch Linux" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:description" content="How to install a Phundrak-flavored Arch Linux" />
|
||||
#+PROPERTY: header-args :exports code
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-400070eb-725f-4416-a4c6-da3053df750b
|
||||
:END:
|
||||
|
||||
- [[#introduction][Introduction]]
|
||||
- [[#install-arch-linux][Install Arch Linux]]
|
||||
- [[#get-the-latest-live-system-with-fast-mirrors][Get the latest live system with fast mirrors]]
|
||||
- [[#install-the-system][Install the system]]
|
||||
- [[#install-basic-packages][Install basic packages]]
|
||||
- [[#execute-bootstrap][Execute bootstrap]]
|
||||
- [[#decrypt-private-yadm-files][Decrypt private yadm files]]
|
||||
- [[#get-a-correct-keyboard-layout][Get a correct keyboard layout]]
|
||||
- [[#set-our-locale][Set our locale]]
|
||||
- [[#create-some-folders][Create some folders]]
|
||||
- [[#set-users-shell-to-fish][Set user’s shell to fish]]
|
||||
- [[#install-yay-if-it-isnt-already-installed][Install =yay= if it isn’t already installed]]
|
||||
- [[#install-basic-packages-1][Install basic packages]]
|
||||
- [[#setting-up-emacs-installing-spacemacs][Setting up Emacs: Installing Spacemacs]]
|
||||
- [[#set-up-dotfiles][Set up dotfiles]]
|
||||
- [[#update-our-dotfiles-remotes][Update our dotfiles’ remotes]]
|
||||
- [[#get-envtpl][Get =envtpl=]]
|
||||
- [[#update-our-submodules][Update our submodules]]
|
||||
- [[#generate-our-alt-files][Generate our alt files]]
|
||||
- [[#installing-tryones-compton-fork][Installing Tryone’s Compton fork]]
|
||||
- [[#enable-some-of-our-services][Enable some of our services]]
|
||||
- [[#docker][Docker]]
|
||||
- [[#emacs][Emacs]]
|
||||
- [[#ssh-server][SSH server]]
|
||||
- [[#ly][Ly]]
|
||||
- [[#acpilight][Acpilight]]
|
||||
- [[#nordvpn][NordVPN]]
|
||||
- [[#symlink-some-system-config-files][Symlink some system config files]]
|
||||
- [[#set-up-our-fish-shell][Set up our fish shell]]
|
||||
- [[#install-fisher][Install =fisher=]]
|
||||
- [[#install-our-extensions][Install our extensions]]
|
||||
- [[#install-packages-from-git][Install packages from git]]
|
||||
- [[#i3-gaps-rounded][i3-gaps rounded]]
|
||||
- [[#polybar-battery][Polybar Battery]]
|
||||
- [[#revealjs][Reveal.JS]]
|
||||
- [[#install-rust][Install Rust]]
|
||||
- [[#install-the-toolchains][Install the toolchains]]
|
||||
- [[#install-some-utilities][Install some utilities]]
|
||||
- [[#install-some-python-packages][Install some python packages]]
|
||||
- [[#install-go-packages][Install go packages]]
|
||||
- [[#set-up-chicken-scheme-interpretercompiler][Set up Chicken (Scheme interpreter/compiler)]]
|
||||
- [[#clean-the-pacman-and-yay-cache][Clean the =pacman= and =yay= cache]]
|
||||
|
||||
* Introduction
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-12a4ef6d-13b6-4d1f-9e0f-a060b63b12d4
|
||||
:END:
|
||||
Here will be presented what I do to get my system up and running on a fresh
|
||||
Arch Linux install. These installation instructions were written in order to
|
||||
get an Arch Linux distribution up and running with the same configuration as
|
||||
my main computer’s and my travelling laptop’s configuration.
|
||||
|
||||
* Install Arch Linux
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-cfe21de6-15fa-477a-a5ff-6cd81dfead19
|
||||
:END:
|
||||
I usually install Arch from the [[https://www.archlinux.org/download/][vanilla ISO]], however I began using [[https://github.com/MatMoul/archfi][archfi]] to
|
||||
install easily the distro (I’ve done it so many times, I know how it works
|
||||
now). Usually, my distros will be installed on at least two partitions, one
|
||||
dedicated to =/home=, the other to the root partition =/=.
|
||||
|
||||
If the computer supports EFI bootloaders, the EFI partition will be mounted on
|
||||
=/boot=. I generally use rEFInd as my boot manager, but if you are more
|
||||
comfortable with another one, just install what you want. Be aware that if you
|
||||
format your =/boot= partition, you will delete all boot managers that already
|
||||
exist; so, if you are dual-booting, *DO NOT FORMAT IT*. Yes, I made the
|
||||
mistake of wiping the Windows boot manager.
|
||||
|
||||
The swap partition is always at least 4GB large, and I should have a total of
|
||||
12GB of combined RAM and swap. This means on my main computer I have 16GB of
|
||||
RAM and 4GB of swap, but on my thinkpad I have 4GB of RAM and 8GB of swap.
|
||||
|
||||
** Get the latest live system with fast mirrors
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-da7951ee-e39a-4a59-a05d-7b7fffdc7825
|
||||
:END:
|
||||
When you boot into the live ISO, execute the following command:
|
||||
#+BEGIN_SRC sh
|
||||
pacman -Sy reflector
|
||||
reflector -c France -c Germany -l 200 -p http -p https --sort rate \
|
||||
--save /etc/pacman.d/mirrorlist --verbose
|
||||
#+END_SRC
|
||||
This will update the packages from your live ISO, and you will get the best
|
||||
mirrors for your installation. Of course, change the countries accordingly to
|
||||
your location.
|
||||
|
||||
** Install the system
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-9f9e1fe5-4726-486b-9875-5fcfd91d0bb0
|
||||
:END:
|
||||
Then you can use a custom script to ease your installation of Arch if you do
|
||||
not wish to do it manually. Personally, I’ve done it several times already, I
|
||||
know how the distro works, I just want to be able to install my distro
|
||||
quickly now.
|
||||
#+BEGIN_SRC sh
|
||||
wget archfi.sf.net/archfi
|
||||
# Or from matmoul.github.io/archfi if SourceForge is down
|
||||
sh archfi
|
||||
#+END_SRC
|
||||
Then, follow the instructions and install Arch Linux. Take the opportunity to
|
||||
install as many packages as you need, mainly =yay= which I use as my package
|
||||
manager (it is just a wrapper for =pacman=) and AUR helper, and
|
||||
=pacman-contrib= which will help us installing some packages later.
|
||||
|
||||
Once your system is installed, reboot and remove your installation media from
|
||||
your computer.
|
||||
|
||||
* Install basic packages
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-d2485595-3014-4151-a76c-63bc353359a8
|
||||
:END:
|
||||
We will need some basic packages in order to run the bootstrap file. So, let’s
|
||||
install =fish= (our shell running the script) and =git=.
|
||||
#+BEGIN_SRC sh
|
||||
sudo pacman -Sy fish git yadm
|
||||
#+END_SRC
|
||||
|
||||
* Execute bootstrap
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c13d132f-9e69-4bb0-838b-29c7c5611f11
|
||||
:HEADER-ARGS: :tangle ~/.config/yadm/bootstrap
|
||||
:END:
|
||||
=yadm= comes with a very handy feature: its bootstrap script. We can execute
|
||||
it by running the following command:
|
||||
#+BEGIN_SRC fish :tangle no
|
||||
yadm bootstrap
|
||||
#+END_SRC
|
||||
|
||||
Notice these two header files, we can see this is a fish script, hence why we
|
||||
need fish (which is my daily shell anyway).
|
||||
#+BEGIN_SRC fish
|
||||
#!/usr/bin/fish
|
||||
# -*- mode: fish -*-
|
||||
#+END_SRC
|
||||
Let’s take a look at what it does.
|
||||
|
||||
** Decrypt private yadm files
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-2ce7e756-3dab-4c12-a3b3-d1b6f8d4805d
|
||||
:END:
|
||||
Some private files are stored encrypted in the repository of my yadm
|
||||
dotfiles. I will need them later on during the bootstrap execution.
|
||||
#+BEGIN_SRC fish
|
||||
yadm decrypt
|
||||
#+END_SRC
|
||||
|
||||
** Get a correct keyboard layout
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-89fb8f3a-6ec4-4701-a5d9-3e593c47ece9
|
||||
:END:
|
||||
I use mainly the [[https://bepo.fr/wiki/Accueil][bépo]] layout, a French keyboard layout inspired by Dvorak
|
||||
layouts, however I sometimes need to switch back to the standard French
|
||||
AZERTY or the American QWERTY layout, so I make it so the Menu key switches
|
||||
for me my layout between these three. This makes it so my xorg configuration
|
||||
of my keyboard looks like this:
|
||||
#+BEGIN_SRC fish
|
||||
set keyboardconf \
|
||||
'Section "InputClass"
|
||||
Identifier "system-keyboard"
|
||||
MatchIsKeyboard "on"
|
||||
Option "XkbLayout" "fr,fr,us"
|
||||
Option "XkbModel" "pc104"
|
||||
Option "XkbVariant" "bepo,,"
|
||||
Option "XkbOptions" "grp:menu_toggle"
|
||||
EndSection'
|
||||
#+END_SRC
|
||||
So, let’s set it as our keyboard configuration.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Set keyboard layout #########################################################\n\n"
|
||||
echo $keyboardconf | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
#+END_SRC
|
||||
|
||||
** Set our locale
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-48678405-93ae-41b6-b44b-285ab0da4e92
|
||||
:END:
|
||||
I use two main locales, the French and US UTF-8 locales, and I like to keep
|
||||
the Japanese locale activated just in case.
|
||||
#+BEGIN_SRC fish
|
||||
set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"
|
||||
#+END_SRC
|
||||
Let’s enable these.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Set our locale ##############################################################\n\n"
|
||||
for item in $mylocales
|
||||
if test (grep -e "#$item" /etc/locale.gen)
|
||||
sudo sed -i "/$item/s/^#//g" /etc/locale.gen
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
This is my configuration I usually use when it comes to my locale.
|
||||
#+BEGIN_SRC fish
|
||||
set localeconf "LANG=en_US.UTF-8
|
||||
LC_COLLATE=C
|
||||
LC_NAME=fr_FR.UTF-8
|
||||
LC_NUMERIC=fr_FR.UTF-8
|
||||
LC_IDENTIFICATION=fr_FR.UTF-8
|
||||
LC_TELEPHONE=fr_FR.UTF-8
|
||||
LC_MONETARY=fr_FR.UTF-8
|
||||
LC_PAPER=fr_FR.UTF-8
|
||||
LC_ADDRESS=fr_FR.UTF-8
|
||||
LC_TIME=fr_FR.UTF-8
|
||||
LC_MEASUREMENT=fr_FR.UTF-8"
|
||||
#+END_SRC
|
||||
Let’s set it as our system’s locale.
|
||||
#+BEGIN_SRC fish
|
||||
echo $localeconf | sudo tee /etc/locale.conf
|
||||
#+END_SRC
|
||||
Now we can generate our locale!
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Generate locale #############################################################\n\n"
|
||||
sudo locale-gen
|
||||
#+END_SRC
|
||||
|
||||
** Create some folders
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-85ce90ff-56dc-469b-bf08-480ecf27acc4
|
||||
:END:
|
||||
Let’s create some folders we might need for mounting our drives, Android
|
||||
devices and CDs.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Create directories for mounting #############################################\n\n"
|
||||
sudo mkdir -p /mnt/{USB,CD,Android}
|
||||
sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}
|
||||
#+END_SRC
|
||||
|
||||
We also need the following folder for our nano backups.
|
||||
#+BEGIN_SRC fish
|
||||
mkdir -p $HOME/.cache/nano/backups
|
||||
#+END_SRC
|
||||
|
||||
** Set user’s shell to fish
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-c1a78394-c156-4a03-ae82-e5e9d4090dab
|
||||
:END:
|
||||
First of all, the bootstrap shell will set the user’s shell to fish.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Set fish as the default shell ###############################################\n\n"
|
||||
chsh -s /usr/bin/fish
|
||||
#+END_SRC
|
||||
|
||||
** Install =yay= if it isn’t already installed
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-fef57cea-cf1d-4900-9d90-ec6353ea9661
|
||||
:END:
|
||||
Now we’ll need to be sure =yay=, our AUR helper, is installed on our system.
|
||||
If it is, we don’t need to to anything. However, if it isn’t, we’ll install
|
||||
it manually.
|
||||
#+BEGIN_SRC fish
|
||||
if ! test (which yay)
|
||||
printf "\n# Installing yay ##############################################################\n\n"
|
||||
cd
|
||||
mkdir -p fromGIT
|
||||
cd fromGIT
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si --noconfirm
|
||||
else
|
||||
printf "\n# yay already installed #######################################################\n\n"
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Install basic packages
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-887ec6d4-535d-4363-a0a7-884717b87a47
|
||||
:END:
|
||||
Let’s set in a custom varible what packages we’ll be needing.
|
||||
#+BEGIN_SRC fish
|
||||
set PACKAGES \
|
||||
acpilight adobe-source-han-sans-jp-fonts asar ascii aspell-en aspell-fr assimp \
|
||||
awesome-terminal-fonts base-devel bat biber bleachbit bluez-firmware \
|
||||
bluez-utils bookworm boost bzip2 ccls chicken chromium clisp compton cppcheck \
|
||||
cppreference cppreference-devhelp cpupower cronie cryptsetup device-mapper \
|
||||
diffutils discord-canary discount ditaa dmenu dmenu-lpass docker \
|
||||
docker-compose dockerfile-language-server-bin doxygen dunst dwarffortress \
|
||||
emacs exfat-utils farbfeld feh ffmpegthumbnailer findutils firefox \
|
||||
flake8 font-mathematica fontforge freeglut fzf gcc-libs gdb gimp glibc \
|
||||
gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts gnuplot go-tools \
|
||||
golangci-lint-bin graphviz htop i3-gaps i3lock-blur i3status igdm-bin \
|
||||
inetutils j4-dmenu-desktop javascript-typescript-langserver js-beautify \
|
||||
jfsutils jmtpfs lastpass-cli less linux-headers lldb logrotate lvm2 ly-git \
|
||||
meson minted mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools nano ncdu \
|
||||
ncmpcpp nemo-fileroller nemo-preview neofetch neovim netctl networkmanager \
|
||||
networkmanager-openvpn nm-connection-editor nnn nodejs-vmd nomacs nordvpn-bin \
|
||||
noto-fonts-emoji npm ntfs-3g numlockx openssh otf-fandol otf-ipafont p7zip \
|
||||
pacman-contrib pandoc-bin pavucontrol pciutils pcurses pdfpc polybar prettier \
|
||||
pulseaudio-bluetooth python-autoflake python-envtpl-git python-epc \
|
||||
python-importmagic python-language-server python-nose python-pip python-ptvsd \
|
||||
python-pytest python-pywal qt5-imageformats qemu r raw-thumbnailer reflector \
|
||||
rofi rofi-wifi-menu-git rsync rtv rustup s-nail samba scrot sent shadow \
|
||||
siji-git simplescreenrecorder speedcrunch sshfs st-luke-git swi-prolog \
|
||||
texlive-bin texlive-langchinese texlive-langcyrillic texlive-langgreek \
|
||||
texlive-langjapanese texlive-langkorean texlive-latexextra \
|
||||
texlive-localmanager-git texlive-most tmux tree ttf-arphic-uming ttf-baekmuk \
|
||||
ttf-bitstream-vera ttf-dejavu ttf-google-fonts-opinionated-git ttf-hanazono \
|
||||
ttf-joypixels ttf-koruri ttf-liberation ttf-material-design-icons-git \
|
||||
ttf-monapo ttf-mplus ttf-ms-fonts ttf-sazanami ttf-symbola ttf-tibetan-machine \
|
||||
ttf-twemoji-color ttf-unifont ttf-vlgothic typescript \
|
||||
typescript-language-server-bin unicode unicode-emoji unrar usbutils valgrind \
|
||||
vscode-css-languageserver-bin vscode-html-languageserver-bin w3m wget \
|
||||
x11-ssh-askpass xclip xdg-user-dirs-gtk xfsprogs xorg-apps xorg-drivers \
|
||||
xorg-server xorg-xinit xss-lock xvkbd yaml-language-server-bin yapf
|
||||
#+END_SRC
|
||||
These are the minimum I would have in my own installation. You can edit it
|
||||
however you want. Let’s install those.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing needed packages ##################################################\n\n"
|
||||
sudo pacman -Syu
|
||||
yay -S --needed $PACKAGES
|
||||
#+END_SRC
|
||||
|
||||
** Setting up Emacs: Installing Spacemacs
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-bd5a92c4-1a4f-49ea-a447-050a4ff0301c
|
||||
:END:
|
||||
Now, the first thing we want to do with Emacs is install its Spacemacs
|
||||
distribution. We’ll clone its =develop= branch into =~/.emacs.d=. We need to
|
||||
do this prior to our dotfiles’ cloning because of some submodules that are
|
||||
cloned within our =~/.emacs.d= directory, and git won’t let us clone
|
||||
Spacemacs in an already existing and non-empty directory. To make sure it
|
||||
isn’t one, let’s delete any potentially existing =~/.emacs.d= directory:
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing Spacemacs ########################################################\n\n"
|
||||
rm -rf ~/.emacs.d
|
||||
#+END_SRC
|
||||
Now we can clone Spacemacs:
|
||||
#+BEGIN_SRC fish
|
||||
git clone --single-branch --branch develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
|
||||
#+END_SRC
|
||||
And we can restore what might have been deleted in our =~/.emacs.d/private=
|
||||
directory:
|
||||
#+BEGIN_SRC fish
|
||||
yadm checkout -- ~/.emacs.d/private/
|
||||
#+END_SRC
|
||||
|
||||
** Set up dotfiles
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-cf2c3a24-b08e-4b07-9d51-31f6df781e62
|
||||
:END:
|
||||
*** Update our dotfiles’ remotes
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-18967335-2637-44d6-b407-bb1d2d2718b9
|
||||
:END:
|
||||
This line in the bootstrap script will test if the current user is using my
|
||||
username. If yes, it’s probably me.
|
||||
#+BEGIN_SRC fish
|
||||
if ! test (echo "phundrak" | sed -e "s/^.*$USER//I")
|
||||
#+END_SRC
|
||||
If it is me installing and using these dotfiles, I want the remotes of my
|
||||
dotfiles to be set to ssh remotes using my ssh keys.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Update yadm’s remotes #######################################################\n\n"
|
||||
yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git
|
||||
yadm remote add github git@github.com:phundrak/dotfiles.git
|
||||
#+END_SRC
|
||||
I will also want to decrypt my encrypted files, such as said ssh keys.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Decrypt encrypted dotfiles ##################################################\n\n"
|
||||
yadm decrypt
|
||||
#+END_SRC
|
||||
Finally, let’s close this =if= statement.
|
||||
#+BEGIN_SRC fish
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Get =envtpl=
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-39034878-7864-4a1c-855d-d9882795aac0
|
||||
:END:
|
||||
Before we set our dotfiles up, let’s make sure =envtpl= is correctly
|
||||
installed. This package will be needed for generating our alt dotfiles.
|
||||
#+BEGIN_SRC fish
|
||||
printf '\n# Install envtpl ##############################################################\n\n'
|
||||
yay -Syu python-envtpl-git
|
||||
#+END_SRC
|
||||
|
||||
*** Update our submodules
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-ae2f8ccb-a8f3-4699-832c-52cbc8b6d081
|
||||
:END:
|
||||
Now we can download the various dependencies of our dotfiles. To do so,
|
||||
let’s run the following command:
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Getting yadm susbmodules ####################################################\n\n"
|
||||
yadm submodule update --init --recursive
|
||||
#+END_SRC
|
||||
|
||||
*** Generate our alt files
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f924c003-a15c-4132-891f-36cd3948a7c1
|
||||
:END:
|
||||
Now this should be the last manipulation on our dotfiles: let’s create our
|
||||
alternate files:
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Generating alt files ########################################################\n\n"
|
||||
yadm alt
|
||||
#+END_SRC
|
||||
|
||||
** Installing Tryone’s Compton fork
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-aecf9f01-268c-40cd-8fc3-622c6ce822e4
|
||||
:END:
|
||||
For some reason, I found installing directly this fork does not work, and I
|
||||
need to install it after I installed the regular compton packages.
|
||||
=compton-tryone-git= will replace =compton= which will be removed.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing tryone’s compton fork ############################################\n\n"
|
||||
yay -S compton-tryone-git
|
||||
#+END_SRC
|
||||
|
||||
** Enable some of our services
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-1044da09-e992-4dcb-90ff-513725e1d450
|
||||
:END:
|
||||
We have installed some packages which require some services to run. Let’s
|
||||
enable them.
|
||||
|
||||
*** Docker
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-429cb31a-fccb-420f-a5aa-21054c45fb38
|
||||
:END:
|
||||
First, let’s activate Docker.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Enabling and starting Docker ################################################\n\n"
|
||||
sudo systemctl enable --now docker
|
||||
#+END_SRC
|
||||
|
||||
Now, if we wish it, we can be added to the =docker= group so we won’t have
|
||||
to type =sudo= each time we call Docker or Docker Compose.
|
||||
#+BEGIN_SRC fish
|
||||
read --prompt "echo 'Do you wish to be added to the `docker` group? (Y/n): ' " -l adddockergroup
|
||||
if test $adddockergroup = 'y' || test $adddockergroup = "Y" || test $adddockergroup = ''
|
||||
sudo usermod -aG docker $USER
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Emacs
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-7131fa13-3c6e-4cfc-b8e8-c880de9d380f
|
||||
:END:
|
||||
Emacs will run as a user service, which means it won’t be launched until we
|
||||
log in.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Enabling Emacs as user service ##############################################\n\n"
|
||||
systemctl --user enable --now emacs
|
||||
#+END_SRC
|
||||
|
||||
*** SSH server
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-1f355779-f1dc-4c0f-9cf1-14724ce05f4d
|
||||
:END:
|
||||
Maybe we want to activate an SSH server on our machine. If so, we can enable
|
||||
it. Let’s ask the question.
|
||||
#+BEGIN_SRC fish
|
||||
read --prompt "echo 'Do you want to activate the ssh server? (Y/n): ' " -l sshdserver
|
||||
if test $sshdserver = 'y' || test $sshdserver = "Y" || test $sshdserver = ''
|
||||
printf "\n# Enabling ssh server #########################################################\n\n"
|
||||
sudo systemctl enable --now sshd
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Ly
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-2785fc5b-cd35-4c99-9f47-3dcbf1a7a870
|
||||
:END:
|
||||
Ly is a display manager based on ncurses which I find nice enough for me to
|
||||
use (I generally don’t like using display managers). Let’s enable it, and
|
||||
let’s disable tty2 while we’re at it (Ly uses it to run X).
|
||||
#+BEGIN_SRC fish
|
||||
sudo systemctl enable --now ly
|
||||
sudo systemctl disable getty@tty2
|
||||
#+END_SRC
|
||||
|
||||
*** Acpilight
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-5423e2a7-d2ce-4bc3-9d5d-85677c18181e
|
||||
:END:
|
||||
=acpilight= is our utility managing the brightness of our screen. There is
|
||||
actually no service to enable here, but we must ensure the user is part of
|
||||
the =video= group so we can modify the brightness of our screen without
|
||||
using =sudo=.
|
||||
#+BEGIN_SRC fish
|
||||
sudo usermod -aG video $USER
|
||||
#+END_SRC
|
||||
|
||||
*** NordVPN
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-49c24a3e-a496-4200-bf64-96e945c203a0
|
||||
:END:
|
||||
Thanks to the AUR package ~nordvpn-bin~, I no longer have to manually
|
||||
maintain my VPN connections manually with OpenVPN. However, it requires a
|
||||
service that we should activate:
|
||||
#+BEGIN_SRC fish
|
||||
sudo systemctl enable --now nordvpnd
|
||||
#+END_SRC
|
||||
|
||||
** Symlink some system config files
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-b14d7d03-da49-4a7b-ba05-1c0848bd8e44
|
||||
:END:
|
||||
We have some files in [[file:ect/][etc/]] that are to be symlinked to =/etc=.
|
||||
#+BEGIN_SRC fish
|
||||
for f in (find ~/.etc -type f)
|
||||
set dest (echo $f | sed -n 's/^.*etc\(.*\)$/\/etc\1/p')
|
||||
sudo ln -s $f $dest
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
We may also want to symlink our [[file:.nanorc][nanorc]] to the =/root= directory for when we
|
||||
use =nano= as =sudo=.
|
||||
#+BEGIN_SRC fish
|
||||
read --prompt "echo 'Symlink .nanorc to root’s .nanorc? (Y/n): ' " -l nanoroot
|
||||
if test $nanoroot = 'y' || test $nanoroot = "Y" || test $nanoroot = ''
|
||||
printf "\n# Symlinking .nanorc to root’s .nanorc ########################################\n\n"
|
||||
sudo ln -s $HOME/.nanorc /root/.nanorc
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Set up our fish shell
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f6f4df67-b0de-40bf-95fb-888d42169088
|
||||
:END:
|
||||
*** Install =fisher=
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-d6490ddc-c909-4713-b36a-19c25a79c7ac
|
||||
:END:
|
||||
We will be using =fisher= as our extensions manager for Fish. Let’s install
|
||||
it.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing fisher ###########################################################\n\n"
|
||||
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
|
||||
#+END_SRC
|
||||
|
||||
*** Install our extensions
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3d540273-bdfb-4c63-a05f-2374a010dc29
|
||||
:END:
|
||||
I generally use the following extensions in my Fish shell.
|
||||
#+BEGIN_SRC fish
|
||||
set FISHEXTENSIONS \
|
||||
edc/bass franciscolourenco/done jethrokuan/fzf jethrokuan/z \
|
||||
jorgebucaran/fish-getopts laughedelic/pisces matchai/spacefish \
|
||||
tuvistavie/fish-ssh-agent
|
||||
#+END_SRC
|
||||
Let’s install these:
|
||||
#+BEGIN_SRC fish
|
||||
fisher add $FISHEXTENSIONS
|
||||
#+END_SRC
|
||||
|
||||
** Install packages from git
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-e79da7b2-9286-4b66-812e-453e3b2505c7
|
||||
:END:
|
||||
Now, let’s install some packages from git directly.
|
||||
|
||||
*** i3-gaps rounded
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-10e229f7-9a45-4401-a9c0-3f974482bb9f
|
||||
:END:
|
||||
I know we already installed =i3-gaps= from the AUR, why reinstall it? Well,
|
||||
that is certainly bad practices, but this allowed me to already have the
|
||||
needed dependencies for building =i3= installed. Now, let’s clone it, build
|
||||
it, and install it. Doing this is probably very bad practices though, be
|
||||
warned.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Install i3-gaps-rounded #####################################################\n\n"
|
||||
cd ~/fromGIT
|
||||
git clone https://github.com/resloved/i3.git i3-gaps-rounded
|
||||
cd i3-gaps-rounded
|
||||
rm -rf build
|
||||
autoreconf --force --install
|
||||
mkdir build && cd build
|
||||
../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
|
||||
make -j
|
||||
sudo make install
|
||||
#+END_SRC
|
||||
|
||||
*** Polybar Battery
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f228ec52-a7d0-4c16-adfa-75c544fcfa93
|
||||
:END:
|
||||
Now let’s install =polybar-battery=. This is a binary that I’ll use in my [[file:.config/i3/config][i3
|
||||
config]] to indicate my battery level. It also sends a notification on low
|
||||
battery and on charging completed.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Install polybar-battery #####################################################\n\n"
|
||||
cd ~/fromGIT
|
||||
git clone https://github.com/drdeimos/polybar_another_battery.git
|
||||
cd polybar_another_battery
|
||||
go get -u github.com/distatus/battery/cmd/battery
|
||||
make build
|
||||
#+END_SRC
|
||||
|
||||
Now, we have our binary, let’s symlink it in our local binary directory,
|
||||
=~/.local/bin=.
|
||||
#+BEGIN_SRC fish
|
||||
ln -s polybar-ab ~/.local/bin/polybar-ab
|
||||
#+END_SRC
|
||||
|
||||
*** Reveal.JS
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-68d1cdb4-1447-420f-ab0c-53ef905e757b
|
||||
:END:
|
||||
I sometimes use Reveal.JS to make presentations, and I set its location in
|
||||
my [[file:.spacemacs][dotspacemacs]] file to be in =~/fromGIT=, so let’s clone it there.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Install Reveal.JS ###########################################################\n\n"
|
||||
cd ~/fromGIT
|
||||
git clone https://github.com/hakimel/reveal.js.git
|
||||
#+END_SRC
|
||||
|
||||
** Install Rust
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-57e8af4c-93f2-4145-9c39-a5f8d1c9f012
|
||||
:END:
|
||||
*** Install the toolchains
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-05ee25dc-3885-46ca-afaf-35bfb2e385d4
|
||||
:END:
|
||||
When using rust, I bounce between two toolchains, the =stable= toolchain and
|
||||
the =nightly= toolchain. To install them, I will use =rustup= which has
|
||||
already been installed.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n"
|
||||
rustup default nightly
|
||||
#+END_SRC
|
||||
This will both download the nightly toolchain and set it as the default one.
|
||||
Yup, I like to live dangerously. Now to install the stable toolchain, let’s
|
||||
run this:
|
||||
#+BEGIN_SRC fish
|
||||
rustup toolchain install stable
|
||||
#+END_SRC
|
||||
|
||||
*** Install some utilities
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f94f2e18-623f-4aa5-be99-6a7df6a9cbcd
|
||||
:END:
|
||||
We’ll need some utilities when developing Rust from Emacs, namely =rustfmt=
|
||||
and =racer=. Let’s install them with =cargo=.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Add rust utilities ##########################################################\n\n"
|
||||
cargo install rustfmt racer
|
||||
#+END_SRC
|
||||
|
||||
We will also need some components for development purposes:
|
||||
#+BEGIN_SRC fish
|
||||
rustup component add src
|
||||
rustup component add rls
|
||||
#+END_SRC
|
||||
|
||||
** Install some python packages
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-8155ae1a-0be1-489f-be13-9222f7686fb2
|
||||
:END:
|
||||
Some packages will be needed from pip in order to get our Emacs setup
|
||||
correctly working. Let’s install them locally for our user:
|
||||
#+BEGIN_SRC fish
|
||||
pip install --user pyls-isort pyls-mypy
|
||||
#+END_SRC
|
||||
|
||||
** Install go packages
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-8c6e2311-eb84-4bf4-8e0b-948f89bc9664
|
||||
:END:
|
||||
For go development from Emacs, the Spacemacs go and lsp layers requires some
|
||||
packages to be installed.
|
||||
#+BEGIN_SRC fish
|
||||
go get -v golang.org/x/tools/gopls@latest
|
||||
go get -u -v golang.org/x/tools/cmd/godoc
|
||||
go get -u -v golang.org/x/tools/cmd/goimports
|
||||
go get -u -v golang.org/x/tools/cmd/gorename
|
||||
go get -u -v golang.org/x/tools/cmd/guru
|
||||
go get -u -v github.com/cweill/gotests/...
|
||||
go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct
|
||||
go get -u -v github.com/fatih/gomodifytags
|
||||
go get -u -v github.com/godoctor/godoctor
|
||||
go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
go get -u -v github.com/haya14busa/gopkgs/cmd/gopkgs
|
||||
go get -u -v github.com/josharian/impl
|
||||
go get -u -v github.com/mdempsky/gocode
|
||||
go get -u -v github.com/rogpeppe/godef
|
||||
go get -u -v github.com/zmb3/gogetdoc
|
||||
go get -u -v golang.org/x/tools/gopls
|
||||
#+END_SRC
|
||||
|
||||
** Set up Chicken (Scheme interpreter/compiler)
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-10ffb0c0-8028-4e9c-842e-9e7d2c165c5b
|
||||
:END:
|
||||
Chicken needs to be set up before being used. First, we need to install its
|
||||
documentation.
|
||||
#+BEGIN_SRC fish
|
||||
chicken-install -s apropos chicken-doc
|
||||
#+END_SRC
|
||||
|
||||
Then, we’ll complete the documentation like so:
|
||||
#+BEGIN_SRC fish
|
||||
cd (chicken-csi -b -e "(import (chicken platform))" -p "(chicken-home)")
|
||||
curl https://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
|
||||
#+END_SRC
|
||||
|
||||
** Clean the =pacman= and =yay= cache
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-fa5307ec-065b-4d06-9d47-05ccde0da8ac
|
||||
:END:
|
||||
Finally, we are almost done! Let’s clean the cache of =pacman= and =yay=.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Clean the pacman and yay cache ##############################################\n\n"
|
||||
yay -Sc --noconfirm
|
||||
#+END_SRC
|
||||
You should now run a system pretty close to the one I have on my main
|
||||
computer and my thinkpad.
|
||||
151
org/config-website/nano.org
Normal file
151
org/config-website/nano.org
Normal file
@@ -0,0 +1,151 @@
|
||||
#+TITLE: Phundrak’s nano configuration
|
||||
#+INCLUDE: headers.org
|
||||
#+OPTIONS: auto-id:t
|
||||
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's nano configuration" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's nano configuration" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the nano configuration of Phundrak" />
|
||||
#+PROPERTY: header-args :tangle ~/.nanorc
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-fe544a28-d8d9-49d3-b5ea-0b828148dbb5
|
||||
:END:
|
||||
- [[#introduction][Introduction]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#keys-behavior][Keys behavior]]
|
||||
- [[#search][Search]]
|
||||
- [[#visual-settings][Visual settings]]
|
||||
- [[#whitespace-settings][Whitespace settings]]
|
||||
- [[#included-configuration-file][Included configuration file]]
|
||||
|
||||
* Introduction
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-ed3ad74a-f67a-4fc2-bb1f-b2cfb38f3ed0
|
||||
:END:
|
||||
I nowadays rarely use Nano as a text editor, since I mainly rely on Emacs for
|
||||
all sorts of tasks, including quick file editing. However, at times, Emacs
|
||||
won’t work or won’t be available, and I therefore need a lightweight, fast and
|
||||
reliable text editor: Nano. And despite Nano being a simple piece of software,
|
||||
it does offer some customization I cannot refuse. Here is how I configured it:
|
||||
|
||||
* Configuration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-76aa0ff6-9e6a-4a35-974f-9132b08c8eb4
|
||||
:END:
|
||||
When saving a file, create a backup file by adding a tilde (=~=) to the file's
|
||||
name. And make and keep not just one backup file, but make and keep a uniquely
|
||||
numbered one every time a file is saved — when backups are enabled with =set
|
||||
backup= or =--backup= or =-B=. The uniquely numbered files are stored in the
|
||||
directory =~/.cache/nano/backups/=.
|
||||
#+BEGIN_SRC conf
|
||||
set backup
|
||||
set backupdir /home/phundrak/.cache/nano/backups/
|
||||
#+END_SRC
|
||||
|
||||
Save a file by default in Unix format. This overrides nano's default behavior
|
||||
of saving a file in the format that it had. (This option has no effect when
|
||||
you also use =set noconvert=.)
|
||||
#+BEGIN_SRC conf
|
||||
set unix
|
||||
#+END_SRC
|
||||
|
||||
** Keys behavior
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-0f092122-dd91-40e0-8e02-b732a8d5485f
|
||||
:END:
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the very
|
||||
beginning of non-whitespace characters on a line, the cursor will jump to
|
||||
that beginning (either forwards or backwards). If the cursor is already at
|
||||
that position, it will jump to the true beginning of the line.
|
||||
#+BEGIN_SRC conf
|
||||
set smarthome
|
||||
#+END_SRC
|
||||
|
||||
** Search
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-edff993e-54f5-42c6-8a45-e5a7194adf57
|
||||
:END:
|
||||
Do case-unsensitive searches by default.
|
||||
#+BEGIN_SRC conf
|
||||
unset casesensitive
|
||||
#+END_SRC
|
||||
|
||||
Do regular-expression searches by default. Regular expressions in =nano= are
|
||||
of the extended type (ERE).
|
||||
#+BEGIN_SRC conf
|
||||
set regexp
|
||||
#+END_SRC
|
||||
|
||||
** Visual settings
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f4d533e9-a86d-4b6e-b601-28536267f7ab
|
||||
:END:
|
||||
Use bold instead of reverse video for the title bar, status bar, key combos,
|
||||
function tags, line numbers, and selected text. This can be overridden by
|
||||
setting the options =titlecolor=, =statuscolor=, =keycolor=, =functioncolor=,
|
||||
=numbercolor=, and =selectedcolor=.
|
||||
#+BEGIN_SRC conf
|
||||
set boldtext
|
||||
#+END_SRC
|
||||
|
||||
Enable soft line wrapping for easier viewing of very long lines.
|
||||
#+BEGIN_SRC conf
|
||||
set softwrap
|
||||
#+END_SRC
|
||||
|
||||
When soft line wrapping is enabled, make it wrap lines at blank characters
|
||||
(tabs and spaces) instead of always at the edge of the screen.
|
||||
#+BEGIN_SRC conf
|
||||
set atblanks
|
||||
#+END_SRC
|
||||
|
||||
Display line numbers to the left of the text area.
|
||||
#+BEGIN_SRC conf
|
||||
set linenumbers
|
||||
#+END_SRC
|
||||
|
||||
Constantly display the cursor position in the status bar. This overrides the
|
||||
option =quickblank=.
|
||||
#+BEGIN_SRC conf
|
||||
set constantshow
|
||||
#+END_SRC
|
||||
|
||||
** Whitespace settings
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-24190b41-8efe-4dfd-ac4b-0f5614b8c9e0
|
||||
:END:
|
||||
Convert typed tabs to spaces. Sue me.
|
||||
#+BEGIN_SRC conf
|
||||
set tabstospaces
|
||||
#+END_SRC
|
||||
|
||||
Use a tab size of a certain amount of columns. The value of number must be
|
||||
greater than 0. The default value is 8.
|
||||
#+BEGIN_SRC conf
|
||||
set tabsize 2
|
||||
#+END_SRC
|
||||
|
||||
Automatically indent a newly created line to the same number of tabs and/or
|
||||
spaces as the previous line (or as the next line if the previous line is the
|
||||
beginning of a paragraph).
|
||||
#+BEGIN_SRC conf
|
||||
set autoindent
|
||||
#+END_SRC
|
||||
|
||||
Remove trailing whitespace from wrapped lines when automatic hard-wrapping
|
||||
occurs or when text is justified.
|
||||
#+BEGIN_SRC conf
|
||||
set trimblanks
|
||||
#+END_SRC
|
||||
|
||||
** Included configuration file
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-491cba80-5fa9-4b75-a9cb-2865ec39440a
|
||||
:END:
|
||||
Nano gives the opportunity to include some files located elsewhere. This is
|
||||
why I added [[https://github.com/scopatz/nanorc][this repo]] as a submodule of my dotfiles so I can access a lot of
|
||||
them at the same time. Since the submodule is cloned in =~/.config/nanorc=,
|
||||
we can add only one line to include all of the =.nanorc= files.
|
||||
#+BEGIN_SRC conf
|
||||
include ~/.config/nanorc/*.nanorc
|
||||
#+END_SRC
|
||||
1103
org/config-website/polybar.org
Normal file
1103
org/config-website/polybar.org
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
/home/phundrak/spacemacs.org
|
||||
2567
org/config-website/spacemacs.org
Normal file
2567
org/config-website/spacemacs.org
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
/home/phundrak/tmux.org
|
||||
418
org/config-website/tmux.org
Normal file
418
org/config-website/tmux.org
Normal file
@@ -0,0 +1,418 @@
|
||||
#+TITLE: Phundrak’s tmux config
|
||||
#+INCLUDE: ~/org/config-website/headers.org
|
||||
#+OPTIONS: auto-id:t
|
||||
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's tmux config" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's tmux config" />
|
||||
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the tmux config file of Phundrak" />
|
||||
#+PROPERTY: header-args :tangle ~/.tmux.conf.local
|
||||
|
||||
* Table of Contents :TOC_4_gh:noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-400070eb-725f-4416-a4c6-da3053df750b
|
||||
:END:
|
||||
|
||||
- [[#presentation][Presentation]]
|
||||
- [[#windows-and-pane-creation][Windows and pane creation]]
|
||||
- [[#display][Display]]
|
||||
- [[#colors-and-style][Colors and style]]
|
||||
- [[#window-status-bar][Window status bar]]
|
||||
- [[#clipboard][Clipboard]]
|
||||
- [[#user-customizations][User customizations]]
|
||||
|
||||
* Presentation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-d6e5eaf3-150c-4f3e-bc8e-fbbbb604640e
|
||||
:END:
|
||||
I don’t really use tmux often, but I certainly do like a nice presentation and
|
||||
useful features, hence this configuration. This config file is inspired by
|
||||
gpakosz’s tmux configuration repo you can find [[https://github.com/gpakosz/.tmux][here]].
|
||||
|
||||
* Windows and pane creation
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-b7e4f3a6-ab16-47e8-aa72-b74b3a66893d
|
||||
:END:
|
||||
Whether if a new *window* will retain the current path. Possible values are:
|
||||
- true
|
||||
- false (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_new_window_retain_current_path=true
|
||||
#+END_SRC
|
||||
|
||||
Whether if a new *pane* should retain the current path. Possible values are:
|
||||
- true (default)
|
||||
- false
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_new_window_retain_current_path=true
|
||||
#+END_SRC
|
||||
|
||||
Whether or not tmux should attempt to reconnect to the current ssh session.
|
||||
This is still experimental. Possible values are:
|
||||
- true
|
||||
- false (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_new_pane_reconnect_ssh=true
|
||||
#+END_SRC
|
||||
|
||||
Whether tmux should prompt for new session name when creating a new one.
|
||||
Possible values are:
|
||||
- true
|
||||
- false (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_new_session_prompt=false
|
||||
#+END_SRC
|
||||
|
||||
* Display
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-a1b48bb1-40d8-4ffb-9ec0-b77e63f7ef84
|
||||
:END:
|
||||
Whether to activate RGB 24-bit color support (only available in tmux >= 2.2).
|
||||
Possible values are:
|
||||
- true
|
||||
- false (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_24b_colour=false
|
||||
#+END_SRC
|
||||
|
||||
These variables are for chosing the window style. I use the default one.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_fg='default'
|
||||
tmux_conf_theme_window_bg='default'
|
||||
#+END_SRC
|
||||
|
||||
Whether the focused pane should be highlighted (only available in tmux >=
|
||||
2.1). Possible values are:
|
||||
- true
|
||||
- false (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_highlight_focused_pane=false
|
||||
#+END_SRC
|
||||
|
||||
Set the terminal title. Built-in variables are:
|
||||
- =#{circled_window_index}=
|
||||
- =#{circled_session_name}=
|
||||
- =#{hostname}=
|
||||
- =#{hostname_ssh}=
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W'
|
||||
#+END_SRC
|
||||
|
||||
These variables set the left/right separators between sections. With the
|
||||
current values, you don’t need to install Powerline, but only fonts patched
|
||||
with Powerline symbols or the standalone PowerlineSymbols.otf font.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_left_separator_main='\uE0B0'
|
||||
tmux_conf_theme_left_separator_sub='\uE0B1'
|
||||
tmux_conf_theme_right_separator_main='\uE0B2'
|
||||
tmux_conf_theme_right_separator_sub='\uE0B3'
|
||||
#+END_SRC
|
||||
|
||||
** Colors and style
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-3142ab15-458c-434b-99d6-1f89462a6f26
|
||||
:END:
|
||||
Colors displayed in tmux can be chosen thanks to the following variables. Any
|
||||
color should be formatted as a hexadecimal RGB value preceded by a pound sign
|
||||
=#= (e.g. =#00afff= for light blue) or =default= to let our terminal set it
|
||||
for us.
|
||||
|
||||
Choose the style of the pane borders. Possible values are:
|
||||
- thin (default)
|
||||
- fat
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_pane_border_style=thin
|
||||
#+END_SRC
|
||||
|
||||
Declare what the colors of the focused pane should be. The first variable
|
||||
specifies the foreground color, the other the background color.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_focused_pane_fg='default'
|
||||
tmux_conf_theme_focused_pane_bg='#0087d7'
|
||||
#+END_SRC
|
||||
|
||||
Here you can set the colors of the pane borders.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_pane_border='#444444'
|
||||
tmux_conf_theme_pane_active_border='#00afff'
|
||||
#+END_SRC
|
||||
|
||||
With these variables, you can set the colors for the pane indicators.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_pane_indicator='#00afff'
|
||||
tmux_conf_theme_pane_active_indicator='#00afff'
|
||||
#+END_SRC
|
||||
|
||||
These variables set the colors and the style of the status line.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_message_fg='#000000'
|
||||
tmux_conf_theme_message_bg='#ffff00'
|
||||
tmux_conf_theme_message_attr='bold'
|
||||
#+END_SRC
|
||||
|
||||
Same as above for the status line command style.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_message_command_fg='#ffff00'
|
||||
tmux_conf_theme_message_command_bg='#000000'
|
||||
tmux_conf_theme_message_command_attr='bold'
|
||||
#+END_SRC
|
||||
|
||||
These variables set the style of the window modes.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_mode_fg='#000000'
|
||||
tmux_conf_theme_mode_bg='#ffff00'
|
||||
tmux_conf_theme_mode_attr='bold'
|
||||
#+END_SRC
|
||||
|
||||
Set the style of the status line.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_status_fg='#8a8a8a'
|
||||
tmux_conf_theme_status_bg='#080808'
|
||||
tmux_conf_theme_status_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
** Window status bar
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-f6a802f9-3b1e-4c83-8ffc-a72a35a691e9
|
||||
:END:
|
||||
The following variables are to set the window’s status style and format.
|
||||
|
||||
Sets the colors and style of the window status.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_fg='#8a8a8a'
|
||||
tmux_conf_theme_window_status_bg='#080808'
|
||||
tmux_conf_theme_window_status_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
Sets the format of the window status. Built-in variables are:
|
||||
- =#{circled_window_index}=
|
||||
- =#{circled_session_name}=
|
||||
- =#{hostname}=
|
||||
- =#{hostname_ssh}=
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_format='#I #W'
|
||||
#+END_SRC
|
||||
|
||||
Sets the colors and style of the current window status.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_current_fg='#000000'
|
||||
tmux_conf_theme_window_status_current_bg='#00afff'
|
||||
tmux_conf_theme_window_status_current_attr='bold'
|
||||
#+END_SRC
|
||||
|
||||
Sets the format of the currentwindow status. Built-in variables are:
|
||||
- =#{circled_window_index}=
|
||||
- =#{circled_session_name}=
|
||||
- =#{hostname}=
|
||||
- =#{hostname_ssh}=
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_current_format='#I #W'
|
||||
#+END_SRC
|
||||
|
||||
Sets the window activity status style.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_activity_fg='default'
|
||||
tmux_conf_theme_window_status_activity_bg='default'
|
||||
tmux_conf_theme_window_status_activity_attr='underscore'
|
||||
#+END_SRC
|
||||
|
||||
Sets the window bell status style.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_bell_fg='#ffff00'
|
||||
tmux_conf_theme_window_status_bell_bg='default'
|
||||
tmux_conf_theme_window_status_bell_attr='blink,bold'
|
||||
#+END_SRC
|
||||
|
||||
Sets the window last status style.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_last_fg='#00afff'
|
||||
tmux_conf_theme_window_status_last_bg='default'
|
||||
tmux_conf_theme_window_status_last_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
Sets the left and right content of the status bar of tmux. Sections should be
|
||||
separated with =|=, subsections with =,=. The built-in values are:
|
||||
- =#{battery_bar}=
|
||||
- =#{battery_hbar}=
|
||||
- =#{battery_percentage}=
|
||||
- =#{battery_status}=
|
||||
- =#{battery_vbar}=
|
||||
- =#{circled_session_name}=
|
||||
- =#{hostname_ssh}=
|
||||
- =#{hostname}=
|
||||
- =#{loadavg}=
|
||||
- =#{pairing}=
|
||||
- =#{prefix}=
|
||||
- =#{root}=
|
||||
- =#{synchronized}=
|
||||
- =#{uptime_y}=
|
||||
- =#{uptime_d}= (modulo 365 when =#{uptime_y}= is used)
|
||||
- =#{uptime_h}=
|
||||
- =#{uptime_m}=
|
||||
- =#{uptime_s}=
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} '
|
||||
tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} '
|
||||
#+END_SRC
|
||||
|
||||
Sets the left status style and colors.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4'
|
||||
tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff'
|
||||
tmux_conf_theme_status_left_attr='bold,none,none'
|
||||
#+END_SRC
|
||||
|
||||
Sets the right status style and colors.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000'
|
||||
tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4'
|
||||
tmux_conf_theme_status_right_attr='none,none,bold'
|
||||
#+END_SRC
|
||||
|
||||
Set the pairing indicator, its style and its attribute.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_pairing='👓 ' # U+1F453
|
||||
tmux_conf_theme_pairing_fg='none'
|
||||
tmux_conf_theme_pairing_bg='none'
|
||||
tmux_conf_theme_pairing_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
Set the pairing indicator, its style and its attribute.
|
||||
#+BEGIN_SRC conf-unix
|
||||
# prefix indicator
|
||||
tmux_conf_theme_prefix='⌨ ' # U+2328
|
||||
tmux_conf_theme_prefix_fg='none'
|
||||
tmux_conf_theme_prefix_bg='none'
|
||||
tmux_conf_theme_prefix_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
Set the root indicator, its style and its attribute.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_root='!'
|
||||
tmux_conf_theme_root_fg='none'
|
||||
tmux_conf_theme_root_bg='none'
|
||||
tmux_conf_theme_root_attr='bold,blink'
|
||||
#+END_SRC
|
||||
|
||||
Set the synchronized indicator, its style and its attribute.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_synchronized='🔒' # U+1F512
|
||||
tmux_conf_theme_synchronized_fg='none'
|
||||
tmux_conf_theme_synchronized_bg='none'
|
||||
tmux_conf_theme_synchronized_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
Set the battery bar symbols.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_bar_symbol_full='◼'
|
||||
tmux_conf_battery_bar_symbol_empty='◻'
|
||||
#+END_SRC
|
||||
|
||||
Set the battery bar length in terms of amount of symbols. Possible values
|
||||
are:
|
||||
- =auto=
|
||||
- an integer number, e.g. 5
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_bar_length='auto'
|
||||
#+END_SRC
|
||||
|
||||
Set the battery bar palette. Possible values are:
|
||||
- =gradient= (default)
|
||||
- =heat=
|
||||
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
|
||||
value preceded by a pound symbol =#=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_bar_palette='gradient'
|
||||
#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000'
|
||||
#+END_SRC
|
||||
|
||||
Set the hbar palette. Possible values are:
|
||||
- =gradient= (default)
|
||||
- =heat=
|
||||
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
|
||||
value preceded by a pound symbol =#=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_hbar_palette='gradient'
|
||||
#+END_SRC
|
||||
|
||||
Set the vbar palette. Possible values are:
|
||||
- =gradient= (default)
|
||||
- =heat=
|
||||
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
|
||||
value preceded by a pound symbol =#=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_vbar_palette='gradient'
|
||||
#+END_SRC
|
||||
|
||||
Set symbols used to indicate whether the battery is charging or discharging.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_status_charging='⚡ ' # U+26A1
|
||||
tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
|
||||
# tmux_conf_battery_status_charging='↑' # U+2191
|
||||
# tmux_conf_battery_status_discharging='↓' # U+2193
|
||||
#tmux_conf_battery_status_charging='🔌 ' # U+1F50C
|
||||
#+END_SRC
|
||||
|
||||
Set the clock style. If it is displayed on the right side of the status bar,
|
||||
it might be better to use =%I:%M %p= rather than =%R= in
|
||||
=tmux_conf_theme_status_right=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_clock_colour='#00afff'
|
||||
tmux_conf_theme_clock_style='24'
|
||||
#+END_SRC
|
||||
|
||||
* Clipboard
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-47a20d72-6406-4467-b833-a4bd33731487
|
||||
:END:
|
||||
Whether if in copy mode, copying the selection also copies to the OS
|
||||
clipboard. Possible values are:
|
||||
- true
|
||||
- false (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_copy_to_os_clipboard=false
|
||||
#+END_SRC
|
||||
|
||||
* User customizations
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h-68bc0e1c-48d9-4b14-953d-875601d0edb7
|
||||
:END:
|
||||
Here we can override or undo some setting from settings from tmux. First, we
|
||||
can increase the history size.
|
||||
#+BEGIN_SRC conf-unix
|
||||
set -g history-limit 10000
|
||||
#+END_SRC
|
||||
|
||||
We can also start with mouse mode enabled. But I don’t.
|
||||
#+BEGIN_SRC conf-unix
|
||||
#set -g mouse on
|
||||
#+END_SRC
|
||||
|
||||
Whether or not Vi mode should be enabled. But really, we should rather export
|
||||
the =VISUAL= or =EDITOR= environment variables, see the tmux manual. Although
|
||||
I don’t, as said in my dotfish, I prefer to use Emacs.
|
||||
#+BEGIN_SRC conf-unix
|
||||
#set -g status-keys vi
|
||||
#set -g mode-keys vi
|
||||
#+END_SRC
|
||||
|
||||
Replace =C-b= by =C-a= instead of using both prefixes. I personally prefer to
|
||||
just use =C-b=, hence why the lines are commented.
|
||||
#+BEGIN_SRC conf-unix
|
||||
# set -gu prefix2
|
||||
# unbind C-a
|
||||
# unbind C-b
|
||||
# set -g prefix C-a
|
||||
# bind C-a send-prefix
|
||||
#+END_SRC
|
||||
|
||||
Move the status line to the top.
|
||||
#+BEGIN_SRC conf-unix
|
||||
#set -g status-position top
|
||||
#+END_SRC
|
||||
Reference in New Issue
Block a user