-
Notifications
You must be signed in to change notification settings - Fork 123
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
added :clip command #117
base: master
Are you sure you want to change the base?
added :clip command #117
Changes from 2 commits
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 |
---|---|---|
|
@@ -72,21 +72,35 @@ checkIfPass () { | |
|
||
autopass () { | ||
x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}') | ||
inclip='false' | ||
clipcontent="" | ||
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 should put both |
||
xset r off | ||
|
||
rm -f "$HOME/.cache/rofi-pass/last_used" | ||
printf '%s\n' "${root}: $selected_password" > "$HOME/.cache/rofi-pass/last_used" | ||
for word in ${stuff["$AUTOTYPE_field"]}; do | ||
case "$word" in | ||
":tab") xdotool key Tab;; | ||
":space") xdotool key space;; | ||
":delay") sleep "${delay}";; | ||
":enter") xdotool key Return;; | ||
":otp") printf '%s' "$(generateOTP)" | xdotool type --clearmodifiers --file -;; | ||
"pass") printf '%s' "${password}" | xdotool type --clearmodifiers --file -;; | ||
*) printf '%s' "${stuff[${word}]}" | xdotool type --clearmodifiers --file -;; | ||
esac | ||
wordToPrint="" | ||
case "$word" in | ||
":tab") xdotool key Tab;; | ||
":space") xdotool key space;; | ||
":delay") sleep "${delay}";; | ||
":enter") xdotool key Return;; | ||
":otp") wordToPrint="$(generateOTP)";; | ||
"pass") wordToPrint="${password}";; | ||
":clip") inclip=true;; | ||
*) wordToPrint="${stuff[${word}]}";; | ||
esac | ||
if [[ ! -z "$wordToPrint" ]]; then | ||
if [[ ${inclip} == "true" ]]; then | ||
clipcontent=$(printf '%s%s ' "$clipcontent" "$wordToPrint") | ||
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. What is the 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 don't know if the whitespace is required but lets look at an example: If we have:
without the whitespace the clipboard content after the auto fill would look like: 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. Certainly you mean 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. Let's say we have this auto pass field: Then the content of the clipcontent looks like this (loop iteration -> result): Look at the whitespaces here:
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. Does the whitespace at the end of the string not pose any issue? |
||
else | ||
printf '%s' "$wordToPrint" | xdotool type --clearmodifiers --file - | ||
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. We should probably exile |
||
fi | ||
fi | ||
done | ||
if [[ ${inclip} == "true" ]]; then | ||
printf '%s' "$clipcontent" | doClip | ||
fi | ||
if [[ ${auto_enter} == "true" ]]; then | ||
xdotool key Return | ||
fi | ||
|
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.
You could add an example.