[Misc] Move files to XDG user dirs
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Lucien Cartier-Tilet 2022-06-07 19:20:14 +02:00
parent 23c9e37dfc
commit 73c629afc4
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
5 changed files with 179 additions and 127 deletions

View File

@ -52,7 +52,7 @@ alias exti exit
alias exi exit alias exi exit
alias clean clear alias clean clear
alias vi emacs alias vi find-file
alias vim emacs alias vim find-file
alias ed emacs alias ed find-file
alias nano emacs alias nano find-file

View File

@ -32,7 +32,7 @@ of said command running.
|----------------------+------------------------------------------+-----------| |----------------------+------------------------------------------+-----------|
| ~pactl~ | ~load-module module-switch-on-connect~ | | | ~pactl~ | ~load-module module-switch-on-connect~ | |
| ~mpc~ | ~stop~ | no | | ~mpc~ | ~stop~ | no |
| ~xrdb~ | ~-merge "$HOME"/.Xresources~ | no | | ~xrdb~ | ~-merge "$XDG_CONFIG_HOME"/X11/Xresources~ | no |
| ~picom~ | ~--experimental-backends~ | yes | | ~picom~ | ~--experimental-backends~ | yes |
| ~set-screens~ | | no | | ~set-screens~ | | no |
| ~numlockx~ | ~on~ | yes | | ~numlockx~ | ~on~ | yes |

View File

@ -409,12 +409,13 @@ Below you will find my window management keybinds.
:END: :END:
**** General configuration **** General configuration
:PROPERTIES: :PROPERTIES:
:HEADER-ARGS: :mkdirp yes :tangle ~/.gtkrc-2.0 :HEADER-ARGS: :mkdirp yes :tangle ~/.config/gtk-2.0/gtkrc
:CUSTOM_ID: Theme-and-graphical-tweaks-GTK-Settings-GTK2-General-configuration-xod7gbc0l9j0 :CUSTOM_ID: Theme-and-graphical-tweaks-GTK-Settings-GTK2-General-configuration-xod7gbc0l9j0
:END: :END:
This file is tangled at ~$HOME/.gtkrc-2.0~. This is an equivalent for the GTK3 This file is tangled at ~$HOME/.config/gtk-2.0/gtkrc~. This is an
configuration file you will see below, and it shares most of its settings. equivalent for the GTK3 configuration file you will see below, and it
First, lets select the Nordic theme for GTK2. Lets also set the icon theme. shares most of its settings. First, lets select the Nordic theme for
GTK2. Lets also set the icon theme.
#+BEGIN_SRC conf-unix #+BEGIN_SRC conf-unix
# -*- mode: unix-config -*- # -*- mode: unix-config -*-
gtk-theme-name="Nordic" gtk-theme-name="Nordic"
@ -555,7 +556,7 @@ You can find my Picom configuration [[file:picom.org][here]].
** Xresources ** Xresources
:PROPERTIES: :PROPERTIES:
:HEADER-ARGS: :mkdirp yes :tangle ~/.Xresources :exports code :HEADER-ARGS: :mkdirp yes :tangle ~/.config/X11/Xresources :exports code
:CUSTOM_ID: Theme-and-graphical-tweaks-Xresources-4dr7gbc0l9j0 :CUSTOM_ID: Theme-and-graphical-tweaks-Xresources-4dr7gbc0l9j0
:END: :END:
The main body in my Xresources declaration is the declaration of my The main body in my Xresources declaration is the declaration of my

View File

