Bug fixes from quality and security audits: - moonarch-capsnote: use value[0] instead of value[2] - moonarch-btnote: guard empty PER_INT before integer comparison - moonarch-clipboard + niri config: use XDG_RUNTIME_DIR instead of UID 1000 - moonarch-waybar-hidpp: use charging icon when charging - moonarch-waybar-gpustat: find gpu_busy_percent dynamically across hwmon* - post-install/transform: use systemctl --user cat for service detection - post-install/transform: install paru from [extra] instead of AUR clone Replace wlogout with moonset in niri keybind and waybar on-click. Remove moonarch-session (dead code, replaced by moonset) and wlogout layout config.
27 lines
677 B
Bash
Executable File
27 lines
677 B
Bash
Executable File
#!/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="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/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
|