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

No unlock ring #126

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/lock.1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ immediately.
\fB-n, --nofork\fP
Do not fork i3lock after starting.

.TP
\fB-u, --nounlockindicator\fP
Suppress display of the ring and keypress feedback.

.TP
\fB--\fP
Must be last option. Set command to use for taking a screenshot. Default is
Expand Down
5 changes: 4 additions & 1 deletion i3lock-fancy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ options="Options:

-n, --nofork Do not fork i3lock after starting.

-u, --nounlockindicator Suppress display of the ring and keypress feedback.

-- Must be last option. Set command to use for taking a
screenshot. Default is 'import -window root'. Using 'scrot'
or 'maim' will increase script speed and allow setting
Expand All @@ -40,7 +42,7 @@ options="Options:
# move pipefail down as for some reason "convert -list font" returns 1
set -o pipefail
trap 'rm -f "$image"' EXIT
temp="$(getopt -o :hdnpglt:f: -l desktop,help,listfonts,nofork,pixelate,greyscale,text:,font: --name "$0" -- "$@")"
temp="$(getopt -o :hdnpglt:f:u -l desktop,help,listfonts,nofork,pixelate,greyscale,text:,font:,nounlockindicator --name "$0" -- "$@")"
eval set -- "$temp"

# l10n support
Expand Down Expand Up @@ -77,6 +79,7 @@ while true ; do
convert -list font | awk -F: '/Font: / { print $2 }' | sort -du | command -- ${PAGER:-less}
exit 0 ;;
-n|--nofork) i3lock_cmd+=(--nofork) ; shift ;;
-u|--nounlockindicator) i3lock_cmd=(i3lock -i "$image" -u) ; shift ;;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you resetting the command instead of i3lock_cmd+=(-u)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? The only differences seem to me to be improved readability, and avoiding repetitive options if some user script ends up passing "-u -u -u -u".

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible someone can have flags which are then over written, such as:
i3lock-fancy -gp -f Noto-Sans -u

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meskarune : All the options that you mentioned are handled differently by the script, so nothing would be overwritten. Wait a minute, the no-fork option does conflict, so I do need to make the change.

--) shift; shot_custom=true; break ;;
*) echo "error" ; exit 1 ;;
esac
Expand Down