Compare commits
1 commit
f8fa6fb67e
...
312886ba84
Author | SHA1 | Date | |
---|---|---|---|
|
312886ba84 |
5 changed files with 36 additions and 36 deletions
|
@ -31,9 +31,6 @@ fi
|
||||||
xdh="$XDG_DATA_HOME"
|
xdh="$XDG_DATA_HOME"
|
||||||
xch="$XDG_CONFIG_HOME"
|
xch="$XDG_CONFIG_HOME"
|
||||||
xsh="$XDG_STATE_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
|
if test -d "$DATA"; then
|
||||||
da=$(builtin cd $DATA/_* && pwd)
|
da=$(builtin cd $DATA/_* && pwd)
|
||||||
d1=$(builtin cd $DATA/1* && pwd)
|
d1=$(builtin cd $DATA/1* && pwd)
|
||||||
|
@ -322,12 +319,12 @@ sshl() {
|
||||||
local authcache="/var/tmp/ssh-keys"
|
local authcache="/var/tmp/ssh-keys"
|
||||||
mkdir -p "$authcache"
|
mkdir -p "$authcache"
|
||||||
local file="$authcache/$1"
|
local file="$authcache/$1"
|
||||||
ssh -G "$1" | grep --silent "^user root$" &&
|
ssh -G "$1" | grep --silent "^user root$" &&
|
||||||
! [[ "$1" =~ "pve.*" ]] &&
|
! [[ "$1" =~ "pve.*" ]] &&
|
||||||
! [[ "$1" =~ "encee.*" ]] &&
|
! [[ "$1" =~ "encee.*" ]] &&
|
||||||
! [[ "$1" =~ ".*fmh.*" ]] &&
|
! [[ "$1" =~ ".*fmh.de" ]] &&
|
||||||
! [[ "$1" =~ "delta*" ]] &&
|
! [[ "$1" =~ "delta*" ]] &&
|
||||||
local pass=pass
|
local pass=pass
|
||||||
test "$all" &&
|
test "$all" &&
|
||||||
$pass scp ~/.bash_aliases "$1:" &&
|
$pass scp ~/.bash_aliases "$1:" &&
|
||||||
$pass ssh "$1" 'grep -q ".bash_aliases" .bashrc || echo "source ~/.bash_aliases" >>.bashrc'
|
$pass ssh "$1" 'grep -q ".bash_aliases" .bashrc || echo "source ~/.bash_aliases" >>.bashrc'
|
||||||
|
@ -570,34 +567,27 @@ compdef mkcd=mkdir
|
||||||
|
|
||||||
# Other stuff {{{1
|
# Other stuff {{{1
|
||||||
|
|
||||||
alias unmount=umoul
|
# This is a function rather than a script as it potentially needs to cd out of the directory
|
||||||
# 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() {
|
umoul() {
|
||||||
local arg
|
local arg
|
||||||
local mnt="${MNT:-${XDG_RUNTIME_DIR}/mnt}"
|
|
||||||
# get the last arg
|
# get the last arg
|
||||||
for arg; do true; done
|
for arg; do true; done
|
||||||
case "$arg" in
|
if test "$arg"
|
||||||
(-a|--all)
|
then mountpoints="$(test -d "$arg" && realpath "$arg" || echo "${MNT:-${XDG_RUNTIME_DIR}/mnt}/$arg")"
|
||||||
mountpoints=$(mount | grep "$mnt" | cut -d' ' -f3)
|
mountpoint "$mountpoints" 2>/dev/null || test -b "$mountpoints" ||
|
||||||
("")
|
mountpoints="$(mount --show-labels | grep "$arg" | cut -d' ' -f3)"
|
||||||
mountpoints="$(pwd | grep -v /home || echo /)"
|
test "$mountpoints" || return 1
|
||||||
|
else mountpoints="$PWD"
|
||||||
while test "$mountpoints" != "/"; do
|
while test "$mountpoints" != "/"; do
|
||||||
mountpoint "$mountpoints" >/dev/null && break
|
mountpoint "$mountpoints" >/dev/null && break
|
||||||
mountpoints="$(dirname "$mountpoints")"
|
mountpoints="$(dirname "$mountpoints")"
|
||||||
done
|
done
|
||||||
test "$(dirname "$mountpoints")" != "/" ||
|
test "$(dirname "$mountpoints")" != "/" ||
|
||||||
mountpoints="$(mount |
|
mountpoints="$(mount |
|
||||||
grep --invert-match -e " /[^m][^/]*\(/[^/]*\)\? " -e "/sys" -e "/run/user" -e "/run/docker" -e "/home" |
|
grep --invert-match -e " /[^m][^/]*\(/[^/]*\)\? " -e "/sys" -e "/run/user" -e "/run/docker" |
|
||||||
fzf --exit-0 | awk '{print $3}')" ||
|
fzf --select-1 --exit-0 | awk '{print $3}')" ||
|
||||||
return $?
|
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
|
while true; do
|
||||||
case "$PWD" in
|
case "$PWD" in
|
||||||
("$mountpoints"*) popd || builtin cd "$(dirname $mountpoints)";;
|
("$mountpoints"*) popd || builtin cd "$(dirname $mountpoints)";;
|
||||||
|
|
|
@ -13,8 +13,6 @@ test "$DISPLAY" || return 0
|
||||||
|
|
||||||
alias graphics='lspci -vnn | grep VGA --color=never && xrandr --listproviders'
|
alias graphics='lspci -vnn | grep VGA --color=never && xrandr --listproviders'
|
||||||
|
|
||||||
alias clip='cliphist list | fzf | cliphist decode | wl-copy'
|
|
||||||
|
|
||||||
# WIP Edit mozilla config
|
# WIP Edit mozilla config
|
||||||
mozedit() (
|
mozedit() (
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
16
.config/sway/config.d/keyboard.conf
Normal file
16
.config/sway/config.d/keyboard.conf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
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 * {
|
input * {
|
||||||
xkb_layout eu,de,us
|
xkb_layout eu,de,us
|
||||||
xkb_variant basic,nodeadkeys,euro
|
xkb_variant nodeadkeys,basic,euro
|
||||||
xkb_numlock enabled
|
xkb_numlock enabled
|
||||||
xkb_options caps:escape_shifted_capslock
|
xkb_options caps:escape_shifted_capslock
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
#!/bin/sh -x
|
#!/bin/sh
|
||||||
# Mount a partition by label or device identifier automatically
|
# Mount a partition by label or device identifier automatically
|
||||||
# Includes interactive selection if no argument is given
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
_help="$0 <device> [mountpoint] [options...]"
|
_help="$0 <device> [mountpoint] [options...]"
|
||||||
case $1 in
|
case $1 in
|
||||||
(-v) shift
|
(-v) shift
|
||||||
bash -x "$0" "$@";;
|
bash -x "$0" "$@";;
|
||||||
("") # TODO include size
|
("") # TODO include size
|
||||||
arg=$(
|
arg=$(lsblk --list --noheadings --output name,label,fstype,mountpoint |
|
||||||
{ #for ip in $(sudo nmblookup -S \* | grep '^[0-9]' | cut -d' ' -f1)
|
grep -v '/' | grep ".\+ [^ ]\+" | fzf --select-1 --exit-0 |
|
||||||
#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/");;
|
sed "s/^\([^ ]\+ \+\)\?\([^ ]\+\) \+[^ ]\+ *$/\2/");;
|
||||||
(--help) echo "$_help" && exit 0;;
|
(--help) echo "$_help" && exit 0;;
|
||||||
(-u) shift
|
(-u) shift
|
||||||
|
|
Loading…
Add table
Reference in a new issue