[Org, Emacs] Do not add spaces in front of code in src blocks

By default, org-mode will add two spaces before code lines in the org
file itself. This does not change how code is edited when editing a
code block through `org-edit-special' but when copy/pasting code or
editing it directly from the org file, it can be troublesome.
Setting `org-src-preserve-indentation' to `t' prevents org from adding
these two spaces.
This commit is contained in:
Lucien Cartier-Tilet 2021-10-12 11:31:20 +02:00
parent c12164d9bb
commit d4f11b612d
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
12 changed files with 5594 additions and 5554 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -47,9 +47,9 @@ partition is 16GB large.
:END: :END:
When you boot into the live ISO, execute the following command: When you boot into the live ISO, execute the following command:
#+BEGIN_SRC sh #+BEGIN_SRC sh
pacman -Sy reflector pacman -Sy reflector
reflector -c FR -c DE -c BE -l 200 -p http -p https --sort rate \ reflector -c FR -c DE -c BE -l 200 -p http -p https --sort rate \
--save /etc/pacman.d/mirrorlist --verbose --save /etc/pacman.d/mirrorlist --verbose
#+END_SRC #+END_SRC
This will update the packages from your live ISO, and you will get the best This will update the packages from your live ISO, and you will get the best
@ -67,14 +67,14 @@ how the distro works, I just want to be able to install my distro quickly now.
Ill need to download the script with ~wget~, but apparently it isnt installed Ill need to download the script with ~wget~, but apparently it isnt installed
by default on Arch ISOs anymore, so Ill need to install it. by default on Arch ISOs anymore, so Ill need to install it.
#+BEGIN_SRC sh #+BEGIN_SRC sh
pacman -S wget pacman -S wget
#+END_SRC #+END_SRC
Now, lets grab the script. You can check it on [[https://github.com/matmoul/archfi][Github]]. Now, lets grab the script. You can check it on [[https://github.com/matmoul/archfi][Github]].
#+BEGIN_SRC sh #+BEGIN_SRC sh
wget archfi.sf.net/archfi wget archfi.sf.net/archfi
# Or from matmoul.github.io/archfi if SourceForge is down # Or from matmoul.github.io/archfi if SourceForge is down
sh archfi sh archfi
#+END_SRC #+END_SRC
Then, follow the instructions and install Arch Linux. Take the opportunity to Then, follow the instructions and install Arch Linux. Take the opportunity to
@ -90,28 +90,32 @@ your computer.
:HEADER-ARGS:fish: :tangle ~/.config/yadm/bootstrap :shebang "#!/usr/bin/fish" :exports code :mkdirp yes :HEADER-ARGS:fish: :tangle ~/.config/yadm/bootstrap :shebang "#!/usr/bin/fish" :exports code :mkdirp yes
:CUSTOM_ID: Execute_bootstrap-e37054ef :CUSTOM_ID: Execute_bootstrap-e37054ef
:END: :END:
The first thing I will do is add the [[https://github.com/archlinuxcn/repo][ArchLinuxCN]] repository so I can get access The first thing I will do is add the [[https://aur.chaotic.cx/][Chaotic AUR]] repository so I can
to ~paru~. get access to ~paru~ as well as some AUR packages without the need of an
AUR helper (ironic considering ~paru~ is one)..
#+BEGIN_SRC sh #+BEGIN_SRC sh
printf '[archlinuxcn]\nServer = https://repo.archlinuxcn.org/$arch\n' | sudo tee -a /etc/pacman.conf sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
sudo pacman-key --lsign-key 3056513887B78AEB
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
printf '[chaotic-aur]\nServer = /etc/pacman.d/chaotic-mirrorlist\n' | sudo tee -a /etc/pacman.conf
#+END_SRC #+END_SRC
I can now install ~fish~, ~git~, and ~paru~: I can now install ~fish~, ~git~, and ~paru~:
#+BEGIN_SRC sh #+BEGIN_SRC sh
sudo pacman -S fish git paru sudo pacman -S fish git paru
#+END_SRC #+END_SRC
And now that ~paru~ is available, we can install ~yadm~: And now that ~paru~ is available, we can install ~yadm~:
#+BEGIN_SRC sh #+BEGIN_SRC sh
paru -S yadm paru -S yadm
#+END_SRC #+END_SRC
~yadm~ comes with a very handy feature: its bootstrap script. It can be executed ~yadm~ comes with a very handy feature: its bootstrap script. It can be executed
automatically once the dotfiles are cloned with yadm: automatically once the dotfiles are cloned with yadm:
#+BEGIN_SRC sh #+BEGIN_SRC sh
yadm clone https://labs.phundrak.com/phundrak/dotfiles yadm clone https://labs.phundrak.com/phundrak/dotfiles
# or if labs.phundrak.com is down or too slow for you # or if labs.phundrak.com is down or too slow for you
#yadm clone https://github.com/phundrak/dotfiles #yadm clone https://github.com/phundrak/dotfiles
#+END_SRC #+END_SRC
Lets take a look at what it does. Lets take a look at what it does.
@ -123,11 +127,11 @@ Lets take a look at what it does.
Some private files are stored encrypted in the repository of my yadm dotfiles. I Some private files are stored encrypted in the repository of my yadm dotfiles. I
will need them later on during the bootstrap execution. will need them later on during the bootstrap execution.
#+BEGIN_SRC fish #+BEGIN_SRC fish
if test "$USER" = 'phundrak' if test "$USER" = 'phundrak'
yadm decrypt yadm decrypt
else else
whiptail --yesno "Decrypt private files?" 8 40 && yadm decrypt whiptail --yesno "Decrypt private files?" 8 40 && yadm decrypt
end end
#+END_SRC #+END_SRC
** Get a correct keyboard layout ** Get a correct keyboard layout
@ -140,24 +144,24 @@ 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 layout between these three. This makes it so my xorg configuration of my
keyboard looks like this: keyboard looks like this:
#+BEGIN_SRC fish #+BEGIN_SRC fish
set keyboardconf \ set keyboardconf \
'Section "InputClass" 'Section "InputClass"
Identifier "system-keyboard" Identifier "system-keyboard"
MatchIsKeyboard "on" MatchIsKeyboard "on"
Option "XkbLayout" "fr" Option "XkbLayout" "fr"
Option "XkbModel" "pc104" Option "XkbModel" "pc104"
Option "XkbVariant" "bepo_afnor" Option "XkbVariant" "bepo_afnor"
Option "XkbOptions" "caps:ctrl_modifier" Option "XkbOptions" "caps:ctrl_modifier"
EndSection' EndSection'
#+END_SRC #+END_SRC
So, lets ask the user if they want to set it as their keyboard configuration. So, lets ask the user if they want to set it as their keyboard configuration.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Set keyboard layout #########################################################\n\n" printf "\n# Set keyboard layout #########################################################\n\n"
whiptail --yesno "Would you like to set your keyboard layout to the bépo layout?" 8 55 whiptail --yesno "Would you like to set your keyboard layout to the bépo layout?" 8 55
if test $status -eq 0 if test $status -eq 0
echo $keyboardconf | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf echo $keyboardconf | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf
end end
#+END_SRC #+END_SRC
** Set our locale ** Set our locale
@ -167,12 +171,12 @@ So, lets ask the user if they want to set it as their keyboard configuration.
I use two main locales, the French and US UTF-8 locales, and I like to keep the I use two main locales, the French and US UTF-8 locales, and I like to keep the
Japanese locale activated just in case. Japanese locale activated just in case.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8" set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"
#+END_SRC #+END_SRC
Ill let the user accept them one by one. Ill let the user accept them one by one.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Set locale ##################################################################\n\n" printf "\n# Set locale ##################################################################\n\n"
for item in $mylocales for item in $mylocales
whiptail --yesno "Set the \"$item\" locale?" 8 40 whiptail --yesno "Set the \"$item\" locale?" 8 40
@ -184,29 +188,29 @@ Ill let the user accept them one by one.
This is my configuration I usually use when it comes to my locale. This is my configuration I usually use when it comes to my locale.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set localeconf "LANG=en_DK.UTF-8 set localeconf "LANG=en_DK.UTF-8
LC_COLLATE=C LC_COLLATE=C
LC_NAME=fr_FR.UTF-8 LC_NAME=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8 LC_IDENTIFICATION=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8 LC_TELEPHONE=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8 LC_PAPER=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8 LC_ADDRESS=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8" LC_MEASUREMENT=fr_FR.UTF-8"
#+END_SRC #+END_SRC
Lets set it as our systems locale if the user whishes to. Lets set it as our systems locale if the user whishes to.
#+BEGIN_SRC fish #+BEGIN_SRC fish
whiptail --yesno "Do you agree to have the following locale set?\n\n $localeconf" 20 43 whiptail --yesno "Do you agree to have the following locale set?\n\n $localeconf" 20 43
if test $status -eq 0 if test $status -eq 0
echo $localeconf | sudo tee /etc/locale.conf echo $localeconf | sudo tee /etc/locale.conf
end end
#+END_SRC #+END_SRC
Now we can generate our locale! Now we can generate our locale!
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Generate locale #############################################################\n\n" printf "\n# Generate locale #############################################################\n\n"
sudo locale-gen sudo locale-gen
#+END_SRC #+END_SRC
** Create some folders ** Create some folders
@ -216,9 +220,9 @@ Now we can generate our locale!
Lets create some folders we might need for mounting our drives, Android devices Lets create some folders we might need for mounting our drives, Android devices
and CDs. and CDs.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Create directories for mounting #############################################\n\n" printf "\n# Create directories for mounting #############################################\n\n"
sudo mkdir -p /mnt/{USB,CD,Android} sudo mkdir -p /mnt/{USB,CD,Android}
sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android} sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}
#+END_SRC #+END_SRC
** Set users shell to fish ** Set users shell to fish
@ -227,11 +231,11 @@ and CDs.
:END: :END:
First of all, the bootstrap shell will set the users shell to fish. First of all, the bootstrap shell will set the users shell to fish.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Set fish as the default shell ###############################################\n\n" printf "\n# Set fish as the default shell ###############################################\n\n"
whiptail --yesno "Set the current users default shell to fish?" 8 50 whiptail --yesno "Set the current users default shell to fish?" 8 50
if test $status -eq 0 -a ! "$SHELL" = '/usr/bin/fish' if test $status -eq 0 -a ! "$SHELL" = '/usr/bin/fish'
chsh -s /usr/bin/fish chsh -s /usr/bin/fish
end end
#+END_SRC #+END_SRC
** Install basic packages ** Install basic packages
@ -240,49 +244,49 @@ First of all, the bootstrap shell will set the users shell to fish.
:END: :END:
Lets set in a custom varible what packages well be needing. Lets set in a custom varible what packages well be needing.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set PACKAGES \ set PACKAGES \
acpi acpilight adobe-source-han-sans-jp-fonts arc-gtk-theme asar ascii \ acpi acpilight adobe-source-han-sans-jp-fonts arc-gtk-theme asar ascii \
aspell-en aspell-fr awesome awesome-terminal-fonts awesome-freedesktop-git \ aspell-en aspell-fr awesome awesome-terminal-fonts awesome-freedesktop-git \
base-devel bashtop bat biber bitwarden-bin bluez-firmware bluez-utils bzip2 \ base-devel bashtop bat biber bitwarden-bin bluez-firmware bluez-utils bzip2 \
chicken chromium clisp corrupter-git cppcheck cppreference \ chicken chromium clisp corrupter-git cppcheck cppreference \
cppreference-devhelp cpupower discord-canary discount docker docker-compose \ cppreference-devhelp cpupower discord-canary discount docker docker-compose \
dockerfile-language-server-bin doxygen emacs emacs-org-mode exa exfat-utils \ dockerfile-language-server-bin doxygen emacs emacs-org-mode exa exfat-utils \
farbfeld fd ffmpegthumbnailer findutils firefox flake8 flat-remix-gtk freeglut \ farbfeld fd ffmpegthumbnailer findutils firefox flake8 flat-remix-gtk freeglut \
fzf gcc-libs gdb gimp gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts \ fzf gcc-libs gdb gimp gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts \
gnuplot go go-tools golangci-lint-bin graphviz htop hugo i3lock-color \ gnuplot go go-tools golangci-lint-bin graphviz htop hugo i3lock-color \
inetutils isync inter-font javascript-typescript-langserver js-beautify \ inetutils isync inter-font javascript-typescript-langserver js-beautify \
jfsutils jmtpfs kitty lain-git libxft-bgra linux-headers lldb logrotate meson \ jfsutils jmtpfs kitty lain-git libxft-bgra linux-headers lldb logrotate meson \
minted man-db man-pages mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools \ minted man-db man-pages mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools \
nano ncdu ncmpcpp nemo-fileroller nemo-preview neofetch netctl \ nano ncdu ncmpcpp nemo-fileroller nemo-preview neofetch netctl \
network-manager-applet networkmanager networkmanager-openvpn \ network-manager-applet networkmanager networkmanager-openvpn \
nm-connection-editor nodejs-vmd nomacs nordic-theme-git nordvpn-bin \ nm-connection-editor nodejs-vmd nomacs nordic-theme-git nordvpn-bin \
noto-fonts-emoji npm ntfs-3g numlockx obs-studio openssh otf-fandol \ noto-fonts-emoji npm ntfs-3g numlockx obs-studio openssh otf-fandol \
otf-ipafont p7zip pacman-contrib pandoc-bin pass pavucontrol pdfpc picom-git \ otf-ipafont p7zip pacman-contrib pandoc-bin pass pavucontrol pdfpc picom-git \
powerline-fonts prettier pulseaudio-bluetooth python-autoflake python-epc \ powerline-fonts prettier pulseaudio-bluetooth python-autoflake python-epc \
python-importmagic python-language-server python-nose python-pip python-poetry \ python-importmagic python-language-server python-nose python-pip python-poetry \
python-ptvsd python-pytest qt5-imageformats qemu r raw-thumbnailer reflector \ python-ptvsd python-pytest qt5-imageformats qemu r raw-thumbnailer reflector \
ripgrep rofi rsync rtv ruby-rb-fsevent ruby-sass rustup samba scrot sent \ ripgrep rofi rsync rtv ruby-rb-fsevent ruby-sass rustup samba scrot sent \
shadow siji-git simplescreenrecorder sshfs sxiv texlive-bibtexextra \ shadow siji-git simplescreenrecorder sshfs sxiv texlive-bibtexextra \
texlive-fontsextra texlive-formatsextra texlive-humanities \ texlive-fontsextra texlive-formatsextra texlive-humanities \
texlive-langjapanese texlive-pictures texlive-pstricks texlive-publishers \ texlive-langjapanese texlive-pictures texlive-pstricks texlive-publishers \
texlive-science tldr tmux tree ttf-arphic-uming ttf-baekmuk ttf-charis-sil \ texlive-science tldr tmux tree ttf-arphic-uming ttf-baekmuk ttf-charis-sil \
ttf-dejavu ttf-google-fonts-opinionated-git ttf-hanazono ttf-joypixels \ ttf-dejavu ttf-google-fonts-opinionated-git ttf-hanazono ttf-joypixels \
ttf-koruri ttf-liberation ttf-monapo ttf-sazanami ttf-tibetan-machine \ ttf-koruri ttf-liberation ttf-monapo ttf-sazanami ttf-tibetan-machine \
typescript typescript-language-server-bin unicode-emoji unrar usbutils \ typescript typescript-language-server-bin unicode-emoji unrar usbutils \
valgrind vscode-css-languageserver-bin vscode-html-languageserver-bin w3m wget \ valgrind vscode-css-languageserver-bin vscode-html-languageserver-bin w3m wget \
x11-ssh-askpass xclip xdg-user-dirs-gtk xfce-polkit xidlehook xfsprogs \ x11-ssh-askpass xclip xdg-user-dirs-gtk xfce-polkit xidlehook xfsprogs \
xorg-drivers xorg-server xorg-xinit xss-lock xvkbd xwallpaper \ xorg-drivers xorg-server xorg-xinit xss-lock xvkbd xwallpaper \
yaml-language-server-bin zeal yaml-language-server-bin zeal
#+END_SRC #+END_SRC
These are the minimum I would have in my own installation. You can edit it These are the minimum I would have in my own installation. You can edit it
however you want. Lets install those. however you want. Lets install those.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Installing needed packages ##################################################\n\n" printf "\n# Installing needed packages ##################################################\n\n"
sudo pacman -Syu sudo pacman -Syu
for pkg in $PACKAGES for pkg in $PACKAGES
paru -S --needed $pkg paru -S --needed $pkg
end end
#+END_SRC #+END_SRC
** Tangle configuration files from Org files ** Tangle configuration files from Org files
@ -308,9 +312,9 @@ need to create:
#+NAME: gen-dirs-tangle #+NAME: gen-dirs-tangle
#+BEGIN_SRC emacs-lisp :var dirs=dirs-tangled-files #+BEGIN_SRC emacs-lisp :var dirs=dirs-tangled-files
(mapconcat (lambda (x) (format "mkdir -p %s" (car x))) (mapconcat (lambda (x) (format "mkdir -p %s" (car x)))
dirs dirs
"\n") "\n")
#+END_SRC #+END_SRC
#+RESULTS[a95e25a5f3ac91b1f884b39dde38e3b51366b188]: gen-dirs-tangle #+RESULTS[a95e25a5f3ac91b1f884b39dde38e3b51366b188]: gen-dirs-tangle
@ -331,7 +335,7 @@ mkdir -p $HOME/org/capture
Our code to generate such directories looks like this: Our code to generate such directories looks like this:
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
<<gen-dirs-tangle()>> <<gen-dirs-tangle()>>
#+END_SRC #+END_SRC
The next step is to tangle all the Org files. Here is the list of files that are The next step is to tangle all the Org files. Here is the list of files that are
@ -350,13 +354,13 @@ to be tangled:
#+NAME: generate-tangle #+NAME: generate-tangle
#+BEGIN_SRC emacs-lisp :var files=tangled-files[,0] #+BEGIN_SRC emacs-lisp :var files=tangled-files[,0]
(mapconcat (lambda (x) (concat (mapconcat (lambda (x) (concat
(format "printf '\\n\\n==== Tangling %s\\n\\n' && \\\n" x) (format "printf '\\n\\n==== Tangling %s\\n\\n' && \\\n" x)
(concat "emacs -q --batch --eval '(require \\'ob-tangle)' \\\n" (concat "emacs -q --batch --eval '(require \\'ob-tangle)' \\\n"
"--eval '(setq org-confirm-babel-evaluate nil)' \\\n" "--eval '(setq org-confirm-babel-evaluate nil)' \\\n"
(format "--eval '(org-babel-tangle-file \"~/org/config/%s\")'\n" x)))) (format "--eval '(org-babel-tangle-file \"~/org/config/%s\")'\n" x))))
files files
"\n") "\n")
#+END_SRC #+END_SRC
#+RESULTS[87a25d6c524e8d1346452c54aa42ac3ac09d94cf]: generate-tangle #+RESULTS[87a25d6c524e8d1346452c54aa42ac3ac09d94cf]: generate-tangle
@ -403,8 +407,8 @@ emacs -q --batch --eval '(require \'ob-tangle)' \
#+end_example #+end_example
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
printf "\n# Tangling org files ##########################################################\n\n" printf "\n# Tangling org files ##########################################################\n\n"
<<generate-tangle()>> <<generate-tangle()>>
#+END_SRC #+END_SRC
** Setting up Emacs: Installing Spacemacs ** Setting up Emacs: Installing Spacemacs
@ -418,19 +422,19 @@ cloned within our =~/.config/emacs= directory, and git wont let us clone
Spacemacs in an already existing and non-empty directory. To make sure it isnt Spacemacs in an already existing and non-empty directory. To make sure it isnt
one, lets delete any potentially existing =~/.config/emacs= directory: one, lets delete any potentially existing =~/.config/emacs= directory:
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Installing Spacemacs ########################################################\n\n" printf "\n# Installing Spacemacs ########################################################\n\n"
rm -rf $HOME/.config/emacs $HOME/.emacs* .spacemacs rm -rf $HOME/.config/emacs $HOME/.emacs* .spacemacs
#+END_SRC #+END_SRC
Now we can clone Spacemacs: Now we can clone Spacemacs:
#+BEGIN_SRC fish #+BEGIN_SRC fish
git clone --branch develop https://github.com/syl20bnr/spacemacs ~/.config/emacs git clone --branch develop https://github.com/syl20bnr/spacemacs ~/.config/emacs
#+END_SRC #+END_SRC
And we can restore what might have been deleted in our =~/.emacs.d/private= And we can restore what might have been deleted in our =~/.emacs.d/private=
directory: directory:
#+BEGIN_SRC fish #+BEGIN_SRC fish
yadm checkout -- ~/.config/emacs/private/ yadm checkout -- ~/.config/emacs/private/
#+END_SRC #+END_SRC
** Set up dotfiles git repository ** Set up dotfiles git repository
@ -444,26 +448,26 @@ directory:
This line in the bootstrap script will test if the current user is using my This line in the bootstrap script will test if the current user is using my
username. If yes, its probably me. username. If yes, its probably me.
#+BEGIN_SRC fish #+BEGIN_SRC fish
if test "$USER" = 'phundrak' if test "$USER" = 'phundrak'
#+END_SRC #+END_SRC
If it is me installing and using these dotfiles, I want the remotes of my 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. dotfiles to be set to ssh remotes using my ssh keys.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Update yadms remotes #######################################################\n\n" printf "\n# Update yadms remotes #######################################################\n\n"
yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git
yadm remote add github git@github.com:phundrak/dotfiles.git yadm remote add github git@github.com:phundrak/dotfiles.git
#+END_SRC #+END_SRC
I will also want to decrypt my encrypted files, such as said ssh keys. I will also want to decrypt my encrypted files, such as said ssh keys.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Decrypt encrypted dotfiles ##################################################\n\n" printf "\n# Decrypt encrypted dotfiles ##################################################\n\n"
yadm decrypt yadm decrypt
#+END_SRC #+END_SRC
Finally, lets close this ~if~ statement. Finally, lets close this ~if~ statement.
#+BEGIN_SRC fish #+BEGIN_SRC fish
end end
#+END_SRC #+END_SRC
*** Update our submodules *** Update our submodules
@ -473,8 +477,8 @@ Finally, lets close this ~if~ statement.
Now we can download the various dependencies of our dotfiles. To do so, lets Now we can download the various dependencies of our dotfiles. To do so, lets
run the following command: run the following command:
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Getting yadm susbmodules ####################################################\n\n" printf "\n# Getting yadm susbmodules ####################################################\n\n"
yadm submodule update --init --recursive yadm submodule update --init --recursive
#+END_SRC #+END_SRC
** Enable some services ** Enable some services
@ -491,14 +495,14 @@ them.
This service enables time syncing with the NTP protocol, so I can be sure my This service enables time syncing with the NTP protocol, so I can be sure my
computers time is correct. The service first needs to be enabled: computers time is correct. The service first needs to be enabled:
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Enabling timesync ###########################################################\n\n" printf "\n# Enabling timesync ###########################################################\n\n"
sudo systemctl enable --now systemd-timesyncd sudo systemctl enable --now systemd-timesyncd
#+END_SRC #+END_SRC
Now, let systemd know I want to use the NTP protocol to keep my computers time Now, let systemd know I want to use the NTP protocol to keep my computers time
synced. synced.
#+BEGIN_SRC fish #+BEGIN_SRC fish
sudo timedatectl set-ntp true sudo timedatectl set-ntp true
#+END_SRC #+END_SRC
*** Docker *** Docker
@ -507,17 +511,17 @@ synced.
:END: :END:
First, lets activate Docker on startup. First, lets activate Docker on startup.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Enabling and starting Docker ################################################\n\n" printf "\n# Enabling and starting Docker ################################################\n\n"
sudo systemctl enable --now docker sudo systemctl enable --now docker
#+END_SRC #+END_SRC
Now, if we wish it, we can be added to the =docker= group so we wont have to Now, if we wish it, we can be added to the =docker= group so we wont have to
type =sudo= each time we call Docker or Docker Compose. type =sudo= each time we call Docker or Docker Compose.
#+BEGIN_SRC fish #+BEGIN_SRC fish
read --prompt "echo 'Do you wish to be added to the `docker` group? (Y/n): ' " -l adddockergroup 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 = '' if test $adddockergroup = 'y' || test $adddockergroup = "Y" || test $adddockergroup = ''
sudo usermod -aG docker $USER sudo usermod -aG docker $USER
end end
#+END_SRC #+END_SRC
*** Emacs *** Emacs
@ -529,8 +533,8 @@ in. However, the service wont be started immediately, I personally prefer to
start a standalone instance in which installing and compiling the Emacs packages start a standalone instance in which installing and compiling the Emacs packages
will happen, and then once that is done I will start the service. will happen, and then once that is done I will start the service.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Enabling Emacs as user service ##############################################\n\n" printf "\n# Enabling Emacs as user service ##############################################\n\n"
systemctl --user enable emacs systemctl --user enable emacs
#+END_SRC #+END_SRC
*** Mpd *** Mpd
@ -540,9 +544,9 @@ will happen, and then once that is done I will start the service.
Mpd will also use as a user service in order to get rid of some lines of code in Mpd will also use as a user service in order to get rid of some lines of code in
my configuration. my configuration.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Enabling Mpd as a user service ##############################################\n\n" printf "\n# Enabling Mpd as a user service ##############################################\n\n"
mkdir -p ~/.config/mpd/playlists mkdir -p ~/.config/mpd/playlists
systemctl --user enable --now mpd systemctl --user enable --now mpd
#+END_SRC #+END_SRC
*** SSH server *** SSH server
@ -552,11 +556,11 @@ my configuration.
Maybe we want to activate an SSH server on our machine. If so, we can enable it. Maybe we want to activate an SSH server on our machine. If so, we can enable it.
Lets ask the question. Lets ask the question.
#+BEGIN_SRC fish #+BEGIN_SRC fish
whiptail --yesno 'Do you want to activate the ssh server?' 8 50 whiptail --yesno 'Do you want to activate the ssh server?' 8 50
if test $status -eq 0 if test $status -eq 0
printf "\n# Enabling ssh server #########################################################\n\n" printf "\n# Enabling ssh server #########################################################\n\n"
sudo systemctl enable --now sshd sudo systemctl enable --now sshd
end end
#+END_SRC #+END_SRC
*** Acpilight *** Acpilight
@ -568,7 +572,7 @@ 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 ~video~ group so we can modify the brightness of our screen without using
~sudo~. ~sudo~.
#+BEGIN_SRC fish #+BEGIN_SRC fish
sudo usermod -aG video $USER sudo usermod -aG video $USER
#+END_SRC #+END_SRC
*** NordVPN *** NordVPN
@ -579,7 +583,7 @@ Thanks to the AUR package ~nordvpn-bin~, I no longer have to manually maintain
my VPN connections with OpenVPN. However, it requires a service that we should my VPN connections with OpenVPN. However, it requires a service that we should
activate: activate:
#+BEGIN_SRC fish #+BEGIN_SRC fish
sudo systemctl enable --now nordvpnd sudo systemctl enable --now nordvpnd
#+END_SRC #+END_SRC
Lets also set its default protocol to UDP. This will allow me to use any port Lets also set its default protocol to UDP. This will allow me to use any port
@ -587,7 +591,7 @@ while connected to any WiFi as long as the 443 port is available. Because yes, I
do connect to a WiFi that blocks some important ports, such as the IMAP and SMTP do connect to a WiFi that blocks some important ports, such as the IMAP and SMTP
ports. Thanks University of Paris 8 for being SO paranoid. ports. Thanks University of Paris 8 for being SO paranoid.
#+BEGIN_SRC fish #+BEGIN_SRC fish
nordvpn s protocol tcp nordvpn s protocol tcp
#+END_SRC #+END_SRC
** Symlink some system config files ** Symlink some system config files
@ -596,16 +600,16 @@ ports. Thanks University of Paris 8 for being SO paranoid.
:END: :END:
We have some files in [[file:ect/][etc/]] that are to be symlinked to =/etc=. We have some files in [[file:ect/][etc/]] that are to be symlinked to =/etc=.
#+BEGIN_SRC fish #+BEGIN_SRC fish
for f in (find ~/.etc -type f) for f in (find ~/.etc -type f)
set dest (echo $f | sed -n 's|^.*etc\(.*\)$|/etc\1|p') set dest (echo $f | sed -n 's|^.*etc\(.*\)$|/etc\1|p')
sudo ln -s $f $dest sudo ln -s $f $dest
end end
#+END_SRC #+END_SRC
Lets also symlink the ~plock~ script ([[file:bin.org::#Lock-635fcb38][source here]]) to ~/usr/bin~ so ~xss-lock~ Lets also symlink the ~plock~ script ([[file:bin.org::#Lock-635fcb38][source here]]) to ~/usr/bin~ so ~xss-lock~
can find it. can find it.
#+BEGIN_SRC fish #+BEGIN_SRC fish
sudo ln -s (which plock) /usr/bin/plock sudo ln -s (which plock) /usr/bin/plock
#+END_SRC #+END_SRC
** Install packages from git ** Install packages from git
@ -614,7 +618,7 @@ can find it.
:END: :END:
Now, lets install some packages from git directly. Now, lets install some packages from git directly.
#+BEGIN_SRC fish #+BEGIN_SRC fish
mkdir -p ~/fromGIT mkdir -p ~/fromGIT
#+END_SRC #+END_SRC
*** Reveal.JS *** Reveal.JS
@ -624,9 +628,9 @@ Now, lets install some packages from git directly.
I sometimes use Reveal.JS to make presentations, and I set its location in my I sometimes use Reveal.JS to make presentations, and I set its location in my
[[file:.spacemacs][dotspacemacs]] file to be in =~/fromGIT=, so lets clone it there. [[file:.spacemacs][dotspacemacs]] file to be in =~/fromGIT=, so lets clone it there.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Install Reveal.JS ###########################################################\n\n" printf "\n# Install Reveal.JS ###########################################################\n\n"
cd ~/fromGIT cd ~/fromGIT
git clone https://github.com/hakimel/reveal.js.git git clone https://github.com/hakimel/reveal.js.git
#+END_SRC #+END_SRC
** Install Rust ** Install Rust
@ -641,14 +645,14 @@ When using Rust, I bounce between two toolchains, the ~stable~ toolchain and the
~nightly~ toolchain, although I try to stick with Rust Stable. To install them, ~nightly~ toolchain, although I try to stick with Rust Stable. To install them,
I will use ~rustup~ which has already been installed previously. I will use ~rustup~ which has already been installed previously.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n" printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n"
rustup default stable rustup default stable
#+END_SRC #+END_SRC
This will both download the stable toolchain and set it as the default one. Now This will both download the stable toolchain and set it as the default one. Now
to install the nightly toolchain, lets run this: to install the nightly toolchain, lets run this:
#+BEGIN_SRC fish #+BEGIN_SRC fish
rustup toolchain install nightly rustup toolchain install nightly
#+END_SRC #+END_SRC
*** Install some utilities *** Install some utilities
@ -658,8 +662,8 @@ to install the nightly toolchain, lets run this:
Well need some utilities when developing Rust from Emacs, namely ~rustfmt~ and Well need some utilities when developing Rust from Emacs, namely ~rustfmt~ and
~racer~. Lets install them with ~cargo~. ~racer~. Lets install them with ~cargo~.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Add rust utilities ##########################################################\n\n" printf "\n# Add rust utilities ##########################################################\n\n"
cargo install rustfmt racer cargo install rustfmt racer
#+END_SRC #+END_SRC
We will also need some components for development purposes. We will also need some components for development purposes.
@ -672,9 +676,9 @@ We will also need some components for development purposes.
#+NAME: rust-components-gen #+NAME: rust-components-gen
#+BEGIN_SRC emacs-lisp :var components=rust-components-table[,0] #+BEGIN_SRC emacs-lisp :var components=rust-components-table[,0]
(mapconcat (lambda (x) (format "rustup component add %s" x)) (mapconcat (lambda (x) (format "rustup component add %s" x))
components components
"\n") "\n")
#+END_SRC #+END_SRC
#+RESULTS[b3935b1c09d86fe506b43670f52960306a1e9809]: #+RESULTS[b3935b1c09d86fe506b43670f52960306a1e9809]:
@ -684,7 +688,7 @@ We will also need some components for development purposes.
Here is the code to do so: Here is the code to do so:
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
<<rust-components-gen()>> <<rust-components-gen()>>
#+END_SRC #+END_SRC
** Install some python packages ** Install some python packages
@ -703,8 +707,8 @@ working.
#+NAME: python-packages-gen #+NAME: python-packages-gen
#+BEGIN_SRC emacs-lisp :var packages=python-packages-table[,0] #+BEGIN_SRC emacs-lisp :var packages=python-packages-table[,0]
(format "pip install --user %s" (format "pip install --user %s"
(string-join packages " ")) (string-join packages " "))
#+END_SRC #+END_SRC
#+RESULTS[29652be1076ffac01e34189067efa8fe9abda9d9]: python-packages-gen #+RESULTS[29652be1076ffac01e34189067efa8fe9abda9d9]: python-packages-gen
@ -712,8 +716,8 @@ working.
Lets install them locally for our user. Lets install them locally for our user.
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
printf "\n# Installing Python packages ##################################################\n\n" printf "\n# Installing Python packages ##################################################\n\n"
<<python-packages-gen()>> <<python-packages-gen()>>
#+END_SRC #+END_SRC
** Set up Chicken (Scheme interpreter/compiler) ** Set up Chicken (Scheme interpreter/compiler)
@ -723,14 +727,14 @@ Lets install them locally for our user.
Chicken needs to be set up before being used. First, we need to install its Chicken needs to be set up before being used. First, we need to install its
documentation. documentation.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Setting up Chicken ##########################################################\n\n" printf "\n# Setting up Chicken ##########################################################\n\n"
chicken-install -s apropos chicken-doc chicken-install -s apropos chicken-doc
#+END_SRC #+END_SRC
Then, well complete the documentation like so: Then, well complete the documentation like so:
#+BEGIN_SRC fish #+BEGIN_SRC fish
cd (chicken-csi -b -e "(import (chicken platform))" -p "(chicken-home)") 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 curl https://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
#+END_SRC #+END_SRC
** Set up our fish shell ** Set up our fish shell
@ -746,8 +750,8 @@ order to improve the user experience.
:END: :END:
We will be using ~fisher~ as our extensions manager for Fish. Lets install it. We will be using ~fisher~ as our extensions manager for Fish. Lets install it.
#+BEGIN_SRC fish #+BEGIN_SRC fish
printf "\n# Installing fisher ###########################################################\n\n" printf "\n# Installing fisher ###########################################################\n\n"
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
#+END_SRC #+END_SRC
*** Install our extensions *** Install our extensions
@ -770,9 +774,9 @@ I generally use the following extensions in my Fish shell.
#+NAME: fish-extensions-gen #+NAME: fish-extensions-gen
#+BEGIN_SRC emacs-lisp :var extensions=fish-extensions-table[,0] #+BEGIN_SRC emacs-lisp :var extensions=fish-extensions-table[,0]
(mapconcat (lambda (x) (format "fisher add %s" x)) (mapconcat (lambda (x) (format "fisher add %s" x))
extensions extensions
"\n") "\n")
#+END_SRC #+END_SRC
#+RESULTS[a88b321ba9148acc8c28c7fb1aaf924c23b6b072]: fish-extensions-gen #+RESULTS[a88b321ba9148acc8c28c7fb1aaf924c23b6b072]: fish-extensions-gen
@ -786,6 +790,6 @@ I generally use the following extensions in my Fish shell.
: fisher add oh-my-fish/theme-bobthefish : fisher add oh-my-fish/theme-bobthefish
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
printf "\n# Installing Fisher Extensions ################################################\n\n" printf "\n# Installing Fisher Extensions ################################################\n\n"
<<fish-extensions-gen()>> <<fish-extensions-gen()>>
#+END_SRC #+END_SRC

File diff suppressed because it is too large Load Diff

View File

@ -18,9 +18,9 @@ abbreviations.
Just in case, we might need sometimes to declare the fish function =fish_title= Just in case, we might need sometimes to declare the fish function =fish_title=
as =true=, so lets do so. as =true=, so lets do so.
#+BEGIN_SRC fish #+BEGIN_SRC fish
function fish_title function fish_title
true true
end end
#+END_SRC #+END_SRC
* Fish from within Emacs * Fish from within Emacs
@ -30,9 +30,9 @@ as =true=, so lets do so.
I sometimes call fish from within emacs, with =M-x ansi-term=. In this case, the 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=. variable =TERM= needs to have the value =eterm-color=.
#+BEGIN_SRC fish #+BEGIN_SRC fish
if test -n "$EMACS" if test -n "$EMACS"
set -x TERM eterm-color set -x TERM eterm-color
end end
#+END_SRC #+END_SRC
* Tramp remote access * Tramp remote access
@ -44,14 +44,14 @@ 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, lets the commands it needs to execute, and nothing else. Due to this, lets
deactivate and redefine some of the functions defining the appearance of fish. deactivate and redefine some of the functions defining the appearance of fish.
#+BEGIN_SRC fish #+BEGIN_SRC fish
if test "$TERM" = "dumb" if test "$TERM" = "dumb"
function fish_prompt function fish_prompt
echo "\$ " echo "\$ "
end end
function fish_right_prompt; end function fish_right_prompt; end
function fish_greeting; end function fish_greeting; end
function fish_title; end function fish_title; end
end end
#+END_SRC #+END_SRC
* Regular fish shell appearance * Regular fish shell appearance
@ -63,88 +63,88 @@ when Im the one using it: the ~fish_greeting~ function. I use it to give me a
overview of my computers status, including its hostname, uptime, disks usage, overview of my computers status, including its hostname, uptime, disks usage,
ram usage, swap usage, and networking. ram usage, swap usage, and networking.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set RED '\033[0;31m' set RED '\033[0;31m'
set GREEN '\033[0;32m' set GREEN '\033[0;32m'
set NC '\033[0m' set NC '\033[0m'
function display_slider # used total function display_slider # used total
set -l slider_length 38 set -l slider_length 38
set -l used $argv[1] set -l used $argv[1]
set -l total $argv[2] set -l total $argv[2]
set -l used_slider (math -s0 "($used * $slider_length) / $total") set -l used_slider (math -s0 "($used * $slider_length) / $total")
set -l unused_slider (math -s0 "$slider_length - $used_slider") set -l unused_slider (math -s0 "$slider_length - $used_slider")
echo -en "[" echo -en "["
echo -en $RED echo -en $RED
echo -en (string repeat -n $used_slider '=') echo -en (string repeat -n $used_slider '=')
echo -en $GREEN echo -en $GREEN
echo -en (string repeat -n $unused_slider '=') echo -en (string repeat -n $unused_slider '=')
echo -en $NC echo -en $NC
echo -en "]" echo -en "]"
end end
function fish_greeting function fish_greeting
set -l ruler_length 79 set -l ruler_length 79
set -l ruler (string repeat -n $ruler_length "=") set -l ruler (string repeat -n $ruler_length "=")
set -l osname (cat /etc/os-release | grep -i pretty_name | sed 's/.*"\(.*\)".*/\1/') set -l osname (cat /etc/os-release | grep -i pretty_name | sed 's/.*"\(.*\)".*/\1/')
set -l uptime (uptime -p | sed 's/up //') set -l uptime (uptime -p | sed 's/up //')
set -l root (df -Ph | grep -E "/\$") set -l root (df -Ph | grep -E "/\$")
set -l root_p (echo $root | awk '{print $5}' | tr -d '%') set -l root_p (echo $root | awk '{print $5}' | tr -d '%')
set -l root_used (echo $root | awk '{print $3}') set -l root_used (echo $root | awk '{print $3}')
set -l root_total (echo $root | awk '{print $2}') set -l root_total (echo $root | awk '{print $2}')
set -l ram (free -tm | grep Mem) set -l ram (free -tm | grep Mem)
set -l ram_total (echo $ram | awk '{print $2}') set -l ram_total (echo $ram | awk '{print $2}')
set -l ram_used (echo $ram | awk '{print $3}') set -l ram_used (echo $ram | awk '{print $3}')
set -l ram_p (math -s0 "$ram_used / $ram_total * 100") set -l ram_p (math -s0 "$ram_used / $ram_total * 100")
set -l swap (free -tm | grep Swap) set -l swap (free -tm | grep Swap)
set -l swap_total (echo $swap | awk '{print $2}') set -l swap_total (echo $swap | awk '{print $2}')
set -l swap_used (echo $swap | awk '{print $3}') set -l swap_used (echo $swap | awk '{print $3}')
set -l swap_p (math -s0 "$swap_used / $swap_total * 100") set -l swap_p (math -s0 "$swap_used / $swap_total * 100")
set -l connections (nmcli c s | grep -E "wifi|ethernet" | grep -v '\-\-') set -l connections (nmcli c s | grep -E "wifi|ethernet" | grep -v '\-\-')
set -l wifi (echo $connections | grep "wifi" | awk '{print $1}') set -l wifi (echo $connections | grep "wifi" | awk '{print $1}')
set -l ethernet (test "$connections" = "*ethernet*" && echo -e $GREEN"UP"$NC || echo -e $RED"DOWN"$NC) set -l ethernet (test "$connections" = "*ethernet*" && echo -e $GREEN"UP"$NC || echo -e $RED"DOWN"$NC)
set -l wifi (test -n wifi && echo -e $GREEN$wifi$NC || echo - $RED"DOWN"$NC) set -l wifi (test -n wifi && echo -e $GREEN$wifi$NC || echo - $RED"DOWN"$NC)
echo $ruler echo $ruler
printf "OS......: %-30sKernel: %s %s\n" $osname (uname -s) (uname -r) printf "OS......: %-30sKernel: %s %s\n" $osname (uname -s) (uname -r)
printf "Hostname: %-30sUptime: %s\n" (hostname) $uptime printf "Hostname: %-30sUptime: %s\n" (hostname) $uptime
printf "Ethernet: %-41sWifi..: %s\n" $ethernet $wifi printf "Ethernet: %-41sWifi..: %s\n" $ethernet $wifi
printf "Disks...: %-6s %s %6s / %6s (%2d%%)\n" "/" (display_slider $root_p 100) $root_used $root_total $root_p printf "Disks...: %-6s %s %6s / %6s (%2d%%)\n" "/" (display_slider $root_p 100) $root_used $root_total $root_p
# loop other mountpoints # loop other mountpoints
for mp in (df -Ph 2> /dev/null | egrep "sd|tank|nvme" | egrep -v "boot|/\$") for mp in (df -Ph 2> /dev/null | egrep "sd|tank|nvme" | egrep -v "boot|/\$")
set -l mp_p (echo $mp | awk '{print $5}' | tr -d '%') set -l mp_p (echo $mp | awk '{print $5}' | tr -d '%')
set -l mp_used (echo $mp | awk '{print $3}') set -l mp_used (echo $mp | awk '{print $3}')
set -l mp_total (echo $mp | awk '{print $2}') set -l mp_total (echo $mp | awk '{print $2}')
set -l mp_name (echo $mp | awk '{print $6}') set -l mp_name (echo $mp | awk '{print $6}')
printf " %-6s %s %6s / %6s (%2d%%)\n" $mp_name (display_slider $mp_p 100) $mp_used $mp_total $mp_p printf " %-6s %s %6s / %6s (%2d%%)\n" $mp_name (display_slider $mp_p 100) $mp_used $mp_total $mp_p
end end
printf "Ram.....: %s %5dM / %5dM (%2d%%)\n" (display_slider $ram_used $ram_total) $ram_used $ram_total $ram_p printf "Ram.....: %s %5dM / %5dM (%2d%%)\n" (display_slider $ram_used $ram_total) $ram_used $ram_total $ram_p
printf "Swap....: %s %5dM / %5dM (%2d%%)\n" (display_slider $swap_used $swap_total) $swap_used $swap_total $swap_p printf "Swap....: %s %5dM / %5dM (%2d%%)\n" (display_slider $swap_used $swap_total) $swap_used $swap_total $swap_p
echo $ruler echo $ruler
end end
#+END_SRC #+END_SRC
The theme I use for fish is [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]], which by default puts a really long The theme I use for fish is [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]], which by default puts a really long
timestamp to the right of the prompt. I want something shorter, so here is the timestamp to the right of the prompt. I want something shorter, so here is the
variable to set, using the format specified in ~date(1)~. variable to set, using the format specified in ~date(1)~.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -g theme_date_format "+%g-%m-%d %H:%M:%S" set -g theme_date_format "+%g-%m-%d %H:%M:%S"
#+END_SRC #+END_SRC
I also wish to have a kinda different newline prompt, so lets set it: I also wish to have a kinda different newline prompt, so lets set it:
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -g theme_newline_prompt 'λ ' set -g theme_newline_prompt 'λ '
#+END_SRC #+END_SRC
Finally, lets set our prompts theme to the Nord theme. Finally, lets set our prompts theme to the Nord theme.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -g theme_color_scheme nord set -g theme_color_scheme nord
#+END_SRC #+END_SRC
* Global variables * Global variables
@ -154,24 +154,24 @@ Finally, lets set our prompts theme to the Nord theme.
In order to keep some other code clean, I set the ~$BROWSER~ variable so I dont In order to keep some other code clean, I set the ~$BROWSER~ variable so I dont
have to call my web browser directly but rather with this variable. have to call my web browser directly but rather with this variable.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -gx BROWSER firefox set -gx BROWSER firefox
#+END_SRC #+END_SRC
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it can Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it can
get the sudo password. So, lets declare it. get the sudo password. So, lets declare it.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -gx SUDO_ASKPASS ~/.local/bin/askpass set -gx SUDO_ASKPASS ~/.local/bin/askpass
#+END_SRC #+END_SRC
In general, I prefer using ~bat~ to ~less~, although the former relies on the In general, I prefer using ~bat~ to ~less~, although the former relies on the
latter, but ~bat~ provides nice wrapping around ~less~, including syntax latter, but ~bat~ provides nice wrapping around ~less~, including syntax
highlighting. Lets set the manpager to bat then: highlighting. Lets set the manpager to bat then:
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
#+END_SRC #+END_SRC
#+begin_src fish #+begin_src fish
set -x XMODIFIERS set -x XMODIFIERS
#+end_src #+end_src
** Development ** Development
@ -182,8 +182,8 @@ Now, lets declare our editor of choice, EmacsClient; not Emacs itself since i
will most often be just quick edits, nothing too heavy, if it is called from the will most often be just quick edits, nothing too heavy, if it is called from the
~EDITOR~ variable (from Git, for example), or from the ~VISUAL~ variable. ~EDITOR~ variable (from Git, for example), or from the ~VISUAL~ variable.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -gx EDITOR emacsclient -c set -gx EDITOR emacsclient -c
set -gx VISUAL emacsclient -c set -gx VISUAL emacsclient -c
#+END_SRC #+END_SRC
We also need to set the path to the Dart SDK. We also need to set the path to the Dart SDK.
@ -198,21 +198,21 @@ set -gx ANDROID_HOME $HOME/Android/Sdk
Still related to Dart and Flutter development, Still related to Dart and Flutter development,
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -gx CHROME_EXECUTABLE /usr/bin/chromium set -gx CHROME_EXECUTABLE /usr/bin/chromium
#+END_SRC #+END_SRC
Next, we have two variables from Deno, the Node.js destroyer. Its base directory Next, we have two variables from Deno, the Node.js destroyer. Its base directory
will be set in my XDG config directory, and its binaries will be located in my will be set in my XDG config directory, and its binaries will be located in my
local binaries directory (see below). local binaries directory (see below).
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -gx DENO_DIR $HOME/.config/deno set -gx DENO_DIR $HOME/.config/deno
set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno
#+END_SRC #+END_SRC
Finally, some development packages require the =PKG_CONFIG_PATH= to be set, so Finally, some development packages require the =PKG_CONFIG_PATH= to be set, so
lets do so. lets do so.
#+BEGIN_SRC fish #+BEGIN_SRC fish
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
#+END_SRC #+END_SRC
** ~$PATH~ ** ~$PATH~
@ -237,8 +237,8 @@ my own executables, and some more.
#+NAME: generate-extra-paths #+NAME: generate-extra-paths
#+BEGIN_SRC emacs-lisp :var paths=extra-paths[,0] :exports none :cache yes #+BEGIN_SRC emacs-lisp :var paths=extra-paths[,0] :exports none :cache yes
(mapconcat #'identity (mapconcat #'identity
paths " \\\n") paths " \\\n")
#+END_SRC #+END_SRC
#+RESULTS[3fd24377f29513d4c7edcd9621d0462665efb403]: generate-extra-paths #+RESULTS[3fd24377f29513d4c7edcd9621d0462665efb403]: generate-extra-paths
@ -251,8 +251,8 @@ my own executables, and some more.
So, lets set our user paths: So, lets set our user paths:
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
set -g fish_user_paths \ set -g fish_user_paths \
<<generate-extra-paths()>> <<generate-extra-paths()>>
#+END_SRC #+END_SRC
* Abbreviations * Abbreviations
@ -261,12 +261,12 @@ So, lets set our user paths:
:END: :END:
#+NAME: generate-abbr #+NAME: generate-abbr
#+BEGIN_SRC emacs-lisp :var table=[] :exports none :tangle no #+BEGIN_SRC emacs-lisp :var table=[] :exports none :tangle no
(replace-regexp-in-string "\\\\vert[{}]*" (replace-regexp-in-string "\\\\vert[{}]*"
"|" "|"
(mapconcat (lambda (x) (format "abbr %s '%s'" (car x) (cadr x))) (mapconcat (lambda (x) (format "abbr %s '%s'" (car x) (cadr x)))
table table
"\n") "\n")
t t) t t)
#+END_SRC #+END_SRC
Abbreviations are a great way to keep correctly track of which commands are run Abbreviations are a great way to keep correctly track of which commands are run
@ -306,7 +306,7 @@ running right now, and =pscpu10= limits that to the top 10 threads. Similarly,
| psmem10 | ps auxf \vert sort -nr -k 4 \vert head -10 | | psmem10 | ps auxf \vert sort -nr -k 4 \vert head -10 |
#+begin_SRC fish #+begin_SRC fish
<<generate-abbr(table=mgmt-abbr)>> <<generate-abbr(table=mgmt-abbr)>>
#+END_SRC #+END_SRC
** System management (packages and services) ** System management (packages and services)
@ -332,7 +332,7 @@ can type =search=. Otherwise, if I want to include AUR results, Ill use =paru
| purge | paru -Sc | | purge | paru -Sc |
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=pm-abbr)>> <<generate-abbr(table=pm-abbr)>>
#+END_SRC #+END_SRC
*** Service management *** Service management
@ -349,7 +349,7 @@ system services, I can instead type a simple capital =S=.
| suser | systemctl --user | | suser | systemctl --user |
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=service-abbr)>> <<generate-abbr(table=service-abbr)>>
#+END_SRC #+END_SRC
** Development ** Development
@ -373,7 +373,7 @@ configuration for debug or release profiles.
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=abbr-cmake)>> <<generate-abbr(table=abbr-cmake)>>
#+END_SRC #+END_SRC
*** Docker *** Docker
@ -398,7 +398,7 @@ full command, so I use these instead.
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=abbr-docker)>> <<generate-abbr(table=abbr-docker)>>
#+END_SRC #+END_SRC
*** Text editors *** Text editors
@ -419,7 +419,7 @@ In case we want to launch Emacs in GUI mode anyways, ~egui~ is available too.
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish :noweb yes #+BEGIN_SRC fish :noweb yes
<<generate-abbr(table=abbr-text-ed)>> <<generate-abbr(table=abbr-text-ed)>>
#+END_SRC #+END_SRC
*** Compilation *** Compilation
@ -438,7 +438,7 @@ with the ~-Wall~ flag activated.
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=abbr-comp)>> <<generate-abbr(table=abbr-comp)>>
#+END_SRC #+END_SRC
*** Git *** Git
@ -455,7 +455,7 @@ covered.
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=abbr-git)>> <<generate-abbr(table=abbr-git)>>
#+END_SRC #+END_SRC
** LaTeX ** LaTeX
@ -475,7 +475,7 @@ abbreviation. Same goes for ~texhash~ which must be run as sudo.
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=latex-abbr)>> <<generate-abbr(table=latex-abbr)>>
#+END_SRC #+END_SRC
** Some security measures ** Some security measures
@ -507,7 +507,7 @@ accidentally removing the root folder. I added the same option to =chgrp=,
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=sec-abbr)>> <<generate-abbr(table=sec-abbr)>>
#+END_SRC #+END_SRC
** Typos ** Typos
@ -530,7 +530,7 @@ So, let's just replace the former by the latter. I'm also very bad at typing
Here is the corresponding fish configuration: Here is the corresponding fish configuration:
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=typo-abbr)>> <<generate-abbr(table=typo-abbr)>>
#+END_SRC #+END_SRC
** Misc ** Misc
@ -548,33 +548,33 @@ Here you will find various commands related to media in general. the first one
is a command to play some chillhop from the [[https://www.youtube.com/user/Chillhopdotcom][Chillhop YouTube channel]]'s is a command to play some chillhop from the [[https://www.youtube.com/user/Chillhopdotcom][Chillhop YouTube channel]]'s
livestream. livestream.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr chill 'mpv --force-window=no --no-video "https://www.youtube.com/user/Chillhopdotcom/live" &' abbr chill 'mpv --force-window=no --no-video "https://www.youtube.com/user/Chillhopdotcom/live" &'
#+END_SRC #+END_SRC
When it comes to mpv, I do not want to force it to open a graphical window if 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 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. that window. So, I declared this abbreviation.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr mpv 'mpv --no-border --force-window=no' abbr mpv 'mpv --no-border --force-window=no'
#+END_SRC #+END_SRC
When I want to download a song from YouTube, I'll just use the command ~flac When I want to download a song from YouTube, I'll just use the command ~flac
videoIdentifier~ to get it through ~youtube-dl~. videoIdentifier~ to get it through ~youtube-dl~.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"' abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
#+END_SRC #+END_SRC
Some sane default options for ~sxiv~, a simple X image Viewer. This includes Some sane default options for ~sxiv~, a simple X image Viewer. This includes
playing GIFs and not displaying the filename below. Sxiv will also open in playing GIFs and not displaying the filename below. Sxiv will also open in
fullscreen and will fit the displayed image to the frame. fullscreen and will fit the displayed image to the frame.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr sxiv 'sxiv -abfs f' abbr sxiv 'sxiv -abfs f'
#+END_SRC #+END_SRC
Finally, let's declare the following abbreviation that will launch an mpv Finally, let's declare the following abbreviation that will launch an mpv
instance displaying my webcam: instance displaying my webcam:
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr webcam 'devour mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0' abbr webcam 'devour mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0'
#+END_SRC #+END_SRC
*** Sudo *** Sudo
@ -585,7 +585,7 @@ 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:bin.org::#Askpass-d0d7a8c0][askpass]]). I also made it so custom graphical script for getting my password (see [[file:bin.org::#Askpass-d0d7a8c0][askpass]]). I also made it so
~please~ is an equivalent to ~sudo -A~ as a joke. ~please~ is an equivalent to ~sudo -A~ as a joke.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr please 'sudo -A' abbr please 'sudo -A'
#+END_SRC #+END_SRC
*** History *** History
@ -595,7 +595,7 @@ custom graphical script for getting my password (see [[file:bin.org::#Askpass-d0
I find it more intuitive and faster to just write ~hist~ instead of ~history~, I find it more intuitive and faster to just write ~hist~ instead of ~history~,
so let's declare that. so let's declare that.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr hist history abbr hist history
#+END_SRC #+END_SRC
*** Compression *** Compression
@ -614,7 +614,7 @@ management]]).
| untar | tar -xvzf | | untar | tar -xvzf |
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=tar-abbr)>> <<generate-abbr(table=tar-abbr)>>
#+END_SRC #+END_SRC
*** exa *** exa
@ -628,7 +628,7 @@ management]]).
| lsl | exa -halg@ --group-directories-first --git | | lsl | exa -halg@ --group-directories-first --git |
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=exa-abbr)>> <<generate-abbr(table=exa-abbr)>>
#+END_SRC #+END_SRC
*** Network Management *** Network Management
@ -638,7 +638,7 @@ management]]).
First, we have just =nmcli= with sane default options, that is a pretty output First, we have just =nmcli= with sane default options, that is a pretty output
with colors. with colors.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr nmcli 'nmcli -p -c auto' abbr nmcli 'nmcli -p -c auto'
#+END_SRC #+END_SRC
*** NordVPN *** NordVPN
@ -662,7 +662,7 @@ the US.
| ncu | nordvpn c United_States | | ncu | nordvpn c United_States |
#+BEGIN_SRC fish #+BEGIN_SRC fish
<<generate-abbr(table=nordvpn-abbr)>> <<generate-abbr(table=nordvpn-abbr)>>
#+END_SRC #+END_SRC
*** Wget *** Wget
@ -671,7 +671,7 @@ the US.
:END: :END:
By default, continue a download that was interupted. By default, continue a download that was interupted.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr wget 'wget -c' abbr wget 'wget -c'
#+END_SRC #+END_SRC
* Last thing before were done * Last thing before were done

