Compare commits

..

3 commits

Author SHA1 Message Date
xeruf
3ecc4f89ad config/doom: better slugs and wayland clipboard 2023-03-13 15:35:25 +01:00
xeruf
2dbc06047f bin: update git scripts 2023-03-13 15:35:25 +01:00
xeruf
cecb4cef0f config/nvim: clean up firenvim 2023-03-13 15:35:25 +01:00
7 changed files with 124 additions and 78 deletions

View file

@ -87,6 +87,7 @@ Version 2019-11-04 2021-02-16"
(with-eval-after-load 'outline
(add-hook 'ediff-prepare-buffer-hook 'outline-show-all))
(map! :n
;; Buffer-local font resizing
"M-C-+" 'text-scale-increase
@ -172,9 +173,35 @@ Version 2019-11-04 2021-02-16"
(setq buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8))
;; Treat clipboard input as UTF-8 string first; compound text next, etc.
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(add-hook 'window-setup-hook #'xclip-mode)
;;; Clipboard
;; Checks if the session type is in fact for Wayland.
(if (string= (getenv "XDG_SESSION_TYPE") "wayland")
(progn
;; Clipboard from Terminal in Wayland: https://vernon-grant.com/emacs/tmux-emacs-and-the-system-clipboard-on-wayland/
(setq wl-copy-process nil)
(defun wl-copy (text)
(setq wl-copy-process (make-process :name "wl-copy"
:buffer nil
:command '("wl-copy" "-f" "-n")
:connection-type 'pipe
:noquery t))
(process-send-string wl-copy-process text)
(process-send-eof wl-copy-process))
(defun wl-paste ()
(if (and wl-copy-process (process-live-p wl-copy-process))
nil ; should return nil if we're the current paste owner
(shell-command-to-string "wl-paste -n | tr -d \r")))
(setq interprogram-cut-function 'wl-copy)
(setq interprogram-paste-function 'wl-paste)
)
;; Treat clipboard input as UTF-8 string first; compound text next, etc.
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(add-hook 'window-setup-hook #'xclip-mode)
)
;;; Data Preservation
@ -222,7 +249,7 @@ Version 2019-11-04 2021-02-16"
time-stamp-format (concat "[" time-stamp-bare "]"))
;; Automatically add modified stamp - https://github.com/org-roam/org-roam/issues/1935#issuecomment-968047007
(use-package! time-stamp
:init (setq time-stamp-start "modified:[ ]+\\\\?"
:init (setq time-stamp-start "modified:[ ]+\\\\?"
time-stamp-end "$")
:hook before-save)
@ -262,7 +289,9 @@ Version 2019-11-04 2021-02-16"
:config
(defun xf/slugify (string) (downcase (s-replace-regexp "[^[:alnum:][:digit:]]\+" "-" string)))
(defun xf/slugify (string)
(downcase (s-replace-regexp "[^[:alnum:][:digit:]]\+" "-"
(s-replace-regexp ".*://\\([^.]+\\)\\..*" "\\1" (substring-no-properties (org-sort-remove-invisible string))))))
; the value does not matter, see https://emacs.stackexchange.com/questions/71774/pass-default-value-to-org-set-property/71777#71777
;(add-to-list 'org-global-properties-fixed '("ID_ALL" . "id"))
@ -313,6 +342,7 @@ Version 2019-11-04 2021-02-16"
(setq org-priority-faces '((65 . error) (66 . "DarkGoldenRod") (67 . warning) (68 . "bisque") (69 . "grey")))
(push "PERM(e)" (cdr (car org-todo-keywords)))
; #+TODO: IDEA(i!) PROMPT(p!) OUTLINE(o!) DRAFT(t!) | DONE(d!) REVIEWED(r!) ABANDON(a!)
;; Org startup - https://orgmode.org/manual/In_002dbuffer-Settings.html
(setq org-startup-folded 'show2levels
@ -527,7 +557,7 @@ Version 2019-11-04 2021-02-16"
)
(defvar xf/auto-org-roam-db-sync--timer nil)
(defvar xf/auto-org-roam-db-sync--timer-interval 10)
(defvar xf/auto-org-roam-db-sync--timer-interval 40)
(define-minor-mode xf/auto-org-roam-db-sync-mode
"Toggle automatic `org-roam-db-sync' when Emacs is idle.
Reference: `auto-save-visited-mode'"
@ -884,16 +914,19 @@ Version 2019-11-04 2021-02-16"
(add-to-list 'auto-mode-alist '("/journal/" . org-mode))
(add-to-list 'auto-mode-alist '("\\.jrnl\\'" . org-mode))
(add-to-list 'auto-mode-alist '("\\.el##" . emacs-lisp-mode))
(add-to-list 'auto-mode-alist `(,(getenv "CONFIG_SHELLS") . sh-mode))
(add-to-list 'auto-mode-alist `(,(getenv "CONFIG_ZSH") . sh-mode))
(add-to-list 'auto-mode-alist `("\\.local/bin" . sh-mode))
;(add-to-list 'auto-mode-alist '("\\.el##" . emacs-lisp-mode))
;(add-to-list 'auto-mode-alist `(,(getenv "CONFIG_SHELLS") . sh-mode))
;(add-to-list 'auto-mode-alist `(,(getenv "CONFIG_ZSH") . sh-mode))
;(add-to-list 'auto-mode-alist `("\\.local/bin" . sh-mode))
(add-to-list 'auto-mode-alist '("\\.twee\\'" . twee-chapbook-mode))
(add-hook 'twee-chapbook-mode-hook 'twee-mode)
;(add-to-list 'auto-mode-alist '("\\.twee\\'" . twee-chapbook-mode))
;(add-hook 'twee-chapbook-mode-hook 'twee-mode)
;
;;(add-to-list 'auto-mode-alist `("\\.scss.erb\\'" . scss-mode))
;(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
(add-hook 'pdf-view-mode-hook 'auto-revert-mode)
;(add-to-list 'auto-mode-alist `("\\.scss.erb\\'" . scss-mode))
(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
(use-package! web-mode
:mode "\\.html\\'"
:mode "\\.phtml\\'"
@ -942,11 +975,12 @@ Version 2019-11-04 2021-02-16"
:init (add-to-list 'vc-handled-backends 'Fossil))
(use-package! chordpro-mode
:mode "\\.cho"
:mode ("\\.cho\\'" . chordpro-mode)
:config
(set-file-template! 'chordpro-mode :mode 'chordpro-mode) ; TODO broken
(define-key chordpro-mode-map (kbd "C-c C-c") 'chordpro-insert-chord)
)
(use-package! lilypond-mode
:mode ("\\.ly\\'" . LilyPond-mode)
:config

View file

@ -0,0 +1,61 @@
" textarea.inputbox is for phpBB
let g:firenvim_config = {
\ 'globalSettings': {
\ 'alt': 'all',
\ },
\ 'localSettings': {
\ '.*': {
\ 'cmdline': 'firenvim',
\ 'priority': 0,
\ 'selector': 'textarea:not([readonly]):not([class="handsontableInput"]):not([wrap="off"]):not([rows="1"]):not([title="Replace"]):not([title="Search"]):not([name="message"]),
\ div[role="textbox"]:not([aria-label="Search"]), div[class="CodeMirror"]',
\ 'takeover': 'always',
\ },
\ '.*com.*': {
\ 'priority': 1,
\ 'selector': 'textarea.inputbox',
\ 'takeover': 'once',
\ },
\
\ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', },
\ '.*openstreetmap\.de.*': { 'priority': 9, 'takeover': 'once', },
\
\ '.*church\.tools.*': { 'priority': 9, 'takeover': 'empty', },
\ '.*element\.io.*': { 'priority': 9, 'takeover': 'never', },
\
\ '.*discord\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '://chat\..*': { 'priority': 9, 'takeover': 'never', },
\ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', },
\
\ '://pve.*': { 'priority': 9, 'takeover': 'never', },
\ '.*:8006/.*': { 'priority': 9, 'takeover': 'never', },
\
\ '.*calendar\.google\.com.*': { 'priority': 9, 'takeover': 'empty', },
\ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*contacts\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*notion\.so.*': { 'priority': 9, 'takeover': 'never', },
\ '.*cloud\.atomtoast\.xyz.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://aur.archlinux.org/account.*': { 'priority': 9, 'takeover': 'never', },
\
\ '.*stackexchange\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*stackoverflow\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*com/questions/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
\ '.*com/posts/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
\ }
\ }
if exists('g:started_by_firenvim')
nnoremap <Esc><Esc> :call firenvim#focus_page()<CR>
autocmd FocusLost,InsertLeave,BufLeave * ++nested call WriteSilent()
function WriteSilent()
let was_enabled=b:strip_whitespace_on_save
DisableStripWhitespaceOnSave
write
if was_enabled
EnableStripWhitespaceOnSave
endif
endfunction
endif

View file

@ -24,61 +24,4 @@ xmap <silent> ib <Plug>CamelCaseMotion_ib
omap <silent> ie <Plug>CamelCaseMotion_ie
xmap <silent> ie <Plug>CamelCaseMotion_ie
" FIRENVIM {{{1
" textarea.inputbox is for phpBB
let g:firenvim_config = {
\ 'globalSettings': {
\ 'alt': 'all',
\ },
\ 'localSettings': {
\ '.*': {
\ 'cmdline': 'firenvim',
\ 'priority': 0,
\ 'selector': 'textarea:not([readonly]):not([class="handsontableInput"]):not([wrap="off"]):not([rows="1"]):not([title="Replace"]):not([title="Search"]):not([name="message"]),
\ div[role="textbox"]:not([aria-label="Search"]), div[class="CodeMirror"]',
\ 'takeover': 'always',
\ },
\ '.*com.*': {
\ 'priority': 1,
\ 'selector': 'textarea.inputbox',
\ 'takeover': 'once',
\ },
\ '.*church\.tools.*': { 'priority': 9, 'takeover': 'empty', },
\ '.*element\.io.*': { 'priority': 9, 'takeover': 'never', },
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', },
\ '.*openstreetmap\.de.*': { 'priority': 9, 'takeover': 'once', },
\
\ '.*discord\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '://pve.*': { 'priority': 9, 'takeover': 'never', },
\
\ '.*calendar\.google\.com.*': { 'priority': 9, 'takeover': 'empty', },
\ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*contacts\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*notion\.so.*': { 'priority': 9, 'takeover': 'never', },
\ '.*cloud\.atomtoast\.xyz.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://aur.archlinux.org/account.*': { 'priority': 9, 'takeover': 'never', },
\
\ '.*stackexchange\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*stackoverflow\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*com/questions/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
\ '.*com/posts/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
\ }
\ }
if exists('g:started_by_firenvim')
nnoremap <Esc><Esc> :call firenvim#focus_page()<CR>
autocmd FocusLost,InsertLeave,BufLeave * ++nested call WriteSilent()
function WriteSilent()
let was_enabled=b:strip_whitespace_on_save
DisableStripWhitespaceOnSave
write
if was_enabled
EnableStripWhitespaceOnSave
endif
endfunction
endif
source $INITDIR/init/firenvim.vim

View file

@ -20,17 +20,23 @@ case "$command" in
test -f .gitignore || echo '*' > .gitignore
exec $SHELL;;
(create)
if ! test -d .git; then "$0" clone "$@"; exit; fi
git add -f .gitignore PKGBUILD
git commit -m "Create Package" "$@"
git aur push --amend;;
"$0" push --amend;;
(commit)
makepkg --printsrcinfo > .SRCINFO
git add -f .SRCINFO
git commit -v "$@";;
(update)
git pull
updpkgsums
makepkg -si
"$0" push;;
(push)
grep -q SKIP PKGBUILD || updpkgsums
git add -f *.install 2>/dev/null || true
git aur commit -a "$@"
"$0" commit -a "$@"
git push;;
(clean)
find "$aurdir" -mindepth 2 -maxdepth 2 \( -iname "*.pkg.tar.*" -o -iname "*.zip" -o -name "*.tar.gz" -o -type d -not -name ".*" \) \

View file

@ -18,8 +18,8 @@ case $1 in
(socha) user=software-challenge; host=git@github.com;;
(hub) host=git@github.com;;
(lab) host=git@gitlab.com;;
(ftt) host=git@code.ftt.gmbh; user=janek;;
(*) host=${1:-gitea@git.jfischer.org};;
(jf) host=${1:-gitea@git.jfischer.org};;
(*|ftt) host=git@code.ftt.gmbh; user=janek;;
esac
user=${3:-${user:-$(git config user.name)}}
repo=${2:-$(basename $PWD)}

View file

@ -15,7 +15,7 @@ do
fi
# $elevate find -H "$f" -maxdepth $(expr 1 \& "$f" = "/" \| 5 \& $# \> 0 \| 4) -type d -empty -name .stfolder -exec rm -div {} \;
$elevate find -H "$f" -maxdepth $(expr 1 \& "$f" = "/" \| 5 \& $# \> 0 \| 3) -not \( -name '.stfolder' -o -name '.*keep' \) \( -type d -o -type f \) -a -empty -printf 'Removing empty %p\n' -delete
$elevate find -H "$f" -maxdepth $(expr 1 \& "$f" = "/" \| 5 \& $# \> 0 \| 3) -not \( -name '.stfolder' -o -name '.*keep' -o -name "*.py" \) \( -type d -o -type f \) -a -empty -printf 'Removing empty %p\n' -delete
test $# -eq 0 && exit $?
if test -e "$f"; then
echo -n "$f ($(ls -A "$f" | head -3 | paste -s -d' ')) " >&2 &&

2
.local/bin/scripts/yt-audio Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
yt-dlp --extract-audio "$@"