diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index e515561..90ff018 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -17,6 +17,7 @@ $terminal = kitty $fastTerminal = kitty --single-instance $fileManager = thunar $menu = $HOME/.config/rofi/launchers/type-1/launcher.sh & swaync-client -cp +$recorder = $HOME/.config/rofi/scripts/dmenu_recorder.sh $browser = env GTK_THEME=Adwaita:light zen-browser $privateBrowser = env GTK_THEME=Adwaita:light zen-browser --private-window $notificationCenter = pkill rofi & swaync-client -t -sw || notify-send --hint int:transient:1 "Error SwayNC is down" @@ -328,6 +329,7 @@ bind = $mainMod, Q, exec, $browser bind = $mainMod SHIFT, Q, exec, $privateBrowser bind = $mainMod, Backslash, exec, $fastTerminal bind = $mainMod, Space, exec, pkill rofi || $menu +bind = $mainMod, G, exec, pkill rofi || $recorder bind = $mainMod, N, exec, $notificationCenter # Open floating terminal diff --git a/hypr/privacy.conf b/hypr/privacy.conf index 2dbd9e8..9bb1ce5 100644 --- a/hypr/privacy.conf +++ b/hypr/privacy.conf @@ -3,6 +3,7 @@ windowrule = tag +privacy,class:^(Element)$ windowrule = tag +privacy,class:^(vesktop)$ windowrule = tag +privacy,class:^(com.github.hluk.copyq)$ windowrule = tag +privacy,class:^(org.keepassxc.KeePassXC)$ +windowrule = tag +privacy,class:^(otpclient)$ windowrule = tag +privacy,class:^(com.nextcloud.desktopclient.nextcloud)$ windowrule = tag +privacy,title:^(diary)$ windowrule = tag +privacy,class:thunar,title:.*(Downloads|Telegram Desktop).* diff --git a/rofi/launchers/type-1/launcher.sh b/rofi/launchers/type-1/launcher.sh index f193aa4..886cdc3 100755 --- a/rofi/launchers/type-1/launcher.sh +++ b/rofi/launchers/type-1/launcher.sh @@ -16,4 +16,5 @@ ln -s $image /tmp/rofi-img.png rofi \ -modes drun,run,calc \ -show drun \ - -theme /tmp/rofi-theme.rasi + -theme /tmp/rofi-theme.rasi \ + -drun-use-desktop-cache diff --git a/rofi/launchers/type-1/style-7.rasi b/rofi/launchers/type-1/style-7.rasi index 923bbcb..8cf467c 100644 --- a/rofi/launchers/type-1/style-7.rasi +++ b/rofi/launchers/type-1/style-7.rasi @@ -158,7 +158,8 @@ element { spacing: 15px; padding: 8px; border-radius: 10px; - background-color: transparent; + background-color: @background-button; + border-color: @button-shape-top; text-color: @foreground; cursor: pointer; } diff --git a/rofi/scripts/dmenu_recorder.sh b/rofi/scripts/dmenu_recorder.sh new file mode 100755 index 0000000..1011dcf --- /dev/null +++ b/rofi/scripts/dmenu_recorder.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# Check if wf-recorder is already running +if pgrep -x "wf-recorder" > /dev/null; then + current_file=$(ps -o args= -C wf-recorder | head -n1 | grep -oE '[^ ]+\.mp4' | tail -n1) + + pkill -2 wf-recorder + sleep 1 + # Force kill if still running + pkill wf-recorder 2>/dev/null + exit 0 +fi + +datetime=$(date +"%d.%m.%Y %H:%M:%S") + +mode=$(echo -e "動画のみ\nマイク\nシステムの音\n全面的" | rofi \ + -modes drun,run,calc \ + -dmenu -p "ビデオ録画モードを選択 " \ + -theme "$HOME/.config/rofi/styles/style-recorder.rasi" \ + -markup-rows \ + -drun-use-desktop-cache \ +) + +if [[ -z "$mode" ]]; then + notify-send --hint int:transient:1 -t 1000 "Recorder" "Aborting" + exit 1 +fi + +wf-recorder -c libx264rgb -r 30 -a --audio-backend=pipewire -f "$HOME/Videos/$datetime.mkv" +notify-send --hint int:transient:1 -t 1000 "Recorder" "Video saved as $datetime.mkv" diff --git a/rofi/styles/style-recorder.rasi b/rofi/styles/style-recorder.rasi new file mode 100644 index 0000000..dc547a8 --- /dev/null +++ b/rofi/styles/style-recorder.rasi @@ -0,0 +1,127 @@ +* { + background: #1c1c1cc0; + background-alt: #303030ff; + button-shape-top: #505050ff; + button-shape-bottom: #303030ff; + background-button: #2e2d31ff; + background-input: #1c1c1cc0; + border: #48535Ccf; + foreground: #FFe8EE; + selected: #9E2238dd; + selected-shine: #CE5268dd; + active: #9E2238; + urgent: #D14781; + background-color: @background; + border-color: White; + text-color: @foreground; + font: "JetBrains Mono Nerd Font 10"; +} +window { + anchor: north; + location: north; + y-offset: 15px; + width: 480px; + height: 100px; + padding: 6px; + children: [ mainbox ]; + border: 1px; + border-radius: 15px; + border-color: @border; +} + +mainbox { + orientation: vertical; + spacing: 10px; + children: [ inputbox, listview ]; +} + +inputbox { + orientation: horizontal; + children: [ imagebox, contentbox ]; +} + +imagebox { + orientation: vertical; + expand: false; + width: 38px; + vertical-align: 0.5; + border-radius: 100px; + margin: 5px; + background-color: @active; + +} + +contentbox { + orientation: horizontal; + expand: true; + children: [prompt, entry]; +} + +mode-switcher{ + enabled: true; + spacing: 20px; + background-color: transparent; + text-color: @foreground; +} + +listview { + enabled: true; + columns: 1; + lines: 4; + cycle: true; + dynamic: true; + scrollbar: false; + layout: horizontal; + reverse: false; + fixed-height: false; + fixed-columns: true; + + spacing: 10px; + background-color: transparent; + text-color: @foreground; + cursor: "default"; + font: "JetBrains Mono Nerd Font 10"; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 15px; + width: 22.5%; + padding: 8px; + border-radius: 10px; + text-color: @foreground; + cursor: pointer; + background-color: @background-button; + border-color: @button-shape-top; + border: 1px 0 0 0; +} + +element selected.normal { + background-color: @active; + text-color: @foreground; + border-color: @selected-shine; + border: 1px 0 0 0; +} + +element-text { + vertical-align: 0.5; + horizontal-align: 0.5; +} + +prompt { + vertical-align: 0.5; +} + +entry { + vertical-align: 0.5; +} + +element selected { + background-color: @selected; +} + +element-text, element-icon { + background-color: transparent; + text-color: inherit; +}