aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alsause/Makefile15
-rwxr-xr-xalsause/dalsause4
-rw-r--r--bash/aliases3
-rw-r--r--bash/bashrc6
-rw-r--r--brave/Makefile12
-rwxr-xr-xbrave/brave3
-rw-r--r--cryptsetup/Makefile15
-rwxr-xr-xcryptsetup/mount-devices35
-rwxr-xr-xdmenu/plumb22
-rwxr-xr-xelement-desktop/mount-element8
-rwxr-xr-xelement-desktop/umount-element7
-rw-r--r--emacs-go-mode/Makefile11
-rw-r--r--emacs-go-mode/init-go-mode.el (renamed from emacs/init-go-mode.el)0
-rw-r--r--emacs-haskell-mode/Makefile11
-rw-r--r--emacs-haskell-mode/init-haskell-mode.el (renamed from emacs/init-haskell-mode.el)0
-rw-r--r--emacs/Makefile19
-rw-r--r--emacs/init.el52
-rw-r--r--ffmpeg/Makefile5
-rw-r--r--ffmpeg/bash-aliases25
-rwxr-xr-xffmpeg/resize-and-transcode2
-rw-r--r--gdb/Makefile11
-rw-r--r--gdb/init-gdb.el (renamed from emacs/init-gdb.el)0
-rw-r--r--git/Makefile4
-rwxr-xr-xgit/git-cdiff44
-rwxr-xr-xgit/new-c-proj8
-rw-r--r--java-runtime/user-profile2
l---------python@australis1
l---------python@borealis1
l---------python@east1
l---------python@hades1
l---------python@heaven1
l---------python@hyperion1
l---------python@miniaurora1
l---------python@nadir1
l---------python@north1
l---------python@selene1
l---------python@south1
l---------python@west1
-rwxr-xr-xsignal-desktop/mount-signal8
-rwxr-xr-xsignal-desktop/signal-desktop3
-rwxr-xr-xsignal-desktop/umount-signal7
-rw-r--r--ssh/Makefile4
-rwxr-xr-xssh/ssh-archiso5
-rw-r--r--sshexec/Makefile10
-rwxr-xr-xsshexec/sshexec-archiso5
-rwxr-xr-xwire-desktop/mount-wire8
-rwxr-xr-xwire-desktop/umount-wire7
-rw-r--r--xmonad/xinit3
-rw-r--r--xorg-server/xkbdbind.config.h.gpp1
-rwxr-xr-xxorg-xrandr/resolution-changed14
-rwxr-xr-xxorg-xrandr/setres/__main__.py.gpp17
-rw-r--r--xpybar/config/Makefile5
-rw-r--r--xpybar/config/xmonad-monitor.gpp4
-rw-r--r--xwallpaper/xinit14
-rw-r--r--yt-dlp/bash-aliases2
55 files changed, 372 insertions, 81 deletions
diff --git a/alsause/Makefile b/alsause/Makefile
new file mode 100644
index 0000000..d0e39be
--- /dev/null
+++ b/alsause/Makefile
@@ -0,0 +1,15 @@
+.POSIX:
+
+install:
+ ../check-installed-shebang dalsause
+ ../check-in-path dmenu tr sed cut echo
+ mkdir -p -- ~/.local/bin
+ test ! -e ~/.local/bin/dalsause || test -L ~/.local/bin/dalsause
+ ln -sf -- ~/.dotfiles/alsause/dalsause ~/.local/bin/dalsause
+
+uninstall:
+ +! ../check-installed alsause
+ -unlink -- ~/.local/bin/dalsause
+
+clean:
+ @:
diff --git a/alsause/dalsause b/alsause/dalsause
new file mode 100755
index 0000000..f5491ef
--- /dev/null
+++ b/alsause/dalsause
@@ -0,0 +1,4 @@
+#!/bin/dash
+set -e
+dev="$(alsause | tr '\t' ' ' | sed 's/ / /' | dmenu -p 'Choose default audio output' -i -l 20)"
+alsause "$(echo "$dev" | cut -d ' ' -f 1)
diff --git a/bash/aliases b/bash/aliases
index d978492..75a1eda 100644
--- a/bash/aliases
+++ b/bash/aliases
@@ -69,6 +69,9 @@ alias l='ls -CF'
#DESCRIPTION: Go to the parent directory
alias ..="cd .."
+#DESCRIPTION: Print each argument, each on their own line
+alias echoln="printf '%s\n'"
+
#libnotify
diff --git a/bash/bashrc b/bash/bashrc
index 26a319a..f3c31e5 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -62,3 +62,9 @@ elif test "$TERM" = xterm; then
export TERM=xterm-256color
fi
featherweight-off
+
+
+# Use yellow colour on hostname if logged in remotely
+if printenv | grep -q '^SSH_\(CONNECTION\|CLIENT\|TTY\)'; then
+ hostname-colour 33
+fi
diff --git a/brave/Makefile b/brave/Makefile
new file mode 100644
index 0000000..b70f3b8
--- /dev/null
+++ b/brave/Makefile
@@ -0,0 +1,12 @@
+.POSIX:
+
+install:
+ ../check-installed-shebang brave
+ mkdir -p -- ~/.local/bin
+ test ! -e ~/.local/bin/brave || test -L ~/.local/bin/brave
+ ln -sf -- ~/.dotfiles/brave/brave ~/.local/bin/brave
+
+uninstall:
+ +! ../check-installed brave
+ +! ../check-installed brave-bin
+ -unlink -- ~/.local/bin/brave
diff --git a/brave/brave b/brave/brave
new file mode 100755
index 0000000..9971967
--- /dev/null
+++ b/brave/brave
@@ -0,0 +1,3 @@
+#!/bin/dash
+
+exec /usr/bin/brave --password-store=none "$@"
diff --git a/cryptsetup/Makefile b/cryptsetup/Makefile
new file mode 100644
index 0000000..0666bc6
--- /dev/null
+++ b/cryptsetup/Makefile
@@ -0,0 +1,15 @@
+.POSIX:
+
+install:
+ ../check-installed-shebang mount-devices
+ ../check-in-path test
+ ../check-in-path mountpoint
+ ../check-in-path cryptsetup
+ ../check-in-path mount
+ mkdir -p -- ~/.local/bin
+ test ! -e ~/.local/bin/mount-devices || test -L ~/.local/bin/mount-devices
+ ln -sf -- ~/.dotfiles/cryptsetup/mount-devices ~/.local/bin/mount-devices
+
+uninstall:
+ +! ../check-installed cryptsetup
+ -unlink -- ~/.local/bin/mount-devices
diff --git a/cryptsetup/mount-devices b/cryptsetup/mount-devices
new file mode 100755
index 0000000..a26fd1c
--- /dev/null
+++ b/cryptsetup/mount-devices
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Although the name doesn't indicate it, this is only for encrypted
+# partitions, and it exists only because systemd is absolutely
+# terrible at mounting encrypted filesystems. Thanks you, Lennart
+# and all the idiots that thought your craps smelled good.
+
+cd /devices
+
+for f in *; do
+ # Make sure the symlink points to an available device
+ if ! test -e "$f"; then
+ continue
+ fi
+
+ # Make sure that the device should be mounted in /media/
+ if ! test -d "/media/$f"; then
+ continue;
+ fi
+
+ # Make sure the device is not already mounted
+ if mountpoint -q "/media/$f"; then
+ continue;
+ fi
+
+ # If the device has not been decrypted already, attempt to decrypt it
+ if ! test -e "/dev/mapper/$f"; then
+ if ! cryptsetup open "/devices/$f" "$f"; then
+ continue
+ fi
+ fi
+
+ # And of course, mount the decrypted device
+ mount "/dev/mapper/$f" "/media/$f"
+done
diff --git a/dmenu/plumb b/dmenu/plumb
index c0d98f3..d7c45e1 100755
--- a/dmenu/plumb
+++ b/dmenu/plumb
@@ -13,6 +13,7 @@ fi
sel="$(xclip -o)"
url="$(printf '%s' "$sel" | tr -d '\n')"
file="$(printf '%s' "$sel" | tr -d '\n')"
+lower="$(printf '%s' "$sel" | tr A-Z a-z | sed 's/Å/å/g' | sed 's/Ä/ä/g' | sed 's/Ö/ö/g' | sed 's/Ü/ü/g' | sed 's/É/é/g' | sed 's/À/à/g')"
if test -z "$sel"; then
exit 0
@@ -52,6 +53,13 @@ if printf '%s\n' "$url" | grep '^\(https\?://\|www\.\)[^[:space:]./]\+\.[^[:spac
}
fi
+if test $(printf '%s\n' "$sel" | wc -l) = 1 && printf '%s\n' "$sel" | grep -q '^[A-Za-z0-9_-]\{11,11\}$'; then
+ functions="$functions youtube"
+ youtube () {
+ exec $WEB_BROWSER -- "https://youtube.com/watch?v=$sel";
+ }
+fi
+
if printf '%s\n' "$url" | grep '^\(mailto:\)\?\("[^"]\+"\|[a-zA-Z0-9!#$%&'\''*+/=?^_`{|}~-]\+\(\.[a-zA-Z0-9!#$%&'\''*+/=?^_`{|}~-]\)*\)@[^[:space:]./]\+\.[^[:space:]/]*$' > /dev/null; then
functions="$functions email-client"
email-client () {
@@ -66,11 +74,25 @@ if test -r "$file" && file "$file" | grep '\(PNG\|JPEG\) image' > /dev/null; the
}
fi
+if test ! "$lower" = "$sel"; then
+ functions="$functions wiktionary.en.lower-case"
+ wiktionary.en.lower-case () {
+ exec $WEB_BROWSER "https://en.wiktionary.org/wiki/$lower";
+ }
+fi
+
functions="$functions wiktionary.en"
wiktionary.en () {
exec $WEB_BROWSER "https://en.wiktionary.org/wiki/$sel";
}
+if test ! "$lower" = "$sel"; then
+ functions="$functions wiktionary.sv.lower-case"
+ wiktionary.sv.lower-case () {
+ exec $WEB_BROWSER "https://sv.wiktionary.org/wiki/$lower";
+ }
+fi
+
functions="$functions wiktionary.sv"
wiktionary.sv () {
exec $WEB_BROWSER "https://sv.wiktionary.org/wiki/$sel";
diff --git a/element-desktop/mount-element b/element-desktop/mount-element
index 1d3c03c..7b3c6a7 100755
--- a/element-desktop/mount-element
+++ b/element-desktop/mount-element
@@ -1,9 +1,13 @@
#!/bin/dash
if mountpoint -q -- "${HOME}/.var/opt/element/ElementCrypt.d"; then
- printf '%s\n' 'mount-element: already mounted' >&2
+ printf '%s\n' 'mount-element: already mounted' >&2 || :
elif test -e /dev/mapper/ElementCrypt; then
- asroot env ELEMENT_DIR="${HOME}/.var/opt/element" sh -ec \
+ asroot=asroot
+ if ! isfg; then
+ asroot=gasroot
+ fi
+ $asroot env ELEMENT_DIR="${HOME}/.var/opt/element" sh -ec \
'mount -- /dev/mapper/ElementCrypt "${ELEMENT_DIR}/ElementCrypt.d"'
else
gpg --decrypt -- "${HOME}/.var/opt/element/ElementCrypt.key" | \
diff --git a/element-desktop/umount-element b/element-desktop/umount-element
index 44d425b..ddfc602 100755
--- a/element-desktop/umount-element
+++ b/element-desktop/umount-element
@@ -1,6 +1,11 @@
#!/bin/dash
-asroot env \
+asroot=asroot
+if ! isfg; then
+ asroot=gasroot
+fi
+
+$asroot env \
ELEMENT_DIR="${HOME}/.var/opt/element" \
ELEMENT_DEV="$(losetup | sed 's/\s\+/ /g' | cut -d ' ' -f 1,6 | \
sed -n 's#\(/[^ ]*\) '"$(realpath -- "${HOME}/.var/opt/element/ElementCrypt.img")"'$#\1#p' | sed 1q)" \
diff --git a/emacs-go-mode/Makefile b/emacs-go-mode/Makefile
new file mode 100644
index 0000000..ea3f8be
--- /dev/null
+++ b/emacs-go-mode/Makefile
@@ -0,0 +1,11 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.config/emacs
+ test -L ~/.config/emacs/init-go-mode.el || test ! -e ~/.config/emacs/init-go-mode.el
+ ln -sf -- ~/.dotfiles/emacs-go-mode/init-go-mode.el ~/.config/emacs/
+
+uninstall:
+ +! ../check-installed emacs-go-mode
+ -unlink -- ~/.config/emacs/init-go-mode.el
+ -rmdir -- ~/.config/emacs
diff --git a/emacs/init-go-mode.el b/emacs-go-mode/init-go-mode.el
index 56e3c16..56e3c16 100644
--- a/emacs/init-go-mode.el
+++ b/emacs-go-mode/init-go-mode.el
diff --git a/emacs-haskell-mode/Makefile b/emacs-haskell-mode/Makefile
new file mode 100644
index 0000000..3605590
--- /dev/null
+++ b/emacs-haskell-mode/Makefile
@@ -0,0 +1,11 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.config/emacs
+ test -L ~/.config/emacs/init-haskell-mode.el || test ! -e ~/.config/emacs/init-haskell-mode.el
+ ln -sf -- ~/.dotfiles/emacs-haskell-mode/init-haskell-mode.el ~/.config/emacs/
+
+uninstall:
+ +! ../check-installed emacs-haskell-mode
+ -unlink -- ~/.config/emacs/init-haskell-mode.el
+ -rmdir -- ~/.config/emacs
diff --git a/emacs/init-haskell-mode.el b/emacs-haskell-mode/init-haskell-mode.el
index 6fe75c2..6fe75c2 100644
--- a/emacs/init-haskell-mode.el
+++ b/emacs-haskell-mode/init-haskell-mode.el
diff --git a/emacs/Makefile b/emacs/Makefile
index 9fa5799..665bde5 100644
--- a/emacs/Makefile
+++ b/emacs/Makefile
@@ -14,22 +14,8 @@ install:
fi; \
ln -sf -- .config/emacs ~/.emacs.d; \
fi
- printf '; %s\n; %s\n\n' > ~/.config/emacs/init.el \
- 'This file is generated by ~/.dotfiles/emacs/Makefile' \
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
- cat -- init.el >> ~/.config/emacs/init.el
- if ../check-installed emacs-go-mode 2>/dev/null; then \
- printf '\n' >> ~/.config/emacs/init.el && \
- cat -- init-go-mode.el >> ~/.config/emacs/init.el; \
- fi
- if ../check-installed emacs-haskell-mode; then\
- printf '\n' >> ~/.config/emacs/init.el && \
- cat -- init-haskell-mode.el >> ~/.config/emacs/init.el; \
- fi
- if ../check-installed gdb; then \
- printf '\n' >> ~/.config/emacs/init.el && \
- cat -- init-gdb.el >> ~/.config/emacs/init.el; \
- fi
+ test -L ~/.config/emacs/init.el || test ! -e ~/.config/emacs/init.el
+ ln -sf -- ~/.dotfiles/emacs/init.el ~/.config/emacs/init.el
if grep Ubuntu < /etc/lsb-release >/dev/null 2>/dev/null; then \
mkdir -p -- ~/.config/profile.d && \
(test ! -e ~/.config/profile.d/emacs || \
@@ -52,3 +38,4 @@ uninstall:
-unlink -- ~/.emacs.d
-rmdir -- ~/.config/emacs
-unlink -- ~/.local/bin/e
+ test ! -d ../.work/emacs || (cd ../.work/emacs && $(MAKE) uninstall)
diff --git a/emacs/init.el b/emacs/init.el
index a807fa7..432b772 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -4,21 +4,25 @@
;; You may delete these explanatory comments.
(package-initialize)
+
+;; Enable the upcase-region function which is disabled by default
(put 'upcase-region 'disabled nil)
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(inhibit-startup-screen t))
-(setq display-time-string-forms
- '((propertize (concat " " 24-hours ":" minutes " ")
- )))
+;; Never show the startup screen (go to scratch if there is no file specified)
+(custom-set-variables '(inhibit-startup-screen t))
+
+
+;; Display column number after line number
(column-number-mode)
+
+
+;; Configure and display clock
+(setq display-time-string-forms
+ '((propertize (concat " " 24-hours ":" minutes " ") )))
(display-time-mode)
+
; (set-default-font "-misc-fixed-medium-r-normal--13-*-75-75-c-70-iso8859-1")
;; TODO set-default-font stopped working
@@ -34,16 +38,34 @@
(set-face-foreground 'font-lock-comment-face "red")
+
+;; Fix up C mode
+;;;; disable electric mode
(add-hook 'after-change-major-mode-hook (lambda() (electric-indent-mode -1)))
(add-hook 'c-mode-hook (lambda () (electric-indent-local-mode)))
-
+;;;; use tab as indentation
(defvaralias 'c-basic-offset 'tab-width)
+;; TODO trailing whitespaces are removed even where I want them
+
+
+;; TODO I can probably remove these, do not remember why they were added
(global-set-key (kbd "DEL") 'backward-delete-char)
(setq c-backspace-function 'backward-delete-char)
-(setq vc-follow-symlinks nil)
-(setq vc-handled-backends nil)
-(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode))
-(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode))
-(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist))
+;; Version control configurations
+(setq vc-follow-symlinks nil) ; Do not follow symlinks in version control
+(setq vc-handled-backends nil) ; Do not use version control features
+
+
+;; Addition rules for major mode selection
+(add-to-list 'auto-mode-alist '("/PKGBUILD$" . shell-script-mode)) ; arch linux build scripts
+(add-to-list 'auto-mode-alist '("/APKBUILD$" . shell-script-mode)) ; alpine linux build scripts
+(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist)) ; OpenCL source files
+
+
+
+;; Load configurations from installed for other packages
+((lambda ()
+ (dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$"))
+ (load-file file))))
diff --git a/ffmpeg/Makefile b/ffmpeg/Makefile
index 2c472b0..c9f54c0 100644
--- a/ffmpeg/Makefile
+++ b/ffmpeg/Makefile
@@ -8,13 +8,8 @@ install:
mkdir -p -- ~/.local/bin
ln -sf -- ~/.dotfiles/ffmpeg/resize-and-transcode ~/.local/bin/
ln -sf -- ~/.dotfiles/ffmpeg/resize-and-transcode-recursively ~/.local/bin/
- mkdir -p -- ~/.config/bash/aliases.d
- test ! -e ~/.config/bash/aliases.d/ffmpeg || test -L ~/.config/bash/aliases.d/ffmpeg
- ln -sf -- ~/.dotfiles/ffmpeg/bash-aliases ~/.config/bash/aliases.d/ffmpeg
uninstall:
+! ../check-installed ffmpeg
- -unlink -- ~/.config/bash/aliases.d/ffmpeg
- -rmdir -- ~/.config/bash/aliases.d
-unlink -- ~/.local/bin/resize-and-transcode
-unlink -- ~/.local/bin/resize-and-transcode-recursively
diff --git a/ffmpeg/bash-aliases b/ffmpeg/bash-aliases
deleted file mode 100644
index 41846c8..0000000
--- a/ffmpeg/bash-aliases
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- shell-script -*-
-
-remove-video-on-all () (
- for ext in opus aac mp3 m4a; do
- for f in *.{mkv,mp4,webm}; do
- if ffmpeg -i "$f" -map 0:a -codec copy -y -- "$f.$ext"; then
- rm -- "$f"
- else
- rm -- "$f.$ext"
- fi
- done
- done
-)
-
-remove-video-on-all-1 () (
- for ext in opus aac mp3 m4a; do
- for f in *."$1"; do
- if ffmpeg -i "$f" -map 0:a -codec copy -y -- "$f.$ext"; then
- rm -- "$f"
- else
- rm -- "$f.$ext"
- fi
- done
- done
-)
diff --git a/ffmpeg/resize-and-transcode b/ffmpeg/resize-and-transcode
index cecad85..c247b3e 100755
--- a/ffmpeg/resize-and-transcode
+++ b/ffmpeg/resize-and-transcode
@@ -100,7 +100,7 @@ if test -z "$scale" && test "$codec" = '-c:v copy'; then
fi
ttysetting="$(stty -g)"
-ffmpeg -i "$input" $scale $codec -c:a copy -- "$output"
+ffmpeg -i file:"$input" $scale $codec -c:a copy -- file:"$output"
ret=$?
stty "$ttysetting"
diff --git a/gdb/Makefile b/gdb/Makefile
new file mode 100644
index 0000000..874d896
--- /dev/null
+++ b/gdb/Makefile
@@ -0,0 +1,11 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.config/emacs
+ test -L ~/.config/emacs/init-gdb.el || test ! -e ~/.config/emacs/init-gdb.el
+ ln -sf -- ~/.dotfiles/gdb/init-gdb.el ~/.config/emacs/
+
+uninstall:
+ +! ../check-installed gdb
+ -unlink -- ~/.config/emacs/init-gdb.el
+ -rmdir -- ~/.config/emacs
diff --git a/emacs/init-gdb.el b/gdb/init-gdb.el
index 51b1a35..51b1a35 100644
--- a/emacs/init-gdb.el
+++ b/gdb/init-gdb.el
diff --git a/git/Makefile b/git/Makefile
index 1794675..cca3bd0 100644
--- a/git/Makefile
+++ b/git/Makefile
@@ -16,9 +16,12 @@ install:
test ! -d ~/.config/bash/aliases.d/git
ln -sf -- ~/.dotfiles/git/bash-aliases ~/.config/bash/aliases.d/git
../check-installed-shebang ge
+ ../check-installed-shebang git-cdiff
+ ../check-in-path diff
mkdir -p -- ~/.local/bin
ln -sf -- ~/.dotfiles/git/ge ~/.local/bin/
ln -sf -- ~/.dotfiles/git/new-c-proj ~/.local/bin/
+ ln -sf -- ~/.dotfiles/git/git-cdiff ~/.local/bin/
uninstall:
+! ../check-installed git
@@ -28,6 +31,7 @@ uninstall:
-rmdir -- ~/.config/bash/aliases.d
-unlink -- ~/.local/bin/ge
-unlink -- ~/.local/bin/new-c-proj
+ -unlink -- ~/.local/bin/git-cdiff
clean:
-rm -f -- .config
diff --git a/git/git-cdiff b/git/git-cdiff
new file mode 100755
index 0000000..15d91e9
--- /dev/null
+++ b/git/git-cdiff
@@ -0,0 +1,44 @@
+#!/bin/dash
+if test -z "${GIT_CDIFF_CONTEXT}"; then
+ git difftool -y -x "diff -c --color=always" "$@"
+elif printf '%s' "${GIT_CDIFF_CONTEXT}" | grep -q '^-'; then
+ git difftool -y -x "diff ${GIT_CDIFF_CONTEXT} --color=always" "$@"
+else
+ git difftool -y -x "diff -C${GIT_CDIFF_CONTEXT} --color=always" "$@"
+fi | {
+ # this part of the pipeline is optional, it just makes GNU diff colouring bit nicer
+ if test "$TERM" = linux; then
+ sed '/^\(\x1b\[[0-9;]*m\)* /s/\x1b\[[0-9;]*m//g'
+ else
+ sed '/^\(\x1b\[[0-9;]*m\)* /s/^/\x1b\[2m/g'
+ fi
+} | {
+ # this part of the pipeline is optional (and breaks diff format), it adds line number to the margin
+ if printf '%s' "${GIT_CDIFF_CONTEXT}" | grep -q '^-'; then
+ exec cat
+ fi
+ if test "$TERM" = linux; then
+ linecolour="35"
+ else
+ linecolour="2;35"
+ fi
+ lineno=x
+ while IFS= read -r line; do
+ if printf '%s\n' "$line" | sed 's/\x1b\[[0-9;]*m//g' | grep -q '^\(\*\*\* \|--- \)[0-9]*,[0-9]* \(\*\*\*\*\|----\)$'; then
+ lineno="$(printf '%s' "$line" | sed 's/\x1b\[[0-9;]*m//g' | sed 's/^\(\*\*\* \|--- \)\([0-9]*\),.*$/\2/')"
+ printf '%s\n' "$line"
+ elif test ! "$lineno" = x && printf '%s\n' "$line" | sed 's/\x1b\[[0-9;]*m//g' | grep -q '^\(!\|+\|-\| \) '; then
+ printf '\e[%sm%5i \e[m%s\n' "$linecolour" "$lineno" "$line"
+ lineno=$(( $lineno + 1 ))
+ else
+ lineno=x
+ printf '%s\n' "$line"
+ fi
+ done
+} | {
+ if test -t 1; then
+ less -FRX
+ else
+ cat
+ fi
+}
diff --git a/git/new-c-proj b/git/new-c-proj
index 7676e9f..503bdf9 100755
--- a/git/new-c-proj
+++ b/git/new-c-proj
@@ -19,7 +19,7 @@ git init .
cat > LICENSE <<EOF
ISC License
-© $(date +%Y) Mattias Andrée <maandree@kth.se>
+© $(date +%Y) Mattias Andrée <m@maandree.se>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -39,7 +39,9 @@ cat > .gitignore <<EOF
*~
*.o
*.a
+*.t
*.lo
+*.to
*.su
*.so
*.so.*
@@ -52,7 +54,9 @@ cat > .gitignore <<EOF
EOF
mkdir -p -- .git/info
-printf '%s\n' '_*' '.hidden' '.makeenv' >> .git/info/exclude
+printf '%s\n' '_*' '._*' '.hidden' '.makeenv' >> .git/info/exclude
+
+printf '%s\n' 'MAKEENV_OPTS_OPT_ATTACHED_ARG = j' 'CC = gcc-extreme -std=c99' >> .makeenv
if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then
UPPERCASE="$(printf '%s\n' "$1" | tr '[a-z-]' '[A-Z_]')"
diff --git a/java-runtime/user-profile b/java-runtime/user-profile
index 9b60457..f20b9a4 100644
--- a/java-runtime/user-profile
+++ b/java-runtime/user-profile
@@ -1,3 +1,3 @@
# -*- shell-script -*-
-export _JAVA_OPTIONS='-Djdk.gtk.version=2.2'
+export _JAVA_OPTIONS='-Djdk.gtk.version=2.2 -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
diff --git a/python@australis b/python@australis
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@australis
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@borealis b/python@borealis
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@borealis
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@east b/python@east
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@east
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@hades b/python@hades
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@hades
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@heaven b/python@heaven
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@heaven
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@hyperion b/python@hyperion
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@hyperion
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@miniaurora b/python@miniaurora
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@miniaurora
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@nadir b/python@nadir
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@nadir
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@north b/python@north
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@north
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@selene b/python@selene
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@selene
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@south b/python@south
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@south
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/python@west b/python@west
new file mode 120000
index 0000000..ffded53
--- /dev/null
+++ b/python@west
@@ -0,0 +1 @@
+python@zenith \ No newline at end of file
diff --git a/signal-desktop/mount-signal b/signal-desktop/mount-signal
index 6754d0f..c23b860 100755
--- a/signal-desktop/mount-signal
+++ b/signal-desktop/mount-signal
@@ -1,9 +1,13 @@
#!/bin/dash
if mountpoint -q -- "${HOME}/.var/opt/signal/SignalCrypt.d"; then
- printf '%s\n' 'mount-signal: already mounted' >&2
+ printf '%s\n' 'mount-signal: already mounted' >&2 || :
elif test -e /dev/mapper/SignalCrypt; then
- asroot env SIGNAL_DIR="${HOME}/.var/opt/signal" sh -ec \
+ asroot=asroot
+ if ! isfg; then
+ asroot=gasroot
+ fi
+ $asroot env SIGNAL_DIR="${HOME}/.var/opt/signal" sh -ec \
'mount -- /dev/mapper/SignalCrypt "${SIGNAL_DIR}/SignalCrypt.d"'
else
gpg --decrypt -- "${HOME}/.var/opt/signal/SignalCrypt.key" | \
diff --git a/signal-desktop/signal-desktop b/signal-desktop/signal-desktop
index 54f4b99..989c771 100755
--- a/signal-desktop/signal-desktop
+++ b/signal-desktop/signal-desktop
@@ -1,4 +1,7 @@
#!/bin/dash
set -e
mount-signal
+if ! isfg; then
+ exec >/dev/null 2>&1
+fi
exec /usr/bin/signal-desktop "$@"
diff --git a/signal-desktop/umount-signal b/signal-desktop/umount-signal
index 06a4eef..c342fbb 100755
--- a/signal-desktop/umount-signal
+++ b/signal-desktop/umount-signal
@@ -1,6 +1,11 @@
#!/bin/dash
-asroot env \
+asroot=asroot
+if ! isfg; then
+ asroot=gasroot
+fi
+
+$asroot env \
SIGNAL_DIR="${HOME}/.var/opt/signal" \
SIGNAL_DEV="$(losetup | sed 's/\s\+/ /g' | cut -d ' ' -f 1,6 | \
sed -n 's#\(/[^ ]*\) '"$(realpath -- "${HOME}/.var/opt/signal/SignalCrypt.img")"'$#\1#p' | sed 1q)" \
diff --git a/ssh/Makefile b/ssh/Makefile
index be4b0d5..4a3dba4 100644
--- a/ssh/Makefile
+++ b/ssh/Makefile
@@ -55,6 +55,9 @@ install:
mkdir -p -- ~/.config/bash/aliases.d
test ! -e ~/.config/bash/aliases.d/openssh || test -L ~/.config/bash/aliases.d/openssh
ln -sf -- ~/.dotfiles/openssh/bash-aliases ~/.config/bash/aliases.d/openssh
+ mkdir -p -- ~/.local/bin
+ test ! -e ~/.local/bin/ssh-archiso || test -L ~/.local/bin/ssh-archiso
+ ln -sf -- ~/.dotfiles/openssh/ssh-archiso ~/.local/bin/ssh-archiso
uninstall:
+! ../check-installed ssh
@@ -70,3 +73,4 @@ uninstall:
-rm -f -- .ssh-config
-unlink -- ~/.config/bash/aliases.d/openssh
-rmdir -- ~/.config/bash/aliases.d
+ -unlink -- ~/.local/bin/ssh-archiso
diff --git a/ssh/ssh-archiso b/ssh/ssh-archiso
new file mode 100755
index 0000000..f3b7fc7
--- /dev/null
+++ b/ssh/ssh-archiso
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+printf '\033[1m%s\033[m\n\n' 'The password is simply "arch"' >&2
+
+exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@archiso "$@"
diff --git a/sshexec/Makefile b/sshexec/Makefile
new file mode 100644
index 0000000..c2be226
--- /dev/null
+++ b/sshexec/Makefile
@@ -0,0 +1,10 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.local/bin
+ test ! -e ~/.local/bin/sshexec-archiso || test -L ~/.local/bin/sshexec-archiso
+ ln -sf -- ~/.dotfiles/sshexec/sshexec-archiso ~/.local/bin/sshexec-archiso
+
+uninstall:
+ +! ../check-installed sshexec
+ -unlink -- ~/.local/bin/sshexec-archiso
diff --git a/sshexec/sshexec-archiso b/sshexec/sshexec-archiso
new file mode 100755
index 0000000..303726c
--- /dev/null
+++ b/sshexec/sshexec-archiso
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+printf '\033[1m%s\033[m\n\n' 'The password is simply "arch"' >&2
+
+exec sshexec -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@archiso "$@"
diff --git a/wire-desktop/mount-wire b/wire-desktop/mount-wire
index a6dde57..60891f7 100755
--- a/wire-desktop/mount-wire
+++ b/wire-desktop/mount-wire
@@ -1,9 +1,13 @@
#!/bin/dash
if mountpoint -q -- "${HOME}/.var/opt/wire/WireCrypt.d"; then
- printf '%s\n' 'mount-wire: already mounted' >&2
+ printf '%s\n' 'mount-wire: already mounted' >&2 || :
elif test -e /dev/mapper/WireCrypt; then
- asroot env WIRE_DIR="${HOME}/.var/opt/wire" sh -ec \
+ asroot=asroot
+ if ! isfg; then
+ asroot=gasroot
+ fi
+ $asroot env WIRE_DIR="${HOME}/.var/opt/wire" sh -ec \
'mount -- /dev/mapper/WireCrypt "${WIRE_DIR}/WireCrypt.d"'
else
gpg --decrypt -- "${HOME}/.var/opt/wire/WireCrypt.key" | \
diff --git a/wire-desktop/umount-wire b/wire-desktop/umount-wire
index 796ea05..ce7f0c0 100755
--- a/wire-desktop/umount-wire
+++ b/wire-desktop/umount-wire
@@ -1,6 +1,11 @@
#!/bin/dash
-asroot env \
+asroot=asroot
+if ! isfg; then
+ asroot=gasroot
+fi
+
+$asroot env \
WIRE_DIR="${HOME}/.var/opt/wire" \
WIRE_DEV="$(losetup | sed 's/\s\+/ /g' | cut -d ' ' -f 1,6 | \
sed -n 's#\(/[^ ]*\) '"$(realpath -- "${HOME}/.var/opt/wire/WireCrypt.img")"'$#\1#p' | sed 1q)" \
diff --git a/xmonad/xinit b/xmonad/xinit
index 1b7bacb..27bbd7f 100644
--- a/xmonad/xinit
+++ b/xmonad/xinit
@@ -9,6 +9,9 @@ if test "${SESSION}" = xmonad; then
# Use GTK2 theming in Qt applications
export QT_QPA_PLATFORMTHEME=gtk2
+ # Use client-side decorations GTK3 and newer
+ export GTK_CSD=1
+
# Start GTK2 settings daemon
if test ! "${NO_MATE}" = y; then
if test -x /usr/lib/mate-settings-daemon/mate-settings-daemon; then
diff --git a/xorg-server/xkbdbind.config.h.gpp b/xorg-server/xkbdbind.config.h.gpp
index a832b4c..22839a0 100644
--- a/xorg-server/xkbdbind.config.h.gpp
+++ b/xorg-server/xkbdbind.config.h.gpp
@@ -16,6 +16,7 @@ static struct hotkey hotkeys[] = {
{XK_F10, MOD | S, 1, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 5%-")},
{XK_F11, MOD | S, 1, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 5%+")},
{XK_F12, MOD | S, 0, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 100%")},
+ {XK_a, MOD, 0, CMD("dalsause")},
{XK_u, MOD, 0, CMD("unicode")},
{XK_i, MOD, 0, CMD("ipa")},
{XK_p, MOD, 0, CMD("dmenu_run")},
diff --git a/xorg-xrandr/resolution-changed b/xorg-xrandr/resolution-changed
index e1457ce..4e8856f 100755
--- a/xorg-xrandr/resolution-changed
+++ b/xorg-xrandr/resolution-changed
@@ -1,15 +1,23 @@
#!/bin/dash
reset_wallpaper_twice=0
+hostname="$(hostname | tr 'A-Z' 'a-z')"
-if ! test "$(hostname | tr '[A-Z]' '[a-z]')" = zenith; then
+if ! test "${hostname}" = zenith; then ## TODO how about the other east,north,hades,hyperion?
# Reset rat size in case DPI change modified scaling
xsetroot -cursor_name left_ptr || :
# Reset rat speed in case DPI changed
if test "${DESKTOP_SESSION}" = xmonad && test ! "${NO_MATE}" = y; then
- msd=/usr/lib/mate-settings-daemon/mate-settings-daemon
- if ! test -x "$msd"; then
+ if test -x /usr/lib/mate-settings-daemon/mate-settings-daemon; then
+ msd=/usr/lib/mate-settings-daemon/mate-settings-daemon
+ elif test -x /usr/bin/mate-settings-daemon; then
+ msd=/usr/bin/mate-settings-daemon
+ elif test -x /usr/libexec/mate-settings-daemon; then
+ msd=/usr/libexec/mate-settings-daemon
+ elif test -x /usr/libexec/mate-settings-daemon/mate-settings-daemon; then
+ msd=/usr/libexec/mate-settings-daemon/mate-settings-daemon
+ else
msd=mate-settings-daemon
fi
(exec $msd --replace &) || :
diff --git a/xorg-xrandr/setres/__main__.py.gpp b/xorg-xrandr/setres/__main__.py.gpp
index 9c0f1eb..b25f9d6 100755
--- a/xorg-xrandr/setres/__main__.py.gpp
+++ b/xorg-xrandr/setres/__main__.py.gpp
@@ -51,10 +51,25 @@ if hostname == 'zenith':
sec_position = 'left'
elif hostname == 'hades':
- prime, sec = None, None
+ prime = None
+ sec = None
embed = screen['eDP1']
+
+ prime_alt = None
+ sec_alt = None
+
embed.want_mode = '1920x1280'
+elif hostname == 'north':
+ prime = None
+ sec = None
+ embed = screen['eDP1']
+
+ prime_alt = None
+ sec_alt = None
+
+ embed.want_mode = '1920x1080'
+
%%>hostname="$(hostname | tr '[A-Z]' '[a-z]')"
%%>file="${HOME}/.dotfiles/.private/setres/${hostname}"
%%>if test -r "${file}"; then
diff --git a/xpybar/config/Makefile b/xpybar/config/Makefile
index b5ce07a..13b97c8 100644
--- a/xpybar/config/Makefile
+++ b/xpybar/config/Makefile
@@ -2,10 +2,13 @@
all: xmonad-monitor
-xmonad-monitor: xmonad-monitor.gpp
+.gpp:
@touch -- $@
@chmod -- +w $@
gpp -s '%%' < $@.gpp > $@
@chmod -- a-w $@
+.SUFFIXES:
+.SUFFIXES: .gpp
+
.PHONY: all
diff --git a/xpybar/config/xmonad-monitor.gpp b/xpybar/config/xmonad-monitor.gpp
index df42701..92843bb 100644
--- a/xpybar/config/xmonad-monitor.gpp
+++ b/xpybar/config/xmonad-monitor.gpp
@@ -89,6 +89,8 @@ with open('/proc/cpuinfo', 'r') as f:
isvm = [line.replace('\n', ' ').replace('\t', ' ').split(':') for line in isvm if line]
isvm = any('hypervisor' in ':'.join(line[1:]).split(' ') for line in isvm if line[0].strip().startswith('flags'))
card1 = 'Ensoniq AudioPCI' if isvm else 'HDA Intel PCH'
+%%>elif test $hostname = hades; then
+card1 = 'HDA Intel PCH'
%%>else
card1 = 'HD-Audio Generic'
%%>fi
@@ -194,7 +196,7 @@ functions = [ [ myxmonad
#, myii
, None
, MyStat (lambda f : Clocked(f, 10))
-%%>if test ! "$hostname" = zenith; then
+%%>if test ! "$hostname" = zenith && test ! "$hostname" = north; then ## TODO how about east and hyperion?
, MyCGNegative()
%%>fi
, MyBrilliance(None)
diff --git a/xwallpaper/xinit b/xwallpaper/xinit
index 9080e46..7648dd2 100644
--- a/xwallpaper/xinit
+++ b/xwallpaper/xinit
@@ -1,5 +1,19 @@
# -*- shell-script -*-
+# Set default background
+target="$(readlink -- ~/.config/background)"
+if test "${target}" = backgrounds/default || test "${target}" = backgrounds/default-travel || test "${target}" = backgrounds/default-nontravel; then
+ if where="$(where)" 2>/dev/null; then
+ if test "${where}" = travelling && test -f ~/.config/backgrounds/default-travel; then
+ ln -sf -- backgrounds/default-travel ~/.config/background
+ elif test -f ~/.config/backgrounds/default-nontravel; then
+ ln -sf -- backgrounds/default-nontravel ~/.config/background
+ else
+ ln -sf -- backgrounds/default ~/.config/background
+ fi
+ fi
+fi
+
# Set background
if test -f ~/.config/background."${SESSION_}"; then
xwallpaper --zoom ~/.config/background."${SESSION_}"
diff --git a/yt-dlp/bash-aliases b/yt-dlp/bash-aliases
index a4724a4..2200bea 100644
--- a/yt-dlp/bash-aliases
+++ b/yt-dlp/bash-aliases
@@ -1,3 +1,3 @@
# -*- shell-script -*-
-alias yt-dlp='yt-dlp --compat-options filename-sanitization'
+alias yt-dlp='yt-dlp --compat-options filename-sanitization --cookies-from-browser brave'