aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aliases2
-rwxr-xr-xbin/cpu3
-rwxr-xr-xbin/mic_check2
-rwxr-xr-xbin/passmenu260
4 files changed, 65 insertions, 2 deletions
diff --git a/aliases b/aliases
index ea788ee..7b90fa5 100644
--- a/aliases
+++ b/aliases
@@ -114,6 +114,8 @@ alias rec='ffmpeg -f x11grab -s 1920x1080 -i :0.0 Vídeos/rec.mp4'
# list all installed packages with descriptions using fzf
alias lspkgs="pacman -Qq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)'"
+alias lastpkgs="expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | tail -n 20"
+
alias integra="streamlink twitch.tv/integrapoli best --player mpv"
# quickly change kb layout
diff --git a/bin/cpu b/bin/cpu
index a0a4511..9288584 100755
--- a/bin/cpu
+++ b/bin/cpu
@@ -2,7 +2,8 @@
# checks the amount of CPU being used
cpu() {
- cpu="$(cat /proc/loadavg | awk '{print $3}'|cut -f 1 -d ".")"
+ #cpu="$(cat /proc/loadavg | awk '{print $3}'|cut -f 1 -d ".")"
+ cpu="$(iostat | awk '{print $1}' | grep '[0-9]')"
printf "﬙ %.0f%%" "$cpu"
}
diff --git a/bin/mic_check b/bin/mic_check
index 05df57e..a3fcc63 100755
--- a/bin/mic_check
+++ b/bin/mic_check
@@ -3,7 +3,7 @@
# mutes the microphone and send a notification
# microphone mute state
-mute="$(pulsemixer --list-sources | grep -i default | awk '{print $10}' | sed -e 's/,//g')"
+mute="$(pulsemixer --list-sources | grep -i default | awk '{print $11}' | sed -e 's/,//g')"
[ "$mute" -eq 0 ] && notify-send "Microfone" "Mudo"
diff --git a/bin/passmenu2 b/bin/passmenu2
new file mode 100755
index 0000000..3847219
--- /dev/null
+++ b/bin/passmenu2
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+
+shopt -s nullglob globstar
+
+typeit=0
+if [[ $1 == "--type" ]]; then
+ typeit=1
+ shift
+fi
+
+
+STARTDIR=${PASSWORD_STORE_DIR-~/.password-store}
+BASEDIR=$STARTDIR
+DONE=0
+LEVEL=0
+PREVSELECTION=""
+SELECTION=""
+
+while [ "$DONE" -eq 0 ] ; do
+ password_files=( "$STARTDIR"/* )
+ password_files=( "${password_files[@]#"$STARTDIR"/}" )
+ password_files=( "${password_files[@]%.gpg}" )
+
+ if [ "$LEVEL" -ne 0 ] ; then
+ password_files=(".." "${password_files[@]}")
+ fi
+ entry=$(printf '%s\n' "${password_files[@]}" | dmenu "$@" -l 15)
+
+ echo "entry: $entry"
+ if [ -z "$entry" ] ; then
+ DONE=1
+ exit
+ fi
+
+ if [ "$entry" != ".." ] ; then
+ PREVSELECTION=$SELECTION
+ SELECTION="$SELECTION/$entry"
+
+ # check if another dir
+ if [ -d "$STARTDIR/$entry" ] ; then
+ STARTDIR="$STARTDIR/$entry"
+ LEVEL=$((LEVEL+1))
+ else
+ # not a directory so it must be a real password entry
+
+ if [[ $typeit -eq 0 ]]; then
+ pass show -c "$SELECTION" 2>/dev/null
+ else
+ xdotool - <<<"type --clearmodifiers -- $(pass show "$SELECTION" | head -n 1)"
+ fi
+ DONE=1
+ fi
+
+ else
+ LEVEL=$((LEVEL-1))
+ SELECTION=$PREVSELECTION
+ STARTDIR="$BASEDIR/$SELECTION"
+ fi
+done
+