diff --git a/.local/bin/fuzzel_nmcli.sh b/.local/bin/fuzzel_nmcli.sh deleted file mode 100755 index 844edc7..0000000 --- a/.local/bin/fuzzel_nmcli.sh +++ /dev/null @@ -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 diff --git a/.local/bin/fuzzel_open.sh b/.local/bin/fuzzel_open.sh deleted file mode 100755 index 7917b95..0000000 --- a/.local/bin/fuzzel_open.sh +++ /dev/null @@ -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" diff --git a/.local/bin/fuzzel_udisksctl.sh b/.local/bin/fuzzel_udisksctl.sh deleted file mode 100755 index 3506658..0000000 --- a/.local/bin/fuzzel_udisksctl.sh +++ /dev/null @@ -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 diff --git a/.local/bin/nmcli_fzy.sh b/.local/bin/nmcli_fzy.sh new file mode 100755 index 0000000..dbfbcc1 --- /dev/null +++ b/.local/bin/nmcli_fzy.sh @@ -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 diff --git a/.local/bin/udisksctl_fzy.sh b/.local/bin/udisksctl_fzy.sh new file mode 100755 index 0000000..8112195 --- /dev/null +++ b/.local/bin/udisksctl_fzy.sh @@ -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