View File

@ -126,23 +126,23 @@ This file is tangled at ~$HOME/.gtkrc-2.0~. This is an equivalent for the GTK3
configuration file you will see below, and it shares most of its settings. configuration file you will see below, and it shares most of its settings.
First, lets select the Nordic theme for GTK2. Lets also set the icon theme. First, lets select the Nordic theme for GTK2. Lets also set the icon theme.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
# -*- mode: unix-config -*- # -*- mode: unix-config -*-
gtk-theme-name="Nordic" gtk-theme-name="Nordic"
gtk-icon-theme-name="Flat-Remix-Dark" gtk-icon-theme-name="Flat-Remix-Dark"
#+END_SRC #+END_SRC
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-xft-antialias=1 gtk-xft-antialias=1
gtk-xft-hinting=1 gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight" gtk-xft-hintstyle="hintslight"
#+END_SRC #+END_SRC
This changes the shortcuts in menu, lets also make the menus snappier. This changes the shortcuts in menu, lets also make the menus snappier.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-can-change-accels=1 gtk-can-change-accels=1
gtk-menu-bar-popup-delay=0 gtk-menu-bar-popup-delay=0
gtk-menu-popdown-delay=0 gtk-menu-popdown-delay=0
gtk-menu-popup-delay=0 gtk-menu-popup-delay=0
#+END_SRC #+END_SRC
***** Filechooser ***** Filechooser
@ -151,60 +151,60 @@ This changes the shortcuts in menu, lets also make the menus snappier.
:CUSTOM_ID: Features-Graphical_tweaks-GTK_Settings-GTK2-Filechooser-389f040d :CUSTOM_ID: Features-Graphical_tweaks-GTK_Settings-GTK2-Filechooser-389f040d
:END: :END:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
[Filechooser Settings] [Filechooser Settings]
#+END_SRC #+END_SRC
The first option alows me to open the file chooser in the current working The first option alows me to open the file chooser in the current working
directory: directory:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
StartupMode=cwd StartupMode=cwd
#+END_SRC #+END_SRC
Next, setting the location mode to ~path-bar~ will show the path as buttons that Next, setting the location mode to ~path-bar~ will show the path as buttons that
can be clicked rather than the full path. can be clicked rather than the full path.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
LocationMode=path-bar LocationMode=path-bar
#+END_SRC #+END_SRC
With this configuration, by default we wont see hidden files. With this configuration, by default we wont see hidden files.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
ShowHidden=true ShowHidden=true
#+END_SRC #+END_SRC
And we'll also see the size of the visible files. And we'll also see the size of the visible files.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
ShowSizeColumn=true ShowSizeColumn=true
#+END_SRC #+END_SRC
Now, lets choose the geometry of our file picker. These two first lines set Now, lets choose the geometry of our file picker. These two first lines set
where the file picker appears: where the file picker appears:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
GeometryX=566 GeometryX=566
GeometryY=202 GeometryY=202
#+END_SRC #+END_SRC
And these two describe the size of the window: And these two describe the size of the window:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
GeometryWidth=800 GeometryWidth=800
GeometryHeight=400 GeometryHeight=400
#+END_SRC #+END_SRC
With these two lines, we set how our files are sorted: by name, and in the With these two lines, we set how our files are sorted: by name, and in the
ascending order. ascending order.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
SortColumn=name SortColumn=name
SortOrder=ascending SortOrder=ascending
#+END_SRC #+END_SRC
Our default view mode is a list of files: Our default view mode is a list of files:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
ViewMode=list-view ViewMode=list-view
#+END_SRC #+END_SRC
And finally, setting our icon view scale to ~-1~ sets the icon view to the max And finally, setting our icon view scale to ~-1~ sets the icon view to the max
size. size.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
IconViewScale=-1 IconViewScale=-1
#+END_SRC #+END_SRC
**** GTK3 **** GTK3
@ -215,44 +215,44 @@ size.
The following file helps me choosing the aspect of various GTK+ 3 software, The following file helps me choosing the aspect of various GTK+ 3 software,
including their theme and icons. First, lets declare the header: including their theme and icons. First, lets declare the header:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
[Settings] [Settings]
#+END_SRC #+END_SRC
Now, lets hint to GTK that I prefer dark themes. This can have an influence Now, lets hint to GTK that I prefer dark themes. This can have an influence
also on some websites that can detect this preference and therefore set their also on some websites that can detect this preference and therefore set their
own theme to dark by themselves. own theme to dark by themselves.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-application-prefer-dark-theme = true gtk-application-prefer-dark-theme = true
#+END_SRC #+END_SRC
Next, the icon theme is the Flat Remix Dark icon theme: Next, the icon theme is the Flat Remix Dark icon theme:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-icon-theme-name = Flat-Remix-Dark gtk-icon-theme-name = Flat-Remix-Dark
#+END_SRC #+END_SRC
Now, the general theme for GTK3 is Nordic. Now, the general theme for GTK3 is Nordic.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-theme-name = Nordic gtk-theme-name = Nordic
#+END_SRC #+END_SRC
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-can-change-accels=1 gtk-can-change-accels=1
gtk-menu-bar-popup-delay=0 gtk-menu-bar-popup-delay=0
gtk-menu-popdown-delay=0 gtk-menu-popdown-delay=0
gtk-menu-popup-delay=0 gtk-menu-popup-delay=0
#+END_SRC #+END_SRC
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-xft-antialias=1 gtk-xft-antialias=1
gtk-xft-hinting=1 gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight gtk-xft-hintstyle=hintslight
# gtk-xft-rgba=rgb # gtk-xft-rgba=rgb
#+END_SRC #+END_SRC
Since window decorations are handled by my WMs, I will leave this variable Since window decorations are handled by my WMs, I will leave this variable
empty. empty.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
gtk-decoration-layout= gtk-decoration-layout=
#+END_SRC #+END_SRC
*** Picom (Compton) *** Picom (Compton)
@ -271,45 +271,45 @@ You can find my Picom configuration [[file:picom.org][here]].
The main body in my Xresources declaration is the declaration of my The main body in my Xresources declaration is the declaration of my
color theme. It is based on the [[https://www.nordtheme.com/][Nord]] theme, from their [[https://github.com/arcticicestudio/nord-xresources/][Git repository]]. color theme. It is based on the [[https://www.nordtheme.com/][Nord]] theme, from their [[https://github.com/arcticicestudio/nord-xresources/][Git repository]].
#+BEGIN_SRC conf #+BEGIN_SRC conf
#define nord0 #2E3440 #define nord0 #2E3440
#define nord1 #3B4252 #define nord1 #3B4252
#define nord2 #434C5E #define nord2 #434C5E
#define nord3 #4C566A #define nord3 #4C566A
#define nord4 #D8DEE9 #define nord4 #D8DEE9
#define nord5 #E5E9F0 #define nord5 #E5E9F0
#define nord6 #ECEFF4 #define nord6 #ECEFF4
#define nord7 #8FBCBB #define nord7 #8FBCBB
#define nord8 #88C0D0 #define nord8 #88C0D0
#define nord9 #81A1C1 #define nord9 #81A1C1
#define nord10 #5E81AC #define nord10 #5E81AC
#define nord11 #BF616A #define nord11 #BF616A
#define nord12 #D08770 #define nord12 #D08770
#define nord13 #EBCB8B #define nord13 #EBCB8B
#define nord14 #A3BE8C #define nord14 #A3BE8C
#define nord15 #B48EAD #define nord15 #B48EAD
,*.foreground: nord4 ,*.foreground: nord4
,*.background: nord0 ,*.background: nord0
,*.cursorColor: nord4 ,*.cursorColor: nord4
,*fading: 35 ,*fading: 35
,*fadeColor: nord3 ,*fadeColor: nord3
,*.color0: nord1 ,*.color0: nord1
,*.color1: nord11 ,*.color1: nord11
,*.color2: nord14 ,*.color2: nord14
,*.color3: nord13 ,*.color3: nord13
,*.color4: nord9 ,*.color4: nord9
,*.color5: nord15 ,*.color5: nord15
,*.color6: nord8 ,*.color6: nord8
,*.color7: nord5 ,*.color7: nord5
,*.color8: nord3 ,*.color8: nord3
,*.color9: nord11 ,*.color9: nord11
,*.color10: nord14 ,*.color10: nord14
,*.color11: nord13 ,*.color11: nord13
,*.color12: nord9 ,*.color12: nord9
,*.color13: nord15 ,*.color13: nord15
,*.color14: nord7 ,*.color14: nord7
,*.color15: nord6 ,*.color15: nord6
#+END_SRC #+END_SRC
** Text and source code editing ** Text and source code editing
@ -389,10 +389,10 @@ You can find my tmux configuration in [[file:tmux.org][tmux.org]]. It depends on
:END: :END:
This file gets inserted automatically at the end of my emails. This file gets inserted automatically at the end of my emails.
#+BEGIN_SRC text #+BEGIN_SRC text
Lucien “Phundrak” Cartier-Tilet Lucien “Phundrak” Cartier-Tilet
https://phundrak.com (Français) https://phundrak.com (Français)
https://phundrak.com/en (English) https://phundrak.com/en (English)
Sent from GNU/Emacs Sent from GNU/Emacs
#+END_SRC #+END_SRC
*** Global gitignore *** Global gitignore
@ -405,14 +405,14 @@ 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 dont want nanos backup default, hence the [[file:.gitignore_global][~/.gitignore_global]] file. First, we dont want nanos backup
files. files.
#+BEGIN_SRC text #+BEGIN_SRC text
~* ~*
#+END_SRC #+END_SRC
And object files and output binaries generated by =gcc= and the likes arent And object files and output binaries generated by =gcc= and the likes arent
welcome either. welcome either.
#+BEGIN_SRC text #+BEGIN_SRC text
,*.out ,*.out
,*.o ,*.o
#+END_SRC #+END_SRC
*** Paru *** Paru
@ -428,19 +428,19 @@ is running, but if it ever happens it will be already concerning enough they
managed to. I also make use of [[file:bin.org::#Emacs-stuff-Dired-2eeca9da][my custom script dired]] so I can use Emacs Dired managed to. I also make use of [[file:bin.org::#Emacs-stuff-Dired-2eeca9da][my custom script dired]] so I can use Emacs Dired
as the file manager for ~paru~. as the file manager for ~paru~.
#+BEGIN_SRC conf :tangle ~/.config/paru/paru.conf #+BEGIN_SRC conf :tangle ~/.config/paru/paru.conf
[options] [options]
BottomUp BottomUp
Devel Devel
DevelSuffixes = -git -cvs -svn -bzr -darcs -always DevelSuffixes = -git -cvs -svn -bzr -darcs -always
NewsOnUpgrade NewsOnUpgrade
PgpFetch PgpFetch
Provides Provides
RemoveMake RemoveMake
SudoLoop SudoLoop
UpgradeMenu UpgradeMenu
[bin] [bin]
FileManager = dired FileManager = dired
#+END_SRC #+END_SRC
* Installation * Installation

View File

@ -26,9 +26,9 @@ The ~print_info~ function is the function called by Neofetch in order to print
the system information it could fetch. In this function, well choose what to the system information it could fetch. In this function, well choose what to
display, and how. This function looks like this: display, and how. This function looks like this:
#+BEGIN_SRC sh :tangle no #+BEGIN_SRC sh :tangle no
print_info() { print_info() {
# Print information here… # Print information here…
} }
#+END_SRC #+END_SRC
Generally, what we will display will be shown through the ~info~ function, Generally, what we will display will be shown through the ~info~ function,
@ -58,16 +58,16 @@ interesting information; ~info "Memory" memory~ will look like
#+NAME: info-elements-gen #+NAME: info-elements-gen
#+BEGIN_SRC emacs-lisp :var table=info-elements-table :cache yes #+BEGIN_SRC emacs-lisp :var table=info-elements-table :cache yes
(mapconcat (lambda (x) (mapconcat (lambda (x)
(let ((prefix (car x)) (let ((prefix (car x))
(information (cadr x))) (information (cadr x)))
(format "info %s%s" (format "info %s%s"
(if (not (string= prefix "")) (if (not (string= prefix ""))
(format "\"%s\" " prefix) (format "\"%s\" " prefix)
"") "")
information))) information)))
table table
"\n") "\n")
#+END_SRC #+END_SRC
#+RESULTS[83eb4aaa554df955ad996157d911eec3a9251628]: info-elements-gen #+RESULTS[83eb4aaa554df955ad996157d911eec3a9251628]: info-elements-gen
@ -90,9 +90,9 @@ info "Memory" memory
Hence, the function looks like so: Hence, the function looks like so:
#+BEGIN_SRC sh #+BEGIN_SRC sh
print_info() { print_info() {
<<info-elements-gen()>> <<info-elements-gen()>>
} }
#+END_SRC #+END_SRC
Each of these modules can be tuned with the variables presented below. Each of these modules can be tuned with the variables presented below.
@ -130,7 +130,7 @@ This variable can shorten the output of the ~distro~ function.
- on :: ~Arch Linux~ - on :: ~Arch Linux~
- off :: ~Arch~ - off :: ~Arch~
#+begin_src sh #+begin_src sh
distro_shorthand="off" distro_shorthand="off"
#+end_src #+end_src
It is possible to display when the distro has been installed on the computer. It is possible to display when the distro has been installed on the computer.
@ -164,7 +164,7 @@ terminal emulator I use.
- ~viu~ - ~viu~
- flag :: ~--backend~ - flag :: ~--backend~
#+BEGIN_SRC sh #+BEGIN_SRC sh
image_backend="kitty" image_backend="kitty"
#+END_SRC #+END_SRC
Now, since I indicated I wanted an image engine, Ill indicate neofetch which Now, since I indicated I wanted an image engine, Ill indicate neofetch which
@ -182,7 +182,7 @@ image mode, your wallpaper will be used.
- ~command output (neofetch --ascii "$(fortune | cowsay -W 30)")~ - ~command output (neofetch --ascii "$(fortune | cowsay -W 30)")~
- Flag :: ~--source~ - Flag :: ~--source~
#+BEGIN_SRC sh #+BEGIN_SRC sh
image_source="$HOME/org/config/img/leon.png" image_source="$HOME/org/config/img/leon.png"
#+END_SRC #+END_SRC
The default image size will probably not be correct since it is half the The default image size will probably not be correct since it is half the
@ -195,7 +195,7 @@ terminal width and I have an ultrawide monitor, so Ill need to set it manuall
- ~none~ - ~none~
- Flag :: ~--image-size~ or ~--size~ - Flag :: ~--image-size~ or ~--size~
#+BEGIN_SRC sh #+BEGIN_SRC sh
image_size="224px" image_size="224px"
#+END_SRC #+END_SRC
**** Kernel **** Kernel
@ -213,7 +213,7 @@ The variable below can shorten the output ofh the ~kernel~ function.
- on :: ~4.8.9-1-ARCH~ - on :: ~4.8.9-1-ARCH~
- off :: ~Linux 4.8.9-1-ARCH~ - off :: ~Linux 4.8.9-1-ARCH~
#+begin_src sh #+begin_src sh
kernel_shorthand="off" kernel_shorthand="off"
#+end_src #+end_src
**** OS Architecture **** OS Architecture
@ -230,7 +230,7 @@ This variable can show or hide the OS architecture in the ~distro~ output.
- on :: ~Arch Linux x86_64~ - on :: ~Arch Linux x86_64~
- off :: ~Arch Linux~ - off :: ~Arch Linux~
#+begin_src sh #+begin_src sh
os_arch="off" os_arch="off"
#+end_src #+end_src
**** Packages **** Packages
@ -246,7 +246,7 @@ It is possible to show or hide Package Manager names.
- tiny :: ~'908 (pacman, flatpak, snap)'~ - tiny :: ~'908 (pacman, flatpak, snap)'~
- off :: ~'908'~ - off :: ~'908'~
#+BEGIN_SRC sh #+BEGIN_SRC sh
package_managers="on" package_managers="on"
#+END_SRC #+END_SRC
**** Shell **** Shell
@ -284,7 +284,7 @@ This allows to show the shells version in the output of ~shell~.
- on :: ~bash 4.4.5~ - on :: ~bash 4.4.5~
- off :: ~bash~ - off :: ~bash~
#+begin_src sh #+begin_src sh
shell_version="off" shell_version="off"
#+end_src #+end_src
*** Uptime *** Uptime
@ -304,7 +304,7 @@ it a bit, while ~tiny~ shortens it greatly.
- off :: ~2 days, 10 hours, 3 minutes~ - off :: ~2 days, 10 hours, 3 minutes~
- tiny :: ~2d 10h 3m~ - tiny :: ~2d 10h 3m~
#+begin_src sh #+begin_src sh
uptime_shorthand="on" uptime_shorthand="on"
#+end_src #+end_src
*** IP address *** IP address
@ -317,20 +317,20 @@ It is possible to display the machines public IP address with the function
- Value :: ~"url"~ - Value :: ~"url"~
- Flag :: ~--ip_host~ - Flag :: ~--ip_host~
#+begin_src sh #+begin_src sh
public_ip_host="http://ident.me" public_ip_host="http://ident.me"
#+end_src #+end_src
- Default value :: ~""~ # - Default value :: ~""~
- Values :: # - Values ::
- ~""~ # - ~""~
- ~""~ # - ~""~
- Flag :: ~""~ # - Flag :: ~""~
- Supports :: # - Supports ::
- Examples :: # - Examples ::
- on :: ~~ # - on :: ~~
- off :: ~~ # - off :: ~~
#+begin_src sh # #+begin_src sh
#+end_src # #+end_src
*** Theming *** Theming
:PROPERTIES: :PROPERTIES:
@ -354,7 +354,7 @@ With this value, it is possible to shorten the output of the computers themin
- on :: ~Numix, Adwaita~ - on :: ~Numix, Adwaita~
- off :: ~Numix [GTK2], Adwaita [GTK3]~ - off :: ~Numix [GTK2], Adwaita [GTK3]~
#+begin_src sh #+begin_src sh
gtk_shorthand="on" gtk_shorthand="on"
#+end_src #+end_src
**** Enable or disable theming display for GTK2 **** Enable or disable theming display for GTK2
@ -372,7 +372,7 @@ this variable.
- on :: ~Numix [GTK2], Adwaita [GTK3]~ - on :: ~Numix [GTK2], Adwaita [GTK3]~
- off :: ~Adwaita [GTK3]~ - off :: ~Adwaita [GTK3]~
#+begin_src sh #+begin_src sh
gtk2="off" gtk2="off"
#+end_src #+end_src
**** Enable or disable theming display for GTK3 **** Enable or disable theming display for GTK3
@ -389,7 +389,7 @@ The same variable as above is also available for GTK3.
- on :: ~Numix [GTK2], Adwaita [GTK3]~ - on :: ~Numix [GTK2], Adwaita [GTK3]~
- off :: ~Numix [GTK2]~ - off :: ~Numix [GTK2]~
#+begin_src sh #+begin_src sh
gtk3="off" gtk3="off"
#+end_src #+end_src
** Hardware ** Hardware
@ -415,7 +415,7 @@ With this variables, it is possible to show or hide the brand of a CPU in the
- on :: ~Intel i7-6500U~ - on :: ~Intel i7-6500U~
- off :: ~i7-6500U~ - off :: ~i7-6500U~
#+begin_src sh #+begin_src sh
cpu_brand="off" cpu_brand="off"
#+end_src #+end_src
**** CPU speed **** CPU speed
@ -432,7 +432,7 @@ With this variable, it is possible to show or hide the speed of the CPU.
- on :: ~Intel i7-6500U (4) @ 3.1GHz~ - on :: ~Intel i7-6500U (4) @ 3.1GHz~
- off :: ~Intel i7-6500U (4)~ - off :: ~Intel i7-6500U (4)~
#+begin_src sh #+begin_src sh
cpu_speed="off" cpu_speed="off"
#+end_src #+end_src
**** CPU speed type **** CPU speed type
@ -451,7 +451,7 @@ a value.
- Flag :: ~--speed_type~ - Flag :: ~--speed_type~
- Supports :: Linux with ~cpufreq~ - Supports :: Linux with ~cpufreq~
#+begin_src sh #+begin_src sh
speed_type="bios_limit" speed_type="bios_limit"
#+end_src #+end_src
**** CPU speed shorthand **** CPU speed shorthand
@ -469,7 +469,7 @@ supported in systems with CPU speed below 1GHz.
- on :: ~i7-6500U (4) @ 3.1GHz~ - on :: ~i7-6500U (4) @ 3.1GHz~
- off :: ~i7-6500U (4) @ 3.100GHz~ - off :: ~i7-6500U (4) @ 3.100GHz~
#+begin_src sh #+begin_src sh
speed_shorthand="on" speed_shorthand="on"
#+end_src #+end_src
**** CPU cores **** CPU cores
@ -490,7 +490,7 @@ available in the CPU.
- physical :: ~Intel i7-6500U (2) @ 3.1GHz~ (All physical cores) - physical :: ~Intel i7-6500U (2) @ 3.1GHz~ (All physical cores)
- off :: ~Intel i7-6500U @ 3.1GHz~ - off :: ~Intel i7-6500U @ 3.1GHz~
#+begin_src sh #+begin_src sh
cpu_cores="off" cpu_cores="off"
#+end_src #+end_src
**** CPU temperature **** CPU temperature
@ -513,7 +513,7 @@ only supports newer Intel processors.
- F :: ~Intel i7-6500U (4) @ 3.1GHz [82.0°F]~ - F :: ~Intel i7-6500U (4) @ 3.1GHz [82.0°F]~
- off :: ~Intel i7-6500U (4) @ 3.1GHz~ - off :: ~Intel i7-6500U (4) @ 3.1GHz~
#+begin_src sh #+begin_src sh
cpu_temp="off" cpu_temp="off"
#+end_src #+end_src
*** GPU *** GPU
@ -539,7 +539,7 @@ of ~gpu~.
- on :: ~AMD HD 7950~ - on :: ~AMD HD 7950~
- off :: ~HD 7950~ - off :: ~HD 7950~
#+begin_src sh #+begin_src sh
gpu_brand="off" gpu_brand="off"
#+end_src #+end_src
**** Which GPU to display **** Which GPU to display
@ -557,14 +557,14 @@ This allows the user to choose which GPU appears in the output of the function
- Supports :: Linux - Supports :: Linux
- Examples :: - Examples ::
- all :: - all ::
#+BEGIN_SRC text #+BEGIN_SRC text
GPU1: AMD HD 7950 GPU1: AMD HD 7950
GPU2: Intel Integrated Graphics GPU2: Intel Integrated Graphics
#+END_SRC #+END_SRC
- dedicated :: ~GPU1: AMD HD 7950~ - dedicated :: ~GPU1: AMD HD 7950~
- integrated :: ~GPU1: Intel Integrated Graphics~ - integrated :: ~GPU1: Intel Integrated Graphics~
#+begin_src sh #+begin_src sh
gpu_type="all" gpu_type="all"
#+end_src #+end_src
*** Resolution *** Resolution
@ -583,5 +583,5 @@ individually. It is possible to display the refresh rate or to hide it.
- on :: ~1920x1080 @ 60Hz~ - on :: ~1920x1080 @ 60Hz~
- off :: ~1920x1080~ - off :: ~1920x1080~
#+begin_src sh #+begin_src sh
refresh_rate="off" refresh_rate="off"
#+end_src #+end_src

View File

@ -22,13 +22,13 @@ The following enables client-side shadows on windows. Note desktop windows
(windows with ~_NET_WM_WINDOW_TYPE_DESKTOP~) never get shadow, unless explicitly (windows with ~_NET_WM_WINDOW_TYPE_DESKTOP~) never get shadow, unless explicitly
requested using the wintypes option. requested using the wintypes option.
#+BEGIN_SRC conf #+BEGIN_SRC conf
shadow = true; shadow = true;
#+END_SRC #+END_SRC
The blur radius radius for shadows is measured in pixels, and it defaults to The blur radius radius for shadows is measured in pixels, and it defaults to
12px. 12px.
#+BEGIN_SRC conf #+BEGIN_SRC conf
shadow-radius = 17; shadow-radius = 17;
#+END_SRC #+END_SRC
Picom can also apply some level of opacity on shadows. Picom can also apply some level of opacity on shadows.
@ -36,14 +36,14 @@ Picom can also apply some level of opacity on shadows.
| Min value | ~0.0~ | | Min value | ~0.0~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
shadow-opacity = 0.6 shadow-opacity = 0.6
#+END_SRC #+END_SRC
The left and top offsets for shadows are expressed in pixels. The left and top offsets for shadows are expressed in pixels.
| Default value | ~-15~ | | Default value | ~-15~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
shadow-offset-x = -12; shadow-offset-x = -12;
shadow-offset-y = -12; shadow-offset-y = -12;
#+END_SRC #+END_SRC
It is possible to set the color of the shadow with the string contained in It is possible to set the color of the shadow with the string contained in
@ -51,39 +51,39 @@ It is possible to set the color of the shadow with the string contained in
config, but this value will override any value in ~shadow-red~, ~shadow-green~, config, but this value will override any value in ~shadow-red~, ~shadow-green~,
or ~shadow-blue~. or ~shadow-blue~.
#+BEGIN_SRC conf #+BEGIN_SRC conf
shadow-color = "#000000" shadow-color = "#000000"
#+END_SRC #+END_SRC
It is possible to specify a list of conditions of windows that should have no It is possible to specify a list of conditions of windows that should have no
shadow. shadow.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
shadow-exclude = [ shadow-exclude = [
"name = 'Notification'", "name = 'Notification'",
"class_g = 'Conky'", "class_g = 'Conky'",
"class_g ?= 'Notify-osd'", "class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'", "class_g = 'Cairo-clock'",
"_GTK_FRAME_EXTENTS@:c" "_GTK_FRAME_EXTENTS@:c"
]; ];
#+END_SRC #+END_SRC
It is also possible to specify an X geometry that describes the region in which It is also possible to specify an X geometry that describes the region in which
shadows should not be painted in, such as a dock window region. For example, shadows should not be painted in, such as a dock window region. For example,
#+BEGIN_SRC conf :tangle no #+BEGIN_SRC conf :tangle no
# shadow-exclude-reg = "x10+0+0" # shadow-exclude-reg = "x10+0+0"
#+END_SRC #+END_SRC
would make the 10 pixels at the bottom of the screen not have any shadow painted would make the 10 pixels at the bottom of the screen not have any shadow painted
on. on.
| Default value | ~""~ | | Default value | ~""~ |
#+BEGIN_SRC conf :tangle no #+BEGIN_SRC conf :tangle no
shadow-exclude-reg = "" shadow-exclude-reg = ""
#+END_SRC #+END_SRC
Finally, it is also possible to crop the shadow of a window fully on a Finally, it is also possible to crop the shadow of a window fully on a
particular Xinerama screen to the screen. particular Xinerama screen to the screen.
- Default value :: ~false~ - Default value :: ~false~
#+BEGIN_SRC conf #+BEGIN_SRC conf
xinerama-shadow-crop = false xinerama-shadow-crop = false
#+END_SRC #+END_SRC
** Deprecated options ** Deprecated options
@ -98,7 +98,7 @@ This option is deprecated, and users should use the ~wintypes~ option in their
config file instead. config file instead.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
no-dock-shadow = false; no-dock-shadow = false;
#+END_SRC #+END_SRC
This option allows Picom not to draw on drag-and-drop windows. This option is This option allows Picom not to draw on drag-and-drop windows. This option is
@ -106,7 +106,7 @@ deprecated, and users should use the ~wintypes~ option in their config file
instead. instead.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
no-dnd-shadow = false; no-dnd-shadow = false;
#+END_SRC #+END_SRC
~shadow-ignore-shaped~ is also deprecated. It used to indicate Picom not to ~shadow-ignore-shaped~ is also deprecated. It used to indicate Picom not to
@ -114,15 +114,15 @@ paint shadows on shaped windows. Note shaped windows here means windows setting
their shape through X Shape extension. Those using ARGB background are beyond their shape through X Shape extension. Those using ARGB background are beyond
Picoms control. Since it is deprecated, you could instead use Picoms control. Since it is deprecated, you could instead use
#+BEGIN_SRC conf :tangle no #+BEGIN_SRC conf :tangle no
shadow-exclude = 'bounding_shaped' shadow-exclude = 'bounding_shaped'
#+END_SRC #+END_SRC
or or
#+BEGIN_SRC conf :tangle no #+BEGIN_SRC conf :tangle no
shadow-exclude = 'bounding_shaped && !rounded_corners' shadow-exclude = 'bounding_shaped && !rounded_corners'
#+END_SRC #+END_SRC
| Default value | ~""~ | | Default value | ~""~ |
#+BEGIN_SRC conf :tangle no #+BEGIN_SRC conf :tangle no
shadow-ignore-shaped = "" shadow-ignore-shaped = ""
#+END_SRC #+END_SRC
* Rounded corners * Rounded corners
@ -131,15 +131,15 @@ or
:END: :END:
Here we can see the declaration of the corners radius: Here we can see the declaration of the corners radius:
#+BEGIN_SRC conf #+BEGIN_SRC conf
corner-radius = 9.0; corner-radius = 9.0;
#+END_SRC #+END_SRC
It is also possible to exclude some windows from getting their corners rounded. It is also possible to exclude some windows from getting their corners rounded.
I personally excluded any window generated by AwesomeWM. I personally excluded any window generated by AwesomeWM.
#+BEGIN_SRC conf #+BEGIN_SRC conf
rounded-corners-exclude = [ rounded-corners-exclude = [
"_NET_WM_WINDOW_TYPE@[0]:a = '_NET_WM_WINDOW_TYPE_DOCK'" "_NET_WM_WINDOW_TYPE@[0]:a = '_NET_WM_WINDOW_TYPE_DOCK'"
]; ];
#+END_SRC #+END_SRC
* Fading * Fading
@ -152,7 +152,7 @@ feature on or off. However, its behavior can be changed with
~no-fading-openclose~. ~no-fading-openclose~.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
fading = true fading = true
#+END_SRC #+END_SRC
These values controls the opacity change between steps while fading in and out. These values controls the opacity change between steps while fading in and out.
@ -160,35 +160,35 @@ These values controls the opacity change between steps while fading in and out.
| Min value | ~0.01~ | | Min value | ~0.01~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
fade-in-step = 0.09; fade-in-step = 0.09;
fade-out-step = 0.08; fade-out-step = 0.08;
#+END_SRC #+END_SRC
This value represents the time between steps in fade steps, in milliseconds. This value represents the time between steps in fade steps, in milliseconds.
| Default value | ~10~ | | Default value | ~10~ |
| Min value | ~1~ | | Min value | ~1~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
fade-delta = 20; fade-delta = 20;
#+END_SRC #+END_SRC
It is possible to exclude some windows that should not be faded with a specified It is possible to exclude some windows that should not be faded with a specified
list of conditions. list of conditions.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
fade-exclude = [ "class_g = 'mpv'" ]; fade-exclude = [ "class_g = 'mpv'" ];
#+END_SRC #+END_SRC
This option allows Picom not to create any fade on windows opening or closing. This option allows Picom not to create any fade on windows opening or closing.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
no-fading-openclose = true; no-fading-openclose = true;
#+END_SRC #+END_SRC
Finally, this option is a workaround for Openbox, Fluxbox and others by not Finally, this option is a workaround for Openbox, Fluxbox and others by not
fading destroyed ARGB windows with WM frame. fading destroyed ARGB windows with WM frame.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
no-fading-destroyed-argb = false no-fading-destroyed-argb = false
#+END_SRC #+END_SRC
* Transparency and opacity * Transparency and opacity
@ -202,7 +202,7 @@ describes the opacity of inactive windows.
| Min value | ~0.1~ | | Min value | ~0.1~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
inactive-opacity = 0.6; inactive-opacity = 0.6;
#+END_SRC #+END_SRC
On the other hand, it is possible to declare a default opacity for active On the other hand, it is possible to declare a default opacity for active
@ -211,7 +211,7 @@ windows.
| Min value | ~0.1~ | | Min value | ~0.1~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
active-opacity = 1; active-opacity = 1;
#+END_SRC #+END_SRC
This however describes the opacity of window titlebars and borders. This however describes the opacity of window titlebars and borders.
@ -219,7 +219,7 @@ This however describes the opacity of window titlebars and borders.
| Min value | ~0.1~ | | Min value | ~0.1~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
frame-opacity = 1.0; frame-opacity = 1.0;
#+END_SRC #+END_SRC
~menu-opacity~ describes the opacity for dropdown menus and popup menus. ~menu-opacity~ describes the opacity for dropdown menus and popup menus.
@ -227,14 +227,14 @@ This however describes the opacity of window titlebars and borders.
| Min value | ~0.1~ | | Min value | ~0.1~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# menu-opacity = 0.9; # menu-opacity = 0.9;
#+END_SRC #+END_SRC
~inactive-opacity-override~ allows the user to let inactive opacity set by ~-i~ ~inactive-opacity-override~ allows the user to let inactive opacity set by ~-i~
override the ~_NET_WM_OPACITY_ values of windows. override the ~_NET_WM_OPACITY_ values of windows.
| Default value | ~true~ | | Default value | ~true~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
inactive-opacity-override = true; inactive-opacity-override = true;
#+END_SRC #+END_SRC
While it is possible to alter opacity on inactive windows, it is also possible While it is possible to alter opacity on inactive windows, it is also possible
@ -243,7 +243,7 @@ to dim them.
| Min value | ~0.1~ | | Min value | ~0.1~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# inactive-dim = 1.0 # inactive-dim = 1.0
#+END_SRC #+END_SRC
It is also possible to use a fixed inactive dim value, instead of adjusting It is also possible to use a fixed inactive dim value, instead of adjusting
@ -252,18 +252,18 @@ according to window opacity.
| Min value | ~0.1~ | | Min value | ~0.1~ |
| Max value | ~1.0~ | | Max value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# inactive-dim-fixed = 1.0 # inactive-dim-fixed = 1.0
#+END_SRC #+END_SRC
It is also possible to specify a list of conditions of windows that should It is also possible to specify a list of conditions of windows that should
always be considered focused. always be considered focused.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
focus-exclude = [ focus-exclude = [
"class_g = 'mpv'", "class_g = 'mpv'",
"class_g = 'qemu'", "class_g = 'qemu'",
"class_g = 'Qemu-system-x86_64'" "class_g = 'Qemu-system-x86_64'"
]; ];
#+END_SRC #+END_SRC
The user can also specify a list of opacity rules, in the format The user can also specify a list of opacity rules, in the format
@ -272,7 +272,7 @@ over this. Note we don't make any guarantee about possible conflicts with other
programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows. programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
opacity-rule = []; opacity-rule = [];
#+END_SRC #+END_SRC
* Background blurring * Background blurring
@ -282,13 +282,13 @@ programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows.
The following are the parameters for background blurring, see the \*BLUR\* The following are the parameters for background blurring, see the \*BLUR\*
section for more information. section for more information.
#+BEGIN_SRC conf #+BEGIN_SRC conf
blur: { blur: {
method = "dual_kawase"; method = "dual_kawase";
strength = 7; strength = 7;
background = false; background = false;
background-frame = false; background-frame = false;
background-fixed = true; background-fixed = true;
} }
#+END_SRC #+END_SRC
This value enables or disables the blur for the background of semi-transparent This value enables or disables the blur for the background of semi-transparent
@ -296,39 +296,39 @@ or ARGB windows. It has bad performances though, with driver-dependent behavior.
The name of the switch may change without prior notifications. The name of the switch may change without prior notifications.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
blur-background = true; blur-background = true;
#+END_SRC #+END_SRC
Blur background of windows when the window frame is not opaque. If true, this Blur background of windows when the window frame is not opaque. If true, this
implies the value ~true~ for ~blur-background~. implies the value ~true~ for ~blur-background~.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
blur-background-frame = true; blur-background-frame = true;
#+END_SRC #+END_SRC
The following determines whether to use fixed blur strength rather than The following determines whether to use fixed blur strength rather than
adjusting according to window opacity. adjusting according to window opacity.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
blur-background-fixed = false; blur-background-fixed = false;
#+END_SRC #+END_SRC
Specify the blur convolution kernel, with the format Specify the blur convolution kernel, with the format
~"5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"~. ~"5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"~.
| Default value | ~""~ | | Default value | ~""~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# blur-kern = "3x3box"; # blur-kern = "3x3box";
#+END_SRC #+END_SRC
It is possible to write exclude conditions for background blur. It is possible to write exclude conditions for background blur.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
blur-background-exclude = [ blur-background-exclude = [
"window_type = 'desktop'", "window_type = 'desktop'",
"class_g = 'Polybar'", "class_g = 'Polybar'",
"class_g = 'discord-overlay'", "class_g = 'discord-overlay'",
"_GTK_FRAME_EXTENTS@:c" "_GTK_FRAME_EXTENTS@:c"
]; ];
#+END_SRC #+END_SRC
* General settings * General settings
@ -339,74 +339,74 @@ Daemonize process. Fork to background after initialization. Causes issues with
certain (badly-written) drivers. certain (badly-written) drivers.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
daemon = true; daemon = true;
#+END_SRC #+END_SRC
Picom has three backends it can use: ~xrender~, ~glx~, and ~xr_glx_hybrid~. GLX Picom has three backends it can use: ~xrender~, ~glx~, and ~xr_glx_hybrid~. GLX
backend is typically much faster but depends on a sane driver. backend is typically much faster but depends on a sane driver.
| Default value | ~xrender~ | | Default value | ~xrender~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
backend = "glx"; backend = "glx";
#+END_SRC #+END_SRC
This enables or disables VSync. This enables or disables VSync.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
vsync = true; vsync = true;
#+END_SRC #+END_SRC
Enable remote control via D-Bus. See the *D-BUS API* section below for more Enable remote control via D-Bus. See the *D-BUS API* section below for more
details. details.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
dbus = false; dbus = false;
#+END_SRC #+END_SRC
Try to detect WM windows (a non-override-redirect window with no child that has Try to detect WM windows (a non-override-redirect window with no child that has
~WM_STATE~) and markz them as active. ~WM_STATE~) and markz them as active.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
mark-wmwin-focused = true; mark-wmwin-focused = true;
#+END_SRC #+END_SRC
Mark override-redirect windows that doesn't have a child window with ~WM_STATE~ Mark override-redirect windows that doesn't have a child window with ~WM_STATE~
focused. focused.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
mark-ovredir-focused = true; mark-ovredir-focused = true;
#+END_SRC #+END_SRC
Try to detect windows with rounded corners and don't consider them shaped Try to detect windows with rounded corners and don't consider them shaped
windows. The accuracy is not very high, unfortunately. windows. The accuracy is not very high, unfortunately.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
detect-rounded-corners = true; detect-rounded-corners = true;
#+END_SRC #+END_SRC
Detect ~_NET_WM_OPACITY~ on client windows, useful for window managers not Detect ~_NET_WM_OPACITY~ on client windows, useful for window managers not
passing ~_NET_WM_OPACITY~ of client windows to frame windows. passing ~_NET_WM_OPACITY~ of client windows to frame windows.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
detect-client-opacity = true; detect-client-opacity = true;
#+END_SRC #+END_SRC
Specify refresh rate of the screen. If not specified or 0, picom will try Specify refresh rate of the screen. If not specified or 0, picom will try
detecting this with X RandR extension. detecting this with X RandR extension.
| Default value | ~60~ | | Default value | ~60~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
refresh-rate = 120; refresh-rate = 120;
#+END_SRC #+END_SRC
Limit picom to repaint at most once every 1 / ~refresh_rate~ second to boost Limit picom to repaint at most once every 1 / ~refresh_rate~ second to boost
performance. This should not be used with performance. This should not be used with
#+BEGIN_SRC text :tangle no #+BEGIN_SRC text :tangle no
vsync drm/opengl/opengl-oml vsync drm/opengl/opengl-oml
#+END_SRC #+END_SRC
as they essentially does sw-opti's job already, unless you wish to specify a as they essentially does sw-opti's job already, unless you wish to specify a
lower refresh rate than the actual value. lower refresh rate than the actual value.
| Default value | ~""~ | | Default value | ~""~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# sw-opti =; # sw-opti =;
#+END_SRC #+END_SRC
Use EWMH ~_NET_ACTIVE_WINDOW~ to determine currently focused window, rather than Use EWMH ~_NET_ACTIVE_WINDOW~ to determine currently focused window, rather than
@ -414,7 +414,7 @@ listening to ~FocusIn~/~FocusOut~ event. Might have more accuracy, provided that
the WM supports it. the WM supports it.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# use-ewmh-active-win = false; # use-ewmh-active-win = false;
#+END_SRC #+END_SRC
Unredirect all windows if a full-screen opaque window is detected, to maximize Unredirect all windows if a full-screen opaque window is detected, to maximize
@ -423,27 +423,27 @@ redirecting/unredirecting windows. paint-on-overlay may make the flickering less
obvious. obvious.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
unredir-if-possible = false; unredir-if-possible = false;
#+END_SRC #+END_SRC
Delay before unredirecting the window, in milliseconds. Delay before unredirecting the window, in milliseconds.
| Default value | ~0~ | | Default value | ~0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
unredir-if-possible-delay = 0; unredir-if-possible-delay = 0;
#+END_SRC #+END_SRC
Conditions of windows that shouldn't be considered full-screen for unredirecting Conditions of windows that shouldn't be considered full-screen for unredirecting
screen. screen.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
unredir-if-possible-exclude = []; unredir-if-possible-exclude = [];
#+END_SRC #+END_SRC
Use ~WM_TRANSIENT_FOR~ to group windows, and consider windows in the same group Use ~WM_TRANSIENT_FOR~ to group windows, and consider windows in the same group
focused at the same time. focused at the same time.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
detect-transient = true; detect-transient = true;
#+END_SRC #+END_SRC
Use ~WM_CLIENT_LEADER~ to group windows, and consider windows in the same group Use ~WM_CLIENT_LEADER~ to group windows, and consider windows in the same group
@ -451,7 +451,7 @@ focused at the same time. ~WM_TRANSIENT_FOR~ has higher priority if
detect-transient is enabled, too. detect-transient is enabled, too.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
detect-client-leader = true; detect-client-leader = true;
#+END_SRC #+END_SRC
Resize damaged region by a specific number of pixels. A positive value enlarges Resize damaged region by a specific number of pixels. A positive value enlarges
@ -465,14 +465,14 @@ you use ~--resize-damage 2~, and so on). May or may not work with
~--glx-no-stencil~. Shrinking doesn't function correctly. ~--glx-no-stencil~. Shrinking doesn't function correctly.
| Default value | ~1~ | | Default value | ~1~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
resize-damage = 1; resize-damage = 1;
#+END_SRC #+END_SRC
Specify a list of conditions of windows that should be painted with inverted Specify a list of conditions of windows that should be painted with inverted
color. Resource-hogging, and is not well tested. color. Resource-hogging, and is not well tested.
| Default value | ~[]~ | | Default value | ~[]~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
invert-color-include = []; invert-color-include = [];
#+END_SRC #+END_SRC
Disable the use of damage information. This cause the whole screen to be redrawn Disable the use of damage information. This cause the whole screen to be redrawn
@ -481,7 +481,7 @@ degrades the performance, but might fix some artifacts. The opposing option is
use-damage use-damage
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
use-damage = false; use-damage = false;
#+END_SRC #+END_SRC
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are Use X Sync fence to sync clients' draw calls, to make sure all draw calls are
@ -489,21 +489,21 @@ finished before picom starts drawing. Needed on nvidia-drivers with GLX backend
for some users. for some users.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
xrender-sync-fence = false; xrender-sync-fence = false;
#+END_SRC #+END_SRC
Force all windows to be painted with blending. Useful if you have a Force all windows to be painted with blending. Useful if you have a
glx-fshader-win that could turn opaque pixels transparent. glx-fshader-win that could turn opaque pixels transparent.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
force-win-blend = false; force-win-blend = false;
#+END_SRC #+END_SRC
Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is
fullscreen based only on its size and coordinates. fullscreen based only on its size and coordinates.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
no-ewmh-fullscreen = false; no-ewmh-fullscreen = false;
#+END_SRC #+END_SRC
Dimming bright windows so their brightness doesn't exceed this set value. Dimming bright windows so their brightness doesn't exceed this set value.
@ -512,14 +512,14 @@ this could comes with a performance hit. Setting this to 1.0 disables this
behaviour. Requires ~--use-damage~ to be disabled. behaviour. Requires ~--use-damage~ to be disabled.
| Default value | ~1.0~ | | Default value | ~1.0~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
max-brightness = 1.0; max-brightness = 1.0;
#+END_SRC #+END_SRC
Make transparent windows clip other windows like non-transparent windows do, Make transparent windows clip other windows like non-transparent windows do,
instead of blending on top of them. instead of blending on top of them.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
transparent-clipping = false; transparent-clipping = false;
#+END_SRC #+END_SRC
Set the log level. Possible values are: Set the log level. Possible values are:
@ -533,7 +533,7 @@ level, it's better to log into a file using ~--log-file~, since it can generate
a huge stream of logs. a huge stream of logs.
| Default value | ~"debug"~ | | Default value | ~"debug"~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
log-level = "warn"; log-level = "warn";
#+END_SRC #+END_SRC
Set the log file. If ~--log-file~ is never specified, logs will be written to Set the log file. If ~--log-file~ is never specified, logs will be written to
@ -542,19 +542,19 @@ early logs might still be written to the stderr. When setting this option from
the config file, it is recommended to use an absolute path. the config file, it is recommended to use an absolute path.
| Default value | ~''~ | | Default value | ~''~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# log-file = '/path/to/your/log/file'; # log-file = '/path/to/your/log/file';
#+END_SRC #+END_SRC
Show all X errors (for debugging) Show all X errors (for debugging)
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# show-all-xerrors = false; # show-all-xerrors = false;
#+END_SRC #+END_SRC
Write process ID to a file. Write process ID to a file.
| Default value | ~''~ | | Default value | ~''~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
# write-pid-path = '/path/to/your/log/file'; # write-pid-path = '/path/to/your/log/file';
#+END_SRC #+END_SRC
Window type settings. ~WINDOW_TYPE~ is one of the 15 window types defined in Window type settings. ~WINDOW_TYPE~ is one of the 15 window types defined in
@ -588,14 +588,14 @@ Following per window-type options are available:
unredir-if-possible set, and doesn't want certain window to cause unnecessary unredir-if-possible set, and doesn't want certain window to cause unnecessary
screen redirection, you can set this to `true`. screen redirection, you can set this to `true`.
#+BEGIN_SRC conf #+BEGIN_SRC conf
wintypes: wintypes:
{ {
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; } dock = { shadow = false; }
dnd = { shadow = false; } dnd = { shadow = false; }
popup_menu = { opacity = 0.8; } popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; } dropdown_menu = { opacity = 0.8; }
}; };
#+END_SRC #+END_SRC
** GLX backend-specific options ** GLX backend-specific options
@ -608,7 +608,7 @@ practically happened) and may not work with blur-background. Tests show a 15%
performance boost. Recommended. performance boost. Recommended.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
glx-no-stencil = true; glx-no-stencil = true;
#+END_SRC #+END_SRC
Avoid rebinding pixmap on window damage. Probably could improve performance on Avoid rebinding pixmap on window damage. Probably could improve performance on
@ -616,7 +616,7 @@ rapid window content changes, but is known to break things on some drivers
(LLVMpipe, xf86-video-intel, etc.). Recommended if it works. (LLVMpipe, xf86-video-intel, etc.). Recommended if it works.
| Default value | ~false~ | | Default value | ~false~ |
#+BEGIN_SRC conf #+BEGIN_SRC conf
glx-no-rebind-pixmap = false; glx-no-rebind-pixmap = false;
#+END_SRC #+END_SRC
Use specified GLSL fragment shader for rendering window contents. See Use specified GLSL fragment shader for rendering window contents. See
@ -624,5 +624,5 @@ Use specified GLSL fragment shader for rendering window contents. See
~compton-fake-transparency-fshader-win.glsl~ in the source tree for examples. ~compton-fake-transparency-fshader-win.glsl~ in the source tree for examples.
| Default value | ~''~ | | Default value | ~''~ |
#+BEGIN_SRC conf :tangle no #+BEGIN_SRC conf :tangle no
glx-fshader-win = ''; glx-fshader-win = '';
#+END_SRC #+END_SRC

View File

@ -20,23 +20,23 @@ you can find how my Rust code is always formatted.
:END: :END:
First, we are using the 2018 edition of Rust. First, we are using the 2018 edition of Rust.
#+BEGIN_SRC toml #+BEGIN_SRC toml
edition = "2018" edition = "2018"
#+END_SRC #+END_SRC
Put single-expression functions on a single line. Put single-expression functions on a single line.
#+BEGIN_SRC toml #+BEGIN_SRC toml
fn_single_line = true fn_single_line = true
#+END_SRC #+END_SRC
Format string literals where necessary. Format string literals where necessary.
#+BEGIN_SRC toml #+BEGIN_SRC toml
format_strings = true format_strings = true
#+END_SRC #+END_SRC
Maximum width of each line Maximum width of each line
#+BEGIN_SRC toml #+BEGIN_SRC toml
max_width = 80 max_width = 80
#+END_SRC #+END_SRC
Merge multiple imports into a single nested import. Merge multiple imports into a single nested import.
#+BEGIN_SRC toml #+BEGIN_SRC toml
merge_imports = true merge_imports = true
#+END_SRC #+END_SRC
* Structs and Enums * Structs and Enums
@ -50,15 +50,15 @@ purpose of alignment.
Note that this is not how much whitespace is inserted, but instead the longest Note that this is not how much whitespace is inserted, but instead the longest
variant name that doesn't get ignored when aligning. variant name that doesn't get ignored when aligning.
#+BEGIN_SRC toml #+BEGIN_SRC toml
enum_discrim_align_threshold = 20 enum_discrim_align_threshold = 20
#+END_SRC #+END_SRC
The maximum diff of width between struct fields to be aligned with each other. The maximum diff of width between struct fields to be aligned with each other.
#+BEGIN_SRC toml #+BEGIN_SRC toml
struct_field_align_threshold = 20 struct_field_align_threshold = 20
#+END_SRC #+END_SRC
Reorder impl items. ~type~ and ~const~ are put first, then macros and methods. Reorder impl items. ~type~ and ~const~ are put first, then macros and methods.
#+BEGIN_SRC toml #+BEGIN_SRC toml
reorder_impl_items = true reorder_impl_items = true
#+END_SRC #+END_SRC
* Comments * Comments
@ -67,19 +67,19 @@ Reorder impl items. ~type~ and ~const~ are put first, then macros and methods.
:END: :END:
Convert ~/* */~ comments to ~//~ comments where possible. Convert ~/* */~ comments to ~//~ comments where possible.
#+BEGIN_SRC toml #+BEGIN_SRC toml
normalize_comments = true normalize_comments = true
#+END_SRC #+END_SRC
Break comments to fit on the line. Break comments to fit on the line.
#+BEGIN_SRC toml #+BEGIN_SRC toml
wrap_comments = true wrap_comments = true
#+END_SRC #+END_SRC
Report ~FIXME~ items in comments. Report ~FIXME~ items in comments.
#+BEGIN_SRC toml #+BEGIN_SRC toml
report_fixme = "Always" report_fixme = "Always"
#+END_SRC #+END_SRC
Report ~TODO~ items in comments. Report ~TODO~ items in comments.
#+BEGIN_SRC toml #+BEGIN_SRC toml
todo = "Always" todo = "Always"
#+END_SRC #+END_SRC
* Documentation * Documentation
@ -88,11 +88,11 @@ Report ~TODO~ items in comments.
:END: :END:
Format code snippet included in doc comments. Format code snippet included in doc comments.
#+BEGIN_SRC toml #+BEGIN_SRC toml
format_code_in_doc_comments = true format_code_in_doc_comments = true
#+END_SRC #+END_SRC
Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments. Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
#+BEGIN_SRC toml #+BEGIN_SRC toml
normalize_doc_attributes = true normalize_doc_attributes = true
#+END_SRC #+END_SRC
* Whitespace * Whitespace
@ -101,13 +101,13 @@ Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
:END: :END:
Use tab characters for indentation, spaces for alignment. Use tab characters for indentation, spaces for alignment.
#+BEGIN_SRC toml #+BEGIN_SRC toml
hard_tabs = false hard_tabs = false
#+END_SRC #+END_SRC
Number of spaces per tab. Number of spaces per tab.
#+BEGIN_SRC toml #+BEGIN_SRC toml
tab_spaces = 4 tab_spaces = 4
#+END_SRC #+END_SRC
I want newlines to always be Unix style. I want newlines to always be Unix style.
#+BEGIN_SRC toml #+BEGIN_SRC toml
newline_style = "Unix" newline_style = "Unix"
#+END_SRC #+END_SRC

