Update README and version
This commit is contained in:
parent
88f80f629b
commit
2bb27ee701
14
README.md
14
README.md
|
@ -1,5 +1,6 @@
|
||||||
# xkcdlock
|
# xkcdlock
|
||||||
A wrapper around screen lockers to display xkcd images
|
A wrapper around screen lockers to display xkcd images
|
||||||
|
Currently supported are i3lock and swaylack
|
||||||
|
|
||||||
Depending on the given arguments xkcdlock shows a random image, the latest
|
Depending on the given arguments xkcdlock shows a random image, the latest
|
||||||
image or an image of choice.
|
image or an image of choice.
|
||||||
|
@ -9,11 +10,8 @@ If the download fails it falls back to a specific hard-coded image
|
||||||
|
|
||||||
Builtin is a function to download all images.
|
Builtin is a function to download all images.
|
||||||
|
|
||||||
Dependencies: rbash, i3lock, xrandr, awk, curl,
|
## Dependencies
|
||||||
convert (from imagick)
|
rbash, xrandr, awk, curl, convert (from imagick)
|
||||||
|
|
||||||
Use 'xkcdlock -h' to show the command help.
|
## Usage
|
||||||
|
Use ```'xkcdlock -h``` to show the command help.
|
||||||
In order to use the xkcd font for the image number overlay,
|
|
||||||
you need to download it from here: https://github.com/ipython/xkcd-font
|
|
||||||
and put the xkcd.otf in your font path, e.g. /usr/share/fonts
|
|
||||||
|
|
22
xkcdlock
22
xkcdlock
|
@ -22,9 +22,6 @@
|
||||||
# Thanks to Michael Stapelberg for an awesome window manager - i3
|
# Thanks to Michael Stapelberg for an awesome window manager - i3
|
||||||
#
|
#
|
||||||
# TODO:
|
# TODO:
|
||||||
# - Make sure we do not exceed screen boundaries in x and y
|
|
||||||
# - Improve tooltip text border overflow prevention
|
|
||||||
# wrt display resolution (and font size?)
|
|
||||||
# - Add support for other screen lockers
|
# - Add support for other screen lockers
|
||||||
# - Parallelize downloads
|
# - Parallelize downloads
|
||||||
|
|
||||||
|
@ -48,6 +45,9 @@ BG_COLOUR="white"
|
||||||
# Break tooltip every x char to prevent border overflow
|
# Break tooltip every x char to prevent border overflow
|
||||||
TOOLTIP_MAX_LINE_LEN=100
|
TOOLTIP_MAX_LINE_LEN=100
|
||||||
|
|
||||||
|
# git rev-list --count HEAD
|
||||||
|
VERSION=19
|
||||||
|
|
||||||
# Reduce image size by x pixels in x and y dimension
|
# Reduce image size by x pixels in x and y dimension
|
||||||
# so that the tooltip does not overlay image
|
# so that the tooltip does not overlay image
|
||||||
IMAGE_PADDING_PX=100
|
IMAGE_PADDING_PX=100
|
||||||
|
@ -83,16 +83,22 @@ get_script_path() {
|
||||||
}
|
}
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
printf "\n xkcd_lock v1\n\n\
|
printf "\n xkcdlock ${VERSION}\n\n\
|
||||||
Available options are:\n\n \
|
Available options are:\n\n \
|
||||||
-d download images to current working directory\n \
|
-d download images to current working directory\n \
|
||||||
-h show this help\n \
|
-h show this help\n \
|
||||||
-i show specific image file - overrides '-m'\n \
|
-i show specific image file - overrides '-m'\n \
|
||||||
-l lock program: one of i3lock/swaylock\n \
|
-l lock program: one of i3lock/swaylock\n \
|
||||||
-m latest|random default: random\n \
|
-m latest|random default: random\n \
|
||||||
-v be verbose\n\n"
|
-v be verbose\n \
|
||||||
|
-V show version\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_version() {
|
||||||
|
printf "\n xkcdlock ${VERSION}\n\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
check_dependencies() {
|
check_dependencies() {
|
||||||
for i in "${DEPS[@]}"
|
for i in "${DEPS[@]}"
|
||||||
do
|
do
|
||||||
|
@ -324,7 +330,7 @@ main() {
|
||||||
local locker=$(which $LOCK_BIN)
|
local locker=$(which $LOCK_BIN)
|
||||||
local OPTIND
|
local OPTIND
|
||||||
|
|
||||||
while getopts "h?i:l:vm:dy" opt; do
|
while getopts "h?i:l:vVm:dy" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
d)
|
d)
|
||||||
printf "%s${DOWNLOAD_DISCLAIMER}"
|
printf "%s${DOWNLOAD_DISCLAIMER}"
|
||||||
|
@ -353,6 +359,10 @@ main() {
|
||||||
v)
|
v)
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
;;
|
;;
|
||||||
|
V)
|
||||||
|
show_version
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
y)
|
y)
|
||||||
r=$(xkcd_get_all_images)
|
r=$(xkcd_get_all_images)
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue