you need to emerge dev-lang/go, gui-apps/wl-clipboard and gui-apps/rofi-wayland <<< from guru overlay.
additional info howto handle multiple repositories look here: https://forums.gentoo.org/viewtopic-p-8 ... ml#8659032
and download cliphist source code from (you need dev-vcs/git) :
git clone https://github.com/sentriz/cliphist.git
installing cliphist is easy >>> go install go.senan.xyz/cliphist
copy just generated cliphist (bin) from ~/go/bin to /usr/bin
or you can try with downloadable binary at (never tried myself):
download from https://github.com/sentriz/cliphist/releases/tag/v0.5.0
or via go install go.senan.xyz/cliphist@latest
---
entries for sway config:
! thanks to Manjaro - best implementation, imho !
# if-exists autostarts
Code: Select all
exec {
'[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && wl-paste --watch cliphist store'
'[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && wl-paste --watch pkill -RTMIN+9 waybar'
}# Launch // Clipboard ##
Code: Select all
bindsym $mod+y exec $clipboardchange it to whatever available key you want !
# clipboard history
Code: Select all
set $clipboard cliphist list | rofi -dmenu -m -1 -font "Ubuntu Mono Nerd Font 9" -p "Select item to copy" -lines 10 -width 35 | cliphist decode | wl-copy
set $clipboard-del cliphist list | rofi -dmenu -m -1 primary -font "Ubuntu Mono Nerd Font 9" -p "Select item to delete" -lines 10 -width 35 | cliphist delete---
entries for waybar config:
Code: Select all
"custom/clipboard",and (icon hex is f0ea):
Code: Select all
"custom/clipboard": {
"format": "",
"interval": "once",
"return-type": "json",
"on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar",
"on-click-right": "swaymsg -q exec '$clipboard-del'; pkill -RTMIN+9 waybar",
"on-click-middle": "rm -f ~/.cache/cliphist/db; pkill -RTMIN+9 waybar",
"exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
"exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
"signal": 9
},this is my rofi (user) config in .config/rofi/config.rasi:
Code: Select all
configuration {
timeout {
action: "kb-cancel";
delay: 0;
}
filebrowser {
directories-first: true;
sorting-method: "name";
}
}
@import "paper-float"now you get an icon on waybar - middle click will delete the history - it'll look like this:
https://0x0.st/s/lN5FTfA_FzePBGW7zzzKyw/H4Vs.png
sway/waybar sometimes doesn't work correctly after reloading config via mod+shift+c - better restart your computer and you're good to go
EDIT:
this is my first ebuild
Code: Select all
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module git-r3
EGIT_REPO_URI="https://github.com/sentriz/cliphist"
DESCRIPTION="ClipBoard History Manager for Wayland"
HOMEPAGE="https://github.com/sentriz/cliphist"
LICENSE="GPL3"
SLOT="0"
KEYWORDS="~amd64"
BDEPEND=">=dev-lang/go-1.19"
RDEPEND="gui-apps/wl-clipboard x11-misc/xdg-utils"
DEPEND="${RDEPEND}"
RESTRICT+="strip"
src_unpack() {
git-r3_src_unpack
go-module_live_vendor
}
src_compile() {
go build || die
}
src_install() {
dobin cliphist
}placed the ebuild in gui-apps/cliphist/cliphist-9999.ebuild in my local overlay >>> https://wiki.gentoo.org/wiki/Creating_a ... repository
greetings (...programs)

