feat: add screen recorder functionality with Rofi menu integration;
feat: add OTP client to privacy window rules; refactor: improve Rofi element styling with background and border colors; refactor: enable desktop cache in Rofi launcher for faster startup; chore: add new recorder script and theme files to Rofi configuration
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
30
rofi/scripts/dmenu_recorder.sh
Executable file
30
rofi/scripts/dmenu_recorder.sh
Executable file
@@ -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"
|
||||
127
rofi/styles/style-recorder.rasi
Normal file
127
rofi/styles/style-recorder.rasi
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user