summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ar/.config/lf/lfrc32
-rw-r--r--ar/.config/shell/aliasrc2
-rwxr-xr-xar/.local/bin/gitupdate2
-rwxr-xr-xar/.local/bin/ovpn1
-rwxr-xr-xar/.local/bin/statusbar/sb-brightness2
-rwxr-xr-xar/.local/bin/statusbar/sb-internet2
6 files changed, 23 insertions, 18 deletions
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc
index 64416d3..becd52c 100644
--- a/ar/.config/lf/lfrc
+++ b/ar/.config/lf/lfrc
@@ -101,16 +101,24 @@ cmd yank-basename $basename -a -- $fx | head -c-1 | xclip -i -selection clipboar
cmd yank-basename-without-extension &basename -a -- $fx | cut -d. -f1 | head -c-1 | xclip -i -selection clipboard
# Create
-cmd mkdir ${{ clear; tput cup $(($(tput lines)/3)); tput bold
- printf "Directory Name: "
- read ans
- mkdir -p $ans
-}}
-cmd mkfile ${{
- clear; tput cup $(($(tput lines)/3)); tput bold
- printf "File Name: "
- read ans
- $EDITOR $ans
+cmd mkdir %{{
+ IFS=" "
+ file="$*"
+ mkdir -p -- "$file"
+ lf -remote "send $id cd \"$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')\""
+}}
+cmd touch %{{
+ IFS=" "
+ file="$*"
+ case "$file" in
+ /*) ;;
+ *) file="$PWD/$file" ;;
+ esac
+ dir="${file%/*}"
+ [ "$dir" != "$file" ] && mkdir -p -- "$dir"
+ touch -- "$file"
+ file="$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')"
+ lf -remote "send $id :select \"$file\"; \$\$EDITOR \"$file\""
}}
cmd link %{{
set -- $(cat ~/.local/share/lf/files)
@@ -500,8 +508,8 @@ map yt $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/
map yy copy
# Create
-map Md mkdir
-map Mf mkfile
+map Md push :mkdir<space>
+map Mf push :touch<space>
map Ml link
# Cut
diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc
index 1e129f6..1cf6045 100644
--- a/ar/.config/shell/aliasrc
+++ b/ar/.config/shell/aliasrc
@@ -12,7 +12,7 @@
[ -f "$MBSYNCRC" ] && alias mbsync='mbsync -c $MBSYNCRC'
# sudo not required for some system commands
-for command in blkid lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
+for command in arp-scan blkid docker ecrypt lazydocker lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
alias $command="sudo $command"
done
unset command
diff --git a/ar/.local/bin/gitupdate b/ar/.local/bin/gitupdate
index 87c13c3..3dabf34 100755
--- a/ar/.local/bin/gitupdate
+++ b/ar/.local/bin/gitupdate
@@ -2,8 +2,6 @@
set -eu
-pidof transmission-daemon >/dev/null && echo "Turn off transmission-daemon first!" && exit 1
-
# Check if inside a Git repository
! git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "Not a git repository." && exit 1
diff --git a/ar/.local/bin/ovpn b/ar/.local/bin/ovpn
index a89c357..10ecc01 100755
--- a/ar/.local/bin/ovpn
+++ b/ar/.local/bin/ovpn
@@ -7,7 +7,6 @@ turnonoffvpn() {
;;
*off*)
nmcli connection down "$THESIAH_VPN" 2>/dev/null && notify-send "✂️ THESIAH_VPN: OFF" || notify-send "✂️ Error to disconnect"
-
;;
esac
}
diff --git a/ar/.local/bin/statusbar/sb-brightness b/ar/.local/bin/statusbar/sb-brightness
index 625e69e..e18fa2c 100755
--- a/ar/.local/bin/statusbar/sb-brightness
+++ b/ar/.local/bin/statusbar/sb-brightness
@@ -5,7 +5,7 @@ monitor=$(xrandr --query | grep -i '\sconnected' | grep '[0-9]x[0-9]' | grep -i
case "$monitor" in
*DP* | *HDMI*)
current_brightness=$(xrandr --verbose | grep -i "^$monitor connected" -A5 | grep -i "Brightness:" | cut -d ' ' -f2)
- current_brightness=$(echo "$current_brightness * 100" | bc -l)
+ current_brightness=$(printf "%.0f\n" "$(echo "$current_brightness * 100" | bc -l)")
;;
esac
diff --git a/ar/.local/bin/statusbar/sb-internet b/ar/.local/bin/statusbar/sb-internet
index 163b7b3..4dfb605 100755
--- a/ar/.local/bin/statusbar/sb-internet
+++ b/ar/.local/bin/statusbar/sb-internet
@@ -71,7 +71,7 @@ fi
grep -q 'up' /sys/class/net/e*/operstate && ethericon="🌐" || ethericon="❎"
# TUN
-grep -q 'up' /sys/class/net/tun*/operstate 2>/dev/null && tunicon="🛰"
+[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="🛰"
icons=""
[ -n "$wifiicon" ] && icons="${icons}$wifiicon "