1
0
Fork 0

update scripts

main
urosm 2024-04-11 23:25:48 +02:00
parent 61db1999ef
commit 90bfde16a1
5 changed files with 18 additions and 70 deletions

View File

@ -1,29 +0,0 @@
#!/bin/sh
bssid="$(nmcli --colors=no -f BSSID,IN-USE,SSID,BARS device wifi list\
| tail -n+2\
| fuzzel -d -p "connect > "\
| cut -d" " -f1)"
[ -z "$bssid" ] && return
ssid="$(nmcli -g SSID device wifi list bssid "$bssid" --rescan no)"
if nmcli -t connection show "$ssid" >/dev/null 2>&1; then
if nmcli device wifi connect "$bssid" 2>&1; then
exec notify-send "Connected to $ssid."
else
exec notify-send "Could not connect to $ssid."
fi
else
security="$(nmcli -g SECURITY device wifi list bssid "$bssid" --rescan no)"
if [ "$security" = "WPA2" ] || [ "$security" = "WEP" ]; then
password="$(fuzzel -d --password -p "password > ")"
fi
if nmcli device wifi connect "$bssid" password "$password" 2>&1; then
exec notify-send "Connected to $ssid."
else
exec notify-send "Could not connect to $ssid."
fi
fi

View File

@ -1,25 +0,0 @@
#!/bin/sh
while getopts "he:" arg; do
case $arg in
e)
if [ -z "$excludes" ]; then
excludes="-path $OPTARG"
else
excludes="$excludes -o -path $OPTARG"
fi
;;
[h?])
printf "Usage: %s: [-e exclude path] [path]\n" $0
exit;;
esac
done
shift $(($OPTIND - 1))
file="$(find ${1:-$HOME} ! \( \( $excludes \) -prune \) -print0\
| fuzzel --dmenu0 -p "find > ")"
[ -z "$file" ] && exit
exec xdg-open "$file"

View File

@ -1,16 +0,0 @@
#!/bin/sh
name="$(lsblk -lpno"name,size,type,mountpoint"\
| grep "/dev\/sd.*part"\
| fuzzel -d -p "mount > "\
| cut -d" " -f1)"
[ -z "$name" ] && return
mountpoint="$(lsblk -lpno"mountpoint" "$name")"
if [ -z "$mountpoint" ]; then
exec udisksctl mount -b "$name" 2>&1 | xargs -I{} notify-send "{}"
else
exec udisksctl unmount -b "$name" 2>&1 | xargs -I{} notify-send "{}"
fi

View File

@ -0,0 +1,10 @@
#!/bin/sh
nmcli device wifi list
ssid="$(nmcli -g SSID device wifi list --rescan no |
fzy -p "nmcli device wifi connect ")"
[ -z "$ssid" ] && return
if ! nmcli device wifi connect "$ssid"; then
nmcli -a device wifi connect "$ssid"
fi
sleep 1

View File

@ -0,0 +1,8 @@
#!/bin/sh
lsblk
lsblk -lpno"name,type,mountpoint" \
| awk '($1~/.dev.sd/&&$2=="part"){printf($3=="")?"mount -b %s\n":"unmount -b %s\n",$1}' \
| fzy -p "udisksctl " \
| xargs -r udisksctl
sleep 1