diff --git a/.config/nvim/pack/plugins/opt/lspconfig b/.config/nvim/pack/plugins/opt/lspconfig index 94291c9..0bc0c38 160000 --- a/.config/nvim/pack/plugins/opt/lspconfig +++ b/.config/nvim/pack/plugins/opt/lspconfig @@ -1 +1 @@ -Subproject commit 94291c924f0efdbc16ac625cf77ae7d3a7fa5821 +Subproject commit 0bc0c38e1b11dfb6b5f1794d53869f89ccf9e78f diff --git a/.config/nvim/pack/plugins/opt/treesitter b/.config/nvim/pack/plugins/opt/treesitter index d546bcd..871f566 160000 --- a/.config/nvim/pack/plugins/opt/treesitter +++ b/.config/nvim/pack/plugins/opt/treesitter @@ -1 +1 @@ -Subproject commit d546bcd1f1393e144396fc049ae4bf7d4fffccab +Subproject commit 871f5665d92d59a369cf916e9aa4d321d466f1e3 diff --git a/.config/zsh/custom/themes/powerlevel10k b/.config/zsh/custom/themes/powerlevel10k index cb9788b..b474978 160000 --- a/.config/zsh/custom/themes/powerlevel10k +++ b/.config/zsh/custom/themes/powerlevel10k @@ -1 +1 @@ -Subproject commit cb9788b12a1fade6be631ad905928f9a5f7eb03f +Subproject commit b474978b2e9435c10ca66f8281352ebc825264f4 diff --git a/.config/zsh/ohmyzsh b/.config/zsh/ohmyzsh index cc99132..8d23fbd 160000 --- a/.config/zsh/ohmyzsh +++ b/.config/zsh/ohmyzsh @@ -1 +1 @@ -Subproject commit cc9913210498e2d527486310f1e8a53b93f55ca8 +Subproject commit 8d23fbd6964b8446bbc73ff04507362d1fd49eb5 diff --git a/bin/set-light b/bin/set-light index a2a802a..db379a0 100755 --- a/bin/set-light +++ b/bin/set-light @@ -1,48 +1,29 @@ -#!/bin/bash -set -e +#!/bin/bash -e shopt -s extglob nullglob set_brightness() { - MAX="$(cat "$1"/max_brightness)" - FILE="$1"/brightness - VAL="$(($2 * MAX / 100 + 1))" + local max; max="$(cat "$1"/max_brightness)" + local file="$1"/brightness + local val="$(($2 * max / 100 + 1))" - [ "$VAL" -lt 0 ] && VAL=0 - [ "$VAL" -gt "$MAX" ] && VAL="$MAX" - echo "$VAL" > "$FILE" + [ "$val" -lt 0 ] && val=0 + [ "$val" -gt "$max" ] && val="$max" + echo "$val" > "$file" } CUR_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/current_brightness" - -set +e -CUR="$(cat "$CUR_FILE" || echo 50)" -set -e - +CUR="$(cat "$CUR_FILE" 2> /dev/null || echo 50)" case "${1:0:1}" in - '') - exit 1 - ;; - '+'|'-') - NEW="$((CUR - CUR % $1 + $1))" - ;; - *) - NEW="$1" - ;; + '') echo "$CUR"; exit ;; + '+'|'-') NEW="$((CUR - CUR % $1 + $1))" ;; + *) NEW="$1" ;; esac -[ "$NEW" -lt 0 ] && NEW=0 -[ "$NEW" -gt 100 ] && NEW=100 - for dev in /sys/class/backlight/*; do set_brightness "$dev" "$NEW" done echo "$NEW" > "$CUR_FILE" -# update sbar kill -35 "$(cat "$HOME/.cache/pidofbar")" - -if [ -t 1 ]; then - echo "$NEW" -fi diff --git a/bin/set-vol b/bin/set-vol index 6a7cb47..a94ca99 100755 --- a/bin/set-vol +++ b/bin/set-vol @@ -1,37 +1,21 @@ -#!/bin/bash -set -e +#!/bin/bash -e SINK='@DEFAULT_AUDIO_SINK@' if [ "$1" == 'm' ]; then wpctl set-mute "$SINK" toggle else - VOL="$((10#$(wpctl get-volume "$SINK" | tr -dc '0-9')))" - [ -n "$1" ] && VOL="$((VOL - VOL % $1))" + CUR="$((10#$(wpctl get-volume "$SINK" | tr -dc '0-9')))" case "${1:0:1}" in - '') - echo "$VOL" - exit - ;; - '+'|'-') - VOL="$((VOL + $1))" - ;; - *) - VOL="$1" - ;; + '') echo "$CUR"; exit ;; + '+'|'-') CUR="$((CUR - CUR % $1 + $1))" ;; + *) CUR="$1" ;; esac - [ "$VOL" -lt 0 ] && VOL=0 - [ "$VOL" -gt 100 ] && VOL=100 - - wpctl set-volume "$SINK" "$VOL%" - wpctl set-mute "$SINK" 0 + wpctl set-volume -l 1 "$SINK" "$CUR%" + wpctl set-mute "$SINK" 0 fi # update sbar kill -34 "$(cat "$HOME/.cache/pidofbar")" - -if [ -t 1 ]; then - echo "$VOL" -fi