config: a few script updates

This commit is contained in:
xeruf 2022-03-25 09:14:30 +01:00
parent 6b37693904
commit b711a5f921
7 changed files with 21 additions and 10 deletions

View File

@ -18,6 +18,7 @@ Plug 'tpope/vim-surround' " edit surroundings - cs, ds, ys
Plug 'bkad/CamelCaseMotion' " move through camel case words Plug 'bkad/CamelCaseMotion' " move through camel case words
" commands " commands
Plug 'inkarkat/vim-ReplaceWithRegister' " gr to replace with register Plug 'inkarkat/vim-ReplaceWithRegister' " gr to replace with register
Plug 'Konfekt/vim-sentence-chopper' " gw for sembr
Plug 'tpope/vim-commentary' " gc to comment out (gcap for paragraph) Plug 'tpope/vim-commentary' " gc to comment out (gcap for paragraph)
Plug 'junegunn/vim-easy-align' " gaip*= - align in paragraph all equal signs Plug 'junegunn/vim-easy-align' " gaip*= - align in paragraph all equal signs
xmap ga <Plug>(EasyAlign) xmap ga <Plug>(EasyAlign)

View File

@ -46,10 +46,15 @@ unalias rd 2>/dev/null
# System help {{{1 # System help {{{1
alias h='help'
compdef help=man compdef help=man
alias info='info --vi-keys' alias info='info --vi-keys'
h() {
help "$@"
# TODO resolve aliases in 'h' alias
# TODO call 'wh' on scripts instead
}
xtrace() { xtrace() {
set -x set -x
"$@" "$@"
@ -131,7 +136,7 @@ alias twtest='( cp -r "$TIMEWARRIORDB" /tmp/tw-bak && TIMEWARRIORDB=/tmp/timewar
alias syslog='less +F /var/log/syslog' alias syslog='less +F /var/log/syslog'
alias sc='sudo systemctl' alias sc='sudo systemctl'
alias sce='sudo systemctl enable --now' alias sce='sudo systemctl enable --now' # TODO or show log
alias scd='sudo systemctl disable --now' alias scd='sudo systemctl disable --now'
scs() { scs() {
( (

View File

@ -1,11 +1,12 @@
#!/bin/sh -e #!/bin/sh -e
# set repo as origin and set all branches upstream to a corresponding remote branch, if available # set repo as origin and set all branches upstream to a corresponding remote branch, if available
remote="${4:-origin}"
git remote $(case "$(git remote)" in git remote $(case "$(git remote)" in
(*origin*) echo set-url;; (*"$remote"*) echo set-url;;
(*) echo add;; (*) echo add;;
esac) origin "$(git-repo "$@")" esac) "$remote" "$(git-repo "$@")"
git remote -v && git fetch git remote -v && git fetch
git branch --format='%(refname:short)' | while read branch git branch --format='%(refname:short)' | while read branch
do test $(git branch -a | grep origin/$branch | wc -l) -gt 0 && git branch -u origin/$branch $branch do test $(git branch -a | grep $remote/$branch | wc -l) -gt 0 && git branch -u $remote/$branch $branch
done done

View File

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
# set given repository as upstream or add as a new remote # set given repository as upstream or add as a new remote
# ARGS:
# - user/org
# - repo
# - remote name
if test "$3" if test "$3"
then then
name="$3" name="$3"

View File

@ -4,8 +4,6 @@
# optdepends: highlight(dotfiles) # optdepends: highlight(dotfiles)
paginate="${PAGER:-less} +Gg" paginate="${PAGER:-less} +Gg"
test "$1" = "-d" && browse=1 && shift test "$1" = "-d" && browse=1 && shift
# TODO resolve aliases in 'h' alias
# TODO call 'wh' on scripts instead
case $1 in case $1 in
(zsh|zmv) # https://unix.stackexchange.com/questions/19290/zmv-for-zsh-dry-runs-and-man-pages (zsh|zmv) # https://unix.stackexchange.com/questions/19290/zmv-for-zsh-dry-runs-and-man-pages
for last; do true; done for last; do true; done

View File

@ -2,10 +2,10 @@
# Update an Easy2Boot USB Stick after adding ISOs # Update an Easy2Boot USB Stick after adding ISOs
# Call with Linux ISOs to be copied as args # Call with Linux ISOs to be copied as args
# Need to be around E2B mountpoint if it is not the default # Need to be around E2B mountpoint if it is not the default
dir="$(find -maxdepth 2 -name E2B -type d | grep . || echo "${MNT:-${XDG_RUNTIME_DIR}/mnt}/E2B")" dir="$(find . "${MNT:-${XDG_RUNTIME_DIR}/mnt}" -maxdepth 3 -name _ISO -type d | grep .)"
test $# -eq 0 || mv -vi "$@" "$dir/_ISO/LINUX" test $# -eq 0 || mv -vi "$@" "$dir/LINUX"
find "$dir" -name "*32-*.iso" -exec mv -vi {} {}def32 \; find "$dir" -name "*32-*.iso" -exec mv -vi {} {}def32 \;
find "$dir" -name "*.iso" -exec mv -vi {} {}def64 \; find "$dir" -name "*.iso" -exec mv -vi {} {}def64 \;
drive=$(mount | grep "$dir" | cut -d' ' -f1) drive=$(mount | grep "$(basename "$dir")" | cut -d' ' -f1)
sudo umount $drive sudo umount $drive
sudo udefrag $drive sudo udefrag $drive

View File

@ -40,6 +40,7 @@ and configuration for ~less~ and ~fzf~.
- utilities :: youtube-dl dos2unix - utilities :: youtube-dl dos2unix
- powertools :: hexedit hexyl [[https://lftp.yar.ru/][lftp]] glances zsh-doc pacman-contrib - powertools :: hexedit hexyl [[https://lftp.yar.ru/][lftp]] glances zsh-doc pacman-contrib
- multitools :: ffmpeg imagemagick pandoc - multitools :: ffmpeg imagemagick pandoc
- documents :: pdftk java-commons-lang
- music :: mpd mpc ncmpc vlc phonon-qt5-vlc mpdris2 - music :: mpd mpc ncmpc vlc phonon-qt5-vlc mpdris2
: mkdir -p ~/.local/state/mpd && systemctl --user enable --now mpd mpDris2 : mkdir -p ~/.local/state/mpd && systemctl --user enable --now mpd mpDris2
#+begin_src sh YAY for AUR #+begin_src sh YAY for AUR
@ -71,6 +72,7 @@ makepkg -si
- health :: stretchly-xeruf-git redshift acpilight light - health :: stretchly-xeruf-git redshift acpilight light
: scu enable --now redshift : scu enable --now redshift
-> https://www.reddit.com/r/linuxquestions/comments/pm1bxn/setting_brightness_on_amd_ryzen_7_5800h_with -> https://www.reddit.com/r/linuxquestions/comments/pm1bxn/setting_brightness_on_amd_ryzen_7_5800h_with
- games :: opendungeons 0ad mindustry-bin minetest sauerbraten teeworlds
*** Desktop *** Desktop
- xorg :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle light - xorg :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle light
- wayland :: sway azote dex - wayland :: sway azote dex