From 2ee6f3e0ec2c28b97167105d9ef3acae45c0c78e Mon Sep 17 00:00:00 2001 From: xnm Date: Mon, 6 May 2024 22:44:58 +0300 Subject: [PATCH] changed recorder & fixed clipboard --- README.md | 4 ++-- home/.config/fish/functions/autostart.fish | 2 +- home/.config/fish/functions/check_recording.fish | 8 ++++---- home/.config/fish/functions/clipboard_clear.fish | 5 ++--- .../fish/functions/clipboard_to_type.fish | 2 +- .../fish/functions/record_screen_gif.fish | 16 +++++++++------- .../fish/functions/record_screen_mp4.fish | 14 +++++++------- home/.config/fish/functions/screenshot_edit.fish | 2 +- home/.config/hypr/hyprlock.conf | 2 +- home/.config/waybar/config | 2 +- nixos/environment-variables.nix | 8 -------- nixos/services.nix | 5 ++--- 12 files changed, 31 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 2061594..60a599f 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,9 @@ The showcased images do not reflect the latest version of the system's appearanc | Mimetypes | MPV, Imv, Zathura | | Image Editor | Swappy | | Screenshot | Grim + Slurp | -| Recorder | Wf-recorder | +| Recorder | Wl-screenrec | | Color Picker | Hyprpicker | -| Clipboard | Wl-clipboard + Cliphist + Clipboard-jh | +| Clipboard | Wl-clipboard + Cliphist + Wl-clip-persist | | Idle | Hypridle | | Lock | Hyprlock | | Logout menu | Wlogout | diff --git a/home/.config/fish/functions/autostart.fish b/home/.config/fish/functions/autostart.fish index 7b8f1ff..20a299c 100644 --- a/home/.config/fish/functions/autostart.fish +++ b/home/.config/fish/functions/autostart.fish @@ -1,3 +1,3 @@ function autostart - pypr & hyprpaper & waybar & poweralertd & wl-paste --watch cliphist store & avizo-service & systemctl --user start psi-notify & hypridle -w + pypr & hyprpaper & waybar & poweralertd & wl-paste --type text --watch cliphist store & wl-paste --type image --watch cliphist store & wl-clip-persist --clipboard regular & avizo-service & systemctl --user start psi-notify & hypridle end diff --git a/home/.config/fish/functions/check_recording.fish b/home/.config/fish/functions/check_recording.fish index 816fa17..ecca168 100644 --- a/home/.config/fish/functions/check_recording.fish +++ b/home/.config/fish/functions/check_recording.fish @@ -1,7 +1,7 @@ function check_recording - set target_process "wf-recorder" - - if pgrep $target_process > /dev/null + set target_process wl-screenrec + + if pgrep $target_process >/dev/null echo "{\"text\":\"\", \"tooltip\":\"Recording\", \"alt\":\"Recording\"}" end -end \ No newline at end of file +end diff --git a/home/.config/fish/functions/clipboard_clear.fish b/home/.config/fish/functions/clipboard_clear.fish index 2d970c3..91d39d8 100644 --- a/home/.config/fish/functions/clipboard_clear.fish +++ b/home/.config/fish/functions/clipboard_clear.fish @@ -1,5 +1,4 @@ function clipboard_clear rm "$HOME/.cache/cliphist/db" - cb clr -a - dunstify "Clipboard" "Cleared" -t 2000 -end \ No newline at end of file + dunstify Clipboard Cleared -t 2000 +end diff --git a/home/.config/fish/functions/clipboard_to_type.fish b/home/.config/fish/functions/clipboard_to_type.fish index 4f9bee2..ee7c045 100644 --- a/home/.config/fish/functions/clipboard_to_type.fish +++ b/home/.config/fish/functions/clipboard_to_type.fish @@ -1,3 +1,3 @@ function clipboard_to_type cliphist list | rofi -dmenu -p clipboard | cliphist decode | wtype - -end \ No newline at end of file +end diff --git a/home/.config/fish/functions/record_screen_gif.fish b/home/.config/fish/functions/record_screen_gif.fish index 777f6a0..f0bd912 100644 --- a/home/.config/fish/functions/record_screen_gif.fish +++ b/home/.config/fish/functions/record_screen_gif.fish @@ -1,16 +1,18 @@ function record_screen_gif - set target_process "wf-recorder" + set target_process wl-screenrec - if pgrep $target_process > /dev/null + if pgrep $target_process >/dev/null killall -s SIGINT $target_process - cb cp ~/Pictures/Records/(cd ~/Pictures/Records && ls -tA | head -n1 | awk '{print $NF}') - dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (GIF)" -t 2000 else set geometry (slurp) if not [ -z $geometry ] - set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S").gif") + set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S")") dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Started  (GIF)" -t 2000 - wf-recorder -g "$geometry" -f "$HOME/Pictures/Records/$record_name" -c gif -F fps=30 + wl-screenrec -g "$geometry" -f "$HOME/Pictures/Records/$record_name.mp4" --encode-resolution 1920x1080 + ffmpeg -i "$HOME/Pictures/Records/$record_name.mp4" "$HOME/Pictures/Records/$record_name.gif" + rm "$HOME/Pictures/Records/$record_name.mp4" + wl-copy -t text/uri-list file://$HOME/Pictures/Records/$record_name.gif\n + dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (GIF)" -t 2000 end end -end \ No newline at end of file +end diff --git a/home/.config/fish/functions/record_screen_mp4.fish b/home/.config/fish/functions/record_screen_mp4.fish index a47c35a..5872d24 100644 --- a/home/.config/fish/functions/record_screen_mp4.fish +++ b/home/.config/fish/functions/record_screen_mp4.fish @@ -1,16 +1,16 @@ function record_screen_mp4 - set target_process "wf-recorder" + set target_process wl-screenrec - if pgrep $target_process > /dev/null + if pgrep $target_process >/dev/null killall -s SIGINT $target_process - cb cp ~/Videos/Records/(cd ~/Videos/Records && ls -tA | head -n1 | awk '{print $NF}') - dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (MP4)" -t 2000 else set geometry (slurp) if not [ -z $geometry ] - set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S").mp4") + set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S")") dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Started  (MP4)" -t 2000 - wf-recorder -g "$geometry" -f "$HOME/Videos/Records/$record_name" -c h264_vaapi -d /dev/dri/renderD128 + wl-screenrec -g "$geometry" -f "$HOME/Videos/Records/$record_name.mp4" + wl-copy -t text/uri-list file://$HOME/Videos/Records/$record_name.mp4\n + dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (MP4)" -t 2000 end end -end \ No newline at end of file +end diff --git a/home/.config/fish/functions/screenshot_edit.fish b/home/.config/fish/functions/screenshot_edit.fish index 935c5ea..59e3bee 100644 --- a/home/.config/fish/functions/screenshot_edit.fish +++ b/home/.config/fish/functions/screenshot_edit.fish @@ -1,3 +1,3 @@ function screenshot_edit swappy -f ~/Pictures/Screenshots/(cd ~/Pictures/Screenshots && ls -tA | head -n1 | awk '{print $NF}') -end \ No newline at end of file +end diff --git a/home/.config/hypr/hyprlock.conf b/home/.config/hypr/hyprlock.conf index 54ed84e..0da9c7b 100644 --- a/home/.config/hypr/hyprlock.conf +++ b/home/.config/hypr/hyprlock.conf @@ -1,6 +1,6 @@ source = $HOME/.config/hypr/macchiato.conf -$accent = $teal +$accent = 0xb3$tealAlpha $accentAlpha = $tealAlpha $font = JetBrains Mono Regular diff --git a/home/.config/waybar/config b/home/.config/waybar/config index a02eb61..ad73aa2 100644 --- a/home/.config/waybar/config +++ b/home/.config/waybar/config @@ -191,7 +191,7 @@ "custom/recording": { "interval": 1, - "exec-if": "pgrep wf-recorder", + "exec-if": "pgrep wl-screenrec", "exec": "fish -c check_recording", "return-type": "json", }, diff --git a/nixos/environment-variables.nix b/nixos/environment-variables.nix index ad1a3b2..0a47745 100644 --- a/nixos/environment-variables.nix +++ b/nixos/environment-variables.nix @@ -5,12 +5,4 @@ environment.variables.SPOTIFY_PATH = "${pkgs.spotify}/"; environment.variables.JDK_PATH = "${pkgs.jdk11}/"; environment.variables.NODEJS_PATH = "${pkgs.nodePackages_latest.nodejs}/"; - - environment.variables.CI = "1"; - # environment.variables.CLIPBOARD_EDITOR = "hx"; - environment.variables.CLIPBOARD_NOAUDIO = "1"; - # environment.variables.CLIPBOARD_NOGUI = "1"; - # environment.variables.CLIPBOARD_NOPROGRESS = "1"; - # environment.variables.CLIPBOARD_NOREMOTE = "1"; - environment.variables.CLIPBOARD_SILENT = "1"; } diff --git a/nixos/services.nix b/nixos/services.nix index e1dfb03..fb57ac8 100644 --- a/nixos/services.nix +++ b/nixos/services.nix @@ -37,11 +37,10 @@ imagemagick swappy ffmpeg_6-full - # wl-screenrec - wf-recorder + wl-screenrec wl-clipboard + wl-clip-persist cliphist - clipboard-jh xdg-utils wtype wlrctl