diff options
| author | 2021-04-29 01:32:54 +0000 | |
|---|---|---|
| committer | 2021-04-29 01:32:54 +0000 | |
| commit | 4e2125c459be4d858db2b751a19811e70b981cff (patch) | |
| tree | 3158d2a54391beef11a5f11c026bfc681ab0ba1f | |
| parent | 59fcab1b0cacc328c2a8c22cde55633e50bd7bcb (diff) | |
Modificados scripts de cpu e microfone, e adicionado script passmenu2
| -rw-r--r-- | aliases | 2 | ||||
| -rwxr-xr-x | bin/cpu | 3 | ||||
| -rwxr-xr-x | bin/mic_check | 2 | ||||
| -rwxr-xr-x | bin/passmenu2 | 60 |
4 files changed, 65 insertions, 2 deletions
@@ -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 @@ -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 + |
