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
" commands
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 'junegunn/vim-easy-align' " gaip*= - align in paragraph all equal signs
xmap ga <Plug>(EasyAlign)

View File

@ -46,10 +46,15 @@ unalias rd 2>/dev/null
# System help {{{1
alias h='help'
compdef help=man
alias info='info --vi-keys'
h() {
help "$@"
# TODO resolve aliases in 'h' alias
# TODO call 'wh' on scripts instead
}
xtrace() {
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 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'
scs() {
(

View File

@ -1,11 +1,12 @@
#!/bin/sh -e
# 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
(*origin*) echo set-url;;
(*"$remote"*) echo set-url;;
(*) echo add;;
esac) origin "$(git-repo "$@")"
esac) "$remote" "$(git-repo "$@")"
git remote -v && git fetch
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

View File

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

View File

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

View File

@ -2,10 +2,10 @@
# Update an Easy2Boot USB Stick after adding ISOs
# Call with Linux ISOs to be copied as args
# 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")"
test $# -eq 0 || mv -vi "$@" "$dir/_ISO/LINUX"
dir="$(find . "${MNT:-${XDG_RUNTIME_DIR}/mnt}" -maxdepth 3 -name _ISO -type d | grep .)"
test $# -eq 0 || mv -vi "$@" "$dir/LINUX"
find "$dir" -name "*32-*.iso" -exec mv -vi {} {}def32 \;
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 udefrag $drive

View File

@ -40,6 +40,7 @@ and configuration for ~less~ and ~fzf~.
- utilities :: youtube-dl dos2unix
- powertools :: hexedit hexyl [[https://lftp.yar.ru/][lftp]] glances zsh-doc pacman-contrib
- multitools :: ffmpeg imagemagick pandoc
- documents :: pdftk java-commons-lang
- music :: mpd mpc ncmpc vlc phonon-qt5-vlc mpdris2
: mkdir -p ~/.local/state/mpd && systemctl --user enable --now mpd mpDris2
#+begin_src sh YAY for AUR
@ -71,6 +72,7 @@ makepkg -si
- health :: stretchly-xeruf-git redshift acpilight light
: scu enable --now redshift
-> 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
- xorg :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle light
- wayland :: sway azote dex