diff options
| author | 2021-04-08 01:22:13 +0000 | |
|---|---|---|
| committer | 2021-04-08 01:22:13 +0000 | |
| commit | 565a3da2702126e7f10ccb48c3fbf2e188ef37b5 (patch) | |
| tree | e99a753ddf02e524171ff205a49a0f225556c40c | |
| parent | fb6c60c4aa5f2fb1bae1d49b114861cea8f285d4 (diff) | |
Adicionados novos scripts e alteradas configurações
| -rw-r--r-- | aliases | 25 | ||||
| -rwxr-xr-x | bin/batt | 1 | ||||
| -rwxr-xr-x | bin/battery_check | 32 | ||||
| -rwxr-xr-x | bin/connect_wlan | 11 | ||||
| -rwxr-xr-x | bin/linkgrabber | 10 | ||||
| -rwxr-xr-x | bin/transcode | 2 | ||||
| -rwxr-xr-x | bin/wlan | 5 | ||||
| -rwxr-xr-x | colors | 3 | ||||
| -rwxr-xr-x | sxhkd/dwmKeys | 74 |
9 files changed, 70 insertions, 93 deletions
@@ -21,8 +21,6 @@ alias bashrc='nvim ~/.bashrc' alias tmconf='nvim ~/.tmux.conf' -alias tconf='nvim ~/.config/termite/config' - alias alconf='nvim ~/.config/alacritty/alacritty.yml' alias venv='nvim ~/.config/env' @@ -35,6 +33,10 @@ alias xmap='nvim ~/.Xmodmap' alias xhk='nvim ~/.config/sxhkd/sxhkdrc' alias bsp='nvim ~/.config/bspwm/bspwmrc' alias pbar='nvim ~/.config/polybar/config' +alias lbar='nvim ~/.config/lemonbar/launch' + +alias hlwm='nvim ~/.config/herbstluftwm/autostart' +alias hlk='nvim ~/.config/sxhkd/hlwmKeys' alias lfrc='nvim ~/.config/lf/lfrc' @@ -44,6 +46,10 @@ alias nvrc='nvim ~/.config/nvim/init.vim' alias ncc='nvim ~/.config/ncmpcpp/config' alias mpconf='nvim ~/.config/mpd/mpd.conf' +alias muttrc='nvim $HOME/.config/mutt/muttrc' + +alias colors='nvim $HOME/.config/colors' + # suckless utilities alias dwconf="nvim ~/.local/repos/dwm-meu/config.def.h" alias dwcomp="cd ~/.local/repos/dwm-meu && rm -rf config.h && doas make clean install && cd" @@ -57,10 +63,19 @@ alias dmcomp='cd ~/.local/repos/dmenu-meu && rm -rf config.h && doas make clean alias slconf="nvim ~/.local/repos/slock-meu/config.def.h" alias slcomp='cd ~/.local/repos/slock-meu && rm -rf config.h && doas make clean install && cd' +alias bconf="nvim ~/.local/repos/dwmblocks/blocks.def.h" +alias bcomp='cd ~/.local/repos/dwmblocks && rm -rf blocks.h && doas make clean install && cd' + +alias tbconf="nvim ~/.local/repos/tabbed-meu/config.def.h" +alias tbcomp='cd ~/.local/repos/tabbed-meu && rm -rf config.h && doas make clean install && cd' + +alias spatch="patch -p1 <" + # pacman aliases alias p='doas pacman -S' alias pss='pacman -Ss' alias psi='pacman -Si' +alias pf='pacman -F' alias pi='pacman -Qi' alias pl='pacman -Ql' alias pr='doas pacman -Rs' @@ -74,14 +89,18 @@ alias y='yay -S' alias gs='git status' alias ga='git add' alias gc='git commit -m' +alias gl='git log --oneline' # application aliases alias v='nvim' alias V='doas nvim' alias pm='pulsemixer' alias yda='youtube-dl -4 -x --audio-format mp3 -o "~/Música/%(title)s.%(ext)s"' -alias muttrc='nvim $HOME/.config/mutt/muttrc' alias xclip='xclip -sel copy' +alias hc='herbstclient' + +# abre o GTA V com facilidade +alias gtav='legendary launch 9d2d0eb64d5c44529cece33fe2a46482' # todo.txt alias t='todo.sh' @@ -3,6 +3,7 @@ batt() { batt="$(acpi | awk '{print $4}' | sed -e 's/%,//g')" icon="" + state="$(cat /sys/class/power_supply/BAT0/status)" [ "$batt" -ge 90 ] && icon="" diff --git a/bin/battery_check b/bin/battery_check index af44108..7d77b82 100755 --- a/bin/battery_check +++ b/bin/battery_check @@ -1,17 +1,23 @@ #!/usr/bin/env bash -# Simple script to monitor the battery's status +# Simple script to monitor the battery's status and level -# calls batt_status script -batt=$(acpi | awk '{print $4}' | sed -e 's/\%,//g') -state=$(acpi | awk '{print }' | sed -e 's/\,//g') +interval=300 # 5 minutes +critical_level=7 -if [[ $batt -ge 99 ]]; then - notify-send "Bateria" "Completamente carregada! (100%)" -elif [[ $batt -eq 20 ]] ; then - notify-send "Bateria descarregando" "Nível de bateria alcançou 20%" -elif [[ $batt -eq 10 ]] ; then - notify-send "Bateria descarregando" "Nível de bateria alcançou 10%" -elif [[ $batt -le 5 ]]; then - notify-send "Bateria crítica!" "Nível de bateria alcançou 5%" -fi +while true +do + batt="$(cat /sys/class/power_supply/BAT0/capacity)" + state="$(cat /sys/class/power_supply/BAT0/status)" + + if [[ $batt -ge 99 ]]; then + notify-send -u normal"Bateria" "Completamente carregada! (100%)"; pkill -RTMIN+20 dwmblocks + elif [[ $batt -eq 20 ]] ; then + notify-send -u normal "Bateria descarregando" "Nível de bateria alcançou 20%"; pkill -RTMIN+20 dwmblocks + elif [[ $batt -eq 10 ]] ; then + notify-send -u normal "Bateria descarregando" "Nível de bateria alcançou 10%"; pkill -RTMIN+20 dwmblocks + elif [[ $batt -le "$critical_level" ]]; then + notify-send -u critical "Bateria crítica!" "Nível de bateria alcançou 7%"; pkill -RTMIN+20 dwmblocks + fi + sleep "$interval" +done diff --git a/bin/connect_wlan b/bin/connect_wlan new file mode 100755 index 0000000..fd2c8cd --- /dev/null +++ b/bin/connect_wlan @@ -0,0 +1,11 @@ +#!/bin/env bash + +# script to pipe scanned networks to dmenu, using iwd + +station="$(iwctl device list | grep station | awk ' { print $1 } ')" + +iwctl station "$station" scan + +ssid="$(iwctl station "$station" get-networks | dmenu -l 6 -p "Connect to a network:" | sed -e 's/psk.*$//g' -e 's/^\W*//g' -e 's/\W*$//g')" + +[ -v "$ssid" ] && iwctl station "$station" connect "$ssid"; notify-send 'iwctl' "Connected to network $ssid" diff --git a/bin/linkgrabber b/bin/linkgrabber new file mode 100755 index 0000000..bf29fef --- /dev/null +++ b/bin/linkgrabber @@ -0,0 +1,10 @@ +#!/bin/sh + +# opens url in browser: intended use with st +# copied from: https://st.suckless.org/patches/externalpipe/linkgrabber.sh + +regex='(((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]' + +url=$(grep -Po "$regex" | dmenu -p "Go:" -w "$WINDOWID") || exit + +$BROWSER "$url" diff --git a/bin/transcode b/bin/transcode index 094c36e..6f6a3c7 100755 --- a/bin/transcode +++ b/bin/transcode @@ -3,7 +3,7 @@ # Este script faz a transcodagem de um vídeo de um codec para outro, feito para reduzir em até 80% o tamanho do arquivo original. ORIG="$1" -NOME=$(basename "$ORIG" .mp4) +NOME="$(basename "$ORIG" .mp4)" NOVO="${2:-"$NOME-trans.mp4"}" ffmpeg -i "$ORIG" -vf mpdecimate -vsync vfr -c:v libx265 -x265-params crf=32 -preset veryslow "$NOVO" @@ -2,9 +2,10 @@ # prints connected SSID name wlan() { - wlan="$(iwgetid | awk ' {print $2, $3, $4, $5, $6} ' | sed -e 's/ESSID://g' -e 's/"//g')" + station="$(iwctl device list | grep station | awk ' { print $1 } ')" + essid="$(iwgetid | sed -e 's/ESSID://g' -e 's/"//g' -e "s:$station::g" -e 's/^\W*/ /g')" - printf "%s %s" "" "$wlan" + printf "%s" "$essid" } wlan @@ -10,3 +10,6 @@ blue=#799df6 yellow=#fbdd91 pink=#f985e0 green=#6EF38B +cyan=#00ffff +magenta=#ff00ff +purple=#756bb1 diff --git a/sxhkd/dwmKeys b/sxhkd/dwmKeys index 68e2a61..95c6df4 100755 --- a/sxhkd/dwmKeys +++ b/sxhkd/dwmKeys @@ -8,107 +8,33 @@ super + r pkill -USR1 -x sxhkd ; notify-send 'sxhkd' 'Reloaded config' -# spawn vim -super + v - $TERMINAL -e 'nvim' - -# run terminal applications -super + e ; {1, 2, 3, 4, 5, 6} - $TERMINAL -e {\ - lf, \ - ncmpcpp, \ - ncspot, \ - newsboat, \ - htop, \ - pulsemixer} - -# run graphical applications -super + g ; {1, 2} - {firefox-developer-edition, librewolf} - -# lock the screen -alt + shift + l - slock - -# dmenu based applications -super + d ; {1, 2} - {dmenu_run -l 6, passmenu2} - -# center a floating window -super + c - wmMove center - -# -- Screenshots -- # - -# print selection with scrot -@Print - scrot -s -f '%Y-%m-%d_$wx$h.png' -e 'mv $f /home/math/Imagens/Prints' - -# print current window with scrot -shift + @Print - scrot -u '%Y-%m-%d_$wx$h.png' -e 'mv $f /home/math/Imagens/Prints' - -# print entire screen with scrot -alt + @Print - scrot "%Y-%m-%d_$wx$h.png" -e 'mv $f /home/math/Imagens/Prints' - # -- Audio Control -- # XF86AudioMute pulsemixer --toggle-mute; pkill -RTMIN+10 dwmblocks -shift + F1 - pulsemixer --toggle-mute; pkill -RTMIN+10 dwmblocks - XF86AudioLowerVolume pulsemixer --change-volume -5; pkill -RTMIN+10 dwmblocks -shift + F2 - pulsemixer --change-volume -5; pkill -RTMIN+10 dwmblocks - XF86AudioRaiseVolume pulsemixer --change-volume +5; pkill -RTMIN+10 dwmblocks -shift + F3 - pulsemixer --change-volume +5; pkill -RTMIN+10 dwmblocks - XF86AudioMicMute mic_check -shift + F4 - mic_check - -shift + F5 - mpc stop - XF86AudioPrev mpc prev -shift + F6 - mpc prev - XF86AudioPlay mpc toggle -shift + F7 - mpc toggle - XF86AudioNext mpc next - -shift + F8 - mpc next # -- Brightness Control -- # XF86MonBrightnessDown xbacklight -dec 10 -shift + F11 - xbacklight -dec 10 - XF86MonBrightnessUp xbacklight -inc 10 - -shift + F12 - xbacklight -inc 10 |
