Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(waybar): cliphist only if installed #76

Merged
merged 8 commits into from
Oct 23, 2021
Merged

Conversation

boredland
Copy link
Member

resolves parts of manjaro-sway/manjaro-sway#175

@Mathew-D
Copy link
Contributor

The right click parts works but I would have to uninstall cliphist to try the optional part.

@Mathew-D
Copy link
Contributor

After the purge the cliphist list | wc -l section doesn't seems to update until you restart waybar so it still shows the older amount of items.

@Mathew-D
Copy link
Contributor

cliphist just added a new commit which will allow us to use rofi to select just 1 item from the list instead of just purging the whole list. While we are doing work on it we might want update it and add the option to delete just 1 item so they can remove password and such without remove the whole list.

sentriz/cliphist#18

@boredland boredland force-pushed the feat/optional-cliphist branch 2 times, most recently from 4178d66 to 876e6ce Compare October 23, 2021 15:22
@Mathew-D
Copy link
Contributor

Mathew-D commented Oct 23, 2021

On
``[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && (wl-paste --watch pkill -RTMIN+9 waybar; rm -f ~/.cache/cliphist/db)'
isn't the rm -f ~/.cache/cliphist/db) unneeded as it happens in waybar already?

@boredland
Copy link
Member Author

boredland commented Oct 23, 2021

might want update it

well - it is not released yet and I don't know how to properly integrate it into our $clipboard command... I suppose we do that in another PR as soon as it is released

isn't wl-paste --watch pkill -RTMIN+9 waybar; going to restart waybar

no, pkill -RTMIN+9 waybar is actually a signal call (signal 9) to waybar and thus we don't need to recheck cliphist on an interval, but just listen to the signal 9 and recheck then. this saves us a lot of processor time.

@boredland
Copy link
Member Author

would have to uninstall cliphist to try the optional part

just did that and works.

@boredland
Copy link
Member Author

isn't the rm -f ~/.cache/cliphist/db) unneeded as it happens in waybar already?

My idea was that we could have a cheap way to run it on logout. But that's not working yet.

@Mathew-D
Copy link
Contributor

Mathew-D commented Oct 23, 2021

I don't know how to properly integrate it into our $clipboard command...

I would move the purge to the middle click on waybar and move the delete item on right click. Wouldn't you want to remove one item more often then deleting everything with everything being remove on startup?
and wouldn't something like this do it:

"swaymsg -q exec cliphist list | rofi -dmenu -theme-str $rofi_theme | cliphist delete-stdin"

@boredland
Copy link
Member Author

boredland commented Oct 23, 2021

Wouldn't you want to remove one item more often then deleting everything with everything being remove on startup?

so you propose we remove the whole db on startup now and add the single item deletion as soon as that|s released from cliphist side?

@boredland boredland force-pushed the feat/optional-cliphist branch from 00d486a to 11917b8 Compare October 23, 2021 16:05
@Mathew-D
Copy link
Contributor

Wasn't the purging at startup / shutdown one of the items you wanted to add other then making it optional? Or we could just leave the purge on at middle click and add a note like the following to the readme
To remove the clipboard histroy on startup please add the the following to ~/.cofig/sway/config.d/05-clipboard.conf
rm ~/.cache/cliphist/db

Then we add the remove 1 item after the release.

@boredland boredland force-pushed the feat/optional-cliphist branch from 11917b8 to 4c642c2 Compare October 23, 2021 16:06
@Mathew-D
Copy link
Contributor

Should we use $HOME instead of ~?

@boredland
Copy link
Member Author

boredland commented Oct 23, 2021

ya $HOME works, but probably it does not make a lot of sense as is.

@boredland boredland force-pushed the feat/optional-cliphist branch 2 times, most recently from 150e4fe to d9ab688 Compare October 23, 2021 16:56
@boredland boredland force-pushed the feat/optional-cliphist branch 2 times, most recently from 588911b to f93f007 Compare October 23, 2021 17:16
@boredland boredland force-pushed the feat/optional-cliphist branch 4 times, most recently from 4640ed2 to ff747f5 Compare October 23, 2021 17:29
@boredland
Copy link
Member Author

@Mathew-D I think I found a fine middle ground: you now could opt in to purge on logout by providing set $purge_cliphist_logout true in a definition.

@boredland boredland merged commit 14cc7a2 into sway Oct 23, 2021
@boredland boredland deleted the feat/optional-cliphist branch October 23, 2021 17:45
boredland added a commit that referenced this pull request Apr 17, 2022
* feat(waybar): cliphist only if installed

* feat: purge cliphist before shutdown

* fix: safer check for command

* feat: signallify wl-paste watch

* fix: remove disfunct shutdown removal

* chore: move purge to middle click

* feat: purge on reboot and shutdown and logout

* feat: introduce variable to purge cliphist on logout
boredland added a commit that referenced this pull request May 12, 2022
* feat(waybar): cliphist only if installed

* feat: purge cliphist before shutdown

* fix: safer check for command

* feat: signallify wl-paste watch

* fix: remove disfunct shutdown removal

* chore: move purge to middle click

* feat: purge on reboot and shutdown and logout

* feat: introduce variable to purge cliphist on logout
boredland added a commit that referenced this pull request Aug 11, 2022
* feat(waybar): cliphist only if installed

* feat: purge cliphist before shutdown

* fix: safer check for command

* feat: signallify wl-paste watch

* fix: remove disfunct shutdown removal

* chore: move purge to middle click

* feat: purge on reboot and shutdown and logout

* feat: introduce variable to purge cliphist on logout
boredland added a commit that referenced this pull request Dec 21, 2022
* feat(waybar): cliphist only if installed

* feat: purge cliphist before shutdown

* fix: safer check for command

* feat: signallify wl-paste watch

* fix: remove disfunct shutdown removal

* chore: move purge to middle click

* feat: purge on reboot and shutdown and logout

* feat: introduce variable to purge cliphist on logout
boredland added a commit that referenced this pull request Jul 30, 2023
* feat(waybar): cliphist only if installed

* feat: purge cliphist before shutdown

* fix: safer check for command

* feat: signallify wl-paste watch

* fix: remove disfunct shutdown removal

* chore: move purge to middle click

* feat: purge on reboot and shutdown and logout

* feat: introduce variable to purge cliphist on logout
boredland added a commit that referenced this pull request Nov 26, 2023
* feat(waybar): cliphist only if installed

* feat: purge cliphist before shutdown

* fix: safer check for command

* feat: signallify wl-paste watch

* fix: remove disfunct shutdown removal

* chore: move purge to middle click

* feat: purge on reboot and shutdown and logout

* feat: introduce variable to purge cliphist on logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants