docs: typos
deploy / build (push) Successful in 3m41s Details

This commit is contained in:
Lucien Cartier-Tilet 2023-12-10 15:09:07 +01:00
parent dbf3c5e212
commit 3354f79554
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
26 changed files with 509 additions and 962 deletions

View File

@ -19,14 +19,14 @@ respectively. These servers are also located in France.
** Cookies
*** What are cookies?
Cookies are small files a website saves on your computer or mobile
phone when you visit a website. site. Although not all sites make use
of them, they are nevertheless extremely common in order to allow
phone when you visit a website. Although not all sites make use of
them, they are nevertheless extremely common in order to allow
websites to function properly or function properly or more
efficiently.
This website uses some functional cookies in order to remember your
preferences, such as your preferred language or its color theme. These
cookies are not and cannot be used to track you.
preferences, such as your preferred language or its colour theme.
These cookies are not and cannot be used to track you.
However, as this site is protected by Cloudflare, they may also host
some cookies to remember, for example, that your browser is safe or to
@ -34,8 +34,8 @@ record traffic to the site.
*** How can I control cookies on my computer?
If you don't want Cloudflare to record your browsing activity on my
website, a good adblocker should do the trick. I personally recommend
[[https://ublockorigin.com/][uBlock Origin]], one of the most effective adblockers I know of if not
website, a good ad blocker should do the trick. I personally recommend
[[https://ublockorigin.com/][uBlock Origin]], one of the most effective ad blockers I know of if not
the most effective one.
You can also manually delete cookies from your browser, but given the
@ -47,8 +47,8 @@ Google).
*** What about other methods of tracking users?
There are other more subtle methods of tracking someone on the
internet, or even via emails or any web content rendered on the
screen, such as web beacons (extremely small images). It is also
possible to store Flash cookies or local shared objects.
screen, such as web beacons (minuscule images). It is also possible to
store Flash cookies or local shared objects.
This site does not use them at all.
@ -68,5 +68,5 @@ modification of the file =about.org= on [[https://labs.phundrak.com/phundrak/con
** I have other questions
And I have the answers! Ill be more thang happy to chat with you by
And I have the answers! Ill be more than happy to chat with you by
email, feel free to send me one at [[mailto:lucien@phundrak.com][lucien@phundrak.com]].

View File

@ -1,4 +1,4 @@
#+TITLE: Arch Linux, Phundrak-flavored
#+TITLE: Arch Linux, Phundrak-flavoured
#+setupfile: headers
#+PROPERTY: header-args :tangle no :exports none
#+PROPERTY: header-args:sh :tangle no :exports code
@ -6,29 +6,33 @@
#+PROPERTY: header-args:emacs-lisp :exports none :noweb yes :tangle no :cache yes
* Bootstrap Script
Here will be presented what I do to get my system up and running on a fresh Arch
Linux install. These installation instructions were written in order to get an
Arch Linux distribution up and running with the same configuration as my main
computers and my travelling laptops configuration.
Here will be presented what I do to get my system up and running on a
fresh Arch Linux install. These installation instructions were written
in order to get an Arch Linux distribution up and running with the
same configuration as my main computers and my travelling laptops
configuration.
** Install Arch Linux
I usually install Arch from the [[https://www.archlinux.org/download/][vanilla ISO]], however I began using [[https://github.com/MatMoul/archfi][archfi]] to
install easily the distro (Ive done it so many times, I know how it works now).
Usually, my distros will be installed on two partitions: ~/home~ and ~/~ (root).
I usually install Arch from the [[https://www.archlinux.org/download/][vanilla ISO]], however I began using
[[https://github.com/MatMoul/archfi][archfi]] to install easily the distro (Ive done it so many times, I
know how it works now). Usually, my distros will be installed on two
partitions: ~/home~ and ~/~ (root).
If the computer supports EFI bootloaders, the EFI partition will be mounted on
~/boot/efi~. I generally use ~systemd-boot~ as my boot manager, but if you are
more comfortable with another one, just install what you want. Be aware that if
you format your ~/boot~ partition, you will delete all boot managers that
already exist; so, if you are dual-booting, *DO NOT FORMAT IT*. Yes, I made the
mistake of wiping the Windows boot manager when I used to dual-boot.
If the computer supports EFI bootloaders, the EFI partition will be
mounted on ~/boot/efi~. I generally use ~systemd-boot~ as my boot manager,
but if you are more comfortable with another one, just install what
you want. Be aware that if you format your ~/boot~ partition, you will
delete all boot managers that already exist; so, if you are
dual-booting, *DO NOT FORMAT IT*. Yes, I made the mistake of wiping the
Windows boot manager when I used to dual-boot.
In order to use the ~suspend-then-hibernate~ systemd command, it is necessary to
have a swap partition at least twice the size of your installed RAM. That is
because when this command will be run, the system will try to save the current
state of your machine, stored in your RAM, to the swap filesystem. If there is
not enough space, the command will fail, and you wont be able to use this
command. For instance, my current computer has 32 GB of RAM, hence my SWAP
In order to use the ~suspend-then-hibernate~ systemd command, it is
necessary to have a swap partition at least twice the size of your
installed RAM. That is because when this command will be run, the
system will try to save the current state of your machine, stored in
your RAM, to the swap filesystem. If there is not enough space, the
command will fail, and you wont be able to use this command. For
instance, my current computer has 32 GB of RAM, hence my SWAP
partition is 16 GB large.
*** Get the latest, fastest mirrors
@ -38,17 +42,18 @@ pacman -Sy reflector
reflector -c FR,DE -l 20 -p https --sort rate --save /etc/pacman.d/mirrorlist --verbose
#+END_SRC
This will update the packages from your live ISO, and you will get the best
mirrors for your installation. Of course, change the countries accordingly to
your location. In my case, I am only interested in French, German, and Belgian
mirrors.
This will update the packages from your live ISO, and you will get the
best mirrors for your installation. Of course, change the countries
accordingly to your location. In my case, I am only interested in
French, German, and Belgian mirrors.
*** Install the system
Then you can use a custom script to ease your installation of Arch if you do not
wish to do it manually. Personally, Ive done it several times already, I know
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
by default on Arch ISOs anymore, so Ill need to install it.
Then you can use a custom script to ease your installation of Arch if
you do not wish to do it manually. Personally, Ive done it several
times already, I know 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 by default on Arch ISOs any
more, so Ill need to install it.
#+BEGIN_SRC sh
pacman -S wget
#+END_SRC
@ -60,13 +65,14 @@ wget archfi.sf.net/archfi
sh archfi
#+END_SRC
Then, follow the instructions and install Arch Linux. Take the opportunity to
install as many packages as you need, mainly ~paru~ which I use as my package
manager (it is just a wrapper for ~pacman~) and AUR helper, and ~pacman-contrib~
which will help us to install some packages later.
Then, follow the instructions and install Arch Linux. Take the
opportunity to install as many packages as you need, mainly ~paru~ which
I use as my package manager (it is just a wrapper for ~pacman~) and AUR
helper, and ~pacman-contrib~ which will help us to install some packages
later.
Once your system is installed, reboot and remove your installation media from
your computer.
Once your system is installed, reboot and remove your installation
media from your computer.
** Execute bootstrap
:PROPERTIES:
@ -85,8 +91,8 @@ And now that ~paru~ is available, we can install ~yadm~:
paru -S yadm
#+END_SRC
~yadm~ comes with a very handy feature: its bootstrap script. It can be executed
automatically once the dotfiles are cloned with yadm:
~yadm~ comes with a very handy feature: its bootstrap script. It can be
executed automatically once the dotfiles are cloned with yadm:
#+BEGIN_SRC sh
yadm clone https://labs.phundrak.com/phundrak/dotfiles
# or if labs.phundrak.com is down or too slow for you
@ -107,11 +113,11 @@ end
#+END_SRC
*** Get a correct keyboard layout
I use mainly the [[https://bepo.fr/wiki/Accueil][bépo]] layout, a French keyboard layout inspired by Dvorak
layouts, however I sometimes need to switch back to the standard French AZERTY
or the American QWERTY layout, so I make it so the Menu key switches for me my
layout between these three. This makes it so my xorg configuration of my
keyboard looks like this:
I use mainly the [[https://bepo.fr/wiki/Accueil][bépo]] layout, a French keyboard layout inspired by
Dvorak layouts, however I sometimes need to switch back to the
standard French AZERTY or the American QWERTY layout, so I make it so
the Menu key switches for me my layout between these three. This makes
it so my Xorg configuration of my keyboard looks like this:
#+BEGIN_SRC fish
set keyboardconf \
'Section "InputClass"
@ -124,7 +130,8 @@ set keyboardconf \
EndSection'
#+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
printf "\n# Set keyboard layout #########################################################\n\n"
whiptail --yesno "Would you like to set your keyboard layout to the bépo layout?" 8 55
@ -134,8 +141,8 @@ end
#+END_SRC
*** Set our locale
I use two main locales, the French and US UTF-8 locales, and I like to keep the
Japanese locale activated just in case.
I use two main locales, the French and US UTF-8 locales, and I like to
keep the Japanese locale activated just in case.
#+BEGIN_SRC fish
set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"
#+END_SRC
@ -164,7 +171,7 @@ LC_ADDRESS=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8"
#+END_SRC
Lets set it as our systems locale if the user whishes to.
Lets set it as our systems locale if the user wishes to.
#+BEGIN_SRC fish
whiptail --yesno "Do you agree to have the following locale set?\n\n $localeconf" 20 43
if test $status -eq 0
@ -179,8 +186,8 @@ sudo locale-gen
#+END_SRC
*** Create some folders
Lets create some folders we might need for mounting our drives, Android devices
and CDs.
Lets create some folders we might need for mounting our drives,
Android devices and CDs.
#+BEGIN_SRC fish
printf "\n# Create directories for mounting #############################################\n\n"
sudo mkdir -p /mnt/{USB,CD,Android}
@ -198,7 +205,7 @@ end
#+END_SRC
*** Install basic packages
Ok, lets list all the packages that I need. First, lets begin with
OK, lets list all the packages that I need. First, lets begin with
system packages.
#+name: packages-system
| Package name | Why I need it |
@ -381,7 +388,7 @@ Terminal utilities
| unrar | Support for rar file format |
| w3m | Terminal web browser |
| wget | Retrieve files from the web |
| x11-ssh-askpass | Passphrase dialog over SSH |
| x11-ssh-askpass | Passphrase dialogue over SSH |
| xclip | Interact with the X11 clipboard |
| yt-dlp-drop-in | ~yt-dlp~ but it also replaces ~youtube-dl~ |
@ -549,8 +556,8 @@ Our code to generate such directories looks like this:
<<gen-dirs-tangle()>>
#+END_SRC
The next step is to tangle all the Org files. Here is the list of files that are
to be tangled:
The next step is to tangle all the Org files. Here is the list of
files that are to be tangled:
#+NAME: tangled-files
| filename |
|--------------|
@ -636,8 +643,8 @@ printf "\n# Tangling org files #################################################
*** Set up dotfiles git repository
**** Update our dotfiles remotes
This line in the bootstrap script will test if the current user is using my
username. If yes, its probably me.
This line in the bootstrap script will test if the current user is
using my username. If yes, its probably me.
#+BEGIN_SRC fish
if test "$USER" = 'phundrak'
#+END_SRC
@ -661,20 +668,21 @@ end
#+END_SRC
**** Update our submodules
Now we can download the various dependencies of our dotfiles. To do so, lets
run the following command:
Now we can download the various dependencies of our dotfiles. To do
so, lets run the following command:
#+BEGIN_SRC fish
printf "\n# Getting yadm susbmodules ####################################################\n\n"
yadm submodule update --init --recursive
#+END_SRC
*** Enable some services
We have installed some packages which require some services to run. Lets enable
them.
We have installed some packages which require some services to run.
Lets enable them.
**** Systemd-timesyncd
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:
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:
#+BEGIN_SRC fish
printf "\n# Enabling timesync ###########################################################\n\n"
sudo systemctl enable --now systemd-timesyncd
@ -712,10 +720,11 @@ end
#+END_SRC
**** Emacs
Emacs will run as a user service, which means it wont be launched until we log
in. However, the service wont be started immediately, I personally prefer to
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.
Emacs will run as a user service, which means it wont be launched
until we log in. However, the service wont be started immediately, I
personally prefer to 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.
#+BEGIN_SRC fish
printf "\n# Enabling Emacs as user service ##############################################\n\n"
systemctl --user enable emacs
@ -730,8 +739,8 @@ systemctl --user start emacs
#+end_src
**** Mpd
Mpd will also use as a user service in order to get rid of some lines of code in
my configuration.
Mpd will also use as a user service in order to get rid of some lines
of code in my configuration.
#+BEGIN_SRC fish
printf "\n# Enabling Mpd as a user service ##############################################\n\n"
mkdir -p ~/.config/mpd/playlists
@ -739,9 +748,9 @@ systemctl --user enable --now mpd
#+END_SRC
**** NordVPN
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
activate:
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 activate:
#+BEGIN_SRC fish
sudo systemctl enable --now nordvpnd
#+END_SRC
@ -807,11 +816,11 @@ systemctl --user enable --now pipewire-input-filter-chain.service
Just make sure afterwards the microphone is redirected to the
noise-canceling source. The same source should be your input device
where you want to use your microphone. The only downside is this is
ony a mono input, but it shouldnt matter for most people.
only a mono input, but it shouldnt matter for most people.
**** SSH server
Maybe we want to activate an SSH server on our machine. If so, we can enable it.
Lets ask the question.
Maybe we want to activate an SSH server on our machine. If so, we can
enable it. Lets ask the question.
#+BEGIN_SRC fish
whiptail --yesno 'Do you want to activate the ssh server?' 8 50
if test $status -eq 0
@ -845,23 +854,24 @@ git clone https://github.com/hakimel/reveal.js.git
*** Install Rust
**** Install the toolchains
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,
I will use ~rustup~ which has already been installed previously.
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, I will use ~rustup~ which has already been installed
previously.
#+BEGIN_SRC fish
printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n"
rustup default stable
#+END_SRC
This will both download the stable toolchain and set it as the default one. Now
to install the nightly toolchain, lets run this:
This will both download the stable toolchain and set it as the default
one. Now to install the nightly toolchain, lets run this:
#+BEGIN_SRC fish
rustup toolchain install nightly
#+END_SRC
**** Install some utilities
Well need some utilities when developing Rust from Emacs, namely ~rustfmt~ and
~racer~. Lets install them with ~cargo~.
Well need some utilities when developing Rust from Emacs, namely
~rustfmt~. Lets install it with ~cargo~.
#+BEGIN_SRC fish
printf "\n# Add rust utilities ##########################################################\n\n"
cargo install rustfmt
@ -881,7 +891,7 @@ We will also need some components for development purposes.
"\n")
#+END_SRC
#+RESULTS[b3935b1c09d86fe506b43670f52960306a1e9809]: rust-components-gen
#+RESULTS[2499c179aa97dc038832188f53dd855a23eba70c]: rust-components-gen
: rustup component add rust-src
: rustup component add clippy
@ -891,11 +901,12 @@ Here is the code to do so:
#+END_SRC
*** Set up our fish shell
The last thing we want to do is to set up our fish shell with some extensions in
order to improve the user experience.
The last thing we want to do is to set up our fish shell with some
extensions in order to improve the user experience.
**** Install ~fisher~
We will be using ~fisher~ as our extension manager for Fish. Lets install it.
We will be using ~fisher~ as our extension manager for Fish. Lets
install it.
#+BEGIN_SRC fish
printf "\n# Installing fisher ###########################################################\n\n"
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

View File

@ -9,365 +9,6 @@
Many settings formerly present in this websites index are related to
my desktop settings, while some others are not.
# Also, since I switched to StumpWM, many of my keybinds from Emacs need
# to be kept up to date with my StumpWM keybinds, and /vice versa/. This
# document aims to regroup all settings related to the desktop in order
# to have an easier time managing them.
** Common Emacs and StumpWM settings :noexport:
Both Emacs and StumpWM work on the same principle of keychords
powering a function or command. With both of them I have a prefix key,
~SPC~ in the case of Emacs (or ~C-SPC~ when in insert-mode, see the
relevant config) and ~s-SPC~ in the case of StumpWM. That means I can
give them the same keychord following this, for instance ~w/~ to create
a new vertically split frame to the right of the current one.
All the keybinds will be presented in the form of tables, with on the
first column the keychord following the leader key, on the second
column the EmacsLisp function to be called, and on the third the
StumpWM command. If one of the ELisp or StumpWM cases is empty, it
means there is no equivalence. If its ~nil~, then it means it is a
prefix key. The fourth column is for now reserved for Emacs
which-key, so I can give it a better name. If its value is ~nil~, then
it should not show up. Hopefully this can be implemented someday in
StumpWM.
*** Generating Code :noexport:
**** Elisp
#+name: emacs-keybinds-gen
#+header: :var keymap=emacs-stumpwm-media-control
#+begin_src emacs-lisp :exports none :tangle no :wrap "src emacs-lisp :tangle no"
(mapconcat (lambda (keybind)
(let* ((keychord (replace-regexp-in-string (rx (or (seq line-start "~")
(seq "~" line-end)))
""
(car keybind)))
(function (replace-regexp-in-string (rx (or (seq line-start "~")
(seq "~" line-end)))
""
(nth 1 keybind)))
(which (nth 3 keybind)))
(format "\"%s\" %s"
keychord
(if (string= "nil" function)
(format "%S"
`(:ignore :which-key ,which))
(if (string= "" which)
(concat "#'" function)
(format "%S"
`'(,(intern function) :which-key ,which)))))))
(seq-filter (lambda (elem)
(not (string= "" (nth 1 elem))))
keymap)
"\n")
#+end_src
#+RESULTS: emacs-keybinds-gen
#+begin_src emacs-lisp :tangle no
"m" (:ignore :which-key "media")
"m«" #'emms-player-mpd-previous
"m»" #'emms-player-mpd-next
"ma" '(hydra-media/body :which-key "MPD add")
"mb" (:ignore :which-key "browse")
"mba" #'emms-browse-by-artist
"mbA" #'emms-browse-by-album
"mbg" #'emms-browse-by-genre
"mbp" #'emms-playlists-mode-go
"mbs" #'emms-smart-browse
"mby" #'emms-browse-by-year
"mc" #'emms-player-mpd-clear
"mp" #'emms-player-toggle-pause
"ms" #'emms-player-mpd-show
"mu" (:ignore :which-key "update")
"mum" #'emms-player-mpd-update-all
"muc" #'emms-cache-set-from-mpd-all
#+end_src
#+name: emacs-hydra-keybinds-gen
#+header: :var keymap=emacs-stumpwm-resize-frame
#+begin_src emacs-lisp :exports none :tangle no :wrap "src emacs-lisp :tangle no"
(mapconcat (lambda (keybind)
(let ((keychord (replace-regexp-in-string "^~\\|~$"
""
(car keybind)))
(function (replace-regexp-in-string "^~\\|~$"
""
(nth 1 keybind)))
(which (nth 3 keybind)))
(format "%S" (if (string= "" which)
`(,keychord ,(intern function))
`(,keychord ,(intern function) ,which)))))
keymap
"\n")
#+end_src
#+RESULTS: emacs-hydra-keybinds-gen
#+begin_src emacs-lisp :tangle no
("c" shrink-window-horizontally)
("t" enlarge-window)
("s" shrink-window)
("r" enlarge-window-horizontally)
#+end_src
**** Lisp
#+name: stumpwm-filter-keybinds
#+begin_src emacs-lisp :exports none :tangle no
(let ((no-tilde (lambda (string)
(replace-regexp-in-string "^~\\|~$" "" string))))
(seq-filter (lambda (elem)
(= 1 (length (car elem))))
(mapcar (lambda (elem)
`(,(replace-regexp-in-string (format "^%s" prefix) "" (car elem))
.
,(cdr elem)))
(seq-filter (lambda (elem)
(and (not (string= "" (cdr elem)))
(not (string= prefix (car elem)))
(string-prefix-p prefix (car elem))))
(mapcar (lambda (elem)
(let ((keychord (apply no-tilde (list (car elem))))
(function (apply no-tilde (list (nth 2 elem)))))
`(,keychord . ,function)))
keymap)))))
#+end_src
#+name: stumpwm-keybinds-gen
#+header: :var keymap=emacs-stumpwm-media-control keymap-name="my-mpd-add-map" prefix="m"
#+begin_src emacs-lisp :exports none :tangle no :wrap "src lisp :tangle no" :noweb yes
(require 'seq)
(format "(defvar *%s*
(let %S
%s
m))"
keymap-name
`((m (make-sparse-keymap)))
(mapconcat (lambda (keybind)
(let ((keychord (replace-regexp-in-string (format "^%s" prefix)
""
(car keybind)))
(function (cdr keybind)))
(format "%S" `(define-key m (kbd ,keychord) ,function))))
<<stumpwm-filter-keybinds>>
"\n "))
#+end_src
#+RESULTS: stumpwm-keybinds-gen
#+begin_src lisp :tangle no
(defvar *my-mpd-add-map*
(let ((m (make-sparse-keymap)))
(define-key m (kbd ".") "media-interactive")
(define-key m (kbd "«") "mpd-prev")
(define-key m (kbd "»") "mpd-next")
(define-key m (kbd "a") "'*my-mpd-add-keymap*")
(define-key m (kbd "b") "'*my-mpd-browse-keymap*")
(define-key m (kbd "c") "mpd-clear")
(define-key m (kbd "p") "mpd-toggle-pause")
m))
#+end_src
#+name: stumpwm-interactive-keybinds-gen
#+header: :var keymap=emacs-stumpwm-resize-frame prefix=""
#+header: :wrap "src lisp :exports none"
#+begin_src emacs-lisp :noweb yes
(format "(%s)"
(mapconcat (lambda (keybind)
(let ((keychord (car keybind))
(function (cdr keybind)))
(format "%S" `((kbd ,keychord) ,function))))
<<stumpwm-filter-keybinds>>
"\n "))
#+end_src
#+RESULTS: stumpwm-interactive-keybinds-gen
#+begin_src lisp :exports none
(((kbd "c") "resize-direction left")
((kbd "t") "resize-direction down")
((kbd "s") "resize-direction up")
((kbd "r") "resize-direction right"))
#+end_src
#+name: stumpwm-interactive-gen
#+header: :var keymap=emacs-stumpwm-resize-frame keymap-name="my-mpd-add-map" prefix=""
#+begin_src emacs-lisp :exports none :tangle no :wrap "src lisp :tangle no"
(format "%S"
`(define-interactive-keymap ,(intern keymap-name)
(:exit-on '((kbd "RET")
(kbd "ESC")
(kbd "C-g")
(kbd "q")))
,@
<<stumpwm-interactive-keybinds-gen>>
))
#+end_src
#+RESULTS: stumpwm-interactive-gen
#+begin_src lisp :tangle no
(define-interactive-keymap my-mpd-add-map (:exit-on '((kbd "RET") (kbd "ESC") (kbd "C-g") (kbd "q"))) ((kbd "c") "resize-direction left" (kbd "t") "resize-direction down" (kbd "s") "resize-direction up" (kbd "r") "resize-direction right"))
#+end_src
*** Frames Management
In StumpWM, Ill consider my various windows the same as Emacs
buffers.
#+name: emacs-stumpwm-frames-management
| Keychord | Emacs | StumpWM | which-key |
|----------+---------------------------+-------------------------+-----------|
| ~b~ | ~nil~ | ~'*my-buffers-keymap*~ | buffers |
| ~bb~ | ~buflers-switch-buffer~ | ~windowlist~ | |
| ~bB~ | ~bury-buffer~ | | |
| ~bd~ | ~kill-this-buffer~ | ~delete-window~ | |
| ~bD~ | ~kill-buffer~ | ~window-window-and-frame~ | |
| ~bh~ | ~dashboard-refresh-buffer~ | | |
| ~bk~ | | ~kill-window~ | |
| ~bl~ | ~bufler~ | | |
| ~bm~ | ~switch-to-messages-buffer~ | | |
| ~bn~ | ~evil-next-buffer~ | ~next~ | |
| ~bp~ | ~evil-prev-buffer~ | ~prev~ | |
| ~br~ | ~counsel-buffer-or-recentf~ | | |
| ~bs~ | ~switch-to-scratch-buffer~ | | |
EmacsLisp code:
#+begin_src emacs-lisp
(phundrak/leader-key
<<emacs-keybinds-gen(keymap=emacs-stumpwm-frames-management)>>
)
#+end_src
StumpWMs Lisp code:
#+begin_src lisp
<<stumpwm-keybinds-gen(keymap=emacs-stumpwm-frames-management, keymap-name="my-buffers-keymap", prefix="b")>>
(define-key *root-map (kbd "b") '*my-buffers-keymap*)
#+end_src
*** Window Management
The following allows to have an interactive keymap for resizing the
current frame. In Emacs, it will be translated as a hydra while in
StumpWM it will be an interactive keymap.
#+name: emacs-stumpwm-resize-frame
| Keychord | Emacs | StumpWM | which-key |
|----------+-----------------------------+------------------------+-----------|
| ~c~ | ~shrink-window-horizontally~ | ~resize-direction left~ | |
| ~t~ | ~enlarge-window~ | ~resize-direction down~ | |
| ~s~ | ~shrink-window~ | ~resize-direction up~ | |
| ~r~ | ~enlarge-window-horizontally~ | ~resize-direction right~ | |
This translates into the following hydra in EmacsLisp:
#+begin_src emacs-lisp
(defhydra windows-adjust-size ()
"
^Zoom^ ^Other
^^^^^^^-----------------------------------------
[_t_/_s_] shrink/enlarge vertically [_q_] quit
[_c_/_r_] shrink/enlarge horizontally
"
<<emacs-hydra-keybinds-gen(keymap=emacs-stumpwm-resize-frame)>>
("q" nil :exit t))
#+end_src
While the following Lisp code is used with StumpWM.
#+begin_src lisp
(define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize
:on-exit #'resize-unhide
:abort-if #'abort-resize-p
:exit-on '((kbd "RET")
(kbd "ESC")
(kbd "C-g")
(kbd "q")))
<<stumpwm-interactive-keybinds-gen(keymap=emacs-stumpwm-resize-frame)>>
)
#+end_src
Below you will find my window management keybinds.
#+name: emacs-stump-window-management
| Keychord | Emacs | StumpWM | which-key |
|----------+-------------------------------+--------------------------+------------------|
| ~w~ | ~nil~ | ~'*my-windows-keymap*~ | windows |
| ~w.~ | ~windows-adjust-size/body~ | ~iresize~ | resize windows |
| ~w-~ | ~split-window-below-and-focus~ | ~vsplit-and-focus~ | |
| ~w+~ | | ~balance-frames~ | |
| ~wv~ | ~split-window-below~ | ~vsplit~ | |
| ~wV~ | | ~vsplit-equally~ | |
| ~w/~ | ~split-window-right-and-focus~ | ~hsplit-and-focus~ | |
| ~wh~ | ~split-window-right~ | ~hsplit~ | |
| ~wH~ | | ~hsplit-equally~ | |
| ~wc~ | ~evil-window-left~ | ~move-focus left~ | |
| ~wt~ | ~evil-window-down~ | ~move-focus down~ | |
| ~ws~ | ~evil-window-up~ | ~move-focus up~ | |
| ~wr~ | ~evil-window-right~ | ~move-focus right~ | |
| ~wC~ | | ~move-window left~ | |
| ~wT~ | | ~move-window down~ | |
| ~wS~ | | ~move-window up~ | |
| ~wR~ | | ~move-window right~ | |
| ~w C-c~ | | ~exchange-direction right~ | |
| ~w C-s~ | | ~exchange-direction down~ | |
| ~w C-t~ | | ~exchange-direction up~ | |
| ~w C-r~ | | ~exchange-direction right~ | |
| ~wb~ | ~kill-buffer-and-delete-window~ | | |
| ~we~ | ~winum-select-window-by-number~ | ~expose~ | |
| ~wf~ | | ~fullscreen~ | |
| ~wF~ | | ~'*my-floating-keymap*~ | floating windows |
| ~wFf~ | | ~float-this~ | |
| ~wFF~ | | ~flatten-floats~ | |
| ~wFu~ | | ~unfloat-this~ | |
| ~wi~ | | ~info~ | |
| ~wd~ | ~delete-window~ | ~remove-split~ | |
| ~wD~ | ~delete-other-windows~ | ~only~ | |
| ~wm~ | | ~meta~ | |
| ~wo~ | ~other-window~ | ~other-window~ | |
| ~ws~ | | ~sibling~ | |
| ~wu~ | | ~next-urgent~ | |
| ~wU~ | | ~unmaximize~ | |
| ~ww~ | ~nil~ | | writeroom |
| ~ww.~ | ~writeroom-buffer-width/body~ | | |
| ~www~ | ~writeroom-mode~ | | |
*** Media Control
#+name: emacs-stumpwm-media-interactive
| Keychord | Emacs | StumpWM | which-key |
|----------+-------------------------------------------------------------+-----------------+-----------|
| ~c~ | ~emms-player-mpd-previous~ | ~mpd-prev~ | |
| ~t~ | ~(shell-command-and-echo "mpc volume -2" "mpc volume" "mpc")~ | ~mpd-volume-down~ | |
| ~s~ | ~(shell-command-and-echo "mpc volume +2" "mpc volume" "mpc")~ | ~mpd-volume-up~ | |
| ~r~ | ~emms-player-mpd-next~ | ~mpd-next~ | |
| ~s~ | ~emms-player-mpd-stop~ | ~mpd-stop~ | |
#+name: emacs-stumpwm-general-media
| Keychord | Emacs | StumpWM | which-key |
|----------+-------+--------------------------------------+----------------|
| ~c~ | | ~exec xbacklight -dec 2~ | backlight down |
| ~t~ | | ~exec amixer -q set Master 2%- unmute~ | volume down |
| ~s~ | | ~exec amixer -q set Master 2%+ unmute~ | volume up |
| ~r~ | | ~exec xbacklight -inc 2~ | backlight up |
| ~m~ | | ~exec amixer -q set Master 1+ toggle~ | toggle mute |
#+name: emacs-stumpwm-media-control
| Keychord | Emacs | StumpWM | which-key |
|----------+-----------------------------+---------------------------+-----------|
| ~m~ | ~nil~ | ~'*my-media-keymap*~ | media |
| ~m.~ | | ~media-interactive~ | |
| ~m«~ | ~emms-player-mpd-previous~ | ~mpd-prev~ | |
| ~m»~ | ~emms-player-mpd-next~ | ~mpd-next~ | |
| ~ma~ | ~hydra-media/body~ | ~'*my-mpd-add-keymap*~ | MPD add |
| ~maa~ | | ~mpd-serach-and-add-artist~ | |
| ~maA~ | | ~mpd-serach-and-add-album~ | |
| ~maf~ | | ~mpd-search-and-add-file~ | |
| ~maF~ | | ~mpd-add-file~ | |
| ~mag~ | | ~mpd-search-and-add-genre~ | |
| ~mat~ | | ~mpd-search-and-add-title~ | |
| ~mb~ | ~nil~ | ~'*my-mpd-browse-keymap*~ | browse |
| ~mba~ | ~emms-browse-by-artist~ | ~mpd-browse-artists~ | |
| ~mbA~ | ~emms-browse-by-album~ | ~mpd-browse-albums~ | |
| ~mbg~ | ~emms-browse-by-genre~ | ~mpd-browse-genres~ | |
| ~mbp~ | ~emms-playlists-mode-go~ | ~mpd-browse-playlist~ | |
| ~mbs~ | ~emms-smart-browse~ | | |
| ~mbt~ | | ~mpd-browse-tracks~ | |
| ~mby~ | ~emms-browse-by-year~ | | |
| ~mc~ | ~emms-player-mpd-clear~ | ~mpd-clear~ | |
| ~mp~ | ~emms-player-toggle-pause~ | ~mpd-toggle-pause~ | |
| ~ms~ | ~emms-player-mpd-show~ | | |
| ~mu~ | ~nil~ | | update |
| ~mum~ | ~emms-player-mpd-update-all~ | | |
| ~muc~ | ~emms-cache-set-from-mpd-all~ | | |
** Theme and graphical tweaks
*** GTK Settings
**** GTK2
@ -407,8 +48,8 @@ gtk-menu-popup-delay=0
[Filechooser Settings]
#+END_SRC
The first option alows me to open the file chooser in the current working
directory:
The first option allows me to open the file chooser in the current
working directory:
#+BEGIN_SRC conf-unix
StartupMode=cwd
#+END_SRC
@ -513,7 +154,8 @@ gtk-decoration-layout=
:HEADER-ARGS: :mkdirp yes :tangle ~/.config/X11/Xresources :exports code
:END:
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]].
colour 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
#define nord0 #2E3440
#define nord1 #3B4252

View File

@ -42,7 +42,7 @@ I sure dont. Lets tell Emacs.
(setq-default sentence-end-double-space nil)
#+end_src
There is a minor mode in Emacs which allows to have a finer way of
There is a minor mode in Emacs which allows having a finer way of
jumping from word to word: ~global-subword-mode~. It detects if what
Emacs usually considers a word can be understood as several words, as
in camelCase words, and allows us to jump words on this finer level.
@ -82,7 +82,7 @@ spaces tabs, some deranged people prefer 8 spaces tabs, and some
monsters prefer 3!
But the thing is, once you indented your code, and then you need
alignment, tabs dont work anymore! Or they may on *your* text editor
alignment, tabs dont work any more! Or they may on *your* text editor
but not on your coworkers! (Hes the one using 3 spaces tabs by the
way).
@ -144,7 +144,7 @@ of indentation (Python, why…?). The minor-mode that enables that is
*** Stay Clean, Emacs!
As nice as Emacs is, it isnt very polite or clean by default: open a
file, and it will create backup files in the same directory. But then,
when you open your directory with your favorite file manager and see
when you open your directory with your favourite file manager and see
almost all of your files duplicated with a =~= appended to the filename,
it looks really uncomfortable! This is why I prefer to tell Emacs to
keep its backup files to itself in a directory it only will access.
@ -168,7 +168,7 @@ If we delete a file, we want it moved to the trash, not simply deleted.
(setq delete-by-moving-to-trash t)
#+end_src
Finally, the scatch buffer always has some message at its beginning, I
Finally, the scratch buffer always has some message at its beginning, I
dont want it!
#+begin_src emacs-lisp
(setq-default initial-scratch-message nil)
@ -186,7 +186,8 @@ This will make Emacs ask us for either hitting the ~y~ key for “yes”, or
the ~n~ key for “no”. Much more polite!
It is also very impolite to keep a certain version of a file in its
buffer when said file has changed on disk. Lets change this behavior:
buffer when said file has changed on disk. Lets change this
behaviour:
#+begin_src emacs-lisp
(global-auto-revert-mode 1)
#+end_src
@ -222,7 +223,7 @@ set it up correctly.
** Visual Configuration
The first visual setting in this section will activate the visible
bell. What it does is I get a visual feedback each time I do something
Emacs doesnt agree with, like tring to go up a line when Im already
Emacs doesnt agree with, like trying to go up a line when Im already
at the top of the buffer.
#+begin_src emacs-lisp
(setq visible-bell t)
@ -346,9 +347,9 @@ to the one ~setq~ uses?
"Bind each custom variable FORM to the value of its VAL.
FORMS is a list of pairs of values [FORM VAL].
`customize-set-variable' is called sequentially on each pairs
`customize-set-variable' is called sequentially on each pair
contained in FORMS. This means `csetq' has a similar behaviour as
`setq': each VAL expression are evaluated sequentially, i.e. the
`setq': each VAL expression is evaluated sequentially, i.e. the
first VAL is evaluated before the second, and so on. This means
the value of the first FORM can be used to set the second FORM.

View File

@ -54,7 +54,7 @@ it as.
#+begin_src emacs-lisp
(defun self-screenshot (&optional type)
"Save a screenshot of type TYPE of the current Emacs frame.
As shown by the function `', type can weild the value `svg',
As shown by the function `', type can wield the value `svg',
`png', `pdf'.
This function will output in /tmp a file beginning with \"Emacs\"

View File

@ -18,7 +18,7 @@ easily add new packages and configure them, such as ~package!~, ~after!~,
and others. But ultimately, I wanted to have a system I designed
entirely, with the keybinds I want, the packages I want.
Aso, why Emacs? You know this famous quote:
Also, why Emacs? You know this famous quote:
#+begin_quote
Emacs is a great operating system, it just lacks a good text editor.
#+end_quote

View File

@ -160,7 +160,7 @@ additional code compared to most people due to the bépo layout.
reason is it doesnt create a linear undo/redo history, but rather a
complete tree you can navigate to see your complete editing history.
One of the two obvious things to do are to tell Emacs to save all its
undo history fies in a dedicated directory, otherwise wed risk
undo history files in a dedicated directory, otherwise wed risk
littering all of our directories. The second thing is to simply
globally enable its mode.
#+begin_src emacs-lisp
@ -185,7 +185,7 @@ globally enable its mode.
undo-outer-limit (* 128 1024 1024)))
#+end_src
An interesting behavior from DoomEmacs is to compress the history
An interesting behaviour from DoomEmacs is to compress the history
files with ~zstd~ when it is present on the system. Not only do we enjoy
much smaller files (according to DoomEmacs, we get something like 80%
file savings), Emacs can load them much faster than the regular files.

View File

@ -69,7 +69,7 @@ host. This username is retrieved through the following variable:
The huge advantage of straight is it clones through git the packages
it installs. This means development can be done directly on the
downloaded package. However, Forge (a Magit extension for interacting
with websites such as GitHub, Gitlab, and such) interacts by default
with websites such as GitHub, GitLab, and such) interacts by default
with the forge described by the =origin= remote, which isnt necessarily
the one I want Forge to interact with by default. Therefore,
=straight.el= will name all default remotes =straight= to avoid any name

View File

@ -161,7 +161,7 @@ database is to be stored.
I dont want YouTube videos to be open with my web browser when I
invoke ~elfeed-show-visit~, so Ill advise this function to make it
possible to modify the behavior of said function. Oh, and I already
possible to modify the behaviour of said function. Oh, and I already
made [[file:../../scripts.md#ytplay][a neat package]] for playing YouTube videos and friends through
[[https://ytdl-org.github.io/youtube-dl/][youtube-dl]] or its superior fork [[https://github.com/yt-dlp/yt-dlp][yt-dlp]] in mpv.
@ -495,7 +495,7 @@ configuration for the ~mu4e~ package itself.
(find-file outfile))))
#+end_src
Quick sidenote: on ArchLinux, youll need to install either ~mu~ or
Quick sidenote: on Arch Linux, youll need to install either ~mu~ or
~mu-git~ from the AUR in order to use mu4e. I also have a ~.desktop~ file
to make it possible to open mu4e directly from my program picker. It
uses the shell script ~emacsmail~ Ive written [[file:bin.org::#Emacsmail-afffb7cd][here]].
@ -526,7 +526,7 @@ events shared with me on my personal mailbox. The answer is actually
#+end_src
Ill just configure a couple of things regarding these events, namely
converting them to Orgmode and add them to my =~/org/notes.org= file,
converting them to org-mode and add them to my =~/org/notes.org= file,
and delete the email once I answered to the event.
#+name: mu4e-ical-config
#+begin_src emacs-lisp
@ -639,7 +639,7 @@ Next I need an inbox dedicated to the association Im part of.
As for the Emacs-doctor list, I need to match both the current, modern
mailing list address but also its old address. The same applies for
the emacs-devel mailing list as well as GitHub emails related to my
package ~eshell-info-banner.el~ (*see here*). Here are the addresses to
package ~eshell-info-banner.el~. Here are the addresses to
match:
# Insert #Packages-Configuration-Emacs-built-ins-Eshell-Visual-configuratione7c2fl6184j0 equivalent in *see here*
@ -777,7 +777,7 @@ We can finally define our bookmarks! The code reads as follows:
Sometimes, bookmarks are a bit too restrictive when I want to search
for stuff. Simply jumping to a mail directory, or maildir, is more
than enough. In mu4e, with my current setup, I can jump to any maildir
with the shortcut ~Jo~ in normal-mode, and I just need to chose in a
with the shortcut ~Jo~ in normal-mode, and I just need to choose in a
list the maildir I want to jump to. But it can be faster.
With this piece of code, I can simply jump to my inbox maildir with
@ -1303,8 +1303,8 @@ reader?
** PDF Tools
~pdf-tools~ enables PDF support for Emacs, much better than its built-in
support with DocView. Aside from the classical settings such as
keybinds, I also enable the midnight colors by default; think of it as
an equivalent of Zathuras recolor feature which kind of enables a
keybinds, I also enable the midnight colours by default; think of it
as an equivalent of Zathuras recolour feature which kind of enables a
dark mode for PDFs.
#+begin_src emacs-lisp
(use-package pdf-tools
@ -1467,7 +1467,7 @@ I also want to highlight these angular-style keywords in commit messages.
display in the Magit buffer a list of TODOs found in the current
project to remind you of what to do next.
First, lets se tup our todo keywords with =hl-todo=. A good few todo
First, lets setup our todo keywords with =hl-todo=. A good few todo
keywords are already defined in the =hl-todo-keyword-faces= variable.
Why not use them? =hl-todo-mode= enables fontlock highlight of these
keywords in a buffer. Lets enable this mode globally.
@ -1508,7 +1508,7 @@ deactivate `magit-todos-mode', otherwise enable it."
#+end_src
*** Forge
Forge acts as an interface for GitHub, Gitlab, and Bitbucket inside
Forge acts as an interface for GitHub, GitLab, and Bitbucket inside
Magit. A lot of possibilities are present, you can read issues and
pull requests, create them, and fork projects among other things.

View File

@ -43,7 +43,7 @@ major-mode.
#+end_src
On the other hand, ~company-box~ is a Company front-end which offers
colors, icons, documentation and so on. Very nice.
colours, icons, documentation and so on. Very nice.
Declaring all the icons for the variable
~company-box-icons-all-the-icons~ is quite verbose in Elisp, so I do it
@ -207,7 +207,7 @@ I warned you Id use too much ~all-the-icons~, I did!
#+end_src
A buffer popping at the bottom of the screen is nice and all, but have
you considered a floating buffer in the center of your frame?
you considered a floating buffer in the centre of your frame?
#+begin_src emacs-lisp
(use-package ivy-posframe
:defer t

View File

@ -134,7 +134,7 @@ behavior.
~smartparens~ is a package similar to ~parinfer~, but while the latter is
more specialized for Lisp dialects, ~smartparens~ works better with
other programming languages that still uses parenthesis, but not as
much as Lisp dialects; think for example C, C++, Rust, Javascript, and
much as Lisp dialects; think for example C, C++, Rust, JavaScript, and
so on.
#+begin_src emacs-lisp
(use-package smartparens
@ -159,7 +159,7 @@ escaping your strings!
** Writeroom
On the other hand, ~writeroom~ allows the user to enter a
distraction-free mode of Emacs, and I like that! But the default width
is a bit too small for me, and I prefer not to go fullscren.
is a bit too small for me, and I prefer not to go full-screen.
#+begin_src emacs-lisp
(use-package writeroom-mode
:defer t

View File

@ -11,7 +11,7 @@ Dired is Emacs built-in file manager. Its really great, and replaces
any graphical file manager for me most of the time because:
- I am not limited to /x/ tabs or panes
- All actions can be done with keybindings
- I get a consistent behavior between Dired and Emacs, since its the
- I get a consistent behaviour between Dired and Emacs, since its the
same thing.
I used to have an extensive configuration for Dired with a couple of
additional packages to make it more usable. Dirvish rendered that
@ -97,18 +97,19 @@ otherwise some commands wont work.
" "))
#+end_src
However, it is possible to instead use ~exa~ when it is available.
Instead of making Emacs main thread to the file listing in a
directory, we offload it to an external thread.
However, it is possible to instead use =eza= when it is available (its
a replacement to the unmaintained =exa=). Instead of making Emacs main
thread to the file listing in a directory, we offload it to an
external thread.
#+name: dirvish-exa-offload
#+begin_src emacs-lisp :tangle no
(dirvish-define-preview exa (file)
"Use `exa' to generate directory preview."
:require ("exa")
(dirvish-define-preview eza (file)
"Use `eza' to generate directory preview."
:require ("eza")
(when (file-directory-p file)
`(shell . ("exa" "--color=always" "-al" ,file))))
`(shell . ("eza" "--color=always" "-al" ,file))))
(add-to-list 'dirvish-preview-dispatchers 'exa)
(add-to-list 'dirvish-preview-dispatchers 'eza)
#+end_src
Finally, some directories need to be set for Dired to store various
@ -243,9 +244,9 @@ window.
(defalias 'openo #'find-file-other-window)
#+end_src
The default behavior of ~eshell/clear~ is not great at all, although it
The default behaviour of ~eshell/clear~ is not great at all, although it
clears the screen it also scrolls all the way down. Therefore, lets
alias it to ~eshell/clear-scrollback~ which has the correct behavior.
alias it to ~eshell/clear-scrollback~ which has the correct behaviour.
#+name: eshell-alias-clear
#+begin_src emacs-lisp :tangle no
(defalias 'eshell/clear #'eshell/clear-scrollback)
@ -348,7 +349,7 @@ something more standard than fish:
I like to have at quick glance some information about my machine when
I fire up a terminal. I havent found anything that does that the way
I like it, so [[https://github.com/Phundrak/eshell-info-banner.el][Ive written a package]]! Its actually available on
MELPA, but since Im the main dev of this package, Ill keep track of
Melpa, but since Im the main dev of this package, Ill keep track of
the git repository.
#+begin_src emacs-lisp
(use-package eshell-info-banner
@ -370,7 +371,7 @@ the git repository.
#+end_src
Another feature I like is fish-like syntax highlight, which brings
some more colors to Eshell.
some more colours to Eshell.
#+begin_src emacs-lisp
(use-package eshell-syntax-highlighting
:after (esh-mode eshell)

View File

@ -7,7 +7,7 @@
* EXWM
So, Im finally slowly getting back to EXWM. I tried it a couple of
years ago, but that was with the SpacemacsOS layer on Spacemacs, on a
laptop which got accidentaly formatted before I could save my config
laptop which got accidentally formatted before I could save my config
and all… So it got me some time to come back. Im still a bit worried
about Emacs being single threaded, so if I get one blocking function
blocking Emacs, my whole desktop will hang, but for now I havent had
@ -62,14 +62,14 @@ exec emacs --with-exwm
#+end_src
** EXWM itself
Now we come to the plat de résistance. Like with ~xelb~, Im using its
Now we come to the plat de resistance. Like with ~xelb~, Im using its
Git source to install it to make sure I get the right version --- the
version available on the GNU ELPA is from the same source, true, but I
dont know at which rate it is updated. And more packages down the
line will depend on this Git repository, so I might as well just clone
it right now.
As you can see, I added in the ~:config~ secion to two hooks functions
As you can see, I added in the ~:config~ section to two hooks functions
that rename buffers accurately. While the average X window will simply
get the name of the current X window, I want Firefox and Qutebrowser
to be prefixed with the name of the browser. Actually, all these will
@ -123,7 +123,7 @@ want. However, when I exit one, I want to default back to normal-mode.
(advice-add #'exwm-input-release-keyboard :after (lambda (&optional id) (evil-insert-state)))
#+end_src
Secondly, I add ~i~, ~C-SPC~, and ~M-m~ as exwm prefix keys so they arent
Secondly, I add ~i~, ~C-SPC~, and ~M-m~ as exwm prefix keys, so they arent
sent directly to the X windows but caught by Emacs (and EXWM). Ill
use the ~i~ key in normal-mode to enter ~insert-mode~ and have Emacs
release the keyboard so the X window can grab it. Initially, I had
@ -362,7 +362,7 @@ The complete configuration for the ~exwm~ package can be found below.
#+begin_src emacs-lisp
(defun create-bluetooth-device (raw-name)
"Create a bluetooth device cons from RAW NAME.
"Create a Bluetooth device cons from RAW NAME.
The cons will hold first the MAC address of the device, then its
human-friendly name."
(let ((split-name (split-string raw-name " " t)))

View File

@ -9,7 +9,7 @@
Bufler is a package that organises and lists buffers in a much better
way than how they are usually sorted. You can easily and quickly find
buffers by their group, not only by their name, and THIS is great
news! Also, no ~helm~ please! And for some reasons the keybindings are
news! Also, no ~helm~ please! And for some reason, the keybindings are
borked by default, so lets redefine them, and lets also rebind ~SPC~
to ~p~ since it would conflict with my main ~general~ prefix.
#+begin_src emacs-lisp

View File

@ -6,7 +6,7 @@
* Misc
** ArchWiki pages
A small package Ive written allows the user to view ArchLinux pages
A small package Ive written allows the user to view Arch Linux pages
either in Emacs or in an external web browser. I prefer the defaults.
#+begin_src emacs-lisp
(use-package archwiki
@ -114,11 +114,11 @@ quickly find files across my filesystem.
:host github
:repo "phundrak/quick-find-files.el"
:build t)
:config
(setq quick-find-files-program 'fd
quick-find-files-dirs-and-exts '(("~/org" . "org")
("~/Documents/university" . "org"))
quick-find-files-fd-additional-options "-L"))
:custom
(quick-find-files-program 'fd)
(quick-find-files-dirs-and-exts '(("~/org" . "org")
("~/Documents/university" . "org")))
(quick-find-files-fd-additional-options "-L"))
#+end_src
** Keycast
@ -255,7 +255,7 @@ Moreover, inside Emacs?
** Winum
Winum allows Emacs to associate windows with a specific number and
navigate through these windows by directly refering to their
navigate through these windows by directly referring to their
associated number! This allows for faster window configuration than
just going to the frame above, then left, left, and up.
#+begin_src emacs-lisp

View File

@ -35,7 +35,7 @@ the ~citeproc~ package, a citation processor.
:straight (:build t))
#+end_src
Org is the main reason I am using Emacs. It is an extremely powerfu
Org is the main reason I am using Emacs. It is an extremely powerful
tool when you want to write anything that is not necessarily primarily
programming-related, though it absolutely can be! Org can be a
replacement for anything similar to LibreOffice Writer, LibreOffice
@ -488,7 +488,7 @@ The capture templates are set like so:
** Custom functions
*** Emphasize text
Sometimes, I want to emphasize some text in my org-mode documents.
Its very possible to just go to the begining of the chosen text, add
Its very possible to just go to the beginning of the chosen text, add
the marker, then go to the end of the text than needs emphasis and add
another marker, and Im sure most people are fine with that. But I
also like being able to select a region and hit a keybind to emphasize
@ -574,7 +574,7 @@ the value `split-window-right', then it will be changed to
#+end_src
** Exporters
I want to disable by default behavior of ~^~ and ~_~ for only one
I want to disable by default behaviour of ~^~ and ~_~ for only one
character, making it compulsory to use instead ~^{}~ and ~_{}~
respectively. This is due to my frequent usage of the underscore in my
org files as a regular character and not a markup one, especially when
@ -614,12 +614,6 @@ exported HTML. Lets disable that since I never use it.
(setq org-html-validation-link nil)
#+END_SRC
#+begin_src emacs-lisp
;; (use-package htmlize
;; :defer t
;; :straight (:build t))
#+end_src
This package allows for live-previewing the HTML export of an org
buffer in an XWidget Webkit browser window. But when testing it, its
not great for large org files, I should keep its usage for smaller org
@ -700,11 +694,11 @@ coloring is ~engraved~.
(setq org-latex-src-block-backend 'engraved)
#+end_src
The default packages break my LaTeX exports: for some reasons, images
are not loaded and exported in PDFs, so I needed to redifine the
The default packages break my LaTeX exports: for some reason, images
are not loaded and exported in PDFs, so I needed to redefine the
default packages excluding the one that broke my exports; namely, I
need to remove ~inputenc~, ~fontenc~ and ~grffile~. I also added some default
packages:
need to remove ~inputenc~, ~fontenc~ and ~grffile~. I also added some
default packages:
- ~cleveref~ for better references to various elements.
- ~svg~ for inserting SVG files in PDF outputs
- ~booktabs~ for nicer tables
@ -927,9 +921,9 @@ Finally, lets make enabling and disabling stuff accessible:
:PROPERTIES:
:header-args:emacs-lisp: :tangle no :exports code :results silent
:END:
I currently have two custom formats for my Org-mode exports: one for general use
(initialy for my conlanging files, hence its ~conlang~ name), and one for beamer
exports.
I currently have two custom formats for my Org-mode exports: one for
general use (initially for my conlanging files, hence its ~conlang~
name), and one for beamer exports.
Below is the declaration of the ~conlang~ LaTeX class:
#+NAME: org-latex-class-conlang

View File

@ -64,9 +64,9 @@ it is.
*** Databases
A really cool tool in Emacs for manipulating databases is ~emacsql~.
Its able to manipulate Sqlite databases by default, but its also
Its able to manipulate SQLite databases by default, but its also
possible to manipulate MariaDB and PostgreSQL databases by installing
additional packages. For now, I just need Sqlite and PostgreSQL
additional packages. For now, I just need SQLite and PostgreSQL
interfaces, so lets install the relevant packages.
#+begin_src emacs-lisp
(use-package emacsql-psql
@ -257,7 +257,7 @@ I also want all the visual enhancements LSP can provide.
"r" #'lsp-ui-pook--select-next-file))
#+end_src
And lets enable some intergration with ~ivy~.
And lets enable some integration with ~ivy~.
#+begin_src emacs-lisp
(use-package lsp-ivy
:straight (:build t)
@ -491,7 +491,7 @@ language [[http://www.gnuplot.info/][Gnuplot]]. Lets make some beautiful grap
#+end_src
*** Graphviz
[[https://graphviz.org/][Graphviz]], often known with ~dot~, allows to programatically create
[[https://graphviz.org/][Graphviz]], often known with ~dot~, allows to programmatically create
visual graphs and networks.
#+begin_src emacs-lisp
(use-package graphviz-dot-mode
@ -1243,7 +1243,7 @@ Access pydoc through counsel.
#+end_src
This generates Python documentation that is meant to be compatible
with Sphinx, a documentation generaton for Python.
with Sphinx, a documentation generation for Python.
#+begin_src emacs-lisp
(use-package sphinx-doc
:defer t
@ -1402,7 +1402,7 @@ modifications.
#+end_src
Web mode is a sort of hybrid major mode that allows editing several
languages in the same buffer, mainly HTML, CSS, and Javascript.
languages in the same buffer, mainly HTML, CSS, and JavaScript.
#+begin_src emacs-lisp
(use-package web-mode
:defer t
@ -1540,7 +1540,7 @@ activate when I open ~.less~ files by default. Lets fix that.
**** Javascript
:END:
~javascript-mode~ is meh at best, while ~rjsx-mode~ (Real JSX) is much
better: it supports both Javascript and ~.jsx~ files for React and
better: it supports both JavaScript and ~.jsx~ files for React and
Next.JS.
#+begin_src emacs-lisp
(use-package rjsx-mode
@ -1577,7 +1577,7 @@ Next.JS.
js2-idle-timer-delay 0.15))
#+end_src
~js2-refactor~ is an amazing tool for refactoring Javascript code. I
~js2-refactor~ is an amazing tool for refactoring JavaScript code. I
mean, [[https://www.youtube.com/watch?v=-7yMWD1wUu4][look at this]]! And the video is only from 2013, and it still
receives some commits!
#+begin_src emacs-lisp
@ -1589,8 +1589,8 @@ receives some commits!
:hook (rjsx-mode . js2-refactor-mode))
#+end_src
Which Emacser prefers the command line over Emacs itself? I dont.
Lets interact with NPM through Emacs then.
Is there any Emacser who prefers the command line over Emacs itself? I
dont. Lets interact with NPM through Emacs then.
#+begin_src emacs-lisp
(use-package npm-transient
:defer t
@ -1605,7 +1605,7 @@ Lets interact with NPM through Emacs then.
;; "n" #'npm-transient))
#+end_src
And finally, here is a formatter for Javascript.
And finally, here is a formatter for JavaScript.
#+begin_src emacs-lisp
(use-package prettier-js
:defer t
@ -1618,7 +1618,7 @@ And finally, here is a formatter for Javascript.
**** Typescript
:END:
Typescript is a safer alternative to Javascript. Lets install its major mode then.
Typescript is a safer alternative to JavaScript. Lets install its major mode then.
#+begin_src emacs-lisp
(use-package typescript-mode
:defer t
@ -1712,78 +1712,7 @@ First, here is its major mode.
#+end_src
For LSP to work, we need ~zls~ to be installed. In my case, as I am on
ArchLinux, I can install it from the AUR, and my AUR helper is ~paru~.
Arch Linux, I can install it from the AUR, and my AUR helper is ~paru~.
#+begin_src fish :results raw :wrap "src text" :exports code
paru --skipreview --noconfirm -S zls-bin 2>&1
#+end_src
#+RESULTS:
#+begin_src text
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...
Aur (1) Old Version New Version Make Only
aur/zls-bin 0.10.0-1 No
:: Proceed with installation? [Y/n]:
:: Downloading PKGBUILDs...
PKGBUILDs up to date
fetching devel info...
==> Making package: zls-bin 0.10.0-1 (ven. 19 mai 2023 11:23:59)
==> Retrieving sources...
-> Downloading zls-LICENSE.txt...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 1091 100 1091 0 0 3596 0 --:--:-- --:--:-- --:--:-- 3600
-> Downloading zls-bin-0.10.0.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
56 1477k 56 827k 0 0 1164k 0 0:00:01 --:--:-- 0:00:01 1164k 100 1477k 100 1477k 0 0 2012k 0 --:--:-- --:--:-- --:--:-- 27.5M
==> Validating source files with sha256sums...
zls-LICENSE.txt ... Passed
==> Validating source_x86_64 files with sha256sums...
zls-bin-0.10.0.tar.gz ... Passed
==> Making package: zls-bin 0.10.0-1 (ven. 19 mai 2023 11:24:02)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found zls-LICENSE.txt
-> Found zls-bin-0.10.0.tar.gz
==> Validating source files with sha256sums...
zls-LICENSE.txt ... Passed
==> Validating source_x86_64 files with sha256sums...
zls-bin-0.10.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting zls-bin-0.10.0.tar.gz with bsdtar
==> Sources are ready.
zls-bin-0.10.0-1: parsing pkg list...
:: zls-bin-0.10.0-1 is up to date -- skipping build
loading packages...
resolving dependencies...
looking for conflicting packages...
Package (1) New Version Net Change
zls-bin 0.10.0-1 1,36 MiB
Total Installed Size: 1,36 MiB
:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing zls-bin...
Consider runing 'zls --config' to setup initial configuration
This is not required, but it is highly recommended
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Refreshing PackageKit...
#+end_src

View File

@ -122,10 +122,8 @@ of our symbols when the cursor is on it.
#+end_src
** Ligatures
The font Im using (see *here*) supports ligatures, but Emacs in GUI
mode does not. And of course, theres a package for that.
# Insert equivalent of #Basic-configuration-Visual-Configuration-Fontsxfkjel6184j0 in *here*
The font Im using supports ligatures, but Emacs in GUI mode does not.
And of course, theres a package for that.
#+begin_src emacs-lisp
(use-package ligature
@ -175,9 +173,8 @@ The DoomEmacs modeline looks nice in my opinion, lets use it.
#+end_src
** Pixel-perfect alignment of Markdown and org-mode tables
:END:
Usually, I have no issue with the alignment of the tables I write in
org-mode and (more rarely) Markdown. However, there are occurences
org-mode and (more rarely) Markdown. However, there are occurrences
where Ill use a character that does not exactly respect my monospace
font, which messes with the alignment of the table (often when I do
linguistics stuff). A solution to this is the package ~valign~. A little
@ -215,7 +212,7 @@ sometimes theres just too much. Is the first window source code? Is
the other one just an open email? Oh, lets not forget the ~*Messages*~
buffer open next to another source buffer.
Solaire-mode applies a subtle but useful tweak to your current color
Solaire-mode applies a subtle but useful tweak to your current colour
scheme: the background of programming buffers is slightly lighter than
the background of other buffers. (Or is it other buffers that have a
slightly darker background? Im not sure.)
@ -229,7 +226,7 @@ slightly darker background? Im not sure.)
** Theme
You may have noticed I use the Nord theme pretty much everywhere on my
computer, why not Emacs? In my opinion, its aurora variant is nicer
than the default Nord theme since it is richer in colors --- just a
than the default Nord theme since it is richer in colours --- just a
personal preference.
#+begin_src emacs-lisp
(use-package doom-themes
@ -248,9 +245,9 @@ for any language that has delimiters like brackets too.
:hook (prog-mode . rainbow-delimiters-mode))
#+end_src
** Yall want some more /COLORS/?
It is possible to make info buffers much more colorful (and imo easier
to read) with this simple package:
** Yall want some more /COLOURS/?
It is possible to make info buffers much more colourful (and, in my
opinion, easier to read) with this simple package:
#+begin_src emacs-lisp
(use-package info-colors
:straight (:build t)

View File

@ -17,8 +17,8 @@ end
#+END_SRC
** Fish from within Emacs
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=.
I sometimes call fish from within Emacs, with =M-x ansi-term=. In this
case, the variable =TERM= needs to have the value =eterm-color=.
#+BEGIN_SRC fish
if test -n "$EMACS"
set -x TERM eterm-color
@ -33,8 +33,8 @@ fenv source ~/.profile
#+end_src
*** Development
Finally, some development packages require the =PKG_CONFIG_PATH= to be set, so
lets do so.
Finally, some development packages require the =PKG_CONFIG_PATH= to be
set, so lets do so.
#+BEGIN_SRC fish
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
#+END_SRC
@ -64,7 +64,8 @@ function. I just want it empty.
function fish_greeting; end
#+END_SRC
For my fish prompt, I use [[https://starship.rs][starship]], a shell-agnostic prompt. Lets load it:
For my fish prompt, I use [[https://starship.rs][starship]], a shell-agnostic prompt. Lets
load it:
#+begin_src fish
starship init fish | source
#+end_src
@ -74,9 +75,13 @@ starship init fish | source
:PROPERTIES:
:header-args:toml: :tangle ~/.config/starship.toml
:END:
As mentioned above, starship is a shell-agnostic prompt, written in Rust and which can be configured separately from the shell. I decided to configure it here though, since fish is the only shell I use which is compatible with starship.
As mentioned above, starship is a shell-agnostic prompt, written in
Rust and which can be configured separately from the shell. I decided
to configure it here though, since fish is the only shell I use which
is compatible with starship.
First Ill modify the default format variable, removing the modules I dont need.
First Ill modify the default format variable, removing the modules I
dont need.
#+begin_src toml
format = """
$username\
@ -117,7 +122,9 @@ $shell\
$character"""
#+end_src
I want starship to be able to detect Lisp files, be it CommonLisp or EmacsLisp. Unfortunately, it seems nerd-font doesnt have any symbol for either language, so Im just using a lambda character.
I want starship to be able to detect Lisp files, be it CommonLisp or
EmacsLisp. Unfortunately, it seems nerd-font doesnt have any symbol
for either language, so Im just using a lambda character.
#+begin_src toml
[custom.lisp]
extensions = ["lisp", "el"]
@ -186,7 +193,8 @@ disable = true
#+end_src
*** Loading ~zoxide~
~zoxide~ is a smarter ~cd~ command, accessible through ~z~. It can be loaded like so:
~zoxide~ is a smarter ~cd~ command, accessible through ~z~. It can be loaded
like so:
#+begin_src fish
zoxide init fish | source
#+end_src
@ -202,13 +210,14 @@ zoxide init fish | source
t t)
#+END_SRC
Abbreviations are a great way to keep correctly track of which commands are run
in the shell without polluting the history of the shell with obscure commands.
When typing an abbreviation, fish will replace it with replace it with its
expanded equivalent. Below are some of the abbreviations I use. Be aware some of
them that invoke GUI programs can be invoked through ~devour~ which will make
the terminal disappear while the program runs, and once the GUI program exists
the terminal window will come back.
Abbreviations are a great way to keep correctly track of which
commands are run in the shell without polluting the history of the
shell with obscure commands. When typing an abbreviation, fish will
replace it with replace it with its expanded equivalent. Below are
some of the abbreviations I use. Be aware some of them that invoke GUI
programs can be invoked through ~devour~ which will make the terminal
disappear while the program runs, and once the GUI program exists the
terminal window will come back.
*** System monitoring
Here I have some abbreviations which are quite useful when performing
@ -241,14 +250,15 @@ important threads in terms of memory usage.
#+END_SRC
*** System management (packages and services)
I added some of these abbreviations due to how often I have to write the whole
thing.
I added some of these abbreviations due to how often I have to write
the whole thing.
**** Package management
The first command is =remove= which removes a package from my system, as well as
its dependencies no longer needed. =p=. =pacman='s or =paru='s. This is why I
simply type =purge=. And if I want to simply seach among the =pacman= repos, I
can type =search=. Otherwise, if I want to include AUR results, Ill use =paru=.
The first command is =remove= which removes a package from my system, as
well as its dependencies no longer needed. =p=. =pacman='s or =paru='s. This
is why I simply type =purge=. And if I want to simply search among the
=pacman= repos, I can type =search=. Otherwise, if I want to include AUR
results, Ill use =paru=.
#+NAME: pm-abbr
| abbreviation | command |
@ -261,9 +271,9 @@ can type =search=. Otherwise, if I want to include AUR results, Ill use =paru
#+END_SRC
**** Service management
I dont have the muscle memory of =systemctl=. So instead, I simply type =c=
when I want to do something user service related. And if I want to manipulate
system services, I can instead type a simple capital =S=.
I dont have the muscle memory of =systemctl=. So instead, I simply type
=c= when I want to do something user service related. And if I want to
manipulate system services, I can instead type a simple capital =S=.
#+NAME: service-abbr
| abbreviation | command |
|--------------+------------------|
@ -275,8 +285,8 @@ system services, I can instead type a simple capital =S=.
#+END_SRC
*** Development
A good amount of these commands are development related, especially when it
comes to compilation or Docker.
A good amount of these commands are development related, especially
when it comes to compilation or Docker.
**** CMake
I have the following abbreviations to quickly run CMake and create a
@ -411,12 +421,13 @@ Here is the corresponding fish configuration:
#+END_SRC
*** Typos
Let's admit it, we all make typos from time to time in the shell, and some are
recurrent enough we make abbreviations or aliases of the correct command. Well,
I have some of my abbreviations which were make exactly because of this.
Sometimes for some reasons, my brain makes me write ~clean~ instead of ~clear~.
So, let's just replace the former by the latter. I'm also very bad at typing
~exit~. And sometimes I suck at typing ~htop~.
Let's admit it, we all make typos from time to time in the shell, and
some are recurrent enough we make abbreviations or aliases of the
correct command. Well, I have some of my abbreviations which were make
exactly because of this. Sometimes for some reason, my brain makes me
write ~clean~ instead of ~clear~. So, let's just replace the former by the
latter. I'm also very bad at typing ~exit~. And sometimes I suck at
typing ~htop~.
#+NAME: typo-abbr
| abbreviation | command |
|--------------+---------|
@ -434,17 +445,6 @@ Here is the corresponding fish configuration:
Finally, some miscellaneous abbreviations that don't really fit into any of the
above categories.
**** Screens setup
I have an automatic screen setup for when I am at home, but it
unfortunately doesnt match my setup at work. =autorandr horizontal=
does not work because my third screen is vertical, the wallpaper is
misaligned, and picom becomes too taxing on my system. I ended up
writing the following command each morning, but now a simple abbrev
does the work for me.
#+begin_src fish
abbr work 'autorandr -l work; xwallpaper --zoom (cat $HOME/.cache/wallpaper); pkill picom'
#+end_src
**** Media
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/@LofiGirl][Lofi Girl
@ -453,7 +453,7 @@ YouTube channel]]'s livestream.
abbr chill 'mpv --force-window=no --no-video "https://www.youtube.com/watch?v=jfKfPfyJRdk" &'
#+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
that window. So, I declared this abbreviation.
#+BEGIN_SRC fish
@ -467,7 +467,7 @@ abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(upl
#+END_SRC
Some sane default options for [[https://github.com/nsxiv/nsxiv][~nsxiv~]]. This includes playing GIFs and
not displaying the filename below. Nsxiv will also open in fullscreen
not displaying the filename below. Nsxiv will also open in full-screen
and will fit the displayed image to the frame. It will also output to
stdout the selected files in case I want to pipe them to another
program.
@ -481,8 +481,8 @@ GPU.
abbr nv 'env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia'
#+end_src
Finally, let's declare the following abbreviation that will launch a MPV
instance displaying my webcam:
Finally, let's declare the following abbreviation that will launch an
MPV instance displaying my webcam:
#+BEGIN_SRC fish
abbr webcam 'devour mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0 --profile=low-latency --untimed'
#+END_SRC
@ -519,29 +519,29 @@ abbreviation of ~remove~ (see [[file:./fish.md#package-management][Package manag
#+END_SRC
**** exa
#+NAME: exa-abbr
#+NAME: eza-abbr
| abbreviation | command |
|--------------+--------------------------------------------|
| exa | exa -halg@ --group-directories-first --git |
| lsl | exa -halg@ --group-directories-first --git |
| eza | eza -halg@ --group-directories-first --git |
| lsl | eza -halg@ --group-directories-first --git |
#+BEGIN_SRC fish
<<generate-abbr(table=exa-abbr)>>
<<generate-abbr(table=eza-abbr)>>
#+END_SRC
**** Network Management
First, we have just =nmcli= with sane default options, that is a pretty output
with colors.
First, we have just =nmcli= with sane default options, that is a pretty
output with colours.
#+BEGIN_SRC fish
abbr nmcli 'nmcli -p -c auto'
#+END_SRC
**** NordVPN
Next, we have some NordVPN-related shortcuts. The first one is a simple
abbreviation to =nordvpn=. The second one is a shortcut to connect to a server,
and to disconnect from the current server. I also have a couple of shortcuts to
quickly connect to some preselected countries, mainly France, Germany, Japan and
the US.
Next, we have some NordVPN-related shortcuts. The first one is a
simple abbreviation to =nordvpn=. The second one is a shortcut to
connect to a server, and to disconnect from the current server. I also
have a couple of shortcuts to quickly connect to some preselected
countries, mainly France, Germany, Japan and the US.
#+NAME: nordvpn-abbr
| abbreviation | command |
|--------------+-------------------------|
@ -558,7 +558,7 @@ the US.
#+END_SRC
**** Wget
By default, continue a download that was interupted.
By default, continue a download that was interrupted.
#+BEGIN_SRC fish
abbr wget 'wget --hsts-file="$XDG_DATA_HOME/wget-hsts" -c'
#+END_SRC
@ -581,7 +581,7 @@ function fish_command_not_found
end
#+END_SRC
Tadah! No more package suggestions from fish!
Ta-dah! No more package suggestions from fish!
I also have some private abbreviations I dont want people to know
about that I store in a separate configuration file.

View File

@ -67,8 +67,8 @@ MPD each time we run it.
#+end_src
** Audio outputs
Two audio outputs will be defined. The first one sets Pulseaudio up so
I can actually hear my music. Its configuration is simple, really.
Two audio outputs will be defined. The first one sets Pulseaudio up,
so I can actually hear my music. Its configuration is simple, really.
#+begin_src conf-space
audio_output {
type "pulse"

View File

@ -5,30 +5,32 @@
#+PROPERTY: header-args:sh+ :noweb yes :padline no :mkdirp yes
* Neofetch
[[https://github.com/dylanaraps/neofetch][Neofetch]] is a CLI utility used to display system information. It was written in
Bash, and thus its configuration file is written as a Bash script too. This
document was written with org-mode, and my configuration file is tangled from
the source blocks you will see below to ~~/.config/neofetch/config.conf~. This
configuration will only contain what I need. For any further information, please
refer to the [[https://github.com/dylanaraps/neofetch][original repository]] and [[https://github.com/dylanaraps/neofetch/wiki/Customizing-Info][its documentation]].
[[https://github.com/dylanaraps/neofetch][Neofetch]] is a CLI utility used to display system information. It was
written in Bash, and thus its configuration file is written as a Bash
script too. This document was written with org-mode, and my
configuration file is tangled from the source blocks you will see
below to ~~/.config/neofetch/config.conf~. This configuration will only
contain what I need. For any further information, please refer to the
[[https://github.com/dylanaraps/neofetch][original repository]] and [[https://github.com/dylanaraps/neofetch/wiki/Customizing-Info][its documentation]].
** The ~print_info~ functions
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
display, and how. This function looks like this:
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 display, and how. This function looks like this:
#+BEGIN_SRC sh :tangle no
print_info() {
# Print information here…
}
#+END_SRC
Generally, what we will display will be shown through the ~info~ function,
redefined inside Neofetch (this is not ~info(1)~). This ~info~ function accepts
one or two arguments. With one argument, such as with ~info memory~, we can get
a result that looks like ~5136MiB / 15873MiB~, while calling it with two
arguments will treat the first one as a prefix and the second one as the
interesting information; ~info "Memory" memory~ will look like
~Memory: 5136MiB / 15873MiB~. Here is what we want to display:
Generally, what we will display will be shown through the ~info~
function, redefined inside Neofetch (this is not ~info(1)~). This ~info~
function accepts one or two arguments. With one argument, such as with
~info memory~, we can get a result that looks like ~5136MiB / 15873MiB~,
while calling it with two arguments will treat the first one as a
prefix and the second one as the interesting information;
~info "Memory" memory~ will look like ~Memory: 5136MiB / 15873MiB~. Here
is what we want to display:
#+NAME: info-elements-table
| Prefix | Information | What it does |
|----------+-------------+------------------------------|
@ -90,10 +92,11 @@ Each of these modules can be tuned with the variables presented below.
** Information settings
Each of the following variable tunes a function that can be called in
~print_info~ described above. It is possible to tune them by modifying this
document or the configuration file itself, and they can be overridden by the
command line with flags passed to ~neofetch~. I will divide these variables in
two main categories: hardware and software-related properties.
~print_info~ described above. It is possible to tune them by modifying
this document or the configuration file itself, and they can be
overridden by the command line with flags passed to ~neofetch~. I will
divide these variables in two main categories: hardware and
software-related properties.
*** Software
**** OS
@ -112,15 +115,16 @@ This variable can shorten the output of the ~distro~ function.
distro_shorthand="off"
#+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.
****** Distro art or image
By default, Neofetch will display ascii art next to our system information
representing our distros logo. Well customize it a bit. First, lets change
the ~backend~ value. Note that most of them (except ~off~ of course) support
shorthands such as ~--kitty~ when passed as arguments from the command line. In
my case, I will use the Kitty backend since it is the native backend of the
terminal emulator I use.
By default, Neofetch will display ASCII art next to our system
information representing our distros logo. Well customize it a bit.
First, lets change the ~backend~ value. Note that most of them (except
~off~ of course) support shorthands such as ~--kitty~ when passed as
arguments from the command line. In my case, I will use the Kitty
backend since it is the native backend of the terminal emulator I use.
- Default value :: ~"ascii"~
- Values ::
- ~ascii~
@ -143,10 +147,10 @@ terminal emulator I use.
image_backend="kitty"
#+END_SRC
Now, since I indicated I wanted an image engine, Ill indicate neofetch which
image to find. Note that ~auto~ will pick the best image source for whatever
image backend is used. In ascii mode, distro ascii art will be used and in an
image mode, your wallpaper will be used.
Now, since I indicated I wanted an image engine, Ill indicate
Neofetch which image to find. Note that ~auto~ will pick the best image
source for whatever image backend is used. In ASCII mode, distro ASCII
art will be used and in an image mode, your wallpaper will be used.
- Default value :: ~auto~
- Values ::
- ~auto~
@ -272,18 +276,6 @@ It is possible to display the machines public IP address with the function
public_ip_host="http://ident.me"
#+end_src
# - Default value :: ~""~
# - Values ::
# - ~""~
# - ~""~
# - Flag :: ~""~
# - Supports ::
# - Examples ::
# - on :: ~~
# - off :: ~~
# #+begin_src sh
# #+end_src
**** Theming
This section will allow the user to modify what Neofetch can and cannot display
about the machines theming —by this, I mean its GTK theme, its icons and its
@ -413,10 +405,10 @@ cpu_cores="off"
#+end_src
***** CPU temperature
This variable allows the user to hide or show the CPUs temperature, and if
shown, the user can display it in Celcius or Farenheit degrees. For FreeBSD and
NetBSD-based systems, youll need to enable the ~coretemp~ kernel module. This
only supports newer Intel processors.
This variable allows the user to hide or show the CPUs temperature,
and if shown, the user can display it in Celsius or Fahrenheit
degrees. For FreeBSD and NetBSD-based systems, youll need to enable
the ~coretemp~ kernel module. This only supports newer Intel processors.
- Default value :: ~"off"~
- Values ::
- ~"C"~

View File

@ -37,10 +37,10 @@ shadow-offset-x = -16;
shadow-offset-y = -16;
#+END_SRC
It is possible to set the color of the shadow with the string contained in
~shadow-color~ with a hexadecimal value. I havent included these values in my
config, but this value will override any value in ~shadow-red~, ~shadow-green~,
or ~shadow-blue~.
It is possible to set the colour of the shadow with the string
contained in ~shadow-color~ with a hexadecimal value. I havent included
these values in my config, but this value will override any value in
~shadow-red~, ~shadow-green~, or ~shadow-blue~.
#+BEGIN_SRC conf
shadow-color = "#171A20"
#+END_SRC
@ -130,10 +130,10 @@ rounded-corners-exclude = [
#+END_SRC
** Fading
Picom has the ability to create some fading effects on windows when opening or
closing or when the opacity changes. The following parameter toggles this
feature on or off. However, its behavior can be changed with
~no-fading-openclose~.
Picom has the ability to create some fading effects on windows when
opening or closing or when the opacity changes. The following
parameter toggles this feature on or off. However, its behaviour can
be changed with ~no-fading-openclose~.
| Default value | ~false~ |
#+BEGIN_SRC conf
fading = true
@ -204,7 +204,8 @@ This however describes the opacity of window titlebars and borders.
frame-opacity = 1.0;
#+END_SRC
~menu-opacity~ describes the opacity for dropdown menus and popup menus.
~menu-opacity~ describes the opacity for dropdown menus and pop-up
menus.
| Default value | ~1.0~ |
| Min value | ~0.1~ |
| Max value | ~1.0~ |
@ -270,9 +271,10 @@ blur: {
}
#+END_SRC
This value enables or disables the blur for the background of semi-transparent
or ARGB windows. It has bad performances though, with driver-dependent behavior.
The name of the switch may change without prior notifications.
This value enables or disables the blur for the background of
semi-transparent or ARGB windows. It has bad performances though, with
driver-dependent behaviour. The name of the switch may change without
prior notifications.
| Default value | ~false~ |
#+BEGIN_SRC conf
blur-background = true;
@ -338,8 +340,8 @@ details.
dbus = false;
#+END_SRC
Try to detect WM windows (a non-override-redirect window with no child that has
~WM_STATE~) and markz them as active.
Try to detect WM windows (a non-override-redirect window with no child
that has ~WM_STATE~) and marks them as active.
| Default value | ~false~ |
#+BEGIN_SRC conf
mark-wmwin-focused = true;
@ -434,17 +436,17 @@ you use ~--resize-damage 2~, and so on). May or may not work with
resize-damage = 1;
#+END_SRC
Specify a list of conditions of windows that should be painted with inverted
color. Resource-hogging, and is not well tested.
Specify a list of conditions of windows that should be painted with
inverted colour. Resource-hogging, and is not well tested.
| Default value | ~[]~ |
#+BEGIN_SRC conf
invert-color-include = [];
#+END_SRC
Disable the use of damage information. This cause the whole screen to be redrawn
everytime, instead of the part of the screen has actually changed. Potentially
degrades the performance, but might fix some artifacts. The opposing option is
use-damage
Disable the use of damage information. This cause the whole screen to
be redrawn every time, instead of the part of the screen has actually
changed. Potentially degrades the performance, but might fix some
artefacts. The opposing option is use-damage
| Default value | ~false~ |
#+BEGIN_SRC conf
use-damage = false;
@ -465,8 +467,8 @@ glx-fshader-win that could turn opaque pixels transparent.
force-win-blend = false;
#+END_SRC
Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is
fullscreen based only on its size and coordinates.
Do not use EWMH to detect full-screen windows. Reverts to checking if a window is
full-screen based only on its size and coordinates.
| Default value | ~false~ |
#+BEGIN_SRC conf
no-ewmh-fullscreen = false;
@ -524,8 +526,8 @@ Write process ID to a file.
# write-pid-path = '/path/to/your/log/file';
#+END_SRC
Window type settings. ~WINDOW_TYPE~ is one of the 15 window types defined in
EWMH standard:
Window type settings. ~WINDOW_TYPE~ is one of the 15 window types
defined in EWMH standard:
- ~"unknown"~
- ~"desktop"~
- ~"dock"~
@ -542,16 +544,18 @@ EWMH standard:
- ~"combo"~
- ~"dnd"~
Following per window-type options are available:
- fade, shadow :: Controls window-type-specific shadow and fade settings.
- fade, shadow :: Controls window-type-specific shadow and fade
settings.
- opacity :: Controls default opacity of the window type.
- focus :: Controls whether the window of this type is to be always considered
focused. (By default, all window types except "normal" and "dialog" has this
on.)
- full-shadow :: Controls whether shadow is drawn under the parts of the window
that you normally won't be able to see. Useful when the window has parts of it
transparent, and you want shadows in those areas.
- focus :: Controls whether the window of this type is to be always
considered focused. (By default, all window types except =normal= and
=dialog= has this on.)
- full-shadow :: Controls whether shadow is drawn under the parts of
the window that you normally won't be able to see. Useful when the
window has parts of it transparent, and you want shadows in those
areas.
- redir-ignore :: Controls whether this type of windows should cause
screen to become redirected again after being unredirected. If you
screen to become redirected again after being not redirected. If you
have =unredir-if-possible= set, and doesn't want certain window to
cause unnecessary screen redirection, you can set this to =true=.
#+BEGIN_SRC conf
@ -566,18 +570,19 @@ wintypes:
#+END_SRC
*** GLX backend-specific options
Avoid using stencil buffer, useful if you don't have a stencil buffer. Might
cause incorrect opacity when rendering transparent content (but never
practically happened) and may not work with blur-background. Tests show a 15%
performance boost. Recommended.
Avoid using stencil buffer, useful if you don't have a stencil buffer.
Might cause incorrect opacity when rendering transparent content (but
never practically happened) and may not work with blur-background.
Tests show a 15% performance boost. Recommended.
| Default value | ~false~ |
#+BEGIN_SRC conf
glx-no-stencil = true;
#+END_SRC
Avoid rebinding pixmap on window damage. Probably could improve performance on
rapid window content changes, but is known to break things on some drivers
(LLVMpipe, xf86-video-intel, etc.). Recommended if it works.
Avoid rebinding pixmap on window damage. Probably could improve
performance on rapid window content changes, but is known to break
things on some drivers (LLVMpipe, xf86-video-intel, etc.). Recommended
if it works.
| Default value | ~false~ |
#+BEGIN_SRC conf
glx-no-rebind-pixmap = false;
@ -585,7 +590,8 @@ glx-no-rebind-pixmap = false;
Use specified GLSL fragment shader for rendering window contents. See
~compton-default-fshader-win.glsl~ and
~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 | ~''~ |
#+BEGIN_SRC conf :tangle no
glx-fshader-win = '';

View File

@ -12,38 +12,46 @@ First, we are using the 2018 edition of Rust.
#+BEGIN_SRC toml
edition = "2018"
#+END_SRC
Put single-expression functions on a single line.
#+BEGIN_SRC toml
fn_single_line = true
#+END_SRC
Format string literals where necessary.
#+BEGIN_SRC toml
format_strings = true
#+END_SRC
Maximum width of each line
#+BEGIN_SRC toml
max_width = 80
#+END_SRC
Merge multiple imports into a single nested import.
#+BEGIN_SRC toml
merge_imports = true
#+END_SRC
** Structs and Enums
The maximum length of enum variant having discriminant, that gets vertically
aligned with others. Variants without discriminants would be ignored for the
purpose of alignment.
The maximum length of enum variant having discriminant, that gets
vertically aligned with others. Variants without discriminants would
be ignored for the purpose of alignment.
Note that this is not how much whitespace is inserted, but instead the longest
variant name that doesn't get ignored when aligning.
Note that this is not how much whitespace is inserted, but instead the
longest variant name that doesn't get ignored when aligning.
#+BEGIN_SRC toml
enum_discrim_align_threshold = 20
#+END_SRC
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
struct_field_align_threshold = 20
#+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
reorder_impl_items = true
#+END_SRC
@ -53,14 +61,17 @@ Convert ~/* */~ comments to ~//~ comments where possible.
#+BEGIN_SRC toml
normalize_comments = true
#+END_SRC
Break comments to fit on the line.
#+BEGIN_SRC toml
wrap_comments = true
#+END_SRC
Report ~FIXME~ items in comments.
#+BEGIN_SRC toml
report_fixme = "Always"
#+END_SRC
Report ~TODO~ items in comments.
#+BEGIN_SRC toml
todo = "Always"
@ -71,6 +82,7 @@ Format code snippet included in doc comments.
#+BEGIN_SRC toml
format_code_in_doc_comments = true
#+END_SRC
Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
#+BEGIN_SRC toml
normalize_doc_attributes = true
@ -81,10 +93,12 @@ Use tab characters for indentation, spaces for alignment.
#+BEGIN_SRC toml
hard_tabs = false
#+END_SRC
Number of spaces per tab.
#+BEGIN_SRC toml
tab_spaces = 4
#+END_SRC
I want newlines to always be Unix style.
#+BEGIN_SRC toml
newline_style = "Unix"

View File

@ -128,9 +128,9 @@ fi
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/backup
:END:
~backup~ is a very simple, oneliner script that will create a local copy of a
file and add the date at which it was copied in the filename. You can see its
source code here:
~backup~ is a very simple, one-liner script that will create a local
copy of a file and add the date at which it was copied in the
filename. You can see its source code here:
#+BEGIN_SRC fish
cp -r $argv[1] $argv[1].bak.(date +"%Y%m%d%H%M%S")
#+END_SRC
@ -143,7 +143,7 @@ As I am using a laptop, maximum performance isnt always what I want.
Sometimes, its just better to have not so great but less
battery-demanding performance. It is possible to achieve this by
modifying the CPU governor with ~cpupower~. The [[https://wiki.archlinux.org/title/CPU_frequency_scaling#Scaling_governors][Arch Wiki]] has, as usual,
some really good documentation on this.
some superb documentation on this.
The following script asks the user through ~rofi~ which governor to
apply, and it relies on [[file:./scripts.md#askpass][askpass]] to retrieve the users password.
@ -172,13 +172,13 @@ printf "^f3^f0 %d" $NB_CONTAINERS
:END:
This script comes straight from [[https://charm.sh/blog/kamoji-generator/][this blog post]] and generates kamoji. I
modified it a bit in order to work with either =xclipboard= or =wl-copy=
depending on whether I am in a X.org session or a Wayland session.
depending on whether I am in an X.org session or a Wayland session.
Note that it requires the =OPENAI_API_KEY= environment variable to be
set with a valid OpenAI key.
#+begin_src bash
# If the user passes '-h', '--help', or 'help' print out a little bit of help.
# text.
# If the user passes '-h', '--help', or 'help' print out a little bit
# of help. text.
case "$1" in
"-h" | "--help" | "help")
printf 'Generate kaomojis on request.\n\n'
@ -187,28 +187,29 @@ case "$1" in
;;
esac
# The user can pass an argument like "bear" or "angry" to specify the general
# kind of Kaomoji produced.
# The user can pass an argument like "bear" or "angry" to specify the
# general kind of Kaomoji produced.
sentiment=""
if [[ $1 != "" ]]; then
sentiment=" $1"
fi
# Ask mods to generate Kaomojis. Save the output in a variable.
kaomoji="$(mods "generate 10${sentiment} kaomojis. number them and put each one on its own line.")"
kaomoji="$(mods "generate 10${sentiment} kaomojis. Number them and put each one on its own line.")"
if [[ $kaomoji == "" ]]; then
exit 1
fi
# Pipe mods output to gum so the user can choose the perfect kaomoji. Save that
# choice in a variable. Also note that we're using cut to drop the item number
# in front of the Kaomoji.
# Pipe mods output to gum, so the user can choose the perfect kaomoji.
# Save that choice in a variable. Also note that we're using cut to
# drop the item number in front of the Kaomoji.
choice="$(echo "$kaomoji" | gum choose | cut -d ' ' -f 2)"
if [[ $choice == "" ]]; then
exit 1
fi
# If the current session is Wayland, copy with wl-copy, otherwise copy with xclipboard
# If the current session is Wayland, copy with wl-copy, otherwise copy
# with xclipboard
if [ "$XDG_SESSION_TYPE" = "wayland" ]
then printf '%s' "$choice" | wl-copy # Wayland
else printf '%s' "$choice" | xclip -sel clip # X11
@ -226,7 +227,7 @@ printf 'Copied %s to the clipboard\n' "$choice"
unread emails I have through the use of ~mu~.
As you can see, the output string contains two font switchers for
StumpWM so I can switch from the main font to Siji for the caracter
StumpWM so I can switch from the main font to Siji for the character
contained between them: U+E072 (an email icon).
#+begin_src sh
UNREAD=$(mu find "flag:unread AND (maildir:/Inbox OR maildir:/Junk)" | wc -l)
@ -254,7 +255,7 @@ nsxiv -abfs f "$HOME/Pictures/Screenshots/$*"
This is a utility only useful with Wayland for now, using =grim=, =slurp=
(in order to select which area of the screen I wish to capture) and
=wl-copy= (from =wl-clipboard=). It saves the screenshot in my
=$HOME/Pictures/Screenshots= directory with a name formated as
=$HOME/Pictures/Screenshots= directory with a name formatted as
=Screenshot_20230425_134550.png= if the screenshot was taken on the 25th
of April 2023 at 1:45:50PM. If the file already exists, the script
will suffix the name with an underscore followed by an incremental
@ -326,15 +327,15 @@ ssh -L $argv[1]:$argv[3]:$argv[1] $argv[2] -N
:PROPERTIES:
:HEADER-ARGS: :mkdirp yes :tangle no :noweb yes
:END:
One thing I like with ~nsxiv~ is you can trigger different behaviors
based on keypresses. For instance, with my current nsxiv configuration,
if I press the space key followed by a character, it can delete to the
trashcan, delete definitively, or open the current image in GIMP. All
of that is done through one script file stored in
~$HOME/.config/nsxiv/exec/key-handler~. The fact it reacts to first the
spacebar instead of /Ctrl-x/ is because I use a custom version of nsxiv I
first modified to fit the bépo layout, and then I decided to change
the prefix to fit how I use Emacs and StumpWM. You can read the
One thing I like with ~nsxiv~ is you can trigger different behaviours
based on keypresses. For instance, with my current nsxiv
configuration, if I press the space key followed by a character, it
can delete to the trashcan, delete definitively, or open the current
image in GIMP. All of that is done through one script file stored in
~$HOME/.config/nsxiv/exec/key-handler~. The fact it reacts to first
thespace bar instead of /Ctrl-x/ is because I use a custom version of
nsxiv I first modified to fit the bépo layout, and then I decided to
change the prefix to fit how I use Emacs and StumpWM. You can read the
PKGBUILD and my nsxiv patch [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/Documents/code/PKGBUILDs/sxiv][in my dotfiles repo]].
#+header: :shebang "#!/usr/bin/env fish" :tangle ~/.config/nsxiv/exec/key-handler
@ -466,12 +467,13 @@ telnet towel.blinkenlights.nl
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/tttapping
:END:
For some reasons, my firmware does not recognize the function key for toggling
the touchpad. Im not going to really complain about it since it lets me program
it like I want. Since I often dont need to completely deactivate the touchpad,
Ill instead toggle whether tapping is enabled or not when pressing
~XF86TouchpadToggle~. And for that, I need this small script that will actually
toggle it, and it will be used in my window manager configuration.
For some reason, my firmware does not recognize the function key for
toggling the touchpad. Im not going to really complain about it since
it lets me program it like I want. Since I often dont need to
completely deactivate the touchpad, Ill instead toggle whether
tapping is enabled or not when pressing ~XF86TouchpadToggle~. And for
that, I need this small script that will actually toggle it, and it
will be used in my window manager configuration.
First lets declare some variables to make this script more personal. With my
current computer (a Gazelle by System76), the name of my touchpad is the
@ -533,7 +535,7 @@ emacsclient -c -a emacs -e "(dired \"$*\")"
:HEADER-ARGS: :shebang "#!/bin/bash" :mkdirp yes :tangle ~/.local/bin/ediff
:END:
I want Ediff as my merge tool, not just with Git but with other
programs too such as =pacdiff=.
programs tooa, such as =pacdiff=.
#+begin_src bash
emacsclient -c -a emacs -e "(ediff-files \"$1\" \"$2\")"
#+end_src
@ -564,9 +566,9 @@ ffmpeg -i $argv[1] -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis $argv[1].webm
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/ytplay
:END:
~ytplay~ is a simple script Ive written that allows me to play in mpv any
YouTube video at the desired resolution. The script relies on ~dmenu~ (or ~rofi~
in dmenu-mode), ~youtube-dl~ and of course ~mpv~ itself.
~ytplay~ is a simple script Ive written that allows me to play in MPV
any YouTube video at the desired resolution. The script relies on
~dmenu~ (or ~rofi~ in dmenu-mode), ~youtube-dl~ and of course ~mpv~ itself.
#+BEGIN_SRC fish
set URL (rofi -dmenu -i -p "Video URL")
if test -n "$URL"
@ -899,14 +901,15 @@ end
#+END_SRC
***** Download a Single Video
In order to download a single video, a simple function has been written for this
that will display when downloaded how far it is down the list of videos to be
downloaded and it will add its ID to the file listing all videos downloaded. The
script will also try to download the video according to the ~PREFFERED_FORMAT~
variable, but if the download fails it will download the default format selected
by ~youtube-dl~. If both downloads fail, the ID of the video will be added to
the list of failed videos. If one of the downloads succeeds, it will remove the
ID from the list of failed downloads.
In order to download a single video, a simple function has been
written for this that will display when downloaded how far it is down
the list of videos to be downloaded, and it will add its ID to the
file listing all videos downloaded. The script will also try to
download the video according to the ~PREFFERED_FORMAT~ variable, but if
the download fails it will download the default format selected by
~youtube-dl~. If both downloads fail, the ID of the video will be added
to the list of failed videos. If one of the downloads succeeds, it
will remove the ID from the list of failed downloads.
The first argument of the function is the video ID from YouTube, the second
argument is the position of the video in the queue, and the third argument is
@ -969,16 +972,17 @@ by ~#~, ~;~ and ~]~ (just like ~youtube-dl~) and will download them, assuming
these are channel URLs or playlist URLs, however it should also work with direct
video URLs.
What this function does is for each line, it will fetch the entierty of the
video IDs found in a playlist or channel. Then, it will look each ID up the list
of already downloaded videos and will add all new IDs to a queue of videos to be
downloaded. It will then pass each new video ID to ~_ytdl_download_video~
directly. Beware that if you pass directly the URL of the channel, such as
~https://www.youtube.com/user/enyay~ if you want to download Tom Scotts videos,
it will download everything on the main page of their channel, which means it
will even download videos from playlists they decided to put on their channels
front page, even if it is not theirs. So in that case, we need to append
~/videos~ to any channel URL.
What this function does is for each line, it will fetch the entirety
of the video IDs found in a playlist or channel. Then, it will look
each ID up the list of already downloaded videos and will add all new
IDs to a queue of videos to be downloaded. It will then pass each new
video ID to ~_ytdl_download_video~ directly. Beware that if you pass
directly the URL of the channel, such as
~https://www.youtube.com/user/enyay~ if you want to download Tom Scotts
videos, it will download everything on the main page of their channel,
which means it will even download videos from playlists they decided
to put on their channels front page, even if it is not theirs. So in
that case, we need to append ~/videos~ to any channel URL.
#+BEGIN_SRC fish
function _ytdl_download_batch
set -q $FILE
@ -1212,7 +1216,7 @@ begin
#+END_SRC
What the script does first is detect everything that can be mounted. Between a
=begin= and =end=, lets set =LFS= as a local variable. This si in order to get
=begin= and =end=, lets set =LFS= as a local variable. This is in order to get
sane variables in the current block.
#+BEGIN_SRC fish
set -l LFS
@ -1243,10 +1247,10 @@ And thats the end of our first block!
end
#+END_SRC
Alright, well save what kind on drives we can mount in a temporary file called
=/tmp/drives=. Well make sure its blank by erasing it then creating it again
with =touch=, like so. The =-f= flag on =rm= is here so we get no error if we
try to delete a file that doesnt exist (yet).
Alright, well save what kind on drives we can mount in a temporary
file called =/tmp/drives=. Well make sure its blank by erasing it then
creating it again with =touch=, like so. The =-f= flag on =rm= is here, so
we get no error if we try to delete a file that doesnt exist (yet).
#+BEGIN_SRC fish
set -g TMPDRIVES /tmp/drives
rm -f $TMPDRIVES
@ -1267,16 +1271,16 @@ set -g basemount /media
#+END_SRC
***** Get the mount point
Now, lets declare a function that will allow us to chose the drive we want to
mount.
Now, lets declare a function that will allow us to choose the drive
we want to mount.
#+BEGIN_SRC fish
function getmount
#+END_SRC
First, we want to get our mount point. Well run a =find= command on each of the
directories listed in =$basemount= to look for folders on which our drive could
be mounted. This list will be passed to rofi from which we will chose our mount
point.
First, we want to get our mount point. Well run a =find= command on
each of the directories listed in =$basemount= to look for folders on
which our drive could be mounted. This list will be passed to rofi
from which we will choose our mount point.
#+BEGIN_SRC fish
set -g mp (for d in $basemount
find $d -maxdepth 5 -type d
@ -1319,9 +1323,10 @@ care of it for us.
function mountusb
#+END_SRC
Now, the first thing we want to do is select the partition we want to mount.
Remember, we stored those in =$usbdrives= earlier, so lets pipe them into rofi
so we can chose from it. Also, =awk= will get their path in =/dev=.
Now, the first thing we want to do is select the partition we want to
mount. Remember, we stored those in =$usbdrives= earlier, so lets pipe
them into rofi, so we can choose from it. Also, =awk= will get their
path in =/dev=.
#+BEGIN_SRC fish
set -g chosen (echo $usbdrives | \
rofi -dmenu -i -p "Mount which drive?" | \
@ -1346,8 +1351,8 @@ the script.
test -z $mp && return 1
#+END_SRC
Now, lets mount it! Well use a switch which will detect the filesystem used so
we know how to mount the partition.
Now, lets mount it! Well use a switch which will detect the
filesystem used, so we know how to mount the partition.
#+BEGIN_SRC fish
switch (lsblk -no "fstype" $chosen)
#+END_SRC
@ -1371,8 +1376,8 @@ case '*'
sudo -A mount $chosen $mp
#+END_SRC
Well also run a =chown= on this newly mounted filesystem so the user can access
it without any issues.
Well also run a =chown= on this newly mounted filesystem, so the user
can access it without any issues.
#+BEGIN_SRC fish
sudo -A chown -R $USER:(id -g $USER) $mp
#+END_SRC
@ -1412,13 +1417,14 @@ Lets temporarily mount our device.
jmtpfs -device=$chosen $mp
#+END_SRC
Now, we need to allow our computer to mount our Android device. Depending on the
Android version it is running on, we either need to specify our device is USB
connected in order to exchange files, or Android will explicitely ask us if it
is OK for our computer to access it. Lets inform the user of that.
Now, we need to allow our computer to mount our Android device.
Depending on the Android version it is running on, we either need to
specify our device is USB connected in order to exchange files, or
Android will explicitly ask us if it is OK for our computer to access
it. Lets inform the user of that.
#+BEGIN_SRC fish
echo "OK" | \
rofi -dmenu -i -p "Press (Allow) on your phone screen, or set your USB settings to allow file transfert"
rofi -dmenu -i -p "Press (Allow) on your phone screen, or set your USB settings to allow file transfer"
#+END_SRC
Now, lets get the actual path of our Android filesystem we wish to mount, and
@ -1428,7 +1434,7 @@ set newchosen (jmtpfs -l | grep $bus | awk '{print $1 $2}' | sed 's/,$//')
sudo -A umount $mp
#+END_SRC
Now we cam mount the new filesystem and send a notification if everything went
Now we can mount the new filesystem and send a notification if everything went
well.
#+BEGIN_SRC fish
jmtpfs -device=$newchosen $mp && \
@ -1471,15 +1477,15 @@ end
#+END_SRC
***** Ask what type of drive we want to mount
The first thing we will be asked if different types of drives are detected is
which of these types the user wishes to mount. This is done with the function
=asktype= which is declared below.
The first thing we will be asked if different types of drives are
detected is which of these types the user wishes to mount. This is
done with the function =asktype= which is declared below.
#+BEGIN_SRC fish
function asktype
#+END_SRC
We will use a switch statement which will use our anwser to rofi about what we
wish to mount.
We will use a switch statement which will use our answer to rofi about
what we wish to mount.
#+BEGIN_SRC fish
switch (cat $TMPDRIVES | rofi -dmenu -i -p "Mount which drive?")
#+END_SRC
@ -1823,8 +1829,8 @@ if test -z $password
end
#+END_SRC
Depending on the arguments passed earlier, we might want some different
behavior.
Depending on the arguments passed earlier, we might want some
different behaviour.
#+BEGIN_SRC fish :noweb yes
if test $TYPE = "yes"
<<rofi-pass-type>>
@ -1833,8 +1839,8 @@ else
end
#+END_SRC
The default behavior is to copy the password to the clipboard for 45 seconds, so
lets do that.
The default behaviour is to copy the password to the clipboard for 45
seconds, so lets do that.
#+NAME: rofi-pass-copy
#+BEGIN_SRC fish :noweb yes :tangle no
pass show -c $password 2> /dev/null

View File

@ -8,7 +8,7 @@
** Introduction
*** What is StumpWM?
[[https://stumpwm.github.io/][StumpWM]] is a tiling window manager inheriting from [[http://www.nongnu.org/ratpoison/][RatPoison]], written
entirely in [[https://common-lisp.net/][Common Lisp]] and compiled with [[http://www.sbcl.org/][SBCL]]. While it is not an
entirely in [[https://common-lisp.net/][Common Lisp]] and compiled with [[http://www.sbcl.org/][SBCL]]. While it is not a
dynamic tiling window manager like [[file:Deprecated/awesome.org][Awesome]] is, its ability of managing
windows in frames and using keychords with keymaps like Emacs does is
a huge plus for me, not to mention the fact its configuration file is
@ -28,12 +28,12 @@ This file has two main goals:
configuration, thanks to Emacs org-mode, and thanks to org-modes
literate config capabilities.
Almost all of the visible source blocks if not all will be included
in my configuration files through tangling, which can be done in
Emacs when this file is opened through ~M-x org-babel-tangle~, which
will write my configuration files based on the source blocks present
in this document. This file is not only my configs documentation,
it /*is*/ my configuration.
Almost all the visible source blocks if not all will be included in
my configuration files through tangling, which can be done in Emacs
when this file is opened through ~M-x org-babel-tangle~, which will
write my configuration files based on the source blocks present in
this document. This file is not only my configs documentation, it
/*is*/ my configuration.
- Be my documentation on my StumpWM configuration. That way, Ill
never forget which block of code does what.
@ -50,7 +50,7 @@ follows this architecture:
- ~init.el~ :: My main configuration file, glues everything together. It
loads all of my configuration files as well as some modules I find
useful;
- ~colors.lisp~ :: This file defines colors that will be used in my
- ~colors.lisp~ :: This file defines colours that will be used in my
~theme.lisp~ and ~modeline.lisp~ files. Lets make my code DRY, or as I
prefer to say, DRYD (/Dont Repeat Yourself Dummy/).
- ~commands.lisp~ :: Lisp commands, in case I want to bind some
@ -66,7 +66,7 @@ follows this architecture:
- ~utilities.lisp~ :: Here you can find my StumpWM configuration that
isnt really related to the rest of the config, for instance utility
code for connecting by SSH to some host.
- ~theme.lisp~ :: manages the color theme of StumpWM, the default
- ~theme.lisp~ :: manages the colour theme of StumpWM, the default
placement of some windows and StumpWMs gaps.
You will also find below my ~xinit~ file for StumpWM, exported to
@ -239,13 +239,13 @@ Finally, we can notify the user everything is ready.
And its done! We can now move on to the creation of the other CLisp files.
** Colors
** Colours
:PROPERTIES:
:header-args:lisp: :mkdirp yes :tangle ~/.stumpwm.d/colors.lisp
:END:
If youve taken a look at the rest of my dotfiles, you may have
noticed I really like the [[https://www.nordtheme.com/][Nord theme]]. No wonder we can find it here
again! Here is a small table listing the Nord colors:
If youve had a look at the rest of my dotfiles, you may have noticed
I really like the [[https://www.nordtheme.com/][Nord theme]]. No wonder we can find it here again!
Here is a small table listing the Nord colours:
#+name: nord-colors
| Name | Value |
|--------+---------|
@ -299,7 +299,7 @@ code looks like so:
#+end_src
Finally, lets also modify the default colors StumpWM has. Ill try to
respect the original colors while converting them to Nord. We also
respect the original colours while converting them to Nord. We also
need to reload them now that we modified them.
#+begin_src lisp
(setq *colors*
@ -352,7 +352,7 @@ The modeline is pretty easy. First, lets load the ~colors.lisp~ file we just
(load "~/.stumpwm.d/colors.lisp")
#+end_src
Next, we can set some colors for the modeline. Lets set the
Next, we can set some colours for the modeline. Lets set the
background of the modeline to Nord1 and the foreground to Nord5, I
think this is a pretty good combination.
#+begin_src lisp
@ -361,7 +361,7 @@ think this is a pretty good combination.
#+end_src
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 colour to Nord1, just in case.
#+begin_src lisp
(setf *mode-line-border-color* phundrak-nord1
,*mode-line-border-width* 0)
@ -394,7 +394,7 @@ Here are some modules that we will load for the modeline:
(load-module "mem")
#+end_src
We need to set some variables so modules can be displayed correctly.
We need to set some variables, so modules can be displayed correctly.
Note that the character between the font switchers in the second CPU
formatter is U+E082, which symbolizes the CPU.
#+begin_src lisp
@ -474,7 +474,7 @@ when the `car' is a formatter and t when it is a shell command."
#+end_src
It is then easy to define a command that can call this function and
set this variable so we can sort of reload the mode-line.
set this variable, so we can sort of reload the mode-line.
#+begin_src lisp
(defcommand reload-modeline () ()
"Reload modeline."
@ -554,7 +554,7 @@ are manual tiling groups. Otherwise, as you can see above, they can
also be dynamic tiling groups or floating groups.
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 behaviour.
#+begin_src lisp
(clear-window-placement-rules)
#+end_src
@ -595,7 +595,8 @@ of the available space.
:PROPERTIES:
:header-args:lisp: :mkdirp yes :tangle ~/.stumpwm.d/theme.lisp :noweb yes
: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
colours.
#+begin_src lisp
(load "~/.stumpwm.d/colors.lisp")
#+end_src
@ -627,7 +628,7 @@ src_lisp[:exports code]{(ql:add-to-init-file)} so it is loaded each
time you start your Lisp interpreter. ~SBCL~ should be your CommonLisp
interpreter of choice since StumpWM is generally compiled with it. The
main advantage is also that SBCL supports multithreading, unlike
clisp. In case StumpWM doesnt find your font, spin up SBCL and
CLisp. In case StumpWM doesnt find your font, spin up SBCL and
execute the following lines:
#+begin_src lisp :tangle no
(ql:quickload :clx-truetype)
@ -728,7 +729,7 @@ want to get them back, theyll be nice to have.
(set-float-unfocus-color phundrak-nord3)
#+end_src
Lets also set the colors of the message and input windows:
Lets also set the colours of the message and input windows:
#+begin_src lisp
(set-fg-color phundrak-nord4)
(set-bg-color phundrak-nord1)
@ -794,7 +795,7 @@ Finally, lets enable our gaps:
:END:
The first command I declare in this file is a command that will avoid
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:
#+begin_src lisp
(defcommand firefox () ()
@ -837,56 +838,6 @@ a program.
"kitty")))))
#+end_src
*** At work
When Im at work, I have a desktop layout I always use. No need to
describe it here, but I want a quick command to save my layout in case
I change it a bit as well as a command to load it. That way, I can
automatically organize my screens. These command will save and load
the dump where the variable ~*my/desktop-dump-file*~ points at.
#+begin_src lisp
(defvar *my/desktop-dump-file* "~/.cache/stump-at-work"
"Where my desktop dump should go and be loaded from.")
#+end_src
To save the current desktop, I can write a wrapper around
~dump-desktop-to-file~.
#+begin_src lisp
(defcommand dump-work () ()
"Save desktop layout when at work."
(dump-desktop-to-file *my/desktop-dump-file*))
#+end_src
Basically the same goes for loading the desktop layout, but this time
its ~restore-from-file~ thats wrapped. I also want to launch Global
Protect at the same time, because I always forget to before launching
~launch-work~ described below, and automatically connect my bluetooth
headset.
#+begin_src lisp
(load-module "swm-gaps")
(defcommand at-work () ()
"Restore desktop layout when at work."
(swm-gaps:toggle-gaps-off)
(run-shell-command "pkill picom" t)
(run-shell-command "autorandr -l work" t)
(run-shell-command "xwallpaper --zoom $(cat $HOME/.cache/wallpaper)" t)
(run-shell-command "gpclient")
(run-shell-command "bluetoothctl power on && bluetoothctl connect 14:3F:A6:6D:E3:D9"))
#+end_src
If I want to quickly launch all programs I will need, I can also
invoke the command ~launch-work~.
#+begin_src lisp
(defcommand launch-work () ()
"Launch programs I need at work."
(run-shell-command "firefox")
(run-shell-command "remmina")
(run-shell-command "kitty tmux")
(run-shell-command "teams")
(run-shell-command "discord")
(restore-from-file *my/desktop-dump-file*)
(restore-window-placement-rules "~/.cache/placement-rules"))
#+end_src
** Keybinds
:PROPERTIES:
:header-args:lisp: :mkdirp yes :tangle ~/.stumpwm.d/keybindings.lisp :noweb yes
@ -911,7 +862,7 @@ a couple of keybinds to other keymaps. I hope this will get improved
soon.
There are also two keymaps you need to be aware of:
- ~*top-map*~ :: This is the keymap available litteraly everywhere. With
- ~*top-map*~ :: This is the keymap available literally everywhere. With
this keymap, you can emulate most of your keybinds you have in other
window managers. For instance, I cannot live without ~s-RET~ for
creating new shells, so Ill bind it to ~*top-map*~. But its good
@ -928,7 +879,7 @@ which would be displayed instead of the actual function or keymap
called by keybind. It would be nicer to see ~frames~ rather than
~*my-frames-management-keymap*~.
Anyways, as mentionned above, ~*root-map*~ is already pre-populated with
Anyway, as mentioned above, ~*root-map*~ is already pre-populated with
some cool stuff for you, and you can access it with a prefix which is
by default ~C-t~. But if this doesnt suit you, you can always redefine
it with ~set-prefix-key~. I personally like to have my space key as a
@ -1020,7 +971,7 @@ such as « or » and have them replaced with their actual name when
*** Applications
When I speak about applications, I speak about programs and scripts in
general. With these keymaps, I can launch programs I often have use
general. With these keymaps, I can launch programs I have often use
for, but I can also launch some scripts as well as take screenshots.
First, lets create my ~rofi~ scripts keymap.
@ -1107,7 +1058,7 @@ and the ~XF86Mail~ key opens mu4e in Emacs.
The module ~end-session~ provides functions for gracefully ending the
user session, powering off, restarting, and suspending the computer.
It also provides a function that interactively asks what the user
whishes to do.
wishes to do.
#+name: end-session-keymap
| Keychord | Function |
|----------+-------------------|
@ -1539,7 +1490,7 @@ anywhere else:
#+end_src
From time to time, I need to switch between different keyboard
layouts, especially to the US Qwerty layout when Im playing some
layouts, especially to the US QWERTY layout when Im playing some
games and the bépo layout most of the time. Ill use the command
~switch-layout~ defined above.
#+name: keyboard-layout-map
@ -1562,7 +1513,7 @@ games and the bépo layout most of the time. Ill use the command
:header-args:lisp: :mkdirp yes :tangle ~/.stumpwm.d/utilities.lisp :noweb yes
:END:
Part of my configuration is not really related to StumpWM itself, or
rather it adds new behavior StumpWM doesnt have. ~utilities.lisp~
rather it adds new behaviour StumpWM doesnt have. ~utilities.lisp~
stores all this code in one place.
*** Binwarp
@ -1593,12 +1544,12 @@ Binwarp mode is now available from the keybind ~s-m~ at top level.
:PROPERTIES:
:header-args:lisp: :mkdirp yes :tangle ~/.stumpwm.d/bluetooth.lisp :noweb yes
:END:
Although there is a bluetooth module for the modeline, this is about
the extent to which StumpWM can interact with the systems bluetooth.
However, I wish for some more interecactivity, like powering on and
off bluetooth, connecting to devices and so on.
Although there is a Bluetooth module for the modeline, this is about
the extent to which StumpWM can interact with the systems Bluetooth.
However, I wish for some more interactivity, like powering on and
off Bluetooth, connecting to devices and so on.
First, out code relies on ~cl-ppcre~, so lets quickload it.
Firstly, our code relies on ~cl-ppcre~, so lets quickload it.
#+begin_src lisp
(ql:quickload :cl-ppcre)
#+end_src
@ -1610,7 +1561,7 @@ Lets indicate which command well be using.
#+end_src
**** Utilities
Well need a couple of functions that will take care of stuff for us
Well need a couple of functions that will take care of stuff for us,
so we dont have to repeat ourselves. The first one is a way for us to
share a message. The function ~bluetooth-message~ will first display
~Bluetooth:~ in green, then it will display the message we want it to
@ -1637,7 +1588,7 @@ with a space as their separator.
Now we can put ~bluetooth-make-command~ to use with ~bluetooth-command~
which will actually run the result of the former. As you can see, it
also collects the output so we can display it later in another
also collects the output, so we can display it later in another
function.
#+begin_src lisp
(defmacro bluetooth-command (&rest args)
@ -1656,8 +1607,8 @@ call src_lisp[:exports code]{(bluetooth-message-command "power"
#+end_src
**** Toggle Bluetooth On and Off
This part is easy. Now that we can call our bluetooth commands easily,
we can easily define how to turn on bluetooth.
This part is easy. Now that we can call our Bluetooth commands easily,
we can easily define how to turn on Bluetooth.
#+begin_src lisp
(defcommand bluetooth-turn-on () ()
"Turn on bluetooth."
@ -1672,7 +1623,7 @@ And how to power it off.
#+end_src
**** Bluetooth Devices
In order to manipulate bluetooth device, which we can represent as a
In order to manipulate Bluetooth device, which we can represent as a
MAC address and a name, we can create a structure that will make use
of a constructor for simpler use. The constructor
~make-bluetooth-device-from-command~ expects an entry such as ~Device
@ -1704,10 +1655,10 @@ We can now collect our devices easily.
#+end_src
**** Connect to a device
When we want to connect to a bluetooth device, we always need
bluetooth turned on, so ~bluetooth-turn-on~ will always be called. Then
When we want to connect to a Bluetooth device, we always need
Bluetooth turned on, so ~bluetooth-turn-on~ will always be called. Then
the function will attempt to connect to the device specified by the
~device~ argument, whether the argument is a bluetooth structure as
~device~ argument, whether the argument is a Bluetooth structure as
defined above or a plain MAC address.
#+begin_src lisp
(defun bluetooth-connect-device (device)
@ -1722,7 +1673,7 @@ defined above or a plain MAC address.
#+end_src
The command to connect to a device displays a choice between the
collected bluetooth device and the user only has to select it. It will
collected Bluetooth device and the user only has to select it. It will
then attempt to connect to it.
#+begin_src lisp
(defcommand bluetooth-connect () ()
@ -1739,7 +1690,7 @@ then attempt to connect to it.
**** Keybinds
Its all nice and all, but typing manually the commands with ~s-SPC ;~
is a bit tiring, so lets define our bluetooth keymap which we will
is a bit tiring, so lets define our Bluetooth keymap which we will
bind to ~s-SPC B~.
#+name: bluetooth-keymap
| Keychord | Command |
@ -1843,8 +1794,8 @@ Im currently in the process of writing functions to interact with
Systemd directly through StumpWM. For now, not much work is done, but
its a start.
First of all, I have the following function that lists all the system
or user services.
Firstly, I have the following function that lists all the system or
user services.
#+begin_src lisp
(defun systemd-get-services (&key user-p)
"Collect all systemd services running.

View File

@ -32,7 +32,7 @@ set-window-option -g mode-keys vi
** Windows and panes configuration
Although I agree in computer science most things should begin with
zero, I find it quite weird to see my first window and my first pane
to be labeled with it rather than one. So, lets pull a Lua on Tmux
to be labelled with it rather than one. So, lets pull a Lua on Tmux
and force it to begin with 1 instead of 0.
#+begin_src tmux
set -g base-index 1
@ -106,9 +106,9 @@ set -g @resurrect-processes '<<resurrect-processes()>>'
#+end_src
** Keybindings
First of all, I dont like prefixing all of my keybindings with ~C-b~,
thats what I use in ~insert-mode~ in Emacs to make the cursor go back.
So instead, lets set meta with space as my prefix.
Firstly, I dont like prefixing all of my keybindings with ~C-b~, thats
what I use in ~insert-mode~ in Emacs to make the cursor go back. So
instead, lets set meta with space as my prefix.
#+begin_src tmux
unbind C-b
set -g prefix M-Space
@ -222,7 +222,10 @@ with the main prefix.
<<gen-keybinds(keybinds=windows-prefix, prefix="windows")>>
#+end_src
In order to access more easily the different windows, I want to be able to type =<prefix> TAB <window number>=. However, Im using the bépo layout, numbers are available only when pressing shift. Otherwise, the characters typed are ="«»()@+-/*= (from 1 to 0).
In order to access more easily the different windows, I want to be
able to type =<prefix> TAB <window number>=. However, Im using the bépo
layout, numbers are available only when pressing shift. Otherwise, the
characters typed are ="«»()@+-/*= (from 1 to 0).
#+begin_src emacs-lisp :wrap src tmux :exports code
(let ((keybinds "")
(keys '("\\\"" "«" "»" "(" ")" "@" "+" "-" "/" "*")))
@ -251,7 +254,7 @@ bind-key -T windows * select-window -t :=10
*** Copy in vi mode
Tmux has a nice mode for vim keybindings users: =copy-mode-vi= which
allows to move the cursor around in the pane, select some stuff, and
allows moving the cursor around in the pane, select some stuff, and
copy it. But first, I need to unbind some keys:
#+begin_src tmux
unbind -T copy-mode-vi H