diff --git a/config/hypr/UserConfigs/Laptops.conf b/config/hypr/UserConfigs/Laptops.conf index 3eddf52d..03c3d2d1 100644 --- a/config/hypr/UserConfigs/Laptops.conf +++ b/config/hypr/UserConfigs/Laptops.conf @@ -8,12 +8,12 @@ $RunCMD = $scriptsDir/RunCMD.sh $UserConfigs = $HOME/dotfiles/hypr/UserConfigs #VolumeControl -bindle = ,XF86MonBrightnessUp, exec, swayosd-client --brightness=raise 5 -bindle = ,XF86MonBrightnessDown, exec, swayosd-client --brightness=lower 5 -bindle = ,XF86AudioRaiseVolume, exec, swayosd-client --output-volume 5 -bindle = ,XF86AudioLowerVolume, exec, swayosd-client --output-volume -5 -bindle = ,XF86AudioMute, exec, swayosd-client --output-volume mute-toggle -bindle = ,XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle # Mic mute key +bindle = ,XF86MonBrightnessUp, exec, $RunCMD brightness --inc +bindle = ,XF86MonBrightnessDown, exec, $RunCMD brightness --dec +bindle = ,XF86AudioRaiseVolume, exec, $RunCMD volume --inc +bindle = ,XF86AudioLowerVolume, exec, $RunCMD volume --dec +bindle = ,XF86AudioMute, exec, $RunCMD volume --toggle +bindle = ,XF86AudioMicMute, exec, $RunCMD volume --toggle-mic #bind = ,XF86MonBrightnessUp, exec, brightnessctl set +5% #bind = ,XF86MonBrightnessDown, exec, brightnessctl set 5%- #bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5 # Volume Higher key diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index fc044019..2f10757c 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -60,27 +60,6 @@ bind = $mainMod, H, exec, killall -SIGUSR1 waybar # ScreenShot -bind = $mainMod, Z, exec, grim -g "$(slurp)" - | tee ~/Pictures/"$(date '+%d-%b_%H-%M-%S')_${RANDOM}".png | wl-copy -bind = ,Print, exec, grim - | tee ~/Pictures/"$(date '+%d-%b_%H-%M-%S')_${RANDOM}".png | wl-copy +bind = $mainMod, Z, exec, $RunCMD screenshot --area +bind = ,Print, exec, $RunCMD screenshot --now - - -# ags related -#bind = CTRL SHIFT, R, exec, pkill ags ; ags -# -#bind = SUPER, R, exec, ags toggle-window applauncher__window -# -#bind = SUPER_SHIFT, W, exec, ags toggle-window wallpaper-picker__window # wallpaper picker -# -#bind = CTRL ALT, R, exec, ags -r "recorder.start()" # Recorder -# -#bind = $mainMod, Z, exec, ags -r "recorder.screenshot()" # Partial -#bind = ,Print, exec, ags -r "recorder.screenshot(true)" # Full -# -#bind = ,Caps_Lock, exec, ags -r 'update_capslock()' -# -#bind = $mainMod, escape, exec, ags -t powermenu__window # PowerMenu -#bind = $mainMod Caps_Lock, H, exec, ags -r 'moveBar("left")' -#bind = $mainMod Caps_Lock, J, exec, ags -r 'moveBar("bottom")' -#bind = $mainMod Caps_Lock, K, exec, ags -r 'moveBar("top")' -#bind = $mainMod Caps_Lock, L, exec, ags -r 'moveBar("right")' diff --git a/config/hypr/UserConfigs/UserSettings.conf b/config/hypr/UserConfigs/UserSettings.conf index 0489e023..6a8441c2 100644 --- a/config/hypr/UserConfigs/UserSettings.conf +++ b/config/hypr/UserConfigs/UserSettings.conf @@ -58,23 +58,17 @@ decoration { } animations { - enabled = yes - - bezier = wind, 0.05, 0.9, 0.1, 1.05 - bezier = winIn, 0.1, 1.1, 0.1, 1.1 - bezier = winOut, 0.3, -0.3, 0, 1 - bezier = liner, 1, 1, 1, 1 - - animation = windows, 1, 6, wind, slide - animation = windowsIn, 1, 6, winIn, slide - animation = windowsOut, 1, 5, winOut, slide - animation = windowsMove, 1, 5, wind, slide - animation = border, 1, 1, liner - animation = borderangle, 1, 180, liner, loop #used by rainbow borders and rotating colors - animation = fade, 1, 10, default - animation = workspaces, 1, 5, wind + enabled = true + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 9, default } + input { kb_layout=us,np kb_variant = diff --git a/config/hypr/assets/brightness.svg b/config/hypr/assets/brightness.svg new file mode 100644 index 00000000..85c44c1d --- /dev/null +++ b/config/hypr/assets/brightness.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/hypr/assets/microphone-mute.png b/config/hypr/assets/microphone-mute.png new file mode 100755 index 00000000..1780e330 Binary files /dev/null and b/config/hypr/assets/microphone-mute.png differ diff --git a/config/hypr/assets/microphone.png b/config/hypr/assets/microphone.png new file mode 100755 index 00000000..d1b6d767 Binary files /dev/null and b/config/hypr/assets/microphone.png differ diff --git a/config/hypr/assets/music.png b/config/hypr/assets/music.png old mode 100755 new mode 100644 diff --git a/config/hypr/assets/rofi.png b/config/hypr/assets/rofi.png deleted file mode 100644 index 5006cee7..00000000 Binary files a/config/hypr/assets/rofi.png and /dev/null differ diff --git a/config/hypr/assets/screenshot.svg b/config/hypr/assets/screenshot.svg new file mode 100644 index 00000000..342a4a67 --- /dev/null +++ b/config/hypr/assets/screenshot.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/config/hypr/assets/timer.png b/config/hypr/assets/timer.png new file mode 100755 index 00000000..420d1f15 Binary files /dev/null and b/config/hypr/assets/timer.png differ diff --git a/config/hypr/assets/volume-high.png b/config/hypr/assets/volume-high.png new file mode 100755 index 00000000..200f17b2 Binary files /dev/null and b/config/hypr/assets/volume-high.png differ diff --git a/config/hypr/assets/volume-low.png b/config/hypr/assets/volume-low.png new file mode 100755 index 00000000..17cfff78 Binary files /dev/null and b/config/hypr/assets/volume-low.png differ diff --git a/config/hypr/assets/volume-mid.png b/config/hypr/assets/volume-mid.png new file mode 100755 index 00000000..1a3ad3a3 Binary files /dev/null and b/config/hypr/assets/volume-mid.png differ diff --git a/config/hypr/assets/volume-mute.png b/config/hypr/assets/volume-mute.png new file mode 100755 index 00000000..0b9b0c3c Binary files /dev/null and b/config/hypr/assets/volume-mute.png differ diff --git a/config/hypr/scripts/Device_cmd.sh b/config/hypr/scripts/Device_cmd.sh index 2b429c1e..8c3f2f08 100755 --- a/config/hypr/scripts/Device_cmd.sh +++ b/config/hypr/scripts/Device_cmd.sh @@ -12,21 +12,24 @@ source "$CONFIG_FILE" ###################################### toggle_touchpad() { - local status_file="$STATUS_FILE" - local action + local status_file="$STATUS_FILE" + local action - if [[ ! -e "$status_file" ]] || ! $(<"$status_file"); then - echo "1" > "$status_file" - action="enabled" - else - echo "0" > "$status_file" - action="disabled" - fi + # Toggle the status in the status file + if [[ ! -e "$status_file" ]] || [[ $(<"$status_file") -eq 0 ]]; then + echo "1" > "$status_file" + action="enabled" + else + echo "0" > "$status_file" + action="disabled" + fi - notify-send -u low -i "$notif" "Touchpad $action" - hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" "$(cat "$status_file")" + # Notify the user and update the touchpad status + notify-send -u low -i "$notif" "Touchpad $action" + hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" "$(cat "$status_file")" } + ###################################### # # # Toggle wifi state # diff --git a/config/hypr/scripts/Ref.sh b/config/hypr/scripts/Ref.sh index 6e3a2963..135cc297 100755 --- a/config/hypr/scripts/Ref.sh +++ b/config/hypr/scripts/Ref.sh @@ -1,7 +1,7 @@ #!/bin/bash # For TouchPad -HYPRLAND_DEVICE="dll07a7:01-044e:120b" +HYPRLAND_DEVICE="dll07a7:01-044e:120b-touchpad" DIR=$HOME/.cache STATUS_FILE="$DIR/touchpad.status" @@ -45,3 +45,4 @@ config_dir="$HOME/dotfiles/waybar/configs" waybar_config="$HOME/dotfiles/waybar/config" RunCMD="$SCRIPTSDIR/RunCMD.sh" +iDIR="$HOME/dotfiles/hypr/assets" diff --git a/config/hypr/scripts/RunCMD.sh b/config/hypr/scripts/RunCMD.sh index 6d86288b..0a6be514 100755 --- a/config/hypr/scripts/RunCMD.sh +++ b/config/hypr/scripts/RunCMD.sh @@ -5,7 +5,7 @@ source ~/dotfiles/hypr/scripts/Device_cmd.sh source ~/dotfiles/hypr/scripts/Rofi_cmd.sh source ~/dotfiles/hypr/scripts/System_cmd.sh source ~/dotfiles/hypr/scripts/Music_cmd.sh - +source ~/dotfiles/hypr/scripts/Util.sh help() { declare -F diff --git a/config/hypr/scripts/Util.sh b/config/hypr/scripts/Util.sh new file mode 100755 index 00000000..773da8c2 --- /dev/null +++ b/config/hypr/scripts/Util.sh @@ -0,0 +1,168 @@ +#!/bin/bash + +# Source the configuration file. +CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh +source "$CONFIG_FILE" + +brightness() { + local notification_timeout=1000 + + get_backlight() { + brightnessctl -m | cut -d, -f4 + } + + get_icon() { + local current=$(get_backlight | sed 's/%//') + echo "$iDIR/brightness.svg" + } + + notify_user() { + local current=$(get_backlight | sed 's/%//') + local icon=$(get_icon) + 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" && notify_user + } + + case "$1" in + --get) get_backlight ;; + --inc) change_backlight "+10%" ;; + --dec) change_backlight "10%-" ;; + *) get_backlight ;; + esac +} + +volume() { + get_volume() { + local volume=$(pamixer --get-volume) + [[ "$volume" -eq "0" ]] && echo "Muted" || echo "$volume%" + } + + get_icon() { + local 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() { + local volume=$(get_volume) + local icon=$(get_icon) + if [[ "$volume" == "Muted" ]]; then + notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$icon" "Volume: Muted" + else + notify-send -e -h int:value:"${volume%\%}" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$icon" "Volume: $volume" + fi + } + + change_volume() { + pamixer "$1" "$2" && notify_user + } + + toggle_mute() { + if pamixer --get-mute; then + pamixer -u && notify-send -e -u low -i "$(get_icon)" "Volume Switched ON" + else + pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF" + fi + } + + toggle_mic() { + if pamixer --default-source --get-mute; then + pamixer --default-source -u && notify-send -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON" + else + pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" + fi + } + + notify_mic_user() { + local volume=$(pamixer --default-source --get-volume) + local icon=$(pamixer --default-source --get-mute && echo "$iDIR/microphone-mute.png" || echo "$iDIR/microphone.png") + notify-send -e -h int:value:"$volume" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$icon" "Mic-Level: $volume%" + } + + change_mic_volume() { + pamixer --default-source "$1" "$2" && notify_mic_user + } + + case "$1" in + --get) get_volume ;; + --inc) change_volume -i 5 ;; + --dec) change_volume -d 5 ;; + --toggle) toggle_mute ;; + --toggle-mic) toggle_mic ;; + --mic-inc) change_mic_volume -i 5 ;; + --mic-dec) change_mic_volume -d 5 ;; + *) get_volume ;; + esac +} + +screenshot() { + local notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/screenshot.svg" + local time=$(date "+%d-%b_%H-%M-%S") + local dir="$(xdg-user-dir)/Pictures/Screenshots" + local file="Screenshot_${time}_${RANDOM}.png" + local active_window_path="${dir}/Screenshot_${time}_$(hyprctl -j activewindow | jq -r '.class').png" + + notify_view() { + local msg="Screenshot Saved." + [[ "$1" == "active" && ! -e "$active_window_path" ]] && msg="Screenshot NOT Saved." + $notify_cmd_shot "$msg" + } + + countdown() { + for ((sec=$1; sec>0; sec--)); do + notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR/timer.png" "Taking shot in: $sec" + sleep 1 + done + } + + take_shot() { + cd "$dir" && grim - | tee "$file" | wl-copy + sleep 2 + notify_view "$1" + } + + shot_timer() { + countdown "$1" + sleep 1 + take_shot "$2" + } + + shotarea() { + local tmpfile=$(mktemp) + local area=$(slurp) + [[ -z "$area" ]] && { notify-send -u low -i "$iDIR/picture.png" 'No area selected'; rm "$tmpfile"; return; } + grim -g "$area" - > "$tmpfile" && [[ -s "$tmpfile" ]] && { + wl-copy < "$tmpfile" + mv "$tmpfile" "$dir/Screenshot_$(date '+%d-%b_%H-%M-%S')_${RANDOM}.png" + notify_view + } + rm "$tmpfile" + } + + shotactive() { + hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "$active_window_path" + sleep 1 + notify_view "active" + } + + [[ ! -d "$dir" ]] && mkdir -p "$dir" + + case "$1" in + --now) take_shot ;; + --in5) shot_timer 5 ;; + --in10) shot_timer 10 ;; + --area) shotarea ;; + --active) shotactive ;; + *) echo "Available Options: --now --in5 --in10 --area --active" ;; + esac +} diff --git a/config/hypr/wallpaper_effects/.wallpaper_current b/config/hypr/wallpaper_effects/.wallpaper_current index 63f5d759..f65904e9 120000 --- a/config/hypr/wallpaper_effects/.wallpaper_current +++ b/config/hypr/wallpaper_effects/.wallpaper_current @@ -1 +1 @@ -/home/sankalp/Pictures/wallpapers/wall-15.png \ No newline at end of file +/home/sankalp/Pictures/wallpapers/wall-27.jpg \ No newline at end of file diff --git a/config/hypr/wallpaper_effects/.wallpaper_modified b/config/hypr/wallpaper_effects/.wallpaper_modified index c44f89a5..4549818d 100644 Binary files a/config/hypr/wallpaper_effects/.wallpaper_modified and b/config/hypr/wallpaper_effects/.wallpaper_modified differ diff --git a/config/swayosd/style.css b/config/swayosd/style.css deleted file mode 100644 index 99c2ec71..00000000 --- a/config/swayosd/style.css +++ /dev/null @@ -1,38 +0,0 @@ -window { - padding: 0; - border-radius: 10px; - border: solid 1px #1b1d1d; - background: alpha(black, 0.75); -} - -#container { - margin: 10px; -} - -image, label { - color: @theme_fg_color; -} - -progressbar:disabled, -image:disabled { - opacity: 0.5; -} - -progressbar { - min-height: 5px; - border-radius: 999px; - background: transparent; - border: none; -} -trough { - min-height: inherit; - border-radius: inherit; - border: none; - background: alpha(@theme_fg_color, 0.5); -} -progress { - min-height: inherit; - border-radius: inherit; - border: none; - background: @theme_fg_color; -} diff --git a/setup b/setup index 90139c14..954c80ac 100755 --- a/setup +++ b/setup @@ -94,7 +94,6 @@ pkg=( noto-fonts gnu-free-fonts bibata-cursor-theme-bin - swayosd-git ) # Creating a new `packages` array packages=(