#!/bin/sh . "lib_common.sh" . "lib_handle.sh" help() { cat << EOF ${progname}: Lock screen options: -n Black screen lock -h Print this message and exit EOF exit 0 } trap 'rm -f "${lock_image}"' EXIT INT TERM HUP if [ "${#}" -eq 1 ]; then [ "${1}" = "-h" ] && help [ "${1}" = "-n" ] || invalid_use screenlock_handle exit 0 fi [ "${#}" -ne 0 ] && invalid_use mode=$(printf "Blank\nBlur\nWallpaper" | menu_handle default) if [ "${mode}" = "Blank" ]; then screenlock_handle exit 0 fi lock_image=$(get_random_filename .png) if [ "${mode}" = "Blur" ]; then screenshot_handle fullscreen "${lock_image}" image_handle blur "${lock_image}" fi if [ "${mode}" = "Wallpaper" ]; then current_wallpaper="${XDG_CACHE_HOME:-$HOME/.cache}/wallpaper/current" cp "${current_wallpaper}" "${lock_image}" fi screenlock_handle "${lock_image}"