diff --git a/.config/hypr/hyprland/keybinds.conf b/.config/hypr/hyprland/keybinds.conf index c86220d1..98d46c09 100644 --- a/.config/hypr/hyprland/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -53,16 +53,15 @@ bind = Ctrl+Super+Shift,S,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesse bind = Super+Shift, C, exec, hyprpicker -a # Pick color (Hex) >> clipboard # Fullscreen screenshot bindl=,Print,exec,grim - | wl-copy # Screenshot >> clipboard -bindl= Ctrl,Print, exec, mkdir -p ~/Pictures/Screenshots && ~/.config/ags/scripts/grimblast.sh copysave screen ~/Pictures/Screenshots/Screenshot_"$(date '+%Y-%m-%d_%H.%M.%S')".png # Screenshot >> clipboard & file +bindl= Ctrl,Print, exec, mkdir -p ~/Pictures/Screenshots && grimblast copysave screen ~/Pictures/Screenshots/Screenshot_"$(date '+%Y-%m-%d_%H.%M.%S')".png # Screenshot >> clipboard & file # AI bind = Super+Shift+Alt, mouse:273, exec, ~/.config/ags/scripts/ai/primary-buffer-query.sh # Provide AI response for selected text # Recording stuff -bind = Super+Alt, R, exec, ~/.config/ags/scripts/record-script.sh # Record region (no sound) -bind = Ctrl+Alt, R, exec, ~/.config/ags/scripts/record-script.sh --fullscreen # [hidden] Record screen (no sound) -bind = Super+Shift+Alt, R, exec, ~/.config/ags/scripts/record-script.sh --fullscreen-sound # Record screen (with sound) +bind = Super+Alt, R, exec, ~/.config/hypr/hyprland/record-script.sh # Record region (no sound) +bind = Ctrl+Alt, R, exec, ~/.config/hypr/hyprland/record-script.sh --fullscreen # [hidden] Record screen (no sound) +bind = Super+Shift+Alt, R, exec, ~/.config/hypr/hyprland/record-script.sh --fullscreen-sound # Record screen (with sound) ##! Session -bind = Ctrl+Super, L, exec, agsv1 run-js 'lock.lock()' # [hidden] bind = Super, L, exec, loginctl lock-session # Lock bind = Super+Shift, L, exec, loginctl lock-session # [hidden] bindl = Super+Shift, L, exec, sleep 0.1 && systemctl suspend || loginctl suspend # Suspend system @@ -177,8 +176,7 @@ bind = Alt, Tab, bringactivetotop, # [hidden] bring it to the top #! ##! Widgets -bindr = Ctrl+Super, R, exec, killall ags agsv1 gjs ydotool; agsv1 & # Restart widgets -bindr = Ctrl+Super+Alt, R, exec, hyprctl reload; killall agsv1 ydotool; agsv1 & # [hidden] +bindr = Ctrl+Super, R, exec, killall ags agsv1 gjs ydotool qs; qs & # Restart widgets bind = Ctrl+Alt, Slash, exec, agsv1 run-js 'cycleMode();' # Cycle bar mode (normal, focus) bind = Super, Slash, exec, for ((i=0; i<$(hyprctl monitors -j | jq length); i++)); do agsv1 -t "cheatsheet""$i"; done # Show cheatsheet bind = Super, M, exec, agsv1 run-js 'openMusicControls.value = (!mpris.getPlayer() ? false : !openMusicControls.value);' # Toggle music controls @@ -213,7 +211,7 @@ bind = Super, E, exec, nautilus --new-window # Launch file manager (Nautilus) bind = Super, Z, exec, Zed # Launch Zed (editor) bind = Super, C, exec, code # Launch VSCode (editor) bind = Super+Alt, E, exec, thunar # [hidden] -bind = Super, W, exec, google-chrome-stable || firefox # [hidden] Let's not give people (more) reason to shit on my rice +bind = Super, W, exec, zen-browser # [hidden] bind = Ctrl+Super, W, exec, firefox # Launch Firefox (browser) bind = Super, X, exec, gnome-text-editor --new-window # Launch GNOME Text Editor bind = Super+Shift, W, exec, wps # Launch WPS Office diff --git a/.config/hypr/hyprland/record-script.sh b/.config/hypr/hyprland/record-script.sh new file mode 100755 index 00000000..f9dd16dc --- /dev/null +++ b/.config/hypr/hyprland/record-script.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +getdate() { + date '+%Y-%m-%d_%H.%M.%S' +} +getaudiooutput() { + pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2 +} +getactivemonitor() { + hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name' +} + +mkdir -p "$(xdg-user-dir VIDEOS)" +cd "$(xdg-user-dir VIDEOS)" || exit +if pgrep wf-recorder > /dev/null; then + notify-send "Recording Stopped" "Stopped" -a 'record-script.sh' & + pkill wf-recorder & +else + notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'record-script.sh' + if [[ "$1" == "--sound" ]]; then + wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio="$(getaudiooutput)" & disown + elif [[ "$1" == "--fullscreen-sound" ]]; then + wf-recorder -o $(getactivemonitor) --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" & disown + elif [[ "$1" == "--fullscreen" ]]; then + wf-recorder -o $(getactivemonitor) --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t & disown + else + wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown + fi +fi