.
This commit is contained in:
1 parent
9ab0307538
commit
3fd5fcc825
15 files changed
+433
-209
No files matched your search
@@ -6,12 +6,12 @@ DIR=$HOME/.cache
|
||||
STATUS_FILE="$DIR/touchpad.status"
|
||||
|
||||
# For Notification icon
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
notif="$HOME/dotfiles/swaync/images/bell.png"
|
||||
iDIR="$HOME/dotfiles/swaync/icons"
|
||||
|
||||
# Scripts DIR
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
UserSCRIPTSDIR="$HOME/.config/hypr/UserScripts"
|
||||
SCRIPTSDIR="$HOME/dotfiles/hypr/scripts"
|
||||
UserSCRIPTSDIR="$HOME/dotfiles/hypr/UserScripts"
|
||||
linker="$SCRIPTSDIR/RunCMD.sh linker"
|
||||
|
||||
|
||||
@@ -39,30 +39,17 @@ SWWW_PARAMS1="--transition-fps $FPS1 --transition-type $TYPE1 --transition-durat
|
||||
|
||||
# For Keyboard Layout Switcher
|
||||
layout_f="$HOME/.cache/kb_layout"
|
||||
settings_file="$HOME/.config/hypr/UserConfigs/UserSettings.conf"
|
||||
settings_file="$HOME/dotfiles/hypr/UserConfigs/UserSettings.conf"
|
||||
|
||||
|
||||
# For Quickedit
|
||||
configs="$HOME/.config/hypr/configs"
|
||||
UserConfigs="$HOME/.config/hypr/UserConfigs"
|
||||
|
||||
|
||||
# For TODO
|
||||
file="$HOME/Documents/Notes/.rofi_todo"
|
||||
touch "$file"
|
||||
prompt="Add/delete a task: "
|
||||
height=$(wc -l "$file" | awk '{print $1}')
|
||||
|
||||
configs="$HOME/dotfiles/hypr/configs"
|
||||
UserConfigs="$HOME/dotfiles/hypr/UserConfigs"
|
||||
|
||||
# For Waybar Layout
|
||||
config_dir="$HOME/.config/waybar/configs"
|
||||
waybar_config="$HOME/.config/waybar/config"
|
||||
config_dir="$HOME/dotfiles/waybar/configs"
|
||||
waybar_config="$HOME/dotfiles/waybar/config"
|
||||
RunCMD="$SCRIPTSDIR/RunCMD.sh"
|
||||
|
||||
|
||||
# For Note
|
||||
NOTES_AUTHOR="$(whoami)"
|
||||
NOTES_FOLDER="$HOME/Documents/Notes"
|
||||
NOTES_EDITOR="kitty --class fly_is_kitty -e nvim"
|
||||
|
||||
|
||||
@@ -128,6 +128,179 @@ lock_screen() {
|
||||
}
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Volume Controller #
|
||||
# #
|
||||
######################################
|
||||
|
||||
volume() {
|
||||
get_volume() {
|
||||
volume=$(pamixer --get-volume)
|
||||
if [[ "$volume" -eq "0" ]]; then
|
||||
echo "Muted"
|
||||
else
|
||||
echo "$volume%"
|
||||
fi
|
||||
}
|
||||
get_icon() {
|
||||
current=$(get_volume)
|
||||
if [[ "$current" == "Muted" ]]; then
|
||||
echo "$iDIR/volume-mute.png"
|
||||
elif [[ "${current%\%}" -le 30 ]]; then
|
||||
echo "$iDIR/volume-low.png"
|
||||
elif [[ "${current%\%}" -le 60 ]]; then
|
||||
echo "$iDIR/volume-mid.png"
|
||||
else
|
||||
echo "$iDIR/volume-high.png"
|
||||
fi
|
||||
}
|
||||
notify_user() {
|
||||
if [[ "$(get_volume)" == "Muted" ]]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: Muted"
|
||||
else
|
||||
notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: $(get_volume)"
|
||||
fi
|
||||
}
|
||||
inc_volume() {
|
||||
if [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify_user
|
||||
fi
|
||||
pamixer -i 5 && notify_user
|
||||
}
|
||||
dec_volume() {
|
||||
if [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify_user
|
||||
fi
|
||||
pamixer -d 5 && notify_user
|
||||
}
|
||||
toggle_mute() {
|
||||
if [ "$(pamixer --get-mute)" == "false" ]; then
|
||||
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
|
||||
elif [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify-send -e -u low -i "$(get_icon)" "Volume Switched ON"
|
||||
fi
|
||||
}
|
||||
toggle_mic() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
|
||||
pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
|
||||
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
|
||||
fi
|
||||
}
|
||||
get_mic_icon() {
|
||||
current=$(pamixer --default-source --get-volume)
|
||||
if [[ "$current" -eq "0" ]]; then
|
||||
echo "$iDIR/microphone-mute.png"
|
||||
else
|
||||
echo "$iDIR/microphone.png"
|
||||
fi
|
||||
}
|
||||
get_mic_volume() {
|
||||
volume=$(pamixer --default-source --get-volume)
|
||||
if [[ "$volume" -eq "0" ]]; then
|
||||
echo "Muted"
|
||||
else
|
||||
echo "$volume%"
|
||||
fi
|
||||
}
|
||||
notify_mic_user() {
|
||||
volume=$(get_mic_volume)
|
||||
icon=$(get_mic_icon)
|
||||
notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" "Mic-Level: $volume"
|
||||
}
|
||||
inc_mic_volume() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer --default-source -u && notify_mic_user
|
||||
fi
|
||||
pamixer --default-source -i 5 && notify_mic_user
|
||||
}
|
||||
dec_mic_volume() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer --default-source -u && notify_mic_user
|
||||
fi
|
||||
pamixer --default-source -d 5 && notify_mic_user
|
||||
}
|
||||
if [[ "$1" == "--get" ]]; then
|
||||
get_volume
|
||||
elif [[ "$1" == "--inc" ]]; then
|
||||
inc_volume
|
||||
elif [[ "$1" == "--dec" ]]; then
|
||||
dec_volume
|
||||
elif [[ "$1" == "--toggle" ]]; then
|
||||
toggle_mute
|
||||
elif [[ "$1" == "--toggle-mic" ]]; then
|
||||
toggle_mic
|
||||
elif [[ "$1" == "--get-icon" ]]; then
|
||||
get_icon
|
||||
elif [[ "$1" == "--get-mic-icon" ]]; then
|
||||
get_mic_icon
|
||||
elif [[ "$1" == "--mic-inc" ]]; then
|
||||
inc_mic_volume
|
||||
elif [[ "$1" == "--mic-dec" ]]; then
|
||||
dec_mic_volume
|
||||
else
|
||||
get_volume
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
############################################################
|
||||
# #
|
||||
# Brightness Controller both keyboard & screen #
|
||||
# #
|
||||
############################################################
|
||||
|
||||
brightness() {
|
||||
notification_timeout=1000
|
||||
get_backlight() {
|
||||
echo $(brightnessctl -m | cut -d, -f4)
|
||||
}
|
||||
get_kbd_backlight() {
|
||||
brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4 | tr -d '%'
|
||||
}
|
||||
get_icon() {
|
||||
current=$(get_backlight | sed 's/%//')
|
||||
[ "$current" -le "20" ] && icon="$iDIR/brightness-20.png" ||
|
||||
[ "$current" -le "40" ] && icon="$iDIR/brightness-40.png" ||
|
||||
[ "$current" -le "60" ] && icon="$iDIR/brightness-60.png" ||
|
||||
[ "$current" -le "80" ] && icon="$iDIR/brightness-80.png" ||
|
||||
icon="$iDIR/brightness-100.png"
|
||||
}
|
||||
notify_user() {
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness: $current%"
|
||||
}
|
||||
change_backlight() {
|
||||
brightnessctl set "$1" && get_icon && notify_user
|
||||
}
|
||||
change_kbd_backlight() {
|
||||
brightnessctl -d '*::kbd_backlight' set "$1" && get_icon && notify_user
|
||||
}
|
||||
case "$1" in
|
||||
"--get")
|
||||
get_backlight
|
||||
;;
|
||||
"--inc")
|
||||
change_backlight "+5%"
|
||||
;;
|
||||
"--dec")
|
||||
change_backlight "5%-"
|
||||
;;
|
||||
"--get-kbd")
|
||||
get_kbd_backlight
|
||||
;;
|
||||
"--inc-kbd")
|
||||
change_kbd_backlight "+30%"
|
||||
;;
|
||||
"--dec-kbd")
|
||||
change_kbd_backlight "30%-"
|
||||
;;
|
||||
*)
|
||||
get_backlight
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Battery Notifer #
|
||||
|
||||
@@ -271,7 +271,7 @@ ln_success=false # Initialize a flag to determine if the ln command was execute
|
||||
for cache_file in "${monitor_outputs[@]}"; do # Loop through monitor outputs
|
||||
if [ -f "$cache_file" ]; then # Check if the cache file exists for the current monitor output
|
||||
wallpaper_path=$(<"$cache_file") # Get the wallpaper path from the cache file
|
||||
if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then # Copy the wallpaper to the location Rofi can access
|
||||
if ln -sf "$wallpaper_path" "$HOME/dotfiles/rofi/.current_wallpaper"; then # Copy the wallpaper to the location Rofi can access
|
||||
ln_success=true # Set the flag to true upon successful execution
|
||||
break # Exit the loop after processing the first found monitor output
|
||||
fi
|
||||
@@ -373,3 +373,18 @@ while read -r line; do # Read the playerctl o/p via its fifo pipe
|
||||
fi
|
||||
done < $playerctl_waybar_pipe
|
||||
}
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Cursor Zoom #
|
||||
# #
|
||||
######################################
|
||||
|
||||
cz() {
|
||||
if [ $(hyprctl -j getoption misc:cursor_zoom_factor | jq '.float' | sed 's/\..*$//') == 1 ]; then
|
||||
$(hyprctl keyword misc:cursor_zoom_factor 2) &> /dev/null
|
||||
else
|
||||
$(hyprctl keyword misc:cursor_zoom_factor 1) &> /dev/null
|
||||
fi
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/.config/hypr/scripts/Ref.sh
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
# Note: You can add more options below with the following format:
|
||||
@@ -40,7 +40,7 @@ declare -A menu_options=(
|
||||
#System
|
||||
["qq Shutdown"]="$RunCMD sys_poweroff"
|
||||
["rr Reboot"]="$RunCMD sys_reboot"
|
||||
["pm Powermenu"]="$RunCMD powermenu"
|
||||
["SS Wlogout"]="wlogout"
|
||||
["cn Close Notifactions"]="swaync-client -C"
|
||||
["dm0 disable monitor"]="$RunCMD disable_edp1"
|
||||
["dm1 enable monitor"]="$RunCMD enable_edp1"
|
||||
@@ -57,6 +57,7 @@ declare -A menu_options=(
|
||||
["vi Nvim"]="kitty nvim"
|
||||
["yz Yazi"]="kitty yazi"
|
||||
["cd Codium"]="codium --disable-gpu"
|
||||
["tg Telegram"]="telegram-desktop"
|
||||
)
|
||||
|
||||
# Main function
|
||||
|
||||
Reference in new issue
Block a user