-
Notifications
You must be signed in to change notification settings - Fork 90
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
New features for clipdel #100
Changes from all commits
f2c6cd8
e49734f
76f5749
8505ff5
3dd7512
b23c3ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,9 @@ if [[ "$CM_LAUNCHER" == rofi-script ]]; then | |
# shellcheck disable=SC2124 | ||
chosen_line="${@: -1}" | ||
fi | ||
elif [[ ! -t 1 ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I think this seems good, but it should likely be implemented by a flag rather than by checking if stdout is connected to a terminal. Otherwise I worry this feature is too hard to turn off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean, like Currently "all arguments are passed through to dmenu itself" ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think with the comment below, this can be done reasonably as it is in mpdmenu :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, are you suggesting we change the way arguments are handled to make it
Wouldn't it break current workflows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'd argue that having selection passed through a pipe or redirected to a file would be the expected behavior when using *nix tools. Why would someone run something like The only flaw I see in this implementation is that what is printed is the content in |
||
list_clips | "$CM_LAUNCHER" -l "${CM_HISTLENGTH}" "$@" | ||
exit | ||
else | ||
chosen_line=$( | ||
list_clips | "$CM_LAUNCHER" -l "${CM_HISTLENGTH}" "$@" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this logic a bit hard to reason about. Can it be implemented with slicing and a for loop instead? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so everything after a
--
is read as a pattern. E.g.:clipdel --all
: will delete all entriesclipdel -- --all
: will delete all entries matching--all
clipdel pattern1 -- pattern2
will fail due to excessive arguments.Sorry, I don't understand what you mean by "be implemented with slicing and a for loop instead". Could you give me a quick draft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I'm talking about something like this: https://github.com/cdown/mpdmenu/blob/master/mpdmenu#L36-L40