config: various tweaks and fixes

This commit is contained in:
xeruf 2022-07-06 08:59:22 +02:00
parent 31fcc64953
commit 3155792de7
7 changed files with 26 additions and 20 deletions

View File

@ -79,7 +79,7 @@ Version 2019-11-04 2021-02-16"
(defun dragon (&optional @file)
"Share file from current buffer via dragon."
(interactive)
(message (concat "dragon-drop -a -x " (or @file (buffer-file-name))))
(shell-command (concat "dragon-drop -a -x " (or @file (buffer-file-name))))
)
;; rebing C-u - https://emacs.stackexchange.com/a/58320
@ -450,7 +450,7 @@ Version 2019-11-04 2021-02-16"
(interactive)
(unless (equal major-mode 'org-journal-mode) (call-interactively 'org-journal-new-entry)))
(if (file-exists-p org-journal-dir) (xf/survey-mode))
;(if (file-exists-p org-journal-dir) (xf/survey-mode))
; TODO journal at start (call-interactively 'org-journal-new-entry)
)
@ -479,7 +479,7 @@ Version 2019-11-04 2021-02-16"
:unnarrowed t)
)
)
(cl-loop for item in '("health" "own" "list" "notes" "project" "entity:person" "tech:software:list" "faith" "inspiration")
(cl-loop for item in '("health" "own" "list" "notes" "project" "entity:person" "tech:software:list" "faith" "inspiration" "writing")
do (add-to-list 'org-roam-capture-templates
`(,(substring item 0 1) ,(car (split-string item ":")) plain "%?" :target
(file+head ,(concat (car (split-string item ":")) "/" org-roam-extract-new-file-path) ,(concat xf/org-roam-capture-props "#+filetags: :" item ":" xf/org-roam-capture-title))

View File

@ -185,11 +185,12 @@ alias jcj='jce -o json-pretty --unit' # JSON View
# Shorthands
alias v='edit'
alias st='synct'
alias ex='dtrx'
alias expr='noglob expr'
alias get='noglob ='
alias kc='kdeconnect-cli --refresh && kdeconnect-cli --list-devices'
# Shortcuts
alias kc='kdeconnect-cli --refresh && kdeconnect-cli --list-devices'
alias logoff="loginctl terminate-user $USER"
alias calb='rlwrap -a bc -l'
alias dt='python -c "import time;print(time.asctime(time.localtime()))"'
@ -216,10 +217,11 @@ u() {
sudo pacman -Syy
if which topgrade >/dev/null
then
topgrade &&
topgrade --only emacs --yes
# TODO autodetect failure in emacs and rebuild completely
else yadm l && sudo apt update && sudo apt upgrade
topgrade
builtin cd $XDG_CONFIG_HOME/emacs && git pull --rebase && doom sync -u
# TODO autodetect failure in emacs and rebuild it completely
else yadm l
sudo apt update && sudo apt upgrade
fi
}
@ -250,13 +252,12 @@ sshl() {
}
alias delta="sudo systemctl restart openvpn-client@deltaPeak.service || jcl --unit openvpn-client@deltaPeak.service"
# Hardcoded Programs
alias startMinecraftServer='curl https://ipinfo.io/ip | xclip -sel clip && cd ~/daten/games/sharedgames/minecraft/server && java -jar forge-1.12.2-14.23.5.2768-universal.jar -mx 8G'
alias scenic='/usr/lib/jvm/java-11-openjdk/bin/java --module-path /usr/lib/jvm/java-11-openjfx/lib --add-modules javafx.web,javafx.fxml,javafx.swing -jar scenicview.jar'
# Listen to loopback of mic
alias listen='pactl load-module module-loopback; echo "Press Enter to stop"; read; pactl unload-module module-loopback'
alias startMinecraftServer='curl https://ipinfo.io/ip | xclip -sel clip && cd ~/daten/games/sharedgames/minecraft/server && java -jar forge-1.12.2-14.23.5.2768-universal.jar -mx 8G'
alias sqli='rlwrap sqlite3 -column -header -cmd .tables'
alias usergroups="cat /etc/passwd | cut -d':' -f1 | xargs -n 1 id"

View File

@ -2,7 +2,7 @@
#assume_yes = true
# Disable specific steps - same options as the command line flag
disable = ["node", "nix", "emacs", "config_update"]
disable = ["node", "nix", "config_update", "containers"]
# Ignore failures for these steps
#ignore_failures = ["powershell"]

View File

@ -98,10 +98,10 @@ for arg; do
case "$(file --dereference "$arg")" in
(*\ ?udio*)
# TODO preconvert aac - |*\ ADTS\ *
img="$tmpfile.png"
case $TERM in (*-kitty) kitty=true; audioheight=2;; (*) audioheight=5;; esac
if which audiowaveform 2>/dev/null >&2
then find "$img" -not -empty 2>/dev/null | grep --quiet . ||
if ! $inspect && which audiowaveform 2>/dev/null >&2; then
img="$tmpfile.png"
case $TERM in (*-kitty) kitty=true; audioheight=2;; (*) audioheight=5;; esac
find "$img" -not -empty 2>/dev/null | grep --quiet . ||
audiowaveform --quiet --pixels-per-second 2 --height 36 --width 2000 --amplitude-scale auto \
--background-color 000000 --waveform-color 99BBFF --axis-label-color 000000 \
--input-filename "$arg" --output-format png >"$img" && {
@ -187,6 +187,7 @@ if test "$ls" -o $# -le $(echo "$flags" | wc -w); then
checkperm .
# Alternative: find -exec ls -dl {} +
{
# TODO handle single quotes in filenames
timeout .6s sh -c "
if test '$tree'
then $elevate tree -a --dirsfirst --du -h -C -L 3 $flags $(printf "'%s' " "${ls[@]:-.}")

View File

@ -1,5 +1,6 @@
#!/bin/sh
#!/bin/sh -e
# Stage moved files fitting the already staged ones
set -o pipefail
git diff --name-only --cached >/tmp/staged
root=$(git rev-parse --show-toplevel)
git add "$root"

View File

@ -16,7 +16,8 @@ case "$cmd" in
# TODO view fossil ui in terminal
shift
"$cmd" help "$@" | $paginate;;
(rails) { rails -H && rails --help; } | $paginate;;
(doom) "$@" --help;;
(rails) { "$@" -H && "$@" --help; } | $paginate;;
(plantuml) unbuffer "$@" -help | $paginate;;
(vlc) shift && unbuffer vlc --full-help "$@" | $paginate;;
(kdeconnect*) shift && kdeconnect-cli --help-all "$@" | $paginate;;

View File

@ -7,14 +7,16 @@ test "$1" = '-v' && verbose='true' && shift || verbose='false'
case $command in
(update)
for pl; do
highlight $pl
cat $pl | rev | cut -d'/' -f-2 | rev | while read f; do
highlight $pl >&2
bak="/tmp/$pl"
cat $pl | tee "$bak" | rev | cut -d'/' -f-2 | rev | while read f; do
$verbose && printf "\e[31;1mSearching for '$f'\e[0m\n" >&2
test -n "$f" || continue
newpath="$(find $MUSIC -path "*${f#*../}" -prune | grep . || find $MUSIC -path "*${f##* - }" -o -path "*${f##*/}" | grep -m 1 .)"
$verbose && printf "\e[31;1mFound '$newpath'\e[0m\n" >&2
test -n "$newpath" && realpath --relative-to $(dirname "$pl") "$newpath" || echo "$f"
done | tee $pl
echo "Backup of $pl saved to $bak" >&2
done;;
(edit) ${EDITOR:-nano} $(find $MUSIC/Playlists -iname "$1\.*" | grep . || find $MUSIC/Playlists -iname "$1*");;
(make)