add: Add script for setup
This commit is contained in:
parent
0ed962d56f
commit
cd00952c7c
6 changed files with 22 additions and 107 deletions
0
CODE_OF_CONDUCT.md
Normal file → Executable file
0
CODE_OF_CONDUCT.md
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
README.md
Normal file → Executable file
0
README.md
Normal file → Executable file
|
@ -1,52 +0,0 @@
|
||||||
# #!/bin/bash
|
|
||||||
# # I copied this script from JaKooLit. https://github.com/JaKooLit. Because I do not have any laptop to test these kinds of features.
|
|
||||||
|
|
||||||
iDIR="$HOME/.config/dunst/icons/brightness"
|
|
||||||
notification_timeout=1000
|
|
||||||
|
|
||||||
# Get brightness
|
|
||||||
get_backlight() {
|
|
||||||
echo $(brightnessctl -m | cut -d, -f4)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get icons
|
|
||||||
get_icon() {
|
|
||||||
current=$(get_backlight | sed 's/%//')
|
|
||||||
if [ "$current" -le "20" ]; then
|
|
||||||
icon="$iDIR/brightness-20.png"
|
|
||||||
elif [ "$current" -le "40" ]; then
|
|
||||||
icon="$iDIR/brightness-40.png"
|
|
||||||
elif [ "$current" -le "60" ]; then
|
|
||||||
icon="$iDIR/brightness-60.png"
|
|
||||||
elif [ "$current" -le "80" ]; then
|
|
||||||
icon="$iDIR/brightness-80.png"
|
|
||||||
else
|
|
||||||
icon="$iDIR/brightness-100.png"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Notify
|
|
||||||
notify_user() {
|
|
||||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness : $current%"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Change brightness
|
|
||||||
change_backlight() {
|
|
||||||
brightnessctl set "$1" -n && get_icon && notify_user
|
|
||||||
}
|
|
||||||
|
|
||||||
# Execute accordingly
|
|
||||||
case "$1" in
|
|
||||||
"--get")
|
|
||||||
get_backlight
|
|
||||||
;;
|
|
||||||
"up")
|
|
||||||
change_backlight "+10%"
|
|
||||||
;;
|
|
||||||
"down")
|
|
||||||
change_backlight "10%-"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
get_backlight
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,55 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
up)
|
|
||||||
wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
|
|
||||||
wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 2%+
|
|
||||||
;;
|
|
||||||
down)
|
|
||||||
wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
|
|
||||||
wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 2%-
|
|
||||||
;;
|
|
||||||
mute)
|
|
||||||
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {up|down|mute}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
VOLUME=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print int($2 * 100)}')
|
|
||||||
|
|
||||||
NORMALIZED_VOLUME=$((VOLUME / 2))
|
|
||||||
|
|
||||||
send_notification() {
|
|
||||||
# if [ "$1" = "mute" ]; then
|
|
||||||
# ICON='' # Mute icon
|
|
||||||
# MSG="Muted"
|
|
||||||
# elif [ "$NORMALIZED_VOLUME" -lt 50 ]; then
|
|
||||||
# ICON='' # Low volume icon
|
|
||||||
# MSG="Volume: $NORMALIZED_VOLUME%"
|
|
||||||
# elif [ "$NORMALIZED_VOLUME" -lt 90 ]; then
|
|
||||||
# ICON='' # Medium volume icon
|
|
||||||
# MSG="Volume: $NORMALIZED_VOLUME%"
|
|
||||||
# else
|
|
||||||
# ICON='' # High volume icon
|
|
||||||
# MSG="Volume: $NORMALIZED_VOLUME%"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
dunstify -u normal -h "int:value:$NORMALIZED_VOLUME" -a "Volume" "Volume" -t 2000
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
mute)
|
|
||||||
if wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q "MUTED"; then
|
|
||||||
send_notification mute
|
|
||||||
else
|
|
||||||
send_notification
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
send_notification
|
|
||||||
;;
|
|
||||||
esac
|
|
22
setup.sh
Executable file
22
setup.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
echo "Copying config files..."
|
||||||
|
cp -r cava dunst fastfetch gtk-3.0 gtk-4.0 hypr hypridle rofi starship tmux waybar yazi ~/.config/
|
||||||
|
|
||||||
|
cp -r bin ~/.local/bin/
|
||||||
|
|
||||||
|
echo "Copying .zshrc..."
|
||||||
|
cp zsh/.zshrc ~/.zshrc
|
||||||
|
|
||||||
|
echo "Cloning dotsh repo..."
|
||||||
|
mkdir -p ~/SideProjects/
|
||||||
|
git clone https://github.com/ad1822/dotsh ~/SideProjects/dotsh
|
||||||
|
|
||||||
|
cd ~/SideProjects/dotsh || exit
|
||||||
|
|
||||||
|
echo "Making scripts executable..."
|
||||||
|
chmod +x *
|
||||||
|
|
||||||
|
echo "Setup complete!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue