[xdg] Add ‘mimeapps.list’ and move settings into tangled org files

This commit is contained in:
Tom Willemse 2021-11-17 20:45:40 -08:00
parent 8ce94b444b
commit 4adde5f2b8
7 changed files with 89 additions and 10 deletions

View file

@ -1,6 +1,6 @@
include dotfiles.mk include dotfiles.mk
MODULES=xmodmap emacs picom cower mowedline herbstluftwm MODULES=xmodmap emacs picom cower mowedline herbstluftwm xdg
STOW=stow STOW=stow
.PHONY: all clean $(MODULES) zsh .PHONY: all clean $(MODULES) zsh
@ -96,3 +96,15 @@ x11-install: lib-install x11/dot-x11-0-1-any.pkg.tar.xz
x11/dot-x11-0-1-any.pkg.tar.xz: x11/PKGBUILD x11/dot-x11-0-1-any.pkg.tar.xz: x11/PKGBUILD
cd x11 && makepkg -sicf cd x11 && makepkg -sicf
#######
# XDG #
#######
xdg: xdg/.config/mimeapps.list xdg/.config/user-dirs.dirs \
xdg/.config/user-dirs.locale
# Helper
%: %.org
$(call tangle)

3
xdg/.config/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
mimeapps.list
user-dirs.dirs
user-dirs.locale

View file

@ -0,0 +1,41 @@
#+title: XDG Mimeapps
Suggest to open images in Feh when downloading them through Firefox (and others):
#+begin_src conf-unix :noweb-ref added-associations :tangle no
image/png=feh.desktop;
#+end_src
Suggest opening atom XML files in Emacs.
#+begin_src conf-unix :noweb-ref added-associations :tangle no
application/atom+xml=emacsclient.desktop;
#+end_src
Use Firefox to open =http://= and =https://= links.
#+begin_src conf-unix :noweb-ref default-applications :tangle no
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
#+end_src
Use Emacs to handle any =org-protocol://= links.
#+begin_src conf-unix :noweb-ref default-applications :tangle no
x-scheme-handler/org-protocol=EmacsClient.desktop
#+end_src
The rest of this file seems to have been set up by something else, so I've left those around.
#+begin_src conf-unix :noweb yes
[Added Associations]
application/octet-stream=firefox.desktop;org.pwmt.zathura.desktop;zathura.desktop;
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop;
<<added-associations>>
[Default Applications]
x-scheme-handler/discord-610508934456934412=discord-610508934456934412.desktop
x-scheme-handler/msteams=teams.desktop
x-scheme-handler/discord-402572971681644545=discord-402572971681644545.desktop
<<default-applications>>
#+end_src

View file

@ -1,8 +0,0 @@
XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pictures"
XDG_VIDEOS_DIR="$HOME/"

View file

@ -0,0 +1,25 @@
#+title: XDG User Directory Configuration
#+property: header-args:conf-unix :tangle user-dirs.dirs
I don't generally show a desktop, so just use home as my desktop directory.
#+begin_src conf-unix
XDG_DESKTOP_DIR="$HOME/"
#+end_src
Use =documents=, =downloads=, =music=, =pictures=, and =videos= instead of their capitalized cousins. I just prefer seeing them that way.
#+begin_src conf-unix
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pictures"
XDG_VIDEOS_DIR="$HOME/videos"
#+end_src
I don't actually think I use anything that uses these at all, so
#+begin_src conf-unix
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
#+end_src

View file

@ -1 +0,0 @@
en_US

View file

@ -0,0 +1,7 @@
#+title: XDG User Directory Locale Configuration
I don't know what exactly this does, but =en_US= is basically what I use for everything.
#+begin_src conf-unix
en_US
#+end_src