File diff suppressed because it is too large Load Diff

View File

@ -92,11 +92,11 @@ different locations, but I chose an Emacs-like configuration: put
everything in ~~/.stumpwm.d/~. We begin by indicating quicklisp how to everything in ~~/.stumpwm.d/~. We begin by indicating quicklisp how to
properly initialize: properly initialize:
#+begin_src lisp #+begin_src lisp
#-quicklisp #-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname)))) (user-homedir-pathname))))
(when (probe-file quicklisp-init) (when (probe-file quicklisp-init)
(load quicklisp-init))) (load quicklisp-init)))
#+end_src #+end_src
Then, our first StumpWM-related code is declaring we are using the Then, our first StumpWM-related code is declaring we are using the
@ -104,15 +104,15 @@ Then, our first StumpWM-related code is declaring we are using the
us to avoid using the prefix ~stumpwm:~ each time we are using a us to avoid using the prefix ~stumpwm:~ each time we are using a
function or a variable from this package. function or a variable from this package.
#+begin_src lisp #+begin_src lisp
(in-package :stumpwm) (in-package :stumpwm)
(setf *default-package* :stumpwm) (setf *default-package* :stumpwm)
#+end_src #+end_src
Since I install StumpWM with my package manager (I use the AURs Since I install StumpWM with my package manager (I use the AURs
~stumpwm-git~ package), StumpWMs modules are installed to ~stumpwm-git~ package), StumpWMs modules are installed to
~/usr/share/stupmwm/contrib/utils/~, lets indicate that to StumpWM. ~/usr/share/stupmwm/contrib/utils/~, lets indicate that to StumpWM.
#+begin_src lisp #+begin_src lisp
(set-module-dir "/usr/share/stupmwm/contrib/") (set-module-dir "/usr/share/stupmwm/contrib/")
#+end_src #+end_src
A startup message can be used when initializing StumpWM. For now, A startup message can be used when initializing StumpWM. For now,
@ -125,8 +125,8 @@ The first thing I want to do after that is to set some decent cursor
pointer as well as get a bunch of stuff started. To see whats in the pointer as well as get a bunch of stuff started. To see whats in the
~autostart~ script, [[file:bin.org::#Autostart-a99e99e7][see here]]. ~autostart~ script, [[file:bin.org::#Autostart-a99e99e7][see here]].
#+begin_src lisp #+begin_src lisp
(run-shell-command "xsetroot -cursor_name left_ptr") (run-shell-command "xsetroot -cursor_name left_ptr")
(run-shell-command "autostart") (run-shell-command "autostart")
#+end_src #+end_src
Now, well load a couple of my custom files that will be described below: Now, well load a couple of my custom files that will be described below:
@ -142,10 +142,10 @@ Now, well load a couple of my custom files that will be described below:
#+name: gen-load-files #+name: gen-load-files
#+headers: :wrap src lisp #+headers: :wrap src lisp
#+begin_src emacs-lisp :var files=first-loaded-files #+begin_src emacs-lisp :var files=first-loaded-files
(mapconcat (lambda (file) (mapconcat (lambda (file)
(format "(load \"~/.stumpwm.d/%s\")" (car file))) (format "(load \"~/.stumpwm.d/%s\")" (car file)))
files files
"\n") "\n")
#+end_src #+end_src
This is equivalent to the Common Lisp code: This is equivalent to the Common Lisp code:
@ -161,8 +161,8 @@ This is equivalent to the Common Lisp code:
Once the modeline file is loaded, lets indicate StumpWM to activate Once the modeline file is loaded, lets indicate StumpWM to activate
it: it:
#+begin_src lisp #+begin_src lisp
(when *initializing* (when *initializing*
(mode-line)) (mode-line))
#+end_src #+end_src
Another thing I want to set is how focus is linked to my mouse: only Another thing I want to set is how focus is linked to my mouse: only
@ -170,8 +170,8 @@ on click. I /HATE/ it when focus follows my mouse like some damn dog
after its ball. Also, the meta key will be used to move floating after its ball. Also, the meta key will be used to move floating
windows. windows.
#+begin_src lisp #+begin_src lisp
(setf *mouse-focus-policy* :click (setf *mouse-focus-policy* :click
,*float-window-modifier* :META) ,*float-window-modifier* :META)
#+end_src #+end_src
Next, some modules will be loaded from the ~stumpwm-contrib~ package Next, some modules will be loaded from the ~stumpwm-contrib~ package
@ -190,10 +190,10 @@ including a short description of what they are for:
#+name: gen-load-modules #+name: gen-load-modules
#+headers: :wrap src lisp #+headers: :wrap src lisp
#+begin_src emacs-lisp :var modules=loaded-modules #+begin_src emacs-lisp :var modules=loaded-modules
(mapconcat (lambda (module) (mapconcat (lambda (module)
(format "(load-module \"%s\")" (car module))) (format "(load-module \"%s\")" (car module)))
modules modules
"\n") "\n")
#+end_src #+end_src
#+RESULTS[508e36f9747f1da901bbee63582416a8a6ba2c2f]: gen-load-modules #+RESULTS[508e36f9747f1da901bbee63582416a8a6ba2c2f]: gen-load-modules
@ -208,7 +208,7 @@ including a short description of what they are for:
Finally, we can notify the user everything is ready. Finally, we can notify the user everything is ready.
#+begin_src lisp #+begin_src lisp
(setf *startup-message* "StumpWM is ready!") (setf *startup-message* "StumpWM is ready!")
#+end_src #+end_src
And its done! We can now move on to the creation of the other CLisp files. And its done! We can now move on to the creation of the other CLisp files.
@ -223,42 +223,42 @@ me invoking too many Firefox instances. Either Firefox is not already
running and an instance is launched, or one already is and we are running and an instance is launched, or one already is and we are
brought to it. This is done like so: brought to it. This is done like so:
#+begin_src lisp #+begin_src lisp
(defcommand firefox () () (defcommand firefox () ()
"Run or raise Firefox." "Run or raise Firefox."
(run-or-raise "firefox" '(:class "Firefox") t nil)) (run-or-raise "firefox" '(:class "Firefox") t nil))
#+end_src #+end_src
Next, this command will not only close the current window, but it will Next, this command will not only close the current window, but it will
also close the current frame. also close the current frame.
#+begin_src lisp #+begin_src lisp
(defcommand delete-window-and-frame () () (defcommand delete-window-and-frame () ()
"Delete the current frame with its window." "Delete the current frame with its window."
(delete-window) (delete-window)
(remove-split)) (remove-split))
#+end_src #+end_src
The two following commands will create a new frame to the right and The two following commands will create a new frame to the right and
below the current frame respectively, then focus it. below the current frame respectively, then focus it.
#+begin_src lisp #+begin_src lisp
(defcommand hsplit-and-focus () () (defcommand hsplit-and-focus () ()
"Create a new frame on the right and focus it." "Create a new frame on the right and focus it."
(hsplit) (hsplit)
(move-focus :right)) (move-focus :right))
(defcommand vsplit-and-focus () () (defcommand vsplit-and-focus () ()
"Create a new frame below and move focus to it." "Create a new frame below and move focus to it."
(vsplit) (vsplit)
(move-focus :down)) (move-focus :down))
#+end_src #+end_src
Now, lets create a command for invoking the terminal, optionally with Now, lets create a command for invoking the terminal, optionally with
a program. a program.
#+begin_src lisp #+begin_src lisp
(defcommand term (&optional program) () (defcommand term (&optional program) ()
"Invoke a terminal, possibly with a @arg{program}." "Invoke a terminal, possibly with a @arg{program}."
(run-shell-command (if program (run-shell-command (if program
(format nil "kitty ~A" program) (format nil "kitty ~A" program)
"kitty"))) "kitty")))
#+end_src #+end_src
And done! Next! And done! Next!
@ -297,10 +297,10 @@ code looks like so:
#+name: gen-colors #+name: gen-colors
#+headers: :wrap src lisp #+headers: :wrap src lisp
#+begin_src emacs-lisp :var colors=nord-colors #+begin_src emacs-lisp :var colors=nord-colors
(mapconcat (lambda (color) (mapconcat (lambda (color)
(format "(defvar phundrak-%s \"%s\")" (car color) (cadr color))) (format "(defvar phundrak-%s \"%s\")" (car color) (cadr color)))
colors colors
"\n") "\n")
#+end_src #+end_src
#+RESULTS[08b3db7a2b4f31d641bcd096ff265eae06879244]: gen-colors #+RESULTS[08b3db7a2b4f31d641bcd096ff265eae06879244]: gen-colors
@ -332,45 +332,45 @@ And with that were done!
:END: :END:
The modeline is pretty easy. First, lets load the ~colors.lisp~ file we just created: The modeline is pretty easy. First, lets load the ~colors.lisp~ file we just created:
#+begin_src lisp #+begin_src lisp
(load "~/.stumpwm.d/colors.lisp") (load "~/.stumpwm.d/colors.lisp")
#+end_src #+end_src
Next, we can set some colors for the modeline. Lets set the Next, we can set some colors for the modeline. Lets set the
background of the modeline to Nord1 and the foreground to Nord5, I background of the modeline to Nord1 and the foreground to Nord5, I
think this is a pretty good combination. think this is a pretty good combination.
#+begin_src lisp #+begin_src lisp
(setf *mode-line-background-color* phundrak-nord1 (setf *mode-line-background-color* phundrak-nord1
,*mode-line-foreground-color* phundrak-nord5) ,*mode-line-foreground-color* phundrak-nord5)
#+end_src #+end_src
We /could/ also use some borders in the modeline. But we wont. Lets We /could/ also use some borders in the modeline. But we wont. Lets
still set its color to Nord1, just in case. still set its color to Nord1, just in case.
#+begin_src lisp #+begin_src lisp
(setf *mode-line-border-color* phundrak-nord1 (setf *mode-line-border-color* phundrak-nord1
,*mode-line-border-width* 0) ,*mode-line-border-width* 0)
#+end_src #+end_src
The timeout of the modeline indicates how often it refreshes in The timeout of the modeline indicates how often it refreshes in
seconds. I think one second is good. seconds. I think one second is good.
#+begin_src lisp #+begin_src lisp
(setf *mode-line-timeout* 1) (setf *mode-line-timeout* 1)
#+end_src #+end_src
Next we get to the content of the modeline. This format follows the Next we get to the content of the modeline. This format follows the
format indicated in the manpage of ~date~. format indicated in the manpage of ~date~.
#+begin_src lisp #+begin_src lisp
(setf *time-modeline-string* "%F %H:%M") (setf *time-modeline-string* "%F %H:%M")
#+end_src #+end_src
Lets also indicate how the groupname is displayed. Lets also indicate how the groupname is displayed.
#+begin_src lisp #+begin_src lisp
(setf *group-format* "%t") (setf *group-format* "%t")
#+end_src #+end_src
The window format should display first its window number, then its The window format should display first its window number, then its
titled, limited to 30 characters. titled, limited to 30 characters.
#+begin_src lisp #+begin_src lisp
(setf *window-format* "%n: %30t") (setf *window-format* "%n: %30t")
#+end_src #+end_src
Here are some modules that we will load for the modeline: Here are some modules that we will load for the modeline:
@ -384,10 +384,10 @@ Here are some modules that we will load for the modeline:
#+name: gen-load-modeline-modules #+name: gen-load-modeline-modules
#+headers: :wrap src lisp #+headers: :wrap src lisp
#+begin_src emacs-lisp :var modules=modeline-modules #+begin_src emacs-lisp :var modules=modeline-modules
(mapconcat (lambda (module) (mapconcat (lambda (module)
(format "(load-module \"%s\")" (car module))) (format "(load-module \"%s\")" (car module)))
modules modules
"\n") "\n")
#+end_src #+end_src
#+RESULTS[75023085d7c69ae09044826218830e6b678d5959]: gen-load-modeline-modules #+RESULTS[75023085d7c69ae09044826218830e6b678d5959]: gen-load-modeline-modules
@ -405,7 +405,7 @@ highlighted, and ~%u~ will display urgent windows if there are any. ~%d~
on the other hand will display the date in the format set above, while on the other hand will display the date in the format set above, while
~%B~ will display the battery level of the laptop. ~%B~ will display the battery level of the laptop.
#+begin_src lisp #+begin_src lisp
(setf *screen-mode-line-format* (list "%g %v %u ^> %C | %M | %B | %d")) (setf *screen-mode-line-format* (list "%g %v %u ^> %C | %M | %B | %d"))
#+end_src #+end_src
This variable as you can see is a list of elements, although here I am This variable as you can see is a list of elements, although here I am
@ -455,22 +455,22 @@ is the list of groups I will be using:
#+name: gen-groups #+name: gen-groups
#+headers: :exports none #+headers: :exports none
#+begin_src emacs-lisp :var groups=list-groups #+begin_src emacs-lisp :var groups=list-groups
(let ((make-group (lambda (group &optional first-p) (let ((make-group (lambda (group &optional first-p)
(let ((group-name (car group)) (let ((group-name (car group))
(group-type (nth 3 group))) (group-type (nth 3 group)))
(format "(%s \"%s\")" (format "(%s \"%s\")"
(if first-p (if first-p
"grename" "grename"
(pcase group-type (pcase group-type
("Dynamic" "gnewbg-dynamic") ("Dynamic" "gnewbg-dynamic")
("Floating" "gnewbg-float") ("Floating" "gnewbg-float")
(otherwise "gnewbg"))) (otherwise "gnewbg")))
group-name))))) group-name)))))
(string-join `(,(funcall make-group (car groups) t) (string-join `(,(funcall make-group (car groups) t)
,@(mapcar (lambda (group) ,@(mapcar (lambda (group)
(funcall make-group group)) (funcall make-group group))
(cdr groups))) (cdr groups)))
"\n")) "\n"))
#+end_src #+end_src
#+RESULTS[22540ee038b7206f965b7ca48521e93bdccb5de8]: gen-groups #+RESULTS[22540ee038b7206f965b7ca48521e93bdccb5de8]: gen-groups
@ -485,8 +485,8 @@ is the list of groups I will be using:
Groups are specified this way: Groups are specified this way:
#+begin_src lisp #+begin_src lisp
(when *initializing* (when *initializing*
<<gen-groups()>>) <<gen-groups()>>)
#+end_src #+end_src
By default, if nothing is specified as per the group type, my groups By default, if nothing is specified as per the group type, my groups
@ -496,7 +496,7 @@ also be dynamic tiling groups or floating groups.
Next, lets make sure no previous window placement rule is in place, Next, lets make sure no previous window placement rule is in place,
this will avoid unexpected and hard-to-debug behavior. this will avoid unexpected and hard-to-debug behavior.
#+begin_src lisp #+begin_src lisp
(clear-window-placement-rules) (clear-window-placement-rules)
#+end_src #+end_src
As you can see in the table [[list-groups]] above, I also indicated my As you can see in the table [[list-groups]] above, I also indicated my
@ -505,27 +505,27 @@ class, so it will be pretty straightforward to the corresponding code.
#+name: gen-rules #+name: gen-rules
#+headers: :wrap src lisp #+headers: :wrap src lisp
#+begin_src emacs-lisp :var rules=list-groups #+begin_src emacs-lisp :var rules=list-groups
(require 'seq) (require 'seq)
(let ((output "") (let ((output "")
(rules (seq-filter (lambda (rule) rule) (rules (seq-filter (lambda (rule) rule)
(mapcar (lambda (line) (mapcar (lambda (line)
(let ((classes (caddr line))) (let ((classes (caddr line)))
(unless (string= "" classes) (unless (string= "" classes)
(cons (cons
(split-string classes "," t "[[:space:]]*") (split-string classes "," t "[[:space:]]*")
(car line))))) (car line)))))
rules)))) rules))))
(progn (progn
(seq-do (lambda (rule) (seq-do (lambda (rule)
(let ((classes (car rule)) (let ((classes (car rule))
(group (cdr rule))) (group (cdr rule)))
(dolist (class classes) (dolist (class classes)
(setf output (format "%s\n%s" (setf output (format "%s\n%s"
`(define-frame-preference ,(format "\"%s\"" group) `(define-frame-preference ,(format "\"%s\"" group)
(nil t t :class ,(format "\"%s\"" class))) (nil t t :class ,(format "\"%s\"" class)))
output))))) output)))))
rules) rules)
output)) output))
#+end_src #+end_src
This can be written this way: This can be written this way:
@ -550,28 +550,28 @@ three terminal windows to open by default:
- and two terminals - and two terminals
This can be done like so: This can be done like so:
#+begin_src lisp #+begin_src lisp
(defun my-term-init (current-group _last-group) (defun my-term-init (current-group _last-group)
"Create terminals in the first group when none are already there." "Create terminals in the first group when none are already there."
(let ((term-group (select-group (current-screen) "2")) (let ((term-group (select-group (current-screen) "2"))
(windows (group-windows current-group))) (windows (group-windows current-group)))
(when (and (equal current-group term-group) (when (and (equal current-group term-group)
(null windows)) (null windows))
(unless (= 1 (length (group-frames current-group))) (unless (= 1 (length (group-frames current-group)))
(only)) (only))
(term "htop") (term "htop")
(term) (term)
(term)))) (term))))
#+end_src #+end_src
Lets add a hook for that now: Lets add a hook for that now:
#+begin_src lisp #+begin_src lisp
(add-hook *focus-group-hook* 'my-term-init) (add-hook *focus-group-hook* 'my-term-init)
#+end_src #+end_src
By the way, dynamic groups should have a split ratio of half of the By the way, dynamic groups should have a split ratio of half of the
available space. available space.
#+begin_src lisp #+begin_src lisp
(setf *dynamic-group-master-split-ratio* 1/2) (setf *dynamic-group-master-split-ratio* 1/2)
#+end_src #+end_src
* Theme * Theme
@ -581,7 +581,7 @@ available space.
:END: :END:
As in the modeline file, the first thing well do is to load our colors. As in the modeline file, the first thing well do is to load our colors.
#+begin_src lisp #+begin_src lisp
(load "~/.stumpwm.d/colors.lisp") (load "~/.stumpwm.d/colors.lisp")
#+end_src #+end_src
We can now go onto more serious business. We can now go onto more serious business.
@ -599,9 +599,9 @@ Theres a quickfix available while we wait for ~clx-truetype~ to be once
again available: clone it in quicklisps local projects. You will again available: clone it in quicklisps local projects. You will
obviously need to have quicklisp installed (for that, follow the obviously need to have quicklisp installed (for that, follow the
[[https://www.quicklisp.org/beta/#installation][official instructions]]), then execute the following shell commands: [[https://www.quicklisp.org/beta/#installation][official instructions]]), then execute the following shell commands:
#+begin_src sh #+begin_src sh :dir ~/quicklisp/local-projects
cd ~/quicklisp/local-projects/ cd ~/quicklisp/local-projects/
git clone https://github.com/lihebi/clx-truetype.git git clone https://github.com/lihebi/clx-truetype.git
#+end_src #+end_src
This will make ~clx-truetype~ available to quicklisp, and you can run This will make ~clx-truetype~ available to quicklisp, and you can run
@ -611,8 +611,8 @@ issue (running it again is necessary to install its dependencies).
Now that this is out of the way, lets add two lines so we can use TTF Now that this is out of the way, lets add two lines so we can use TTF
fonts: fonts:
#+begin_src lisp #+begin_src lisp
(ql:quickload :clx-truetype) (ql:quickload :clx-truetype)
(load-module "ttf-fonts") (load-module "ttf-fonts")
#+end_src #+end_src
The documentation says we should be able to also use OTF fonts, but so The documentation says we should be able to also use OTF fonts, but so
far Ive had no luck loading one. Loading more than one font to use far Ive had no luck loading one. Loading more than one font to use
@ -636,18 +636,18 @@ work).
#+name: gen-fonts #+name: gen-fonts
#+headers: :wrap src lisp #+headers: :wrap src lisp
#+begin_src emacs-lisp :var fonts=list-fonts #+begin_src emacs-lisp :var fonts=list-fonts
(format "(set-font `(%s))" (format "(set-font `(%s))"
(mapconcat (lambda (font) (mapconcat (lambda (font)
(let ((family (nth 0 font)) (let ((family (nth 0 font))
(subfamily (nth 1 font)) (subfamily (nth 1 font))
(size (nth 2 font))) (size (nth 2 font)))
(format ",%s" `(make-instance 'xft:font (format ",%s" `(make-instance 'xft:font
:family ,(format "\"%s\"" family) :family ,(format "\"%s\"" family)
:subfamily ,(format "\"%s\"" subfamily) :subfamily ,(format "\"%s\"" subfamily)
:size ,size :size ,size
:antialias t)))) :antialias t))))
fonts fonts
"\n ")) "\n "))
#+end_src #+end_src
The code equivalent of this table can be seen below: The code equivalent of this table can be seen below:
@ -671,17 +671,17 @@ We can now set a couple of colors for StumpWM. Not that we will see
them often since I dont like borders on my windows, but in case I them often since I dont like borders on my windows, but in case I
want to get them back, theyll be nice to have. want to get them back, theyll be nice to have.
#+begin_src lisp #+begin_src lisp
(set-border-color phundrak-nord1) (set-border-color phundrak-nord1)
(set-focus-color phundrak-nord1) (set-focus-color phundrak-nord1)
(set-unfocus-color phundrak-nord3) (set-unfocus-color phundrak-nord3)
(set-float-focus-color phundrak-nord1) (set-float-focus-color phundrak-nord1)
(set-float-unfocus-color phundrak-nord3) (set-float-unfocus-color phundrak-nord3)
#+end_src #+end_src
Lets also set the colors of the message and input windows: Lets also set the colors of the message and input windows:
#+begin_src lisp #+begin_src lisp
(set-fg-color phundrak-nord4) (set-fg-color phundrak-nord4)
(set-bg-color phundrak-nord1) (set-bg-color phundrak-nord1)
#+end_src #+end_src
As I said, I dont like borders, so Ill remove them. Ill still keep As I said, I dont like borders, so Ill remove them. Ill still keep
@ -689,11 +689,11 @@ the windows title bar available when its floating, and this is also
where I can set the format of its title: its number as well as its where I can set the format of its title: its number as well as its
name, limited to thirty characters. name, limited to thirty characters.
#+begin_src lisp #+begin_src lisp
(setf *normal-border-width* 0 (setf *normal-border-width* 0
,*float-window-border* 0 ,*float-window-border* 0
,*float-window-title-height* 15 ,*float-window-title-height* 15
,*window-border-style* :none ,*window-border-style* :none
,*window-format* "%n:%30t") ,*window-format* "%n:%30t")
#+end_src #+end_src
** Message and Input Windows ** Message and Input Windows
@ -704,10 +704,10 @@ The Input windows as well as the message windows should both be at the
top of my screen. And I believe a padding of five pixels for the top of my screen. And I believe a padding of five pixels for the
message windows is good. message windows is good.
#+begin_src lisp #+begin_src lisp
(setf *input-window-gravity* :top (setf *input-window-gravity* :top
,*message-window-padding* 10 ,*message-window-padding* 10
,*message-window-y-padding* 10 ,*message-window-y-padding* 10
,*message-window-gravity* :top) ,*message-window-gravity* :top)
#+end_src #+end_src
** Gaps Between Frames ** Gaps Between Frames
@ -719,21 +719,21 @@ plain ~i3~. In Awesome, I still have gaps. And in StumpWM, I shall still
use gaps. In order to use them, lets load a module dedicated to gaps use gaps. In order to use them, lets load a module dedicated to gaps
in StumpWM: in StumpWM:
#+begin_src lisp #+begin_src lisp
(load-module "swm-gaps") (load-module "swm-gaps")
#+end_src #+end_src
Now that this is done, I can now set some variables bound to this Now that this is done, I can now set some variables bound to this
package. package.
#+begin_src lisp #+begin_src lisp
(setf swm-gaps:*head-gaps-size* 0 (setf swm-gaps:*head-gaps-size* 0
swm-gaps:*inner-gaps-size* 5 swm-gaps:*inner-gaps-size* 5
swm-gaps:*outer-gaps-size* 15) swm-gaps:*outer-gaps-size* 15)
#+end_src #+end_src
Finally, lets enable our gaps: Finally, lets enable our gaps:
#+begin_src lisp #+begin_src lisp
(when *initializing* (when *initializing*
(swm-gaps:toggle-gaps)) (swm-gaps:toggle-gaps))
#+end_src #+end_src
* Keybinds * Keybinds
@ -745,7 +745,7 @@ Buckle up, this chapter is going to be *long*, because me loves LOTS of keybinds
First, lets declare again we are using the default package ~stumpwm~: First, lets declare again we are using the default package ~stumpwm~:
#+begin_src lisp #+begin_src lisp
(in-package :stumpwm) (in-package :stumpwm)
#+end_src #+end_src
This will avoid us always repeating ~stumpwm:define-key~ or ~stumpwm:kbd~ This will avoid us always repeating ~stumpwm:define-key~ or ~stumpwm:kbd~
@ -785,12 +785,12 @@ it with ~set-prefix-key~. I personally like to have my space key as a
leader key, but in order to not have it conflict with Emacs, I also leader key, but in order to not have it conflict with Emacs, I also
need to press the super key too. need to press the super key too.
#+begin_src lisp #+begin_src lisp
(set-prefix-key (kbd "s-SPC")) (set-prefix-key (kbd "s-SPC"))
#+end_src #+end_src
Also, lets enable ~which-key~: Also, lets enable ~which-key~:
#+begin_src lisp #+begin_src lisp
(which-key-mode) (which-key-mode)
#+end_src #+end_src
Lastly, before we get more into details, keep in mind that I use the Lastly, before we get more into details, keep in mind that I use the
@ -843,10 +843,10 @@ First, lets create my ~rofi~ scripts keymap.
Heres the equivalent in Common Lisp. Heres the equivalent in Common Lisp.
#+begin_src lisp #+begin_src lisp
(defvar *my-rofi-keymap* (defvar *my-rofi-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=rofi-scripts)>> <<keybinds-gen(map="m", keybinds=rofi-scripts)>>
m)) m))
#+end_src #+end_src
Lets also create a keymap for screenshots. Lets also create a keymap for screenshots.
@ -861,10 +861,10 @@ Lets also create a keymap for screenshots.
Heres the equivalent in Common Lisp. Heres the equivalent in Common Lisp.
#+begin_src lisp #+begin_src lisp
(defvar *my-screenshot-keymap* (defvar *my-screenshot-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=screenshot-keymap)>> <<keybinds-gen(map="m", keybinds=screenshot-keymap)>>
m)) m))
#+end_src #+end_src
We can now define our applications keymap which will reference both We can now define our applications keymap which will reference both
@ -883,22 +883,22 @@ the above keymaps.
This translates to: This translates to:
#+begin_src lisp #+begin_src lisp
(defvar *my-applications-keymap* (defvar *my-applications-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=application-keymap)>> <<keybinds-gen(map="m", keybinds=application-keymap)>>
m)) m))
#+end_src #+end_src
The application keymap can now be bound to the root map like so: The application keymap can now be bound to the root map like so:
#+begin_src lisp #+begin_src lisp
(define-key *root-map* (kbd "a") '*my-applications-keymap*) (define-key *root-map* (kbd "a") '*my-applications-keymap*)
#+end_src #+end_src
I will also bind to the top map ~s-RET~ in order to open a new terminal I will also bind to the top map ~s-RET~ in order to open a new terminal
window. The screenshot keymap is also bound to the ScreenPrint key. window. The screenshot keymap is also bound to the ScreenPrint key.
#+begin_src lisp #+begin_src lisp
(define-key *top-map* (kbd "s-RET") "term") (define-key *top-map* (kbd "s-RET") "term")
(define-key *top-map* (kbd "Print") '*my-screenshot-keymap*) (define-key *top-map* (kbd "Print") '*my-screenshot-keymap*)
#+end_src #+end_src
** End of Session, Powering Off, and the Likes ** End of Session, Powering Off, and the Likes
@ -922,15 +922,15 @@ whishes to do.
This translates to: This translates to:
#+begin_src lisp #+begin_src lisp
(defvar *my-end-session-keymap* (defvar *my-end-session-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=end-session-keymap)>> <<keybinds-gen(map="m", keybinds=end-session-keymap)>>
m)) m))
#+end_src #+end_src
Which is bound in the root map to ~q~: Which is bound in the root map to ~q~:
#+begin_src lisp #+begin_src lisp
(define-key *root-map* (kbd "q") '*my-end-session-keymap*) (define-key *root-map* (kbd "q") '*my-end-session-keymap*)
#+end_src #+end_src
** Groups ** Groups
@ -945,21 +945,18 @@ this:
#+name: group-keybind-gen #+name: group-keybind-gen
#+header: :noweb no :results verbatim :exports none :var convert="no" #+header: :noweb no :results verbatim :exports none :var convert="no"
#+begin_src emacs-lisp :var groups=list-groups mod="s" action="gselect" map="*top-map*" convert="yes" #+begin_src emacs-lisp :var groups=list-groups mod="s" action="gselect" map="*top-map*" convert="yes"
(mapconcat (lambda (group) (mapconcat (lambda (group)
(let ((group-nbr (nth 1 group))) (let ((group-nbr (nth 1 group)))
(format "%S" `(define-key (format "%S" `(define-key
,(make-symbol map) ,(make-symbol map)
;; (kbd ,(if (string= convert "yes") (kbd ,(format "%s-%s"
;; (format "%s-<<num-to-char(num=%s)>>" mod group-nbr) mod
;; (number-to-string group-nbr))) (if (string= "yes" convert)
(kbd ,(format "%s-%s" (format "<<num-to-char(num=%s)>>" group-nbr)
mod (number-to-string group-nbr))))
(if (string= "yes" convert) ,(format "%s %d" action group-nbr)))))
(format "<<num-to-char(num=%s)>>" group-nbr) groups
(number-to-string group-nbr)))) "\n")
,(format "%s %d" action group-nbr)))))
groups
"\n")
#+end_src #+end_src
#+RESULTS[09b139b0e127a88b3e4e2a05a609ccfcb7825b3c]: group-keybind-gen #+RESULTS[09b139b0e127a88b3e4e2a05a609ccfcb7825b3c]: group-keybind-gen
@ -974,7 +971,7 @@ this:
#+header: :cache yes :noweb yes :wrap src lisp #+header: :cache yes :noweb yes :wrap src lisp
#+begin_src emacs-lisp #+begin_src emacs-lisp
<<group-keybind-gen(mod="s", action="gselect", convert="yes")>> <<group-keybind-gen(mod="s", action="gselect", convert="yes")>>
#+end_src #+end_src
#+RESULTS[627ef5c7e456944dd624c322529699e11f2a041b]: #+RESULTS[627ef5c7e456944dd624c322529699e11f2a041b]:
@ -995,7 +992,7 @@ of the group/. As mentioned before, due to my keyboard layout Shift +
/number/ is actually just /number/ for me (e.g. Shift + ~"~ results in ~1~), /number/ is actually just /number/ for me (e.g. Shift + ~"~ results in ~1~),
so theres no need to convert the group number to another character. so theres no need to convert the group number to another character.
#+begin_src emacs-lisp :wrap src lisp #+begin_src emacs-lisp :wrap src lisp
<<group-keybind-gen(mod="s", action="gmove-and-follow", convert="no")>> <<group-keybind-gen(mod="s", action="gmove-and-follow", convert="no")>>
#+end_src #+end_src
#+RESULTS[6577510905e5cce124ff563a6d68a7f64fc8683c]: #+RESULTS[6577510905e5cce124ff563a6d68a7f64fc8683c]:
@ -1012,7 +1009,7 @@ so theres no need to convert the group number to another character.
If I want to send a window to another group without following it, Ill If I want to send a window to another group without following it, Ill
use ~s-S-C-<group number>~, which gives us the following: use ~s-S-C-<group number>~, which gives us the following:
#+begin_src emacs-lisp :wrap src lisp #+begin_src emacs-lisp :wrap src lisp
<<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="no")>> <<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="no")>>
#+end_src #+end_src
#+RESULTS[55852a5a035c23f078ba0a97120151c059fa955f]: #+RESULTS[55852a5a035c23f078ba0a97120151c059fa955f]:
@ -1029,7 +1026,7 @@ use ~s-S-C-<group number>~, which gives us the following:
And if I want to bring the windows of another group into the current And if I want to bring the windows of another group into the current
group, Ill use ~s-C-<group number>~: group, Ill use ~s-C-<group number>~:
#+begin_src emacs-lisp :wrap src lisp :exports results #+begin_src emacs-lisp :wrap src lisp :exports results
<<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="yes")>> <<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="yes")>>
#+end_src #+end_src
#+RESULTS[b536bb0359e6e9e10e98635c82bed3d348d75ac5]: #+RESULTS[b536bb0359e6e9e10e98635c82bed3d348d75ac5]:
@ -1048,19 +1045,19 @@ StumpWM also has already a nice keymap for managing groups called
already bound, but since I plan on erasing ~*root-map*~ in the near already bound, but since I plan on erasing ~*root-map*~ in the near
future before binding stuff to it, I prefer to bind it already) future before binding stuff to it, I prefer to bind it already)
#+begin_src lisp #+begin_src lisp
(define-key *root-map* (kbd "g") '*groups-map*) (define-key *root-map* (kbd "g") '*groups-map*)
#+end_src #+end_src
And a binding to ~vgroups~ is done on ~*groups-map*~ in order to regroup And a binding to ~vgroups~ is done on ~*groups-map*~ in order to regroup
similar keybinds. similar keybinds.
#+begin_src lisp #+begin_src lisp
(define-key *groups-map* (kbd "G") "vgroups") (define-key *groups-map* (kbd "G") "vgroups")
#+end_src #+end_src
I grew accustomed to ~s-ESC~ bringing me to the previous group when I grew accustomed to ~s-ESC~ bringing me to the previous group when
using AwesomeWM, so lets define that: using AwesomeWM, so lets define that:
#+begin_src lisp #+begin_src lisp
(define-key *top-map* (kbd "s-ESC") "gother") (define-key *top-map* (kbd "s-ESC") "gother")
#+end_src #+end_src
** Frames and Windows management ** Frames and Windows management
@ -1125,20 +1122,20 @@ ourselves in ~*my-frames-management-keymap*~, pressing ~F~ will bring us
in ~*my-frames-float-keymap*~. in ~*my-frames-float-keymap*~.
#+begin_src lisp #+begin_src lisp
(defvar *my-frames-float-keymap* (defvar *my-frames-float-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=frames-float)>> <<keybinds-gen(map="m", keybinds=frames-float)>>
m)) m))
(defvar *my-frames-management-keymap* (defvar *my-frames-management-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=frames-and-window-management)>> <<keybinds-gen(map="m", keybinds=frames-and-window-management)>>
m)) m))
#+end_src #+end_src
Lets bind ~*my-frames-management-keymap*~ in ~*root-keymap*~: Lets bind ~*my-frames-management-keymap*~ in ~*root-keymap*~:
#+begin_src lisp #+begin_src lisp
(define-key *root-map* (kbd "w") '*my-frames-management-keymap*) (define-key *root-map* (kbd "w") '*my-frames-management-keymap*)
#+end_src #+end_src
That way, if we want for instance to split our current frame That way, if we want for instance to split our current frame
@ -1163,7 +1160,7 @@ I also bound a couple of these functions to the top keymap for easier access:
This translates to: This translates to:
#+begin_src lisp #+begin_src lisp
<<keybinds-gen(map="*top-map*", keybinds=top-window-map)>> <<keybinds-gen(map="*top-map*", keybinds=top-window-map)>>
#+end_src #+end_src
Being a [[https://bepo.fr/wiki/Accueil][bépo layout]] user, the ~hjkl~ keys dont exactly fit me, as you Being a [[https://bepo.fr/wiki/Accueil][bépo layout]] user, the ~hjkl~ keys dont exactly fit me, as you
@ -1171,19 +1168,19 @@ might have noticed with my use of ~ctsr~ which is its equivalent. Due to
this, the interactive keymap for ~iresize~ is not ideal for me, let me this, the interactive keymap for ~iresize~ is not ideal for me, let me
redefine it: redefine it:
#+begin_src lisp #+begin_src lisp
(define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize (define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize
:on-exit #'resize-unhide :on-exit #'resize-unhide
:abort-if #'abort-resize-p) :abort-if #'abort-resize-p)
((kbd "c") "resize-direction left") ((kbd "c") "resize-direction left")
((kbd "t") "resize-direction down") ((kbd "t") "resize-direction down")
((kbd "s") "resize-direction up") ((kbd "s") "resize-direction up")
((kbd "r") "resize-direction right")) ((kbd "r") "resize-direction right"))
#+end_src #+end_src
As with groups management, I grew used to ~s-TAB~ in AwesomeWM bringing As with groups management, I grew used to ~s-TAB~ in AwesomeWM bringing
me back to the previously focused window. me back to the previously focused window.
#+begin_src lisp #+begin_src lisp
(define-key *top-map* (kbd "s-TAB") "other-window") (define-key *top-map* (kbd "s-TAB") "other-window")
#+end_src #+end_src
** Windows management ** Windows management
@ -1206,12 +1203,12 @@ with Emacs buffers.
| ~p~ | ~prev~ | | ~p~ | ~prev~ |
#+begin_src lisp #+begin_src lisp
(defvar *my-buffers-management-keymap* (defvar *my-buffers-management-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=window-management)>> <<keybinds-gen(map="m", keybinds=window-management)>>
m)) m))
(define-key *root-map* (kbd "b") '*my-buffers-management-keymap*) (define-key *root-map* (kbd "b") '*my-buffers-management-keymap*)
#+end_src #+end_src
** Media and Media Control ** Media and Media Control
@ -1236,7 +1233,7 @@ of MPD.
Cela donne le code suivant: Cela donne le code suivant:
#+begin_src lisp #+begin_src lisp
<<interactive-gen(name="mpc-interactive", keys=inter-mpc)>> <<interactive-gen(name="mpc-interactive", keys=inter-mpc)>>
#+end_src #+end_src
Another one will be defined for the general audio of my computer. And Another one will be defined for the general audio of my computer. And
@ -1253,7 +1250,7 @@ for my screens backlight.
| ~m~ | ~exec amixer -q set Master 1+ toggle~ | | ~m~ | ~exec amixer -q set Master 1+ toggle~ |
#+begin_src lisp #+begin_src lisp
<<interactive-gen(name="media-interactive", keys=inter-media)>> <<interactive-gen(name="media-interactive", keys=inter-media)>>
#+end_src #+end_src
Then, lets declare a keymap for our media controls. Then, lets declare a keymap for our media controls.
@ -1272,12 +1269,12 @@ Then, lets declare a keymap for our media controls.
Lets translate this table in CommonLisp: Lets translate this table in CommonLisp:
#+begin_src lisp #+begin_src lisp
(defvar *my-media-keymap* (defvar *my-media-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=media-management)>> <<keybinds-gen(map="m", keybinds=media-management)>>
m)) m))
(define-key *root-map* (kbd "m") '*my-media-keymap*) (define-key *root-map* (kbd "m") '*my-media-keymap*)
#+end_src #+end_src
I will also define on ~*top-map*~ some basic volume management keybinds I will also define on ~*top-map*~ some basic volume management keybinds
@ -1298,7 +1295,7 @@ media-related, but Ill add keybinds for my screens backlight.
| ~XF86MonBrightnessUp~ | ~exec xbacklight -inc 2~ | | ~XF86MonBrightnessUp~ | ~exec xbacklight -inc 2~ |
#+begin_src lisp #+begin_src lisp
<<keybinds-gen(map="*top-map*", keybinds=media-top-level)>> <<keybinds-gen(map="*top-map*", keybinds=media-top-level)>>
#+end_src #+end_src
** Misc ** Misc
@ -1316,7 +1313,7 @@ anywhere else:
| ~r~ | ~reload~ | | ~r~ | ~reload~ |
#+begin_src lisp #+begin_src lisp
<<keybinds-gen(map="*root-map*", keybinds=misc-root-map)>> <<keybinds-gen(map="*root-map*", keybinds=misc-root-map)>>
#+end_src #+end_src
From time to time, I need to switch between different keyboard From time to time, I need to switch between different keyboard
@ -1330,12 +1327,12 @@ games and the bépo layout most of the time. Ill use the command
| ~u~ | ~exec setxkbmap us~ | | ~u~ | ~exec setxkbmap us~ |
#+begin_src lisp #+begin_src lisp
(defvar *my-keyboard-layout-keymap* (defvar *my-keyboard-layout-keymap*
(let ((m (make-sparse-keymap))) (let ((m (make-sparse-keymap)))
<<keybinds-gen(map="m", keybinds=keyboard-layout-map)>> <<keybinds-gen(map="m", keybinds=keyboard-layout-map)>>
m)) m))
(define-key *root-map* (kbd "k") '*my-keyboard-layout-keymap*) (define-key *root-map* (kbd "k") '*my-keyboard-layout-keymap*)
#+end_src #+end_src
* org functions :noexport: * org functions :noexport:
@ -1345,54 +1342,54 @@ games and the bépo layout most of the time. Ill use the command
#+name: keybinds-gen #+name: keybinds-gen
#+begin_src emacs-lisp :var map="m" keybinds=frames-float #+begin_src emacs-lisp :var map="m" keybinds=frames-float
(mapconcat (lambda (keybind) (mapconcat (lambda (keybind)
(format "%s" (let ((key (let ((s (car keybind))) (format "%s" (let ((key (let ((s (car keybind)))
(substring-no-properties s 1 (1- (length s))))) (substring-no-properties s 1 (1- (length s)))))
(function (let ((s (cadr keybind))) (function (let ((s (cadr keybind)))
(substring-no-properties s 1 (1- (length s)))))) (substring-no-properties s 1 (1- (length s))))))
`(define-key ,map `(define-key ,map
(kbd ,(format "\"%s\"" key)) (kbd ,(format "\"%s\"" key))
,(if (string-prefix-p "'" function t) ,(if (string-prefix-p "'" function t)
function function
(format "\"%s\"" function)))))) (format "\"%s\"" function))))))
keybinds keybinds
"\n") "\n")
#+end_src #+end_src
#+name: interactive-gen #+name: interactive-gen
#+begin_src emacs-lisp :var name="inter" keys=inter-mpc #+begin_src emacs-lisp :var name="inter" keys=inter-mpc
(format "%s" (format "%s"
`(define-interactive-keymap ,name () `(define-interactive-keymap ,name ()
"\n " "\n "
,(mapconcat (lambda (keybind) ,(mapconcat (lambda (keybind)
(format "%s" (format "%s"
(let ((key (let ((s (car keybind))) (let ((key (let ((s (car keybind)))
(substring-no-properties s (substring-no-properties s
1 1
(1- (length s))))) (1- (length s)))))
(command (let ((s (cadr keybind))) (command (let ((s (cadr keybind)))
(substring-no-properties s (substring-no-properties s
1 1
(1- (length s)))))) (1- (length s))))))
`((kbd ,(format "\"%s\"" key)) `((kbd ,(format "\"%s\"" key))
,(format "\"%s\"" command))))) ,(format "\"%s\"" command)))))
keys keys
"\n "))) "\n ")))
#+end_src #+end_src
#+name: num-to-char #+name: num-to-char
#+begin_src emacs-lisp :var table=number-to-char-table num=0 #+begin_src emacs-lisp :var table=number-to-char-table num=0
(let ((char (replace-regexp-in-string (regexp-quote "~") (let ((char (replace-regexp-in-string (regexp-quote "~")
"" ""
(let* ((row (assoc num table)) (let* ((row (assoc num table))
(char (cadr row)) (char (cadr row))
(lispchar (caddr row))) (lispchar (caddr row)))
(if (string= "" lispchar) (if (string= "" lispchar)
char char
lispchar))))) lispchar)))))
(if (string= char "\"") (if (string= char "\"")
"\\\"" "\\\""
char)) char))
#+end_src #+end_src
#+RESULTS[6934c27c10c3f968f70b0112d4639298e519fe61]: num-to-char #+RESULTS[6934c27c10c3f968f70b0112d4639298e519fe61]: num-to-char

