diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2022-09-28 00:04:43 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2022-09-28 00:04:43 +0800 |
commit | 1091e851131312d987a799a86d735a760319c3a4 (patch) | |
tree | b7a46947a891659ca38f791f702db8fc0296dbfe | |
parent | 3556eb2403cb89a9c164e4eabe323507a1b9ac2b (diff) |
Remove tab
-rwxr-xr-x | tools/desktop/password-store.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/desktop/password-store.sh b/tools/desktop/password-store.sh index 4d3759e..6918e3f 100755 --- a/tools/desktop/password-store.sh +++ b/tools/desktop/password-store.sh | |||
@@ -12,21 +12,21 @@ rofi -dmenu "${ROFI_ARGS[@]}" | { | |||
12 | read ARG1 ARG2 | 12 | read ARG1 ARG2 |
13 | 13 | ||
14 | if [[ -z $ARG1 ]]; then | 14 | if [[ -z $ARG1 ]]; then |
15 | exit 1 | 15 | exit 1 |
16 | elif [[ $ARG1 =~ gen ]]; then | 16 | elif [[ $ARG1 =~ gen ]]; then |
17 | # Generate a new password by ARG2 | 17 | # Generate a new password by ARG2 |
18 | alacritty --hold -e pass --clip generate $ARG2 | 18 | alacritty --hold -e pass --clip generate $ARG2 |
19 | else | 19 | else |
20 | pass $ARG1 | { | 20 | pass $ARG1 | { |
21 | # If command fails, just fail directly | 21 | # If command fails, just fail directly |
22 | read PASSWORD; [[ -z $PASSWORD ]] && exit 1 | 22 | read PASSWORD; [[ -z $PASSWORD ]] && exit 1 |
23 | 23 | ||
24 | # Simply copy password into system clipboard | 24 | # Simply copy password into system clipboard |
25 | echo $PASSWORD | xsel -ib | 25 | echo $PASSWORD | xsel -ib |
26 | 26 | ||
27 | # Show success message, and display extra contents | 27 | # Show success message, and display extra contents |
28 | rofi -e "Copied: $ARG1 $(echo; echo; cat | sed '1{/^$/d}')" \ | 28 | rofi -e "Copied: $ARG1 $(echo; echo; cat | sed '1{/^$/d}')" \ |
29 | "${ROFI_ARGS[@]}" | 29 | "${ROFI_ARGS[@]}" |
30 | } | 30 | } |
31 | fi | 31 | fi |
32 | } | 32 | } |