Rofi Clipboard-Menü mit Catppuccin-Theme und eigenem Script
Clipboard-History (Super+C) nutzte bisher rofi ohne Theme. Neues clipboard.rasi und moonarch-clipboard Script analog zu den anderen Rofi-Menüs (vpn, volume, session etc.).
This commit is contained in:
parent
c3213cc0ce
commit
3acfe42ece
26
defaults/bin/moonarch-clipboard
Executable file
26
defaults/bin/moonarch-clipboard
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# ABOUTME: Rofi-based clipboard history manager using cliphist and wl-copy.
|
||||||
|
# ABOUTME: Lists clipboard entries and copies the selected one.
|
||||||
|
|
||||||
|
CLIPHIST_DB="/run/user/1000/cliphist/db"
|
||||||
|
|
||||||
|
function start_rofi() {
|
||||||
|
local content="$1"
|
||||||
|
echo -e "$content" | rofi -dmenu -theme /etc/xdg/rofi/themes/clipboard.rasi -mesg " Clipboard History"
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
local entries
|
||||||
|
local result
|
||||||
|
|
||||||
|
entries=$(cliphist -db-path "$CLIPHIST_DB" list)
|
||||||
|
result=$(start_rofi "$entries")
|
||||||
|
|
||||||
|
if [ -n "$result" ]; then
|
||||||
|
echo "$result" | cliphist -db-path "$CLIPHIST_DB" decode | wl-copy
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
@ -121,7 +121,7 @@ window-rule {
|
|||||||
binds {
|
binds {
|
||||||
Mod+Shift+Slash { show-hotkey-overlay; }
|
Mod+Shift+Slash { show-hotkey-overlay; }
|
||||||
|
|
||||||
Super+C hotkey-overlay-title=null { spawn-sh "cliphist -db-path /run/user/1000/cliphist/db list | rofi -dmenu | cliphist -db-path /run/user/1000/cliphist/db decode | wl-copy"; }
|
Super+C hotkey-overlay-title=null { spawn "moonarch-clipboard"; }
|
||||||
|
|
||||||
Alt+W { spawn-sh "killall waybar && waybar &"; }
|
Alt+W { spawn-sh "killall waybar && waybar &"; }
|
||||||
|
|
||||||
|
|||||||
44
defaults/xdg/rofi/themes/clipboard.rasi
Normal file
44
defaults/xdg/rofi/themes/clipboard.rasi
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
configuration {
|
||||||
|
modi: "drun";
|
||||||
|
show-icons: false;
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
}
|
||||||
|
|
||||||
|
@import "../config.rasi"
|
||||||
|
@import "../colors.rasi"
|
||||||
|
|
||||||
|
|
||||||
|
window {
|
||||||
|
enabled: true;
|
||||||
|
cursor: "default";
|
||||||
|
width: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mainbox {
|
||||||
|
children: [ "message", "listview", "inputbar" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
|
||||||
|
children: [ "textbox-prompt-colon", "entry", "mode-switcher" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 10;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
size: 0px;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user