View File

@ -24,12 +24,14 @@ Whether if a new *window* will retain the current path. Possible values are:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_new_window_retain_current_path=true tmux_conf_new_window_retain_current_path=true
#+END_SRC #+END_SRC
Whether if a new *pane* should retain the current path. Possible values are: Whether if a new *pane* should retain the current path. Possible values are:
- ~true~ (default) - ~true~ (default)
- ~false~ - ~false~
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_new_window_retain_current_path=true tmux_conf_new_window_retain_current_path=true
#+END_SRC #+END_SRC
Whether or not tmux should attempt to reconnect to the current ssh session. This Whether or not tmux should attempt to reconnect to the current ssh session. This
is still experimental. Possible values are: is still experimental. Possible values are:
- ~true~ - ~true~
@ -37,6 +39,7 @@ is still experimental. Possible values are:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_new_pane_reconnect_ssh=true tmux_conf_new_pane_reconnect_ssh=true
#+END_SRC #+END_SRC
Whether tmux should prompt for new session name when creating a new one. Whether tmux should prompt for new session name when creating a new one.
Possible values are: Possible values are:
- ~true~ - ~true~
@ -56,18 +59,21 @@ Possible values are:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_24b_colour=false tmux_conf_theme_24b_colour=false
#+END_SRC #+END_SRC
These variables are for chosing the window style. I use the default one. These variables are for chosing the window style. I use the default one.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_fg='default' tmux_conf_theme_window_fg='default'
tmux_conf_theme_window_bg='default' tmux_conf_theme_window_bg='default'
#+END_SRC #+END_SRC
Whether the focused pane should be highlighted (only available in tmux >= 2.1). Whether the focused pane should be highlighted (only available in tmux >= 2.1).
Possible values are: Possible values are:
- ~true~ - ~true~
- ~false~ (default) - ~false~ (default)
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_highlight_focused_pane=false tmux_conf_theme_highlight_focused_pane=false
#+END_SRC #+END_SRC
Set the terminal title. Built-in variables are: Set the terminal title. Built-in variables are:
- =#{circled_window_index}= - =#{circled_window_index}=
- =#{circled_session_name}= - =#{circled_session_name}=
@ -76,16 +82,17 @@ Set the terminal title. Built-in variables are:
- =#{username}= - =#{username}=
- =#{username_ssh}= - =#{username_ssh}=
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W' tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W'
#+END_SRC #+END_SRC
These variables set the left/right separators between sections. With the current These variables set the left/right separators between sections. With the current
values, you dont need to install Powerline, but only fonts patched with values, you dont need to install Powerline, but only fonts patched with
Powerline symbols or the standalone PowerlineSymbols.otf font. Powerline symbols or the standalone PowerlineSymbols.otf font.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_left_separator_main='\uE0B0' tmux_conf_theme_left_separator_main='\uE0B0'
tmux_conf_theme_left_separator_sub='\uE0B1' tmux_conf_theme_left_separator_sub='\uE0B1'
tmux_conf_theme_right_separator_main='\uE0B2' tmux_conf_theme_right_separator_main='\uE0B2'
tmux_conf_theme_right_separator_sub='\uE0B3' tmux_conf_theme_right_separator_sub='\uE0B3'
#+END_SRC #+END_SRC
** Colors and style ** Colors and style
@ -103,45 +110,52 @@ Choose the style of the pane borders. Possible values are:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_pane_border_style=thin tmux_conf_theme_pane_border_style=thin
#+END_SRC #+END_SRC
Declare what the colors of the focused pane should be. The first variable Declare what the colors of the focused pane should be. The first variable
specifies the foreground color, the other the background color. specifies the foreground color, the other the background color.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_focused_pane_fg='default' tmux_conf_theme_focused_pane_fg='default'
tmux_conf_theme_focused_pane_bg='#0087d7' tmux_conf_theme_focused_pane_bg='#0087d7'
#+END_SRC #+END_SRC
Here you can set the colors of the pane borders. Here you can set the colors of the pane borders.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_pane_border='#444444' tmux_conf_theme_pane_border='#444444'
tmux_conf_theme_pane_active_border='#00afff' tmux_conf_theme_pane_active_border='#00afff'
#+END_SRC #+END_SRC
With these variables, you can set the colors for the pane indicators. With these variables, you can set the colors for the pane indicators.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_pane_indicator='#00afff' tmux_conf_theme_pane_indicator='#00afff'
tmux_conf_theme_pane_active_indicator='#00afff' tmux_conf_theme_pane_active_indicator='#00afff'
#+END_SRC #+END_SRC
These variables set the colors and the style of the status line. These variables set the colors and the style of the status line.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_message_fg='#000000' tmux_conf_theme_message_fg='#000000'
tmux_conf_theme_message_bg='#ffff00' tmux_conf_theme_message_bg='#ffff00'
tmux_conf_theme_message_attr='bold' tmux_conf_theme_message_attr='bold'
#+END_SRC #+END_SRC
Same as above for the status line command style. Same as above for the status line command style.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_message_command_fg='#ffff00' tmux_conf_theme_message_command_fg='#ffff00'
tmux_conf_theme_message_command_bg='#000000' tmux_conf_theme_message_command_bg='#000000'
tmux_conf_theme_message_command_attr='bold' tmux_conf_theme_message_command_attr='bold'
#+END_SRC #+END_SRC
These variables set the style of the window modes. These variables set the style of the window modes.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_mode_fg='#000000' tmux_conf_theme_mode_fg='#000000'
tmux_conf_theme_mode_bg='#ffff00' tmux_conf_theme_mode_bg='#ffff00'
tmux_conf_theme_mode_attr='bold' tmux_conf_theme_mode_attr='bold'
#+END_SRC #+END_SRC
Set the style of the status line. Set the style of the status line.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_status_fg='#8a8a8a' tmux_conf_theme_status_fg='#8a8a8a'
tmux_conf_theme_status_bg='#080808' tmux_conf_theme_status_bg='#080808'
tmux_conf_theme_status_attr='none' tmux_conf_theme_status_attr='none'
#+END_SRC #+END_SRC
** Window status bar ** Window status bar
@ -152,10 +166,11 @@ The following variables are to set the windows status style and format.
Sets the colors and style of the window status. Sets the colors and style of the window status.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_fg='#8a8a8a' tmux_conf_theme_window_status_fg='#8a8a8a'
tmux_conf_theme_window_status_bg='#080808' tmux_conf_theme_window_status_bg='#080808'
tmux_conf_theme_window_status_attr='none' tmux_conf_theme_window_status_attr='none'
#+END_SRC #+END_SRC
Sets the format of the window status. Built-in variables are: Sets the format of the window status. Built-in variables are:
- =#{circled_window_index}= - =#{circled_window_index}=
- =#{circled_session_name}= - =#{circled_session_name}=
@ -166,12 +181,14 @@ Sets the format of the window status. Built-in variables are:
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_format='#I #W' tmux_conf_theme_window_status_format='#I #W'
#+END_SRC #+END_SRC
Sets the colors and style of the current window status. Sets the colors and style of the current window status.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_current_fg='#000000' tmux_conf_theme_window_status_current_fg='#000000'
tmux_conf_theme_window_status_current_bg='#00afff' tmux_conf_theme_window_status_current_bg='#00afff'
tmux_conf_theme_window_status_current_attr='bold' tmux_conf_theme_window_status_current_attr='bold'
#+END_SRC #+END_SRC
Sets the format of the currentwindow status. Built-in variables are: Sets the format of the currentwindow status. Built-in variables are:
- =#{circled_window_index}= - =#{circled_window_index}=
- =#{circled_session_name}= - =#{circled_session_name}=
@ -180,26 +197,30 @@ Sets the format of the currentwindow status. Built-in variables are:
- =#{username}= - =#{username}=
- =#{username_ssh}= - =#{username_ssh}=
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_current_format='#I #W' tmux_conf_theme_window_status_current_format='#I #W'
#+END_SRC #+END_SRC
Sets the window activity status style. Sets the window activity status style.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_activity_fg='default' tmux_conf_theme_window_status_activity_fg='default'
tmux_conf_theme_window_status_activity_bg='default' tmux_conf_theme_window_status_activity_bg='default'
tmux_conf_theme_window_status_activity_attr='underscore' tmux_conf_theme_window_status_activity_attr='underscore'
#+END_SRC #+END_SRC
Sets the window bell status style. Sets the window bell status style.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_bell_fg='#ffff00' tmux_conf_theme_window_status_bell_fg='#ffff00'
tmux_conf_theme_window_status_bell_bg='default' tmux_conf_theme_window_status_bell_bg='default'
tmux_conf_theme_window_status_bell_attr='blink,bold' tmux_conf_theme_window_status_bell_attr='blink,bold'
#+END_SRC #+END_SRC
Sets the window last status style. Sets the window last status style.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_last_fg='#00afff' tmux_conf_theme_window_status_last_fg='#00afff'
tmux_conf_theme_window_status_last_bg='default' tmux_conf_theme_window_status_last_bg='default'
tmux_conf_theme_window_status_last_attr='none' tmux_conf_theme_window_status_last_attr='none'
#+END_SRC #+END_SRC
Sets the left and right content of the status bar of tmux. Sections should be Sets the left and right content of the status bar of tmux. Sections should be
separated with =|=, subsections with =,=. The built-in values are: separated with =|=, subsections with =,=. The built-in values are:
- =#{battery_bar}= - =#{battery_bar}=
@ -223,100 +244,112 @@ separated with =|=, subsections with =,=. The built-in values are:
- =#{username}= - =#{username}=
- =#{username_ssh}= - =#{username_ssh}=
#+BEGIN_SRC conf-unix #+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_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} ' 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 #+END_SRC
Sets the left status style and colors. Sets the left status style and colors.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4'
tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff' tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff'
tmux_conf_theme_status_left_attr='bold,none,none' tmux_conf_theme_status_left_attr='bold,none,none'
#+END_SRC #+END_SRC
Sets the right status style and colors. Sets the right status style and colors.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000' tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000'
tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4' tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4'
tmux_conf_theme_status_right_attr='none,none,bold' tmux_conf_theme_status_right_attr='none,none,bold'
#+END_SRC #+END_SRC
Set the pairing indicator, its style and its attribute. Set the pairing indicator, its style and its attribute.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_pairing='👓 ' # U+1F453 tmux_conf_theme_pairing='👓 ' # U+1F453
tmux_conf_theme_pairing_fg='none' tmux_conf_theme_pairing_fg='none'
tmux_conf_theme_pairing_bg='none' tmux_conf_theme_pairing_bg='none'
tmux_conf_theme_pairing_attr='none' tmux_conf_theme_pairing_attr='none'
#+END_SRC #+END_SRC
Set the pairing indicator, its style and its attribute. Set the pairing indicator, its style and its attribute.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
# prefix indicator tmux_conf_theme_prefix='⌨ ' # U+2328
tmux_conf_theme_prefix='⌨ ' # U+2328 tmux_conf_theme_prefix_fg='none'
tmux_conf_theme_prefix_fg='none' tmux_conf_theme_prefix_bg='none'
tmux_conf_theme_prefix_bg='none' tmux_conf_theme_prefix_attr='none'
tmux_conf_theme_prefix_attr='none'
#+END_SRC #+END_SRC
Set the root indicator, its style and its attribute. Set the root indicator, its style and its attribute.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_root='!' tmux_conf_theme_root='!'
tmux_conf_theme_root_fg='none' tmux_conf_theme_root_fg='none'
tmux_conf_theme_root_bg='none' tmux_conf_theme_root_bg='none'
tmux_conf_theme_root_attr='bold,blink' tmux_conf_theme_root_attr='bold,blink'
#+END_SRC #+END_SRC
Set the synchronized indicator, its style and its attribute. Set the synchronized indicator, its style and its attribute.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_synchronized='🔒' # U+1F512 tmux_conf_theme_synchronized='🔒' # U+1F512
tmux_conf_theme_synchronized_fg='none' tmux_conf_theme_synchronized_fg='none'
tmux_conf_theme_synchronized_bg='none' tmux_conf_theme_synchronized_bg='none'
tmux_conf_theme_synchronized_attr='none' tmux_conf_theme_synchronized_attr='none'
#+END_SRC #+END_SRC
Set the battery bar symbols. Set the battery bar symbols.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_battery_bar_symbol_full='◼' tmux_conf_battery_bar_symbol_full='◼'
tmux_conf_battery_bar_symbol_empty='◻' tmux_conf_battery_bar_symbol_empty='◻'
#+END_SRC #+END_SRC
Set the battery bar length in terms of amount of symbols. Possible values are: Set the battery bar length in terms of amount of symbols. Possible values are:
- =auto= - =auto=
- an integer number, e.g. 5 - an integer number, e.g. 5
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_battery_bar_length='auto' tmux_conf_battery_bar_length='auto'
#+END_SRC #+END_SRC
Set the battery bar palette. Possible values are: Set the battery bar palette. Possible values are:
- =gradient= (default) - =gradient= (default)
- =heat= - =heat=
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB - =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
value preceded by a pound symbol =#=. value preceded by a pound symbol =#=.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_battery_bar_palette='gradient' tmux_conf_battery_bar_palette='gradient'
#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000' #tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000'
#+END_SRC #+END_SRC
Set the hbar palette. Possible values are: Set the hbar palette. Possible values are:
- =gradient= (default) - =gradient= (default)
- =heat= - =heat=
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB - =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
value preceded by a pound symbol =#=. value preceded by a pound symbol =#=.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_battery_hbar_palette='gradient' tmux_conf_battery_hbar_palette='gradient'
#+END_SRC #+END_SRC
Set the vbar palette. Possible values are: Set the vbar palette. Possible values are:
- =gradient= (default) - =gradient= (default)
- =heat= - =heat=
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB - =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
value preceded by a pound symbol =#=. value preceded by a pound symbol =#=.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_battery_vbar_palette='gradient' tmux_conf_battery_vbar_palette='gradient'
#+END_SRC #+END_SRC
Set symbols used to indicate whether the battery is charging or discharging. Set symbols used to indicate whether the battery is charging or discharging.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_battery_status_charging='⚡ ' # U+26A1 tmux_conf_battery_status_charging='⚡ ' # U+26A1
tmux_conf_battery_status_discharging='🔋 ' # U+1F50B tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
# tmux_conf_battery_status_charging='↑' # U+2191 # tmux_conf_battery_status_charging='↑' # U+2191
# tmux_conf_battery_status_discharging='↓' # U+2193 # tmux_conf_battery_status_discharging='↓' # U+2193
#tmux_conf_battery_status_charging='🔌 ' # U+1F50C #tmux_conf_battery_status_charging='🔌 ' # U+1F50C
#+END_SRC #+END_SRC
Set the clock style. If it is displayed on the right side of the status bar, it 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 might be better to use =%I:%M %p= rather than =%R= in
=tmux_conf_theme_status_right=. =tmux_conf_theme_status_right=.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_theme_clock_colour='#00afff' tmux_conf_theme_clock_colour='#00afff'
tmux_conf_theme_clock_style='24' tmux_conf_theme_clock_style='24'
#+END_SRC #+END_SRC
* Clipboard * Clipboard
@ -328,7 +361,7 @@ Possible values are:
- ~true~ - ~true~
- ~false~ (default) - ~false~ (default)
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
tmux_conf_copy_to_os_clipboard=false tmux_conf_copy_to_os_clipboard=false
#+END_SRC #+END_SRC
* User customizations * User customizations
@ -338,29 +371,33 @@ Possible values are:
Here we can override or undo some setting from settings from tmux. First, we can Here we can override or undo some setting from settings from tmux. First, we can
increase the history size. increase the history size.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
set -g history-limit 10000 set -g history-limit 10000
#+END_SRC #+END_SRC
We can also start with mouse mode enabled. But I dont. We can also start with mouse mode enabled. But I dont.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
#set -g mouse on #set -g mouse on
#+END_SRC #+END_SRC
Whether or not Vi mode should be enabled. But really, we should rather export 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 the =VISUAL= or =EDITOR= environment variables, see the tmux manual. Although I
dont, as said in my dotfish, I prefer to use Emacs. dont, as said in my dotfish, I prefer to use Emacs.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
#set -g status-keys vi #set -g status-keys vi
#set -g mode-keys vi #set -g mode-keys vi
#+END_SRC #+END_SRC
Replace =C-b= by =C-a= instead of using both prefixes. I personally prefer to 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. just use =C-b=, hence why the lines are commented.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
# set -gu prefix2 # set -gu prefix2
# unbind C-a # unbind C-a
# unbind C-b # unbind C-b
# set -g prefix C-a # set -g prefix C-a
# bind C-a send-prefix # bind C-a send-prefix
#+END_SRC #+END_SRC
Move the status line to the top. Move the status line to the top.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
#set -g status-position top #set -g status-position top
#+END_SRC #+END_SRC