Compare commits
3 commits
312886ba84
...
f8fa6fb67e
Author | SHA1 | Date | |
---|---|---|---|
|
f8fa6fb67e | ||
|
7d2e650a04 | ||
|
409c37fc97 |
9 changed files with 47 additions and 43 deletions
|
@ -31,6 +31,9 @@ fi
|
|||
xdh="$XDG_DATA_HOME"
|
||||
xch="$XDG_CONFIG_HOME"
|
||||
xsh="$XDG_STATE_HOME"
|
||||
alias xdh="cd $XDG_DATA_HOME"
|
||||
alias xch="cd $XDG_CONFIG_HOME"
|
||||
alias xsh="cd $XDG_STATE_HOME"
|
||||
if test -d "$DATA"; then
|
||||
da=$(builtin cd $DATA/_* && pwd)
|
||||
d1=$(builtin cd $DATA/1* && pwd)
|
||||
|
@ -201,9 +204,8 @@ alias scud='systemctl --user disable --now'
|
|||
# Reload or restart matching systemctl service
|
||||
unalias scr 2>/dev/null
|
||||
scr() {
|
||||
systemctl --user daemon-reload
|
||||
echo -n "User: " && systemctl --user reload-or-restart "$@" ||
|
||||
{ echo -n "System: " && sudo systemctl reload-or-restart "$@"; } &&
|
||||
echo -n "User: " && systemctl --user daemon-reload && systemctl --user reload-or-restart "$@" ||
|
||||
{ echo -n "System: " && sudo systemctl daemon-reload && sudo systemctl reload-or-restart "$@"; } &&
|
||||
echo "Successful reload" ||
|
||||
scs "$@"
|
||||
}
|
||||
|
@ -323,7 +325,7 @@ sshl() {
|
|||
ssh -G "$1" | grep --silent "^user root$" &&
|
||||
! [[ "$1" =~ "pve.*" ]] &&
|
||||
! [[ "$1" =~ "encee.*" ]] &&
|
||||
! [[ "$1" =~ ".*fmh.de" ]] &&
|
||||
! [[ "$1" =~ ".*fmh.*" ]] &&
|
||||
! [[ "$1" =~ "delta*" ]] &&
|
||||
local pass=pass
|
||||
test "$all" &&
|
||||
|
@ -568,27 +570,34 @@ compdef mkcd=mkdir
|
|||
|
||||
# Other stuff {{{1
|
||||
|
||||
# This is a function rather than a script as it potentially needs to cd out of the directory
|
||||
alias unmount=umoul
|
||||
# This is a function rather than a script as it potentially needs to cd out
|
||||
# if the current directory is the one to unmount
|
||||
umoul() {
|
||||
local arg
|
||||
local mnt="${MNT:-${XDG_RUNTIME_DIR}/mnt}"
|
||||
# get the last arg
|
||||
for arg; do true; done
|
||||
if test "$arg"
|
||||
then mountpoints="$(test -d "$arg" && realpath "$arg" || echo "${MNT:-${XDG_RUNTIME_DIR}/mnt}/$arg")"
|
||||
mountpoint "$mountpoints" 2>/dev/null || test -b "$mountpoints" ||
|
||||
mountpoints="$(mount --show-labels | grep "$arg" | cut -d' ' -f3)"
|
||||
test "$mountpoints" || return 1
|
||||
else mountpoints="$PWD"
|
||||
case "$arg" in
|
||||
(-a|--all)
|
||||
mountpoints=$(mount | grep "$mnt" | cut -d' ' -f3)
|
||||
("")
|
||||
mountpoints="$(pwd | grep -v /home || echo /)"
|
||||
while test "$mountpoints" != "/"; do
|
||||
mountpoint "$mountpoints" >/dev/null && break
|
||||
mountpoints="$(dirname "$mountpoints")"
|
||||
done
|
||||
test "$(dirname "$mountpoints")" != "/" ||
|
||||
mountpoints="$(mount |
|
||||
grep --invert-match -e " /[^m][^/]*\(/[^/]*\)\? " -e "/sys" -e "/run/user" -e "/run/docker" |
|
||||
fzf --select-1 --exit-0 | awk '{print $3}')" ||
|
||||
grep --invert-match -e " /[^m][^/]*\(/[^/]*\)\? " -e "/sys" -e "/run/user" -e "/run/docker" -e "/home" |
|
||||
fzf --exit-0 | awk '{print $3}')" ||
|
||||
return $?
|
||||
fi
|
||||
(*)
|
||||
mountpoints="$(test -d "$arg" && realpath "$arg" || echo "$mnt/$arg")"
|
||||
mountpoint "$mountpoints" 2>/dev/null || test -b "$mountpoints" ||
|
||||
mountpoints="$(mount --show-labels | grep "$arg" | cut -d' ' -f3)"
|
||||
test "$mountpoints" || return 1
|
||||
esac
|
||||
while true; do
|
||||
case "$PWD" in
|
||||
("$mountpoints"*) popd || builtin cd "$(dirname $mountpoints)";;
|
||||
|
|
|
@ -13,6 +13,8 @@ test "$DISPLAY" || return 0
|
|||
|
||||
alias graphics='lspci -vnn | grep VGA --color=never && xrandr --listproviders'
|
||||
|
||||
alias clip='cliphist list | fzf | cliphist decode | wl-copy'
|
||||
|
||||
# WIP Edit mozilla config
|
||||
mozedit() (
|
||||
set -eo pipefail
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
input * {
|
||||
xkb_layout de,eu,us
|
||||
xkb_variant nodeadkeys,basic,euro
|
||||
xkb_numlock enabled
|
||||
xkb_options caps:escape_shifted_capslock
|
||||
}
|
||||
#input "1:1:AT_Translated_Set_2_keyboard" {
|
||||
# xkb_switch_layout 1
|
||||
#}
|
||||
input "type:touchpad" {
|
||||
tap enabled
|
||||
natural_scroll disabled
|
||||
accel_profile adaptive
|
||||
dwt disabled
|
||||
pointer_accel 0.4 # set mouse sensitivity (between -1 and 1)
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
input * {
|
||||
xkb_layout eu,de,us
|
||||
xkb_variant nodeadkeys,basic,euro
|
||||
xkb_variant basic,nodeadkeys,euro
|
||||
xkb_numlock enabled
|
||||
xkb_options caps:escape_shifted_capslock
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
display_preamble = false
|
||||
# Don't ask for confirmations
|
||||
#assume_yes = ["emacs"]
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ setopt hist_save_no_dups
|
|||
setopt hist_reduce_blanks
|
||||
unsetopt hist_ignore_space
|
||||
zshaddhistory() {
|
||||
[[ $1 != netkeeper* ]] && [[ $1 != killm* ]]
|
||||
[[ $1 != netkeeper* ]] && [[ $1 != killm* ]] && [[ $1 != "stretchly reset" ]]
|
||||
}
|
||||
|
||||
setopt sh_word_split
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -x
|
||||
# Mount a partition by label or device identifier automatically
|
||||
# Includes interactive selection if no argument is given
|
||||
set -eo pipefail
|
||||
_help="$0 <device> [mountpoint] [options...]"
|
||||
case $1 in
|
||||
(-v) shift
|
||||
bash -x "$0" "$@";;
|
||||
("") # TODO include size
|
||||
arg=$(lsblk --list --noheadings --output name,label,fstype,mountpoint |
|
||||
grep -v '/' | grep ".\+ [^ ]\+" | fzf --select-1 --exit-0 |
|
||||
arg=$(
|
||||
{ #for ip in $(sudo nmblookup -S \* | grep '^[0-9]' | cut -d' ' -f1)
|
||||
#do timeout --kill-after=.1s .1s showmount --no-headers --exports "$ip" 2>/dev/null | sed "s|\([^ ]*\) .*|$ip:\1|"
|
||||
#done &
|
||||
lsblk --list --noheadings --output name,label,fstype,mountpoint | grep -v LUKS | grep -v '/' | grep ".\+ [^ ]\+"; } | fzf --exit-0 |
|
||||
sed "s/^\([^ ]\+ \+\)\?\([^ ]\+\) \+[^ ]\+ *$/\2/");;
|
||||
(--help) echo "$_help" && exit 0;;
|
||||
(-u) shift
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
#!/bin/sh -ex
|
||||
target="${1:-$PWD}"
|
||||
cd $DATA/5*
|
||||
tar xf Qobuz-commandes.tar
|
||||
mv -v *.jpg Qobuz-commandes/
|
||||
mv -v Qobuz-commandes $target/qobuz #$d4/music/Worship/
|
||||
mkdir -p qobuz
|
||||
cd qobuz
|
||||
tar xf ../Qobuz-commandes.tar
|
||||
mv -v ../*.jpg . || true
|
||||
cd ..
|
||||
mv -v qobuz $target/ #$d4/music/Worship/
|
||||
rm -i Qobuz-commandes.tar
|
||||
cd $target/qobuz
|
||||
find -type d -exec sh -c 'test $(ls "{}" | wc -l) -eq 1 && find "{}" -maxdepth 1 -type f | xargs -i% mv -v % .' \;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh -e
|
||||
# Execute commands on a zulip server
|
||||
# https://zulip.readthedocs.io/en/latest/production/management-commands.html
|
||||
zulipdepl="/home/zulip/deployments/current"
|
||||
case $1 in
|
||||
(upgrade)
|
||||
|
|
Loading…
Add table
Reference in a new issue