@ -35,6 +35,173 @@ if test -n "$EMACS"
end end
#+END_SRC #+END_SRC
* Global variables
:PROPERTIES:
:CUSTOM_ID: Global_variables-1c84df8b
:END:
In order to keep some other code clean, I set the ~$BROWSER~ variable so I dont
have to call my web browser directly but rather with this variable.
#+BEGIN_SRC fish
set -gx BROWSER firefox
#+END_SRC
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it can
get the sudo password. So, lets declare it.
#+BEGIN_SRC fish
set -gx SUDO_ASKPASS ~/.local/bin/askpass
#+END_SRC
In general, I prefer using ~bat~ to ~less~, although the former relies on the
latter, but ~bat~ provides nice wrapping around ~less~, including syntax
highlighting. Lets set the manpager to bat then:
#+BEGIN_SRC fish
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
#+END_SRC
~XMODIFIERS~ is set to nothing as to not impede Emacs inputs.
#+begin_src fish
set -x XMODIFIERS
#+end_src
Lets start the Gnome keyring daemon. It will return a variable which must be set.
#+begin_src fish
if test -n "$DESKTOP_SESSION"
set -x (gnome-keyring-daemon --start | string split "=")
end
#+end_src
** XDG user directories
:PROPERTIES:
:CUSTOM_ID: Global-variables-XDG-user-directories-ata8fwf0bhj0
:END:
Theres a couple of XDG user directories that are not set, lets fix
that.
#+begin_src fish
set -x XDG_CACHE_HOME $HOME/.cache
set -x XDG_CONFIG_HOME $HOME/.config
set -x XDG_DATA_HOME $HOME/.local/share
set -x XDG_STATE_HOME $HOME/.local/state
#+end_src
Now, let's clean the ~$HOME~ directory. Be aware it will require quite a
few lines.
#+begin_src fish
set -x HISTFILE "$XDG_STATE_HOME"/bash/history
set -x _Z_DATA "$XDG_DATA_HOME"/z
set -x XAUTHORITY "$XDG_RUNTIME_DIR"/Xauthority
set -x WINEPREFIX "$XDG_DATA_HOME"/wine
set -x TEXMFVAR "$XDG_CACHE_HOME"/texlive/texmf-var
set -x RUSTUP_HOME "$XDG_DATA_HOME"/rustup
set -x BUNDLE_USER_CONFIG "$XDG_CONFIG_HOME"/bundle
set -x BUNDLE_USER_CACHE "$XDG_CACHE_HOME"/bundle
set -x BUNDLE_USER_PLUGIN "$XDG_DATA_HOME"/bundle
set -x PYLINTHOME "$XDG_CACHE_HOME"/pylint
set -x PYENV_ROOT "$XDG_DATA_HOME"/pyenv
set -x PASSWORD_STORE_DIR "$XDG_DATA_HOME"/pass
set -x PARALLEL_HOME "$XDG_CONFIG_HOME"/parallel
set -x _JAVA_OPTIONS -Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
set -x NVM_DIR "$XDG_DATA_HOME"/nvm
set -x CUDA_CACHE_PATH "$XDG_CACHE_HOME"/nv
set -x __GL_SHADER_DISK_CACHE_PATH "$XDG_CACHE_HOME"/nv
set -x NUGET_PACKAGES "$XDG_CACHE_HOME"/NuGetPackages
set -x NPM_CONFIG_USERCONFIG "$XDG_CONFIG_HOME"/npm/npmrc
set -x TERMINFO "$XDG_DATA_HOME"/terminfo
set -x TERMINFO_DIRS "$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
set -x MPLAYER_HOME "$XDG_CONFIG_HOME"/mplayer
set -x ICEAUTHORITY "$XDG_CACHE_HOME"/ICEauthority
set -x LESSHISTFILE "$XDG_CACHE_HOME"/less/history
set -x GTK2_RC_FILES "$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
set -x GOPATH "$XDG_DATA_HOME"/go
set -x GNUPGHOME "$XDG_DATA_HOME"/gnupg
set -x GEM_HOME "$XDG_DATA_HOME"/gem
set -x GEM_SPEC_CACHE "$XDG_CACHE_HOME"/gem
set -x DOCKER_CONFIG "$XDG_CONFIG_HOME"/docker
set -x CARGO_HOME "$XDG_DATA_HOME"/cargo
#+end_src
** Development
:PROPERTIES:
:CUSTOM_ID: Global_variables-Development-76b3ff13
:END:
Now, lets declare our editor of choice, EmacsClient; not Emacs itself since it
will most often be just quick edits, nothing too heavy, if it is called from the
~EDITOR~ variable (from Git, for example), or from the ~VISUAL~ variable.
#+BEGIN_SRC fish
set -gx EDITOR emacsclient -c
set -gx VISUAL emacsclient -c
#+END_SRC
We also need to set the path to the Dart SDK.
#+BEGIN_SRC fish
set -gx DART_SDK /opt/dart-sdk/bin
#+END_SRC
And we also need to specify where the Android SDK it located.
#+BEGIN_SRC fish
set -gx ANDROID_HOME $HOME/Android/Sdk
#+END_SRC
Still related to Dart and Flutter development,
#+BEGIN_SRC fish
set -gx CHROME_EXECUTABLE /usr/bin/chromium
#+END_SRC
Next, we have two variables from Deno, the Node.js destroyer. Its base directory
will be set in my XDG config directory, and its binaries will be located in my
local binaries directory (see below).
#+BEGIN_SRC fish
set -gx DENO_DIR $HOME/.config/deno
set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno
#+END_SRC
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
** ~$PATH~
:PROPERTIES:
:CUSTOM_ID: Global_variables-$PATH-e1320303
:END:
A variable available with the fish shell is ~fish_user_paths~ which lists custom
paths to binaries specified by the user. Using this variable ensures they are
included in the ~$PATH~ variable only once without the need to set it directly.
For instance, my ~PATH~ variable needs Rusts Cargos binaries, Gos binaries,
my own executables, and some more.
#+NAME: extra-paths
| additional path | what it leads to |
|--------------------------+--------------------------------------|
| $HOME/.local/bin | Custom executables, see [[file:bin.org]] |
| $GOPATH/bin | Go binaries and executables |
| $CARGO_HOME/bin | Rust binaries and executables |
| $GEM_HOME/ruby/3.0.0/bin | Ruby 3.0 binaries and executables |
| $GEM_HOME/ruby/2.6.0/bin | Ruby 2.6 binaries and executables |
| $HOME/.cabal/bin | Haskel binaries |
| /usr/lib/xfce-polkit | Path to XFCEs PolKit |
#+NAME: generate-extra-paths
#+BEGIN_SRC emacs-lisp :var paths=extra-paths[,0] :exports none :cache yes
(mapconcat #'identity
paths " \\\n")
#+END_SRC
#+RESULTS[8fe70e73420376a50897de0f9518689ec3088288]: generate-extra-paths
: $HOME/.local/bin \
: $GOPATH/bin \
: $CARGO_HOME/bin \
: $GEM_HOME/ruby/3.0.0/bin \
: $GEM_HOME/ruby/2.6.0/bin \
: $HOME/.cabal/bin \
: /usr/lib/xfce-polkit
So, lets set our user paths:
#+BEGIN_SRC fish :noweb yes
set -g fish_user_paths \
<<generate-extra-paths()>>
#+END_SRC
* Tramp remote access * Tramp remote access
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Tramp_remote_access-72aedec2 :CUSTOM_ID: Tramp_remote_access-72aedec2
@ -200,122 +367,6 @@ disable = true
zoxide init fish | source zoxide init fish | source
#+end_src #+end_src
* Global variables
:PROPERTIES:
:CUSTOM_ID: Global_variables-1c84df8b
:END:
In order to keep some other code clean, I set the ~$BROWSER~ variable so I dont
have to call my web browser directly but rather with this variable.
#+BEGIN_SRC fish
set -gx BROWSER firefox
#+END_SRC
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it can
get the sudo password. So, lets declare it.
#+BEGIN_SRC fish
set -gx SUDO_ASKPASS ~/.local/bin/askpass
#+END_SRC
In general, I prefer using ~bat~ to ~less~, although the former relies on the
latter, but ~bat~ provides nice wrapping around ~less~, including syntax
highlighting. Lets set the manpager to bat then:
#+BEGIN_SRC fish
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
#+END_SRC
#+begin_src fish
set -x XMODIFIERS
#+end_src
#+begin_src fish
if test -n "$DESKTOP_SESSION"
set -x (gnome-keyring-daemon --start | string split "=")
end
#+end_src
** Development
:PROPERTIES:
:CUSTOM_ID: Global_variables-Development-76b3ff13
:END:
Now, lets declare our editor of choice, EmacsClient; not Emacs itself since it
will most often be just quick edits, nothing too heavy, if it is called from the
~EDITOR~ variable (from Git, for example), or from the ~VISUAL~ variable.
#+BEGIN_SRC fish
set -gx EDITOR emacsclient -c
set -gx VISUAL emacsclient -c
#+END_SRC
We also need to set the path to the Dart SDK.
#+BEGIN_SRC fish
set -gx DART_SDK /opt/dart-sdk/bin
#+END_SRC
And we also need to specify where the Android SDK it located.
#+BEGIN_SRC fish
set -gx ANDROID_HOME $HOME/Android/Sdk
#+END_SRC
Still related to Dart and Flutter development,
#+BEGIN_SRC fish
set -gx CHROME_EXECUTABLE /usr/bin/chromium
#+END_SRC
Next, we have two variables from Deno, the Node.js destroyer. Its base directory
will be set in my XDG config directory, and its binaries will be located in my
local binaries directory (see below).
#+BEGIN_SRC fish
set -gx DENO_DIR $HOME/.config/deno
set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno
#+END_SRC
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
** ~$PATH~
:PROPERTIES:
:CUSTOM_ID: Global_variables-$PATH-e1320303
:END:
A variable available with the fish shell is ~fish_user_paths~ which lists custom
paths to binaries specified by the user. Using this variable ensures they are
included in the ~$PATH~ variable only once without the need to set it directly.
For instance, my ~PATH~ variable needs Rusts Cargos binaries, Gos binaries,
my own executables, and some more.
#+NAME: extra-paths
| additional path | what it leads to |
|---------------------------+--------------------------------------|
| $HOME/.local/bin | Custom executables, see [[file:bin.org]] |
| $HOME/go/bin | Go binaries and executables |
| $HOME/.cargo/bin | Rust binaries and executables |
| $HOME/.gem/ruby/3.0.0/bin | Ruby 3.0 binaries and executables |
| $HOME/.gem/ruby/2.6.0/bin | Ruby 2.6 binaries and executables |
| $HOME/.cabal/bin | Haskel binaries |
| /usr/lib/xfce-polkit | Path to XFCEs PolKit |
#+NAME: generate-extra-paths
#+BEGIN_SRC emacs-lisp :var paths=extra-paths[,0] :exports none :cache yes
(mapconcat #'identity
paths " \\\n")
#+END_SRC
#+RESULTS[7d02a0a6d8acf31d148e071a87c69b5f944e0a5f]: generate-extra-paths
: $HOME/.local/bin \
: $HOME/go/bin \
: $HOME/.cargo/bin \
: $HOME/.gem/ruby/3.0.0/bin \
: $HOME/.gem/ruby/2.6.0/bin \
: $HOME/.cabal/bin \
: /usr/lib/xfce-polkit
So, lets set our user paths:
#+BEGIN_SRC fish :noweb yes
set -g fish_user_paths \
<<generate-extra-paths()>>
#+END_SRC
* Abbreviations * Abbreviations
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Abbreviations-97537716 :CUSTOM_ID: Abbreviations-97537716
@ -734,7 +785,7 @@ the US.
:END: :END:
By default, continue a download that was interupted. By default, continue a download that was interupted.
#+BEGIN_SRC fish #+BEGIN_SRC fish
abbr wget 'wget -c' abbr wget 'wget --hsts-file="$XDG_DATA_HOME/wget-hsts" -c'
#+END_SRC #+END_SRC
* Last thing before were done * Last thing before were done