Browse Source

feat: add brightness-up/down scripts

master
Tovi Jaeschke-Rogers 3 weeks ago
parent
commit
fa92087bb7
4 changed files with 55 additions and 3 deletions
  1. +2
    -2
      .config/aliasrc
  2. +5
    -1
      .config/zsh/.zshrc
  3. +24
    -0
      .local/bin/brightness-down
  4. +24
    -0
      .local/bin/brightness-up

+ 2
- 2
.config/aliasrc View File

@ -6,8 +6,8 @@ alias ls="ls --color=auto"
alias ll="ls -G -alh"
alias vim='nvim'
alias grep='grep --color=auto'
alias vz='nvim ~/.zshrc && source ~/.zshrc'
alias va='nvim ~/.config/aliasrc && source ~/.zshrc'
alias vz="nvim ${ZDOTDIR}/.zshrc && source ${ZDOTDIR}/.zshrc"
alias va="nvim ~/.config/aliasrc && source ${ZDOTDIR}.zshrc"
alias sz='source ~/.zshrc'
alias c="xclip -selection clipboard"
alias v="xclip -selection clipboard -o"


+ 5
- 1
.config/zsh/.zshrc View File

@ -46,7 +46,11 @@ if [[ $(uname) == 'Darwin' ]]; then
fi
autoload -Uz compinit
compinit
if [[ -f "${ZDOTDIR}/.zcompdump" && "${ZDOTDIR}/.zcompdump" -nt "${ZDOTDIR}/.zshrc" ]]; then
compinit
else
compinit -C
fi
# Auto complete case insensitive
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'


+ 24
- 0
.local/bin/brightness-down View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
# Define the backlight device
BACKLIGHT_DEVICE="/sys/class/backlight/intel_backlight"
DECREMENT=300 # Adjust this to the value you want to increase
# Get the current and max brightness
current_brightness=$(cat "$BACKLIGHT_DEVICE/brightness")
max_brightness=$(cat "$BACKLIGHT_DEVICE/max_brightness")
# Calculate new brightness value
new_brightness=$((current_brightness - DECREMENT))
# Ensure it doesn't exceed the maximum brightness
if [ "$new_brightness" -gt "$max_brightness" ]; then
new_brightness=$max_brightness
fi
# Set the new brightness
echo "$new_brightness" > "$BACKLIGHT_DEVICE/brightness"
notify-send "Brightness increased to $new_brightness"

+ 24
- 0
.local/bin/brightness-up View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
# Define the backlight device
BACKLIGHT_DEVICE="/sys/class/backlight/intel_backlight"
INCREMENT=300 # Adjust this to the value you want to increase
# Get the current and max brightness
current_brightness=$(cat "$BACKLIGHT_DEVICE/brightness")
max_brightness=$(cat "$BACKLIGHT_DEVICE/max_brightness")
# Calculate new brightness value
new_brightness=$((current_brightness + INCREMENT))
# Ensure it doesn't exceed the maximum brightness
if [ "$new_brightness" -gt "$max_brightness" ]; then
new_brightness=$max_brightness
fi
# Set the new brightness
echo "$new_brightness" > "$BACKLIGHT_DEVICE/brightness"
notify-send "Brightness increased to $new_brightness"

Loading…
Cancel
Save