[org files] Grammar
This commit is contained in:
parent
f790423cca
commit
81cd095d08
@ -188,7 +188,7 @@ go. I even made it so that you can execute it as an executable file, like
|
||||
The choice is given to the user which of them to use with options that will be
|
||||
given to =cppnew=.
|
||||
|
||||
First of all, if no arguments were passed, return an error.
|
||||
First, if no arguments were passed, return an error.
|
||||
#+begin_src fish
|
||||
if ! count $argv >/dev/null
|
||||
echo "Missing argument: PROJECT" && return -1
|
||||
@ -280,7 +280,7 @@ analysis server as requested.
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/UpdateFlutter
|
||||
:CUSTOM_ID: UpdateFlutter-1e8fbeb7
|
||||
:END:
|
||||
This is a simple utility to be ran when the ~flutter~ package is updated.
|
||||
This is a simple utility to run when the ~flutter~ package is updated.
|
||||
#+BEGIN_SRC fish
|
||||
sudo chown -R :flutterusers /opt/flutter
|
||||
sudo chmod -R g+w /opt/flutter
|
||||
@ -406,10 +406,11 @@ fi
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/sshbind
|
||||
:CUSTOM_ID: sshbind-756fabb1
|
||||
:END:
|
||||
Something that I did not know for quite some time but that is actually crazy
|
||||
useful about SSH is its ability to bind locally the port of a remote machine,
|
||||
and vice versa. The syntax is actually very simple, but I prefer a more
|
||||
intuitive way of writing it. Its usage is ~sshbind PORT FROMHOST TOHOST~.
|
||||
Something that I did not know for quite some time, but that is
|
||||
actually crazy useful about SSH is its ability to bind locally the
|
||||
port of a remote machine, and vice versa. The syntax is actually very
|
||||
simple, but I prefer a more intuitive way of writing it. Its usage is
|
||||
~sshbind PORT FROMHOST TOHOST~.
|
||||
#+BEGIN_SRC fish
|
||||
ssh -L $argv[1]:$argv[3]:$argv[1] $argv[2] -N
|
||||
#+END_SRC
|
||||
@ -448,7 +449,7 @@ end
|
||||
#+end_src
|
||||
|
||||
We can then read from the first member of ~argv~ which key the user
|
||||
pressed. Depending on it, we can chose what to execute.
|
||||
pressed. Depending on it, we can choose what to execute.
|
||||
#+name: nsxiv-switch-statement
|
||||
#+begin_src fish
|
||||
switch "$argv[1]"
|
||||
@ -487,12 +488,12 @@ case "g"
|
||||
gimp $FILES
|
||||
#+end_src
|
||||
|
||||
Often, I use nsxiv to convert an image to a jpeg file, because my
|
||||
internet connection is not that great and jpeg screenshots are faster
|
||||
to upload than png screenshots. So what I do is for each file
|
||||
Often, I use nsxiv to convert an image to a JPEG file, because my
|
||||
internet connection is not that great and JPEG screenshots are faster
|
||||
to upload than PNG screenshots. So what I do is for each file
|
||||
selected, I take the base name of the file (i.e. remove its
|
||||
extension), and then I use the ~convert~ command from ~imagemagik~ to
|
||||
convert it from its original format to a jpg format --- ~imagemagik~
|
||||
convert it from its original format to a JPG format --- ~imagemagik~
|
||||
detects the formats based on the extension.
|
||||
#+name: nsxiv-jpeg
|
||||
#+begin_src fish
|
||||
@ -594,10 +595,9 @@ xinput set-prop $TPNAME "libinput Tapping Enabled" $NEWTPSTATUS
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :mkdirp yes :tangle ~/.local/bin/wacom-setup
|
||||
:CUSTOM_ID: Wacom_setup-331fb024
|
||||
:END:
|
||||
I made a small and quick utility to set up my Wacom tablet so it is
|
||||
only bound to one screen. This is quite easy, we simply need to find
|
||||
I made a small and quick utility to set up my Wacom tablet to bind it
|
||||
to one screen when in Xorg. This is quite easy, we simply need to find
|
||||
the Wacom stylus’ ID and assign it to the display we want.
|
||||
|
||||
#+begin_src sh
|
||||
ID=$(xinput | grep -oPi "wacom.+stylus.+id=\K([0-9]+)")
|
||||
SCREEN=$(xrandr -q --current | \
|
||||
@ -640,8 +640,8 @@ emacsclient -c -n -a emacs -e "(browse-url-mail \"$*\")"
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/mp42webm
|
||||
:CUSTOM_ID: mp42webm-aeacca58
|
||||
:END:
|
||||
This function allows me to convert easily an mp4 video to the webm format.
|
||||
Nothing too fancy here.
|
||||
This function allows me to convert easily a MP4 video to the webm
|
||||
format. Nothing too fancy here.
|
||||
#+BEGIN_SRC fish
|
||||
ffmpeg -i $argv[1] -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis $argv[1].webm
|
||||
#+END_SRC
|
||||
@ -692,13 +692,14 @@ Categories=Media
|
||||
:HEADER-ARGS:EMACS-LISP: :exports none :tangle no
|
||||
:CUSTOM_ID: ytdl-a-youtube-dl-wrapper-03bd63e0
|
||||
:END:
|
||||
This script is a wrapper around ~youtube-dl~ which I use mainly for archiving
|
||||
YouTube videos on my NAS (at the time I’m writing this, I have already 2.1TB
|
||||
worth of videos archived). The principle behind this script is quite simple: I
|
||||
want to avoid as much as possible to redownload any video already downloaded in
|
||||
order to avoid pinging too much YouTube’s servers, 429 Too Many Requests errors
|
||||
are really annoying, and it comes really early when you have only a couple of
|
||||
new videos to download among the few 14k videos already downloaded.
|
||||
This script is a wrapper around ~youtube-dl~ which I use mainly for
|
||||
archiving YouTube videos on my NAS (at the time I’m writing this, I
|
||||
have already 2.1 TB worth of videos archived). The principle behind
|
||||
this script is quite simple: I want to avoid as much as possible to
|
||||
redownload any video already downloaded in order to avoid pinging too
|
||||
much YouTube’s servers, 429 Too Many Requests errors are really
|
||||
annoying, and it comes really early when you have only a couple of new
|
||||
videos to download among the few 14k videos already downloaded.
|
||||
|
||||
Be aware this script was written for the Fish shell (3.1.0 and above), and makes
|
||||
use of youtube-dl 2020.03.24 and above, [[https://github.com/jorgebucaran/fish-getopts][Fish getopts]] and [[https://github.com/BurntSushi/ripgrep][ripgrep]].
|
||||
|
@ -38,8 +38,8 @@ 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 won’t be able to use this
|
||||
command. For instance, my current computer has 32GB of RAM, hence my SWAP
|
||||
partition is 16GB large.
|
||||
command. For instance, my current computer has 32 GB of RAM, hence my SWAP
|
||||
partition is 16 GB large.
|
||||
|
||||
** Get the latest, fastest mirrors
|
||||
:PROPERTIES:
|
||||
@ -70,7 +70,7 @@ by default on Arch ISOs anymore, so I’ll need to install it.
|
||||
pacman -S wget
|
||||
#+END_SRC
|
||||
|
||||
Now, let’s grab the script. You can check it on [[https://github.com/matmoul/archfi][Github]].
|
||||
Now, let’s grab the script. You can check it on [[https://github.com/matmoul/archfi][GitHub]].
|
||||
#+BEGIN_SRC sh
|
||||
wget archfi.sf.net/archfi
|
||||
# Or from matmoul.github.io/archfi if SourceForge is down
|
||||
@ -80,7 +80,7 @@ sh archfi
|
||||
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 installing some packages later.
|
||||
which will help us to install some packages later.
|
||||
|
||||
Once your system is installed, reboot and remove your installation media from
|
||||
your computer.
|
||||
@ -90,9 +90,9 @@ your computer.
|
||||
:HEADER-ARGS:fish: :tangle ~/.config/yadm/bootstrap :shebang "#!/usr/bin/fish" :exports code :mkdirp yes
|
||||
:CUSTOM_ID: Execute_bootstrap-e37054ef
|
||||
:END:
|
||||
The first thing I will do is add the [[https://aur.chaotic.cx/][Chaotic AUR]] repository so I can
|
||||
get access to ~paru~ as well as some AUR packages without the need of an
|
||||
AUR helper (ironic considering ~paru~ is one). We can then install ~fish~,
|
||||
The first thing I will do is add the [[https://aur.chaotic.cx/][Chaotic AUR]] repository to get
|
||||
access to ~paru~ as well as some AUR packages without the need of an AUR
|
||||
helper (ironic considering ~paru~ is one). We can then install ~fish~,
|
||||
~git~, and ~paru~:
|
||||
#+BEGIN_SRC sh
|
||||
sudo pacman -S fish git paru
|
||||
@ -221,7 +221,7 @@ sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Execute_bootstrap-Set_user’s_shell_to_fish-1a794be2
|
||||
:END:
|
||||
First of all, the bootstrap shell will set the user’s shell to fish.
|
||||
First, the bootstrap shell will set the user’s shell to fish.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Set fish as the default shell ###############################################\n\n"
|
||||
whiptail --yesno "Set the current user’s default shell to fish?" 8 50
|
||||
@ -259,7 +259,7 @@ system packages.
|
||||
| jmtpfs | FUSE filesystem for the MTP protocol |
|
||||
| kitty | My current terminal emulator, works with Xorg and Wayland |
|
||||
| logrotate | Rotate system logs automatically |
|
||||
| man-pages | Linux man pages |
|
||||
| man-pages | Linux's man pages |
|
||||
| man-db | Read the Linux man pages |
|
||||
| netctl | Profile based systemd network management |
|
||||
| network-manager-applet | System tray applet for NetworkManager |
|
||||
@ -437,9 +437,9 @@ Let’s install some desktop applications too, shall we?
|
||||
| rofi | A beautiful ~dmenu~ replacement |
|
||||
|
||||
All these packages will be installed with the command ~paru -S
|
||||
--skipreview --needed~ so it won’t nag me about the PKGBUILD when I
|
||||
want to install something from the AUR, and if something is already
|
||||
installed it paru won’t try to reinstall it.
|
||||
--skipreview --needed~ to prevent it from nagging me about the PKGBUILD
|
||||
when I want to install something from the AUR, and if something is
|
||||
already installed it paru won’t try to reinstall it.
|
||||
|
||||
#+name: gen-package-list
|
||||
#+header: :wrap "src fish :exports none :tangle no"
|
||||
@ -547,9 +547,9 @@ cd /home/phundrak/Documents/code/PKGBUILDs/sent && makepkg -si; cd ..
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Execute_bootstrap-Tangle_configuration_files_from_Org_files-cc524361
|
||||
:END:
|
||||
Before tangling our configuration files, we need to create some directories
|
||||
first so our files can be properly tangled. Here’s the list of directories we
|
||||
need to create:
|
||||
Before tangling our configuration files, we need to create some
|
||||
directories first to make sure our files can be properly tangled.
|
||||
Here’s the list of directories we need to create:
|
||||
#+NAME: dirs-tangled-files
|
||||
| $HOME/.config/fish |
|
||||
| $HOME/.config/gtk-2.0 |
|
||||
@ -746,8 +746,8 @@ sudo timedatectl set-ntp true
|
||||
:END:
|
||||
~acpilight~ is our utility managing the brightness of our screen. There
|
||||
is actually no service to enable here, but we must ensure the user is
|
||||
part of the ~video~ group so we can modify the brightness of our screen
|
||||
without using ~sudo~.
|
||||
part of the ~video~ group to enable the user modifying the brightness of
|
||||
our screen without using ~sudo~.
|
||||
#+BEGIN_SRC fish
|
||||
sudo usermod -aG video $USER
|
||||
#+END_SRC
|
||||
@ -762,8 +762,8 @@ printf "\n# Enabling and starting Docker #######################################
|
||||
sudo systemctl enable --now docker
|
||||
#+END_SRC
|
||||
|
||||
Now, if we wish it, we can be added to the =docker= group so we won’t have to
|
||||
type =sudo= each time we call Docker or Docker Compose.
|
||||
Now, if we wish it, we can add ourselves to the =docker= group to avoid
|
||||
typing =sudo= each time we call Docker or Docker Compose.
|
||||
#+BEGIN_SRC fish
|
||||
read --prompt "echo 'Do you wish to be added to the `docker` group? (Y/n): ' " -l adddockergroup
|
||||
if test $adddockergroup = 'y' || test $adddockergroup = "Y" || test $adddockergroup = ''
|
||||
@ -815,10 +815,11 @@ activate:
|
||||
sudo systemctl enable --now nordvpnd
|
||||
#+END_SRC
|
||||
|
||||
Let’s also set its default protocol to UDP. This will allow me to use any port
|
||||
while connected to any WiFi as long as the 443 port is available. Because yes, I
|
||||
do connect to a WiFi that blocks some important ports, such as the IMAP and SMTP
|
||||
ports. Thanks University of Paris 8 for being SO paranoid.
|
||||
Let’s also set its default protocol to UDP. This will allow me to use
|
||||
any port while connected to any Wi-Fi as long as the 443 port is
|
||||
available. Because yes, I do connect to a Wi-Fi that blocks some
|
||||
important ports, such as the IMAP and SMTP ports. Thanks University of
|
||||
Paris 8 for being SO paranoid.
|
||||
#+BEGIN_SRC fish
|
||||
nordvpn s protocol tcp
|
||||
#+END_SRC
|
||||
@ -840,9 +841,9 @@ Linux kernel since its version 5.6. And Windows’ since August 2021,
|
||||
but I don’t really care about Windows.
|
||||
|
||||
*But*, WireGuard is less privacy-oriented than OpenVPN. So, if I ever
|
||||
need to use my VPN for privacy reasons, I can simply revert back to
|
||||
the OpenVPN technology like shown with this command (not tangled in
|
||||
the bootstrap):
|
||||
need to use my VPN for privacy reasons, I can simply revert to the
|
||||
OpenVPN technology like shown with this command (not tangled in the
|
||||
bootstrap):
|
||||
#+begin_src fish :tangle no
|
||||
nordvpn set technology OpenVPN
|
||||
#+end_src
|
||||
@ -875,10 +876,10 @@ activate it right away:
|
||||
systemctl --user enable --now pipewire-input-filter-chain.service
|
||||
#+end_src
|
||||
|
||||
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 shouldn’t matter for most people.
|
||||
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 shouldn’t matter for most people.
|
||||
|
||||
*** SSH server
|
||||
:PROPERTIES:
|
||||
@ -995,7 +996,7 @@ order to improve the user experience.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Execute_bootstrap-Set_up_our_fish_shell-Install_=fisher=-3a44531b
|
||||
:END:
|
||||
We will be using ~fisher~ as our extensions manager for Fish. Let’s install it.
|
||||
We will be using ~fisher~ as our extension manager for Fish. Let’s install it.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing fisher ###########################################################\n\n"
|
||||
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
|
||||
|
@ -37,9 +37,10 @@ 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 case’s is empty, it
|
||||
means there is no equivalence. If it’s ~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.
|
||||
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:
|
||||
:PROPERTIES:
|
||||
@ -503,8 +504,9 @@ IconViewScale=-1
|
||||
:HEADER-ARGS: :mkdirp yes :tangle ~/.config/gtk-3.0/settings.ini
|
||||
:CUSTOM_ID: Theme-and-graphical-tweaks-GTK-Settings-GTK3-ojl7gbc0l9j0
|
||||
:END:
|
||||
The following file helps me choosing the aspect of various GTK+ 3 software,
|
||||
including their theme and icons. First, let’s declare the header:
|
||||
The following file helps me to choose the aspect of various GTK+ 3
|
||||
software, including their theme and icons. First, let’s declare the
|
||||
header:
|
||||
#+BEGIN_SRC conf-unix
|
||||
[Settings]
|
||||
#+END_SRC
|
||||
@ -632,15 +634,15 @@ Sent from GNU/Emacs
|
||||
:END:
|
||||
Some software I use are not packaged (yet) on my system. Therefore, in
|
||||
order to make them available in ~rofi~, I need to write a ~.desktop~ file
|
||||
so I can launch them.
|
||||
to launch them.
|
||||
|
||||
** Emacs
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: -desktop-files-for-custom-applications-Emacs-6e9actg0m9j0
|
||||
:END:
|
||||
Emacs does have a default ~.desktop~ file, but I want to override it so
|
||||
I can just “open with Emacs” from other software (such as Nemo) and it
|
||||
will instead open with ~emacsclient~.
|
||||
Emacs does have a default ~.desktop~ file, but I want to override it to
|
||||
just “open with Emacs” from other software (such as Nemo) and it will
|
||||
open with ~emacsclient~ instead of just =emacs=.
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/emacs.desktop
|
||||
[Desktop Entry]
|
||||
Name=Emacs
|
||||
@ -673,7 +675,7 @@ StartupWMClass=Gnus
|
||||
Keywords=Text;Editor;
|
||||
#+end_src
|
||||
|
||||
Then I also have ~org-protocol.desktop~ so I can capture elements from
|
||||
Then I also have ~org-protocol.desktop~ that helps capture elements from
|
||||
other software, mainly web pages from Firefox through the [[https://github.com/sprig/org-capture-extension][org-capture
|
||||
extension]].
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/org-protocol.desktop
|
||||
@ -730,8 +732,8 @@ Categories=Development
|
||||
:CUSTOM_ID: -desktop-files-for-custom-applications-Minecraft-tds7ddh0m9j0
|
||||
:END:
|
||||
Yup, I play Minecraft. And yes, it does have a default ~.desktop~ file,
|
||||
but this one overrides it so it launches automatically Minecraft with
|
||||
[[https://wiki.archlinux.org/title/PRIME][prime-run]] so my GPU is used.
|
||||
but this one overrides it to launch automatically Minecraft with
|
||||
[[https://wiki.archlinux.org/title/PRIME][prime-run]], using my Nvidia GPU instead of my integrated GPU.
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/minecraft-launcher.desktop
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
|
@ -173,7 +173,7 @@ preferred tastes —some may prefer 2 spaces tabs, some may prefer 4
|
||||
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
|
||||
But the thing is, once you indented your code, and then you need
|
||||
alignment, tabs don’t work anymore! Or they may on *your* text editor
|
||||
but not on your coworker’s! (He’s the one using 3 spaces tabs by the
|
||||
way).
|
||||
@ -306,7 +306,7 @@ your unsaved changes won’t be lost. Very polite!
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Basic-configuration-Emacs-Behavior-Misc9j5jel6184j0
|
||||
:END:
|
||||
Let’s raise Emacs undo memory to 10MB, and make Emacs auto-save our
|
||||
Let’s raise Emacs undo memory to 10 MB, and make Emacs auto-save our
|
||||
files by default.
|
||||
#+begin_src emacs-lisp
|
||||
(setq undo-limit 100000000
|
||||
@ -322,7 +322,7 @@ files by default.
|
||||
:CUSTOM_ID: Basic-configuration-Personal-Informationi59jel6184j0
|
||||
:END:
|
||||
Emacs needs to know its master! For various reasons by the way, some
|
||||
packages rely of these variables to know who it is talking to or
|
||||
packages rely on these variables to know who it is talking to or
|
||||
dealing with, such as ~mu4e~ which will guess who you are if you haven’t
|
||||
set it up correctly.
|
||||
#+begin_src emacs-lisp
|
||||
@ -517,7 +517,7 @@ I also had to make the code simply work.
|
||||
:CUSTOM_ID: Custom-Elisp-Dired-functions-phundrak-open-marked-filesdw2kel6184j0
|
||||
:END:
|
||||
This function allows the user to open all marked files from a dired
|
||||
buffer as new Emacs buffers.
|
||||
buffer in new Emacs buffers.
|
||||
#+begin_src emacs-lisp
|
||||
(defun phundrak/open-marked-files (&optional files)
|
||||
"Open all marked FILES in Dired buffer as new Emacs buffers."
|
||||
@ -556,16 +556,16 @@ b s~, which bring the user directly to the ~*Messages*~ buffer and the
|
||||
:CUSTOM_ID: Custom-Elisp-Screenshots-l9bkib013aj0
|
||||
:END:
|
||||
Since Emacs27, it is possible for Emacs to take screenshots of itself
|
||||
in various formats. I’m mainly interested by the SVG and PNG format,
|
||||
in various formats. I’m mainly interested in the SVG and PNG format,
|
||||
so I’ll only write functions for these. It isn’t really redundant with
|
||||
the ~screenshot.el~ package used [[#Packages-Configuration-Applications-Screenshot96d1fl6184j0][here]] since these functions take a
|
||||
screenshot of Emacs as a whole rather than of a code snippet.
|
||||
|
||||
First, we have a general function which is a slight modification of
|
||||
the function shared by Alphapapa in [[https://www.reddit.com/r/emacs/comments/idz35e/emacs_27_can_take_svg_screenshots_of_itself/g2c2c6y/][this Reddit comment]]. It has been
|
||||
modified so it is possible to pass the function an argument for the
|
||||
format the screenshot will be taken as, and if ~type~ is ~nil~ the user
|
||||
can still chose it.
|
||||
the function shared by Alphapapa in [[https://www.reddit.com/r/emacs/comments/idz35e/emacs_27_can_take_svg_screenshots_of_itself/g2c2c6y/][this Reddit comment]]. I modified it
|
||||
to make it possible to pass as an argument the format the screenshot
|
||||
will be taken as or ask the user which format they would like to save
|
||||
it as.
|
||||
#+begin_src emacs-lisp
|
||||
(defun self-screenshot (&optional type)
|
||||
"Save a screenshot of type TYPE of the current Emacs frame.
|
||||
@ -628,9 +628,9 @@ focus the new window immediately.
|
||||
:CUSTOM_ID: Custom-Elisp-Extend-add-to-list-eh2325605gj0
|
||||
:END:
|
||||
One function I find missing regarding ~add-to-list~ is ~add-all-to-list~
|
||||
so I can add multiple elements to a list at once. Instead, with
|
||||
vanilla Emacs, I have to repeatedly call ~add-to-list~. That’s not very
|
||||
clean. Let’s declare this missing function:
|
||||
which enables the user to add multiple elements to a list at once.
|
||||
Instead, with vanilla Emacs, I have to repeatedly call ~add-to-list~.
|
||||
That’s not very clean. Let’s declare this missing function:
|
||||
#+begin_src emacs-lisp
|
||||
(defun add-all-to-list (list-var elements &optional append compare-fn)
|
||||
"Add ELEMENTS to the value of LIST-VAR if it isn’t there yet.
|
||||
@ -669,11 +669,11 @@ an absurd amount of Emacs packages.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Package-Management-Straightry3lel6184j0
|
||||
:END:
|
||||
For my package management, I prefer to use ~straight~ ([[https://github.com/raxod502/straight.el][Github]]). This is
|
||||
For my package management, I prefer to use ~straight~ ([[https://github.com/raxod502/straight.el][GitHub]]). This is
|
||||
due to its capacity of integrating nicely with ~use-package~, which also
|
||||
supports ~general~ which I use for my keybindings (see below), but also
|
||||
because with it I can specify where to retrieve packages that are not
|
||||
on MELPA or ELPA but on Github and other online Git repositories too.
|
||||
because with it, I can specify where to retrieve packages that are not
|
||||
on MELPA or ELPA but on GitHub and other online Git repositories too.
|
||||
First, let’s bootstrap straight.
|
||||
#+begin_src emacs-lisp
|
||||
(defvar bootstrap-version)
|
||||
@ -702,7 +702,7 @@ stuff.
|
||||
|
||||
From time to time, I fork some packages either because I’m trying to
|
||||
implement something new in said package, or because the package is
|
||||
unmaintained and I want to continue developing it a bit more. Straight
|
||||
unmaintained, and I want to continue developing it a bit more. Straight
|
||||
provides a nice feature for using forks of a package with its ~:fork~
|
||||
option. If set to ~t~, then straight will attempt to retrieve the
|
||||
package with the same name but with a different username on the same
|
||||
@ -716,11 +716,11 @@ 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 the forge described by the ~origin~ remote, which isn’t necessarily
|
||||
the one I want Forge to interact with by default. Therefore, all
|
||||
default remotes are named ~straight~ so it won’t collide with my regular
|
||||
development flow.
|
||||
with websites such as GitHub, Gitlab, and such) interacts by default
|
||||
with the forge described by the =origin= remote, which isn’t necessarily
|
||||
the one I want Forge to interact with by default. Therefore,
|
||||
=straight.el= will name all default remotes =straight= to avoid any name
|
||||
collision with my regular development flow.
|
||||
#+begin_src emacs-lisp
|
||||
(setq straight-vc-git-default-remote-name "straight")
|
||||
#+end_src
|
||||
@ -845,10 +845,10 @@ they are much more comfortable than Emacs’.
|
||||
(evil-set-initial-state 'dashboard-mode 'normal))
|
||||
#+end_src
|
||||
|
||||
I want to undefine some of the default keybinds of Evil because it
|
||||
does not match my workflow. Namely, I use the space key and the comma
|
||||
as leaders for my keybinds, and I’m way too used to Emacs’ ~C-t~, ~C-a~,
|
||||
~C-e~, and ~C-y~.
|
||||
I want to undefine some default keybinds of Evil because it does not
|
||||
match my workflow. Namely, I use the space key and the comma as
|
||||
leaders for my keybinds, and I’m way too used to Emacs’ ~C-t~, ~C-a~, ~C-e~,
|
||||
and ~C-y~.
|
||||
#+name: evil-undefine-keys
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(evil-global-set-key 'motion "t" 'evil-next-visual-line)
|
||||
@ -957,7 +957,7 @@ 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.
|
||||
Sure, it uses more CPU time uncompressing these files, but it’s
|
||||
insignificant and it’s still faster than loading a heavier file.
|
||||
insignificant, and it’s still faster than loading a heavier file.
|
||||
#+name: undo-tree-compress-files
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(when (executable-find "zstd")
|
||||
@ -1243,11 +1243,11 @@ with an org-table.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Autocompletion-Ivy84q1fl6184j0
|
||||
:END:
|
||||
My main menu package is ~ivy~ which I use as much as possible –I’ve
|
||||
noticed ~helm~ can be slow, very slow in comparison to ~ivy~ so I’ll use
|
||||
the latter as much as possible. Actually, only ~ivy~ is installed for
|
||||
now. I could have used ~ido~ too, but I find it to be a bit too
|
||||
restricted in terms of features compared to ~ivy~.
|
||||
My main menu package is =ivy= which I use as much as possible –I’ve
|
||||
noticed =helm= can be slow, very slow in comparison to =ivy=, so I’ll use
|
||||
the latter as much as possible. Actually, only =ivy= is installed for
|
||||
now. I could have used =ido= too, but I find it to be a bit too
|
||||
restricted in terms of features compared to =ivy=.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ivy
|
||||
:straight (:build t)
|
||||
@ -1377,7 +1377,7 @@ and ask the user for some input in some precise places.
|
||||
(text-mode . yas-minor-mode)))
|
||||
#+end_src
|
||||
|
||||
Of course, yasnippet wouldn’t be as awesome as it is without premade
|
||||
Of course, yasnippet wouldn’t be as awesome as it is without pre-made
|
||||
snippets.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package yasnippet-snippets
|
||||
@ -1386,7 +1386,7 @@ snippets.
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
Similarly, yatemplate offers premade files rather than just strings.
|
||||
Similarly, yatemplate offers pre-made files rather than just strings.
|
||||
That’s still yasnippet by the way.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package yatemplate
|
||||
@ -1395,7 +1395,7 @@ That’s still yasnippet by the way.
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
And finally, with ivy you can chose your snippets from a menu if
|
||||
And finally, with ivy you can choose your snippets from a menu if
|
||||
you’re not sure or if you don’t remember what your snippet is.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ivy-yasnippet
|
||||
@ -1479,10 +1479,10 @@ database is to be stored.
|
||||
#+end_src
|
||||
|
||||
I don’t want YouTube videos to be open with my web browser when I
|
||||
invoke ~elfeed-show-visit~, so I’ll advise this function so I can modify
|
||||
the behavior of said function. Oh, and I already made [[#Packages-Configuration-Misc-Ytplay-wxm9weq0r4j0][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.
|
||||
invoke ~elfeed-show-visit~, so I’ll advise this function to make it
|
||||
possible to modify the behavior of said function. Oh, and I already
|
||||
made [[#Packages-Configuration-Misc-Ytplay-wxm9weq0r4j0][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.
|
||||
#+name: elfeed-open-youtube-with-mpv
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/elfeed-filter-youtube-videos (orig-fun &rest args)
|
||||
@ -1815,8 +1815,8 @@ configuration for the ~mu4e~ package itself.
|
||||
|
||||
Quick sidenote: on ArchLinux, you’ll need to install either ~mu~ or
|
||||
~mu-git~ from the AUR in order to use mu4e. I also have a ~.desktop~ file
|
||||
so I can open mu4e directly from my program picker. It uses the shell
|
||||
script ~emacsmail~ I’ve written [[file:bin.org::#Emacsmail-afffb7cd][here]].
|
||||
to make it possible to open mu4e directly from my program picker. It
|
||||
uses the shell script ~emacsmail~ I’ve written [[file:bin.org::#Emacsmail-afffb7cd][here]].
|
||||
#+header: :mkdirp yes
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/mu4e.desktop
|
||||
[Desktop Entry]
|
||||
@ -1937,7 +1937,7 @@ Next I need an inbox dedicated to the association I’m 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
|
||||
the emacs-devel mailing list as well as GitHub emails related to my
|
||||
package ~eshell-info-banner.el~ ([[#Packages-Configuration-Emacs-built-ins-Eshell-Visual-configuratione7c2fl6184j0][see here]]). Here are the addresses to
|
||||
match:
|
||||
|
||||
@ -1957,7 +1957,7 @@ match:
|
||||
: list:/ateliers.*emacs.*/ OR t:/ateliers.*emacs.*/ OR f:/ateliers.*emacs.*/ OR contact:/ateliers.*emacs.*/ OR list:/emacs-.*@gnu.org/ OR t:/emacs-.*@gnu.org/ OR f:/emacs-.*@gnu.org/ OR contact:/emacs-.*@gnu.org/ OR list:/.*eshell-info-banner.*/ OR t:/.*eshell-info-banner.*/ OR f:/.*eshell-info-banner.*/ OR contact:/.*eshell-info-banner.*/ OR list:/.*emacsfr.*/ OR t:/.*emacsfr.*/ OR f:/.*emacsfr.*/ OR contact:/.*emacsfr.*/
|
||||
|
||||
Another bookmark I wish to have is one dedicated to emails related to
|
||||
more general development topics, including issues and PRs from Github.
|
||||
more general development topics, including issues and PRs from GitHub.
|
||||
#+name: mu4e-github-mailing-lists
|
||||
- ~/.*\\.github\\.com/~
|
||||
- ~/.*\\.gitlab\\.com/~
|
||||
@ -2098,9 +2098,9 @@ With this piece of code, I can simply jump to my inbox maildir with
|
||||
I’m sure you have received at least one email recently from a sketchy
|
||||
email address asking you something that might be completely unrelated
|
||||
to what you do, or at least somewhat related. Fortunately, [[https://twitter.com/Boris/status/1360208504544444417][we have a
|
||||
hero]]! Now, let me write a function that will insert their pre-written
|
||||
text at point so I don’t have to go back to their Twitter thread each
|
||||
time I want to shut spammers up.
|
||||
hero]]! Now, let me write a function that will insert their
|
||||
pre-written text at point to avoid me going back to their Twitter
|
||||
thread each time I want to shut spammers up.
|
||||
#+begin_src emacs-lisp
|
||||
(defun reply-to-bill ()
|
||||
(interactive)
|
||||
@ -2336,8 +2336,8 @@ the major-mode leader and call a simple function.
|
||||
:CUSTOM_ID: Packages-Configuration-Applications-Email-Composing-messagesth71fl6184j0
|
||||
:END:
|
||||
Org mime is cool and all, you can write some org-mode and then export
|
||||
it so you can send an HTML email. BUT, have you considered skipping
|
||||
the export part and write your emails directly in org-mode?
|
||||
it to either a plain-text or an HTML email. BUT, have you considered
|
||||
skipping the export part and write your emails directly in org-mode?
|
||||
#+begin_src emacs-lisp
|
||||
(use-package org-msg
|
||||
:after (mu4e)
|
||||
@ -2705,7 +2705,7 @@ left it.
|
||||
Magit is an awesome wrapper around Git for Emacs! Very often, I go
|
||||
from disliking to really hating Git GUI clients because they often
|
||||
obfuscate which Git commands are used to make things happen. Such a
|
||||
thing doesn’t happen with Magit, it’s pretty transparent but it still
|
||||
thing doesn’t happen with Magit, it’s pretty transparent, but it still
|
||||
provides some awesome features and visualizations of what you are
|
||||
doing and what Git is doing! In short, I absolutely love it!
|
||||
#+begin_src emacs-lisp
|
||||
@ -2759,7 +2759,7 @@ doing and what Git is doing! In short, I absolutely love it!
|
||||
display in the Magit buffer a list of TODOs found in the current
|
||||
project to remind you of what to do next.
|
||||
|
||||
First, let’s setup our todo keywords with ~hl-todo~. A good few todo
|
||||
First, let’s se tup 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. Let’s enable this mode globally.
|
||||
@ -2816,7 +2816,7 @@ with ~magit-gitflow~:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Project-Management-Forgelcq5fl6184j0
|
||||
:END:
|
||||
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.
|
||||
|
||||
@ -2862,7 +2862,8 @@ which will be very useful when managing projects.
|
||||
#+end_src
|
||||
|
||||
Now, I can use projectile, which is sort of the /de facto/ standard
|
||||
project manager in Emacs. I know there’s ~project.el~, but,… Eh…
|
||||
project manager in Emacs. I know there’s ~project.el~, but… Eh… I’m used
|
||||
to projectile.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package projectile
|
||||
:straight (:build t)
|
||||
@ -3367,9 +3368,9 @@ files and images.
|
||||
#+end_src
|
||||
|
||||
Copying files with Dired is a blocking process. It’s usually fine when
|
||||
there’s not a lot to copy, but it becomes more annoying when moving
|
||||
larger files. The package ~dired-rsync~ allows to copy files with ~rsync~
|
||||
in the background so we can carry on with our tasks while the copy is
|
||||
there’s not a lot to copy, but it becomes annoying when moving larger
|
||||
files. The package ~dired-rsync~ allows copying files with ~rsync~ in the
|
||||
background; we can then carry on with our tasks while the copy is
|
||||
happening.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dired-rsync
|
||||
@ -3562,7 +3563,7 @@ that.
|
||||
(eshell 'N))
|
||||
#+end_src
|
||||
|
||||
A very useful command I use often in fish is ~z~, a port from bash’s and
|
||||
A very useful command I often use in fish is ~z~, a port from bash’s and
|
||||
zsh’s command that allows to jump around directories based on how
|
||||
often we go in various directories.
|
||||
#+begin_src emacs-lisp
|
||||
@ -3840,11 +3841,11 @@ don’t 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, in the ~:config~ secion I added to two hooks functions
|
||||
so buffers are accurately renamed. 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 be renamed this way:
|
||||
As you can see, I added in the ~:config~ secion 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
|
||||
be renamed this way:
|
||||
#+name: exwm-renamed-buffers-list
|
||||
- Kitty
|
||||
- Qutebrowser
|
||||
@ -3883,10 +3884,10 @@ these will be renamed this way:
|
||||
<<exwm-gen-buffers-rename()>>)))
|
||||
#+end_src
|
||||
|
||||
As you can see below, in the ~:config~ section I added two advices and one
|
||||
hook in order to correctly integrate evil with EXWM. When I’m in an X
|
||||
window, I want to be in insert-mode so I can type however I want.
|
||||
However, when I exit one, I want to default back to normal-mode.
|
||||
As you can see below, in the ~:config~ section I added two advices and
|
||||
one hook in order to correctly integrate evil with EXWM. When I’m in
|
||||
an X window, I want to be in insert-mode in order to type however I
|
||||
want. However, when I exit one, I want to default back to normal-mode.
|
||||
#+name: exwm-advices-evil
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(add-hook 'exwm-manage-finish-hook (lambda () (call-interactively #'exwm-input-release-keyboard)))
|
||||
@ -3920,7 +3921,7 @@ completely forgotten. So I removed ~s-I~ and made ~s-<escape>~ behave like
|
||||
|
||||
As stated a couple of times in my different configuration files, I’m
|
||||
using the bépo layout, which means the default keys in the number row
|
||||
are laid as follow:
|
||||
are laid as follows:
|
||||
#+name: exwm-bepo-number-row
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(defconst exwm-workspace-keys '("\"" "«" "»" "(" ")" "@" "+" "-" "/" "*"))
|
||||
@ -3952,7 +3953,7 @@ workspaces 0 to 9.
|
||||
|
||||
You can then see the list of the keybinds I have set for EXWM, which
|
||||
are all prefixed with ~SPC x~ in normal mode (and ~C-SPC x~ in insert
|
||||
mode), with the exception of ~s-RET~ which opens an eshell terminal.
|
||||
mode), except for ~s-RET~ which opens an eshell terminal.
|
||||
#+name: exwm-keybinds
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(exwm-input-set-key (kbd "s-<return>") (lambda ()
|
||||
@ -4191,7 +4192,7 @@ human-friendly name."
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Making-my-life-easier-Buflerw215fl6184j0
|
||||
:END:
|
||||
Bufler is a package that organizes and lists buffers in a much better
|
||||
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
|
||||
@ -4703,7 +4704,7 @@ A useful package I like is ~toc-org~ which creates automatically a table
|
||||
of contents. My main usage for this however is not just to create a
|
||||
table of content of my files to quickly jump around my file (I have
|
||||
~counsel-org-goto~ for that), but it is for creating table of contents
|
||||
for org files that will be hosted and viewable on Github.
|
||||
for org files that will be hosted and viewable on GitHub.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package toc-org
|
||||
:after (org markdown-mode)
|
||||
@ -5881,8 +5882,8 @@ to anything user-defined. Let’s all-the-iconify this!
|
||||
:END:
|
||||
Treesit is a native Emacs [[https://tree-sitter.github.io/tree-sitter/][tree-sitter]] implementation which provides a
|
||||
very fast and flexible way of performing code-highlighting in Emacs.
|
||||
It is built-in in Emacs 29 and newer, and I just need to tweak one
|
||||
variable for now so I can install grammars for different languages.
|
||||
It is built-in in Emacs 29 and newer, and I just need to tweak a couple of
|
||||
variables to install grammars for different languages.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package treesit
|
||||
:defer t
|
||||
@ -6482,7 +6483,7 @@ visual graphs and networks.
|
||||
:END:
|
||||
Yes, I love org-mode and I largely prefer to use it instead of
|
||||
Markdown due to its far superior power and abilities. But still,
|
||||
sometimes I need to use Markdown because not everyone use org-mode,
|
||||
sometimes I need to use Markdown because not everyone uses org-mode,
|
||||
unfortunately.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package markdown-mode
|
||||
@ -6584,7 +6585,7 @@ unfortunately.
|
||||
(setq markdown-fontify-code-blocks-natively t))
|
||||
#+end_src
|
||||
|
||||
Since most of my Markdown files are related to Github, I’d like to be
|
||||
Since most of my Markdown files are related to GitHub, I’d like to be
|
||||
able to render Markdown through its API.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gh-md
|
||||
@ -6598,7 +6599,7 @@ able to render Markdown through its API.
|
||||
"cr" #'gh-md-render-buffer))
|
||||
#+end_src
|
||||
|
||||
Sometimes, I have to work with Github’s markdown flavour, but I’m not
|
||||
Sometimes, I have to work with GitHub’s markdown flavour, but I’m not
|
||||
really a huge fan of writing it by hand. So instead, I’ll write it in
|
||||
org-mode and then export it with ~ox-gfm~.
|
||||
#+begin_src emacs-lisp
|
||||
@ -6874,10 +6875,10 @@ In Lisp buffers, let’s enable ~parinfer-rust-mode~.
|
||||
|
||||
My current window manager is StumpWM, inspired by Emacs and written in
|
||||
CommonLisp. ~stumpwm-mode~ offers some integration between Emacs and
|
||||
StumpWM so we can evaluate CLisp code and see its effects in StumpWM
|
||||
immediately. Since my only use for CommonLisp is for my StumpWM
|
||||
configuration, it should be automatically enabled when entering
|
||||
~lisp-mode~.
|
||||
StumpWM that makes the user able to evaluate CommonLisp code and see
|
||||
its effects in StumpWM immediately. Since my only use for CommonLisp
|
||||
is for my StumpWM configuration, it should be automatically enabled
|
||||
when entering ~lisp-mode~.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package stumpwm-mode
|
||||
:straight (:build t)
|
||||
@ -7016,7 +7017,7 @@ If I need to run CI on a package, [[https://github.com/cask/cask][Cask]] manages
|
||||
#+end_src
|
||||
|
||||
However, I recently began using [[https://github.com/emacs-eask/eask][Eask]] more and more, I find it nicer to
|
||||
work with and it has a lot more features than Cask.
|
||||
work with, and it has a lot more features than Cask.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package eask-api
|
||||
:defer t
|
||||
@ -7358,7 +7359,7 @@ development. First, let’s install the most important package,
|
||||
:CUSTOM_ID: Packages-Configuration-Programming-languages-General-Programming-Languages-Web-programming-7ca40po085j0
|
||||
:END:
|
||||
[[https://emmet.io/][Emmet]] is a powerful templating engine that can generate through simple
|
||||
CSS-like expression some HTML so you don’t have to write everything by
|
||||
CSS-like expression some HTML to avoid the user writing everything by
|
||||
hand.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package emmet-mode
|
||||
@ -7384,8 +7385,8 @@ hand.
|
||||
"ew" #'emmet-wrap-with-markup))
|
||||
#+end_src
|
||||
|
||||
Impatient mode serves web buffers live over HTTP so you can see your
|
||||
editions as you type them.
|
||||
Impatient mode serves web buffers live over HTTP, including your live
|
||||
modifications.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package impatient-mode
|
||||
:straight (:build t)
|
||||
@ -7573,7 +7574,7 @@ Next.JS.
|
||||
#+end_src
|
||||
|
||||
~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
|
||||
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
|
||||
(use-package js2-refactor
|
||||
|
@ -15,7 +15,7 @@ The file present in =~/.config/fish/config.fish= is the configuration file for
|
||||
the [[https://fishshell.com/][fish shell]]. It contains custom functions, environment variables and
|
||||
abbreviations.
|
||||
|
||||
Just in case, we might need sometimes to declare the fish function =fish_title=
|
||||
Just in case, we might sometimes need to declare the fish function =fish_title=
|
||||
as =true=, so let’s do so.
|
||||
#+BEGIN_SRC fish
|
||||
function fish_title
|
||||
@ -59,10 +59,11 @@ set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Tramp_remote_access-72aedec2
|
||||
:END:
|
||||
When accessing from a remote machine our computer from Emacs, tramp needs a
|
||||
precise shell appearance: a simple =$= followed by a space after which to put
|
||||
the commands it needs to execute, and nothing else. Due to this, let’s
|
||||
deactivate and redefine some of the functions defining the appearance of fish.
|
||||
When accessing from a remote machine our computer from Emacs, tramp
|
||||
needs a precise shell appearance: a simple =$= followed by a space after
|
||||
which to put the commands it needs to execute, and nothing else. Due
|
||||
to this, let’s deactivate and redefine some functions defining the
|
||||
appearance of fish.
|
||||
#+BEGIN_SRC fish
|
||||
if test "$TERM" = "dumb"
|
||||
function fish_prompt
|
||||
@ -245,16 +246,17 @@ the terminal window will come back.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Abbreviations-System_monitoring-bd909755
|
||||
:END:
|
||||
Here I have some abbreviations which are quite useful when performing some
|
||||
system monitoring. With =df=, we can get an overview of our filesystem usage,
|
||||
while with =diskspace= we get some more precise information. =meminfo= is a call
|
||||
to =free= with sane defaults, and similar to =meminfo=, we also have
|
||||
=gpumeminfo= so we can get a quick look at the memory-related logs of our X
|
||||
session. I also declared =cpuinfo= an alias of =lscpu= in order to keep
|
||||
consistent with =meminfo=. =pscpu= gives us information on what the CPU is
|
||||
running right now, and =pscpu10= limits that to the top 10 threads. Similarly,
|
||||
=psmem= gives us information on the memory usage of the current threads, and
|
||||
=psmem10= only the ten most important threads in terms of memory usage.
|
||||
Here I have some abbreviations which are quite useful when performing
|
||||
some system monitoring. With =df=, we can get an overview of our
|
||||
filesystem usage, while with =diskspace= we get some more precise
|
||||
information. =meminfo= is a call to =free= with sane defaults, and similar
|
||||
to =meminfo=, we also have =gpumeminfo= to get a quick look at the
|
||||
memory-related logs of our X session. I also declared =cpuinfo= an alias
|
||||
of =lscpu= in order to keep consistent with =meminfo=. =pscpu= gives us
|
||||
information on what the CPU is running right now, and =pscpu10= limits
|
||||
that to the top 10 threads. Similarly, =psmem= gives us information on
|
||||
the memory usage of the current threads, and =psmem10= only the ten most
|
||||
important threads in terms of memory usage.
|
||||
#+NAME: mgmt-abbr
|
||||
| abbreviation | command |
|
||||
|--------------+--------------------------------------------|
|
||||
@ -327,7 +329,7 @@ comes to compilation or Docker.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Abbreviations-Development-CMake-f2951675
|
||||
:END:
|
||||
I have the following abbreviations so I can quickly run CMake and create a
|
||||
I have the following abbreviations to quickly run CMake and create a
|
||||
configuration for debug or release profiles.
|
||||
#+NAME: abbr-cmake
|
||||
| abbreviation | command |
|
||||
@ -374,7 +376,7 @@ I greatly prefer to use Emacsclient as my main text editor; Emacs has basically
|
||||
all I need. So, it's only normal I have an abbreviation to launch a new instance
|
||||
of it. If launched in the terminal, I’ll usually want Emacs to be displayed in
|
||||
CLI mode and not in GUI mode, otherwise I would invoke it with my WM’s shortcut.
|
||||
In case we want to launch Emacs in GUI mode anyways, ~egui~ is available too.
|
||||
In case we want to launch Emacs in GUI mode anyway, ~egui~ is available too.
|
||||
|
||||
#+NAME: abbr-text-ed
|
||||
| abbreviation | command |
|
||||
@ -428,7 +430,7 @@ Here is the corresponding fish configuration:
|
||||
:CUSTOM_ID: Abbreviations-LaTeX-76865eb9
|
||||
:END:
|
||||
Yes, although I use org-mode, I still have some use for LaTeX, especially when
|
||||
it comes to PDF exports of my org files. Hence why I use the LaTeX package
|
||||
it comes to PDF exports of my org files. Hence, why I use the LaTeX package
|
||||
manager. It is recommended to use ~tllocalmgr~ instead of ~tlmgr~, but I can
|
||||
never remember the command, and the latter is faster to type, so time for an
|
||||
abbreviation. Same goes for ~texhash~ which must be run as sudo.
|
||||
@ -447,14 +449,14 @@ Here is the corresponding fish configuration:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Abbreviations-Some_security_measures-489cb521
|
||||
:END:
|
||||
Some commands can be quite dangerous when not used properly, which is why I
|
||||
added default flags and options so I can get warnings before things get ugly.
|
||||
The =-i= and =-I= add prompts in case we might not want to do what we asked the
|
||||
shell to do. Notice =lns= which creates symlinks, =rmd= which removes
|
||||
directories, =rmf= which forces deletion, and =rmdf= which forces the delition
|
||||
of a directory. Notice also the =--preserve-root= which will prevent me from
|
||||
accidentally removing the root folder. I added the same option to =chgrp=,
|
||||
=chmod=, and =chown=.
|
||||
Some commands can be quite dangerous when not used properly, which is
|
||||
why I added default flags and options in order to get warnings before
|
||||
things get ugly. The =-i= and =-I= add prompts in case we might not want
|
||||
to do what we asked the shell to do. Notice =lns= which creates
|
||||
symlinks, =rmd= which removes directories, =rmf= which forces deletion,
|
||||
and =rmdf= which forces the delition of a directory. Notice also the
|
||||
=--preserve-root= which will prevent me from accidentally removing the
|
||||
root folder. I added the same option to =chgrp=, =chmod=, and =chown=.
|
||||
#+NAME: sec-abbr
|
||||
| abbreviation | command |
|
||||
|--------------+--------------------------|
|
||||
@ -539,13 +541,13 @@ program.
|
||||
abbr nsxiv 'nsxiv -abfos f'
|
||||
#+END_SRC
|
||||
|
||||
The following abbreviation is here so I can easily launch software
|
||||
with my Nvidia GPU.
|
||||
The following abbreviation is here to launch software with my Nvidia
|
||||
GPU.
|
||||
#+begin_src fish
|
||||
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 an mpv
|
||||
Finally, let's declare the following abbreviation that will launch a 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'
|
||||
|
@ -38,15 +38,15 @@ some games that do not offer to remap keys (I’m looking at you, Among Us).
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Features-5ab2a2c0
|
||||
:END:
|
||||
- Emacs configuration perfectly tailored for my own use
|
||||
- Emacs' configuration perfectly tailored for my own use
|
||||
- Beautiful and comfy StumpWM configuration
|
||||
- And enough information below to get basically the same distro
|
||||
install as I have on computer.
|
||||
|
||||
Most of the org files you will find in this repos are the actual
|
||||
source code of much of my config files. For instance, the bootstrap
|
||||
found in [[file:bootstrap.org][bootstrap.org]] exports almost all of its code snippets to
|
||||
~$HOME/.config/yadm/bootstrap~ thanks to =M-x org-babel-tangle= from
|
||||
Most of the org files you will find in this repo are the actual source
|
||||
code of much of my config files. For instance, the bootstrap found in
|
||||
[[file:bootstrap.org][bootstrap.org]] exports almost all of its code snippets to
|
||||
=$HOME/.config/yadm/bootstrap= thanks to =M-x org-babel-tangle= from
|
||||
within Emacs. Below I will also present and comment some of my short
|
||||
config files which do not deserve to have a full org file dedicated to
|
||||
them.
|
||||
@ -186,14 +186,15 @@ welcome either.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Features-And-some-minor-configuration-files-Paru-1f3ef49e
|
||||
:END:
|
||||
~paru~ is an AUR helper for Arch Linux which aims to be a replacement for ~yay~.
|
||||
A couple of the options you will see below aim at restoring the behavior of
|
||||
~yay~ in ~paru~. I also activated the sudo loop so I don’t have to enter my
|
||||
password if one package takes too much time to compile and/or compress. I know
|
||||
it can be a security issue if someone ever get access to my computer while paru
|
||||
is running, but if it ever happens it will be already concerning enough they
|
||||
managed to. I also make use of [[file:bin.org::#Emacs-stuff-Dired-2eeca9da][my custom script dired]] so I can use Emacs’ Dired
|
||||
as the file manager for ~paru~.
|
||||
~paru~ is an AUR helper for Arch Linux which aims to be a replacement
|
||||
for ~yay~. A couple of the options you will see below aim at restoring
|
||||
the behavior of ~yay~ in ~paru~. Sudo loop avoids me having to enter again
|
||||
my password if one package takes too much time to compile and/or
|
||||
compress. I know it can be a security issue if someone ever get access
|
||||
to my computer while paru is running, but if it ever happens it will
|
||||
be already concerning enough they managed to. I also make use of [[file:bin.org::#Emacs-stuff-Dired-2eeca9da][my
|
||||
custom script dired]] so I can use Emacs’ Dired as the file manager
|
||||
for ~paru~.
|
||||
#+BEGIN_SRC conf :tangle ~/.config/paru/paru.conf :mkdirp yes
|
||||
[options]
|
||||
BottomUp
|
||||
|
@ -62,9 +62,9 @@ log_file "~/.config/mpd/log"
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Optional-Parameters-hkw8zz71v8j0
|
||||
:END:
|
||||
While these values are not strictly necessary, some are still
|
||||
extremely useful such as ~music_directory~ so we don’t have to manually
|
||||
add our music to MPD each time we run it.
|
||||
While these values are not strictly necessary, some are still useful
|
||||
such as ~music_directory~: we don’t have to manually add our music to
|
||||
MPD each time we run it.
|
||||
#+name: mpd-optional-parameters
|
||||
| Parameter | Value | Comment |
|
||||
|--------------------+---------------------+-----------------------------------------------------------|
|
||||
@ -83,9 +83,8 @@ add our music to MPD each time we run it.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Audio-outputs-emqjro81v8j0
|
||||
:END:
|
||||
Two audio outputs will be defined. The first one is dedicated to
|
||||
Pulseaudio 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"
|
||||
@ -93,9 +92,8 @@ audio_output {
|
||||
}
|
||||
#+end_src
|
||||
|
||||
Another one is created, but this time for the visualizer of ~ncmpcpp~.
|
||||
It is not necessary to create this one if you don’t plan on using this
|
||||
feature.
|
||||
Another one sets up the visualizer of ~ncmpcpp~. It is not necessary to
|
||||
create this one if you don’t plan on using this feature.
|
||||
#+begin_src conf-space
|
||||
audio_output {
|
||||
type "fifo"
|
||||
|
@ -405,7 +405,7 @@ gtk3="off"
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_brand-5b25776b
|
||||
:END:
|
||||
With this variables, it is possible to show or hide the brand of a CPU in the
|
||||
With these variables, it is possible to show or hide the brand of a CPU in the
|
||||
~cpu~ output.
|
||||
- Default value :: ~"on"~
|
||||
- Values ::
|
||||
@ -459,8 +459,8 @@ speed_type="bios_limit"
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_speed_shorthand-0d15fe08
|
||||
:END:
|
||||
This value allows to show sorter CPU speed with less digits. This flag is not
|
||||
supported in systems with CPU speed below 1GHz.
|
||||
This value allows showing sorter CPU speed with fewer digits. This flag
|
||||
is not supported in systems with CPU speed below 1GHz.
|
||||
- Default value :: ~"off"~
|
||||
- Values ::
|
||||
- ~"on"~
|
||||
|
@ -26,7 +26,7 @@ requested using the wintypes option.
|
||||
shadow = true;
|
||||
#+END_SRC
|
||||
|
||||
The blur radius radius for shadows is measured in pixels, and it defaults to
|
||||
The blur radius for shadows is measured in pixels, and it defaults to
|
||||
12px.
|
||||
#+BEGIN_SRC conf
|
||||
shadow-radius = 17;
|
||||
@ -55,8 +55,8 @@ or ~shadow-blue~.
|
||||
shadow-color = "#171A20"
|
||||
#+END_SRC
|
||||
|
||||
It is possible to specify a list of conditions of windows that should have no
|
||||
shadow.
|
||||
It is possible to specify a list of conditions of windows that should
|
||||
have no shadow.
|
||||
| Default value | ~[]~ |
|
||||
#+BEGIN_SRC conf
|
||||
shadow-exclude = [
|
||||
@ -102,9 +102,9 @@ config file instead.
|
||||
no-dock-shadow = false;
|
||||
#+END_SRC
|
||||
|
||||
This option allows Picom not to draw on drag-and-drop windows. This option is
|
||||
deprecated, and users should use the ~wintypes~ option in their config file
|
||||
instead.
|
||||
This option allows Picom not to draw on drag-and-drop windows. It is
|
||||
deprecated, and users should use the ~wintypes~ option in their config
|
||||
file instead.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
no-dnd-shadow = false;
|
||||
@ -156,7 +156,8 @@ feature on or off. However, its behavior can be changed with
|
||||
fading = true
|
||||
#+END_SRC
|
||||
|
||||
These values controls the opacity change between steps while fading in and out.
|
||||
These values control the opacity change between steps while fading in
|
||||
and out.
|
||||
| Default value | ~0.028~ (fade-in), ~0.03~ (fade-out) |
|
||||
| Min value | ~0.01~ |
|
||||
| Max value | ~1.0~ |
|
||||
@ -268,7 +269,7 @@ focus-exclude = [
|
||||
#+END_SRC
|
||||
|
||||
The user can also specify a list of opacity rules, in the format
|
||||
~PERCENT:PATTERN~, like ~50:name *= "Firefox"~ . ~picom-trans~ is recommended
|
||||
~PERCENT:PATTERN~, like ~50:name *= "Firefox"~ . ~picom-trans~ is recommended
|
||||
over this. Note we don't make any guarantee about possible conflicts with other
|
||||
programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows.
|
||||
| Default value | ~[]~ |
|
||||
@ -336,8 +337,8 @@ blur-background-exclude = [
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: General_settings-41398de7
|
||||
:END:
|
||||
Daemonize process. Fork to background after initialization. Causes issues with
|
||||
certain (badly-written) drivers.
|
||||
Daemonize process. Fork to background after initialization. Can cause
|
||||
issues with certain (badly-written) drivers.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
daemon = true;
|
||||
@ -391,13 +392,10 @@ passing ~_NET_WM_OPACITY~ of client windows to frame windows.
|
||||
detect-client-opacity = true;
|
||||
#+END_SRC
|
||||
|
||||
Limit picom to repaint at most once every 1 / ~refresh_rate~ second to boost
|
||||
performance. This should not be used with
|
||||
#+BEGIN_SRC text :tangle no
|
||||
vsync drm/opengl/opengl-oml
|
||||
#+END_SRC
|
||||
as they essentially does sw-opti's job already, unless you wish to specify a
|
||||
lower refresh rate than the actual value.
|
||||
Limit picom to repaint at most once every 1 / ~refresh_rate~ second to
|
||||
boost performance. This should not be used with ~vsync
|
||||
drm/opengl/opengl-oml~ as they essentially do sw-opti's job already,
|
||||
unless you wish to specify a lower refresh rate than the actual value.
|
||||
| Default value | ~""~ |
|
||||
#+BEGIN_SRC conf
|
||||
# sw-opti =;
|
||||
@ -411,10 +409,10 @@ the WM supports it.
|
||||
# use-ewmh-active-win = false;
|
||||
#+END_SRC
|
||||
|
||||
Unredirect all windows if a full-screen opaque window is detected, to maximize
|
||||
performance for full-screen windows. Known to cause flickering when
|
||||
redirecting/unredirecting windows. paint-on-overlay may make the flickering less
|
||||
obvious.
|
||||
Unredirect all windows if a full-screen opaque window is detected, to
|
||||
maximize performance for full-screen windows. Known to cause
|
||||
flickering when redirecting/unredirecting windows. =paint-on-overlay=
|
||||
may make the flickering less obvious.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
unredir-if-possible = false;
|
||||
@ -500,10 +498,10 @@ fullscreen based only on its size and coordinates.
|
||||
no-ewmh-fullscreen = false;
|
||||
#+END_SRC
|
||||
|
||||
Dimming bright windows so their brightness doesn't exceed this set value.
|
||||
Brightness of a window is estimated by averaging all pixels in the window, so
|
||||
this could comes with a performance hit. Setting this to 1.0 disables this
|
||||
behaviour. Requires ~--use-damage~ to be disabled.
|
||||
Dimming bright windows so their brightness doesn't exceed this set
|
||||
value. Brightness of a window is estimated by averaging all pixels in
|
||||
the window, so this could come with a performance hit. Setting this to
|
||||
1.0 disables this behaviour. Requires ~--use-damage~ to be disabled.
|
||||
| Default value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
max-brightness = 1.0;
|
||||
@ -516,24 +514,25 @@ instead of blending on top of them.
|
||||
transparent-clipping = false;
|
||||
#+END_SRC
|
||||
|
||||
Set the log level. Possible values are:
|
||||
Set the log level. Possible values in increasing level of importance are:
|
||||
- ~trace~
|
||||
- ~debug~
|
||||
- ~info~
|
||||
- ~warn~
|
||||
- ~error~
|
||||
in increasing level of importance. Case doesn't matter. If using the "TRACE" log
|
||||
level, it's better to log into a file using ~--log-file~, since it can generate
|
||||
a huge stream of logs.
|
||||
Case doesn't matter. If using the "TRACE" log level, it's better to
|
||||
log into a file using ~--log-file~, since it can generate a huge stream
|
||||
of logs.
|
||||
| Default value | ~"debug"~ |
|
||||
#+BEGIN_SRC conf
|
||||
log-level = "warn";
|
||||
#+END_SRC
|
||||
|
||||
Set the log file. If ~--log-file~ is never specified, logs will be written to
|
||||
stderr. Otherwise, logs will to written to the given file, though some of the
|
||||
early logs might still be written to the stderr. When setting this option from
|
||||
the config file, it is recommended to use an absolute path.
|
||||
Set the log file. If ~--log-file~ is never specified, logs will be
|
||||
written to stderr. Otherwise, logs will to written to the given file,
|
||||
though some early logs might still be written to the stderr. When
|
||||
setting this option from the config file, it is recommended to use an
|
||||
absolute path.
|
||||
| Default value | ~''~ |
|
||||
#+BEGIN_SRC conf
|
||||
# log-file = '/path/to/your/log/file';
|
||||
@ -577,10 +576,10 @@ Following per window-type options are available:
|
||||
- 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 been unredirected. If you have
|
||||
unredir-if-possible set, and doesn't want certain window to cause unnecessary
|
||||
screen redirection, you can set this to `true`.
|
||||
- redir-ignore :: Controls whether this type of windows should cause
|
||||
screen to become redirected again after being unredirected. 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
|
||||
wintypes:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user