bin: useful script shortcut additions

This commit is contained in:
xeruf 2023-04-27 14:28:04 +02:00
parent 02b22627ef
commit 5d7deb24d7
12 changed files with 45 additions and 15 deletions

View File

@ -2,6 +2,7 @@ test -n "$PS1" || return 0
test $(id -u) -eq 0 || sudo=sudo test $(id -u) -eq 0 || sudo=sudo
alias jc="$sudo journalctl --boot --unit"
alias sc="$sudo systemctl" alias sc="$sudo systemctl"
alias scs="$sudo systemctl status" alias scs="$sudo systemctl status"
alias sce="$sudo systemctl enable --now" alias sce="$sudo systemctl enable --now"

View File

@ -342,7 +342,8 @@ Version 2019-11-04 2021-02-16"
(setq org-priority-faces '((65 . error) (66 . "DarkGoldenRod") (67 . warning) (68 . "bisque") (69 . "grey"))) (setq org-priority-faces '((65 . error) (66 . "DarkGoldenRod") (67 . warning) (68 . "bisque") (69 . "grey")))
(push "PERM(e)" (cdr (car org-todo-keywords))) (push "PERM(e)" (cdr (car org-todo-keywords)))
; #+TODO: IDEA(i!) PROMPT(p!) OUTLINE(o!) DRAFT(t!) | DONE(d!) REVIEWED(r!) ABANDON(a!) ; #+TODO: IDEA(i!) PROMPT(p!) OUTLINE(o!) DRAFT(t!) | REVIEW(r!) DONE(d!) ABANDON(a!)
; highlight review keyword
;; Org startup - https://orgmode.org/manual/In_002dbuffer-Settings.html ;; Org startup - https://orgmode.org/manual/In_002dbuffer-Settings.html
(setq org-startup-folded 'show2levels (setq org-startup-folded 'show2levels
@ -770,6 +771,7 @@ Version 2019-11-04 2021-02-16"
:map Info-mode-map :map Info-mode-map
:desc "Go Home" :n "gu" 'Info-directory :desc "Go Home" :n "gu" 'Info-directory
:desc "Go Home" :n "gU" 'Info-directory :desc "Go Home" :n "gU" 'Info-directory
:desc "Search next" :n "," 'Info-search-next
:map thumbs-mode-map :map thumbs-mode-map
:n "q" 'thumbs-kill-buffer :n "q" 'thumbs-kill-buffer
) )
@ -991,6 +993,11 @@ Version 2019-11-04 2021-02-16"
(use-package! lilypond-mode (use-package! lilypond-mode
:mode ("\\.ly\\'" . LilyPond-mode) :mode ("\\.ly\\'" . LilyPond-mode)
:config :config
(map! :map rdictcc-buffer-mode-map
:leader
"hi" 'LilyPond-info)
(set-file-template! 'LilyPond-mode :mode 'LilyPond-mode) (set-file-template! 'LilyPond-mode :mode 'LilyPond-mode)
(setq LilyPond-pdf-command "xdg-open") (setq LilyPond-pdf-command "xdg-open")
(add-hook 'LilyPond-mode-hook 'turn-on-font-lock) (add-hook 'LilyPond-mode-hook 'turn-on-font-lock)

View File

@ -4,7 +4,6 @@ state_file "~/.local/state/mpd/state"
pid_file "~/.local/state/mpd/mpd.pid" pid_file "~/.local/state/mpd/mpd.pid"
db_file "~/.local/state/mpd/mpd.db" db_file "~/.local/state/mpd/mpd.db"
music_directory "{{ env.MUSIC }}" music_directory "{{ env.MUSIC }}"
playlist_directory "{{ env.MUSIC }}/Playlists" playlist_directory "{{ env.MUSIC }}/Playlists"
playlist_plugin { playlist_plugin {

View File

@ -18,6 +18,7 @@ let g:firenvim_config = {
\ }, \ },
\ \
\ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '://wiki\..*': { 'priority': 9, 'takeover': 'never', },
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', }, \ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'once', },
\ '.*openstreetmap\.de.*': { 'priority': 9, 'takeover': 'once', }, \ '.*openstreetmap\.de.*': { 'priority': 9, 'takeover': 'once', },
\ \

View File

@ -51,7 +51,7 @@ highlight "s :: recursively remove logs"
highlight "m :: recursively remove mac-files" highlight "m :: recursively remove mac-files"
if [[ $1 =~ "m" ]]; then if [[ $1 =~ "m" ]]; then
find \( -name '__MACOSX' -o -name '._.Trashes' \) -print -exec rm -r {} + find \( -name '__MACOSX' -o -name '._*' \) -print -exec rm -r {} +
find \( -iname '.spotlight*' -o -name 'System Volume Information' -o -name '.fseventsd' \) -print -exec rm -rI {} + find \( -iname '.spotlight*' -o -name 'System Volume Information' -o -name '.fseventsd' \) -print -exec rm -rI {} +
find -name '*.DS_Store' -delete find -name '*.DS_Store' -delete
echo 'Removed DS Stores' echo 'Removed DS Stores'

View File

@ -1,7 +1,9 @@
#!/bin/sh -e #!/bin/sh -e
# Flatten folder hierarchy # Flatten folder hierarchy
# Args: depth # Args: depth
find -mindepth 2 -maxdepth ${depth:-2} -depth -type d "$@" | while read folder; do depth=$(expr 1 \& $# \| 2)
case $1 in ([0-9]|[0-9][0-9]) depth=$1; shift;; esac
find "$@" -mindepth $depth -maxdepth $depth -depth -type d | while read folder; do
newname="$(echo "$folder" | sed 's|^./||;s|/|_|g')" newname="$(echo "$folder" | sed 's|^./||;s|/|_|g')"
mv -v "$folder" "$newname" mv -v "$folder" "$newname"
parent="$(dirname "$folder")" parent="$(dirname "$folder")"
@ -9,4 +11,4 @@ find -mindepth 2 -maxdepth ${depth:-2} -depth -type d "$@" | while read folder;
rm -d "$parent" && rm -d "$parent" &&
mv -v "$newname" "$parent" mv -v "$newname" "$parent"
done done
find -maxdepth ${depth:-2} -empty -type d -delete find -maxdepth $depth -empty -type d -delete

View File

@ -6,8 +6,8 @@
# optdepends: rewrite(part of my dotfiles, for unzip line rewriting) 7z p7zip unzip # optdepends: rewrite(part of my dotfiles, for unzip line rewriting) 7z p7zip unzip
# TODO auto-delete archive, auto-extract in current dir, trim .tar.gz fully # TODO auto-delete archive, auto-extract in current dir, trim .tar.gz fully
if test $# -eq 0 if test $# -eq 0
then ex *.zip then file -- * | grep -e '(*compress*\|*archive*)' | cut -d: -f1 | xargs ex
exit exit $?
fi fi
for arg do for arg do

6
.local/bin/scripts/iridion Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Upload website to iridion
# TODO: derive from id
site=$1
shift
scp -r "$@" "iridion:web/$site/public_html$(test "$#" -gt 1 || echo '/index.html')"

View File

@ -1,6 +1,8 @@
#!/bin/sh -ex #!/bin/sh -ex
# Execute in target directory or with that as parameter
target="${1:-$PWD}" target="${1:-$PWD}"
cd $DATA/5* archive=$(find $DATA/5* -maxdepth 2 -name Qobuz-commandes.tar)
cd $(dirname "$archive")
mkdir -p qobuz mkdir -p qobuz
cd qobuz cd qobuz
tar xf ../Qobuz-commandes.tar tar xf ../Qobuz-commandes.tar

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh -x
# TODO set brightness? light -S light -S .01
pkill electron pkill --echo electron
pkill --ignore-case discord pkill --echo --ignore-case discord
pkill signal pkill --echo signal
pkill aw-server pkill --echo aw-server
pkill aw-qt pkill --echo aw-qt
systemctl stop --user syncthing plasma-baloorunner kde-baloo openvpn-client@deltaPeak.service systemctl stop --user syncthing plasma-baloorunner kde-baloo openvpn-client@deltaPeak.service

11
.local/bin/scripts/swayscale Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
# Force Sway Scaling
shift=1
scale=1
case $1 in
("") shift=0;;
([0-9]*) scale=$1;;
(col) way-displays -s ARRANGE_ALIGN COLUMN MIDDLE; exit $?;;
esac
shift $shift
way-displays -s SCALE '' $scale "$@" || swaymsg output \* scale $scale

View File

@ -1,2 +1,3 @@
#!/bin/sh -e #!/bin/sh -e
test -f "$1" || cd "$XDG_DATA_HOME/openvpn"
tmux new-session -s "$@" "sudo openvpn $@" tmux new-session -s "$@" "sudo openvpn $@"