Compare commits
17 Commits
master
...
dualmonito
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f85e364140 | ||
|
|
2a63d39bcd | ||
|
|
953987819a | ||
|
|
7d1b255144 | ||
|
|
a9b34bb2e4 | ||
|
|
fe317e078d | ||
|
|
40a02ec59a | ||
|
|
44e3ba3bd8 | ||
|
|
0fcb93355a | ||
|
|
1d7ca7e193 | ||
|
|
1c32f7e2b4 | ||
|
|
428daf38e4 | ||
|
|
7602909dce | ||
|
|
eeb4f1ee97 | ||
|
|
f6e88602d4 | ||
|
|
05324067c9 | ||
|
|
15e0d6fdee |
9
Makefile
Normal file
9
Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
PRGM = i3lock-fancy-dualmonitor
|
||||
PREFIX ?= /usr
|
||||
SHRDIR ?= $(PREFIX)/share
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
|
||||
install:
|
||||
@install -Dm755 i3lock-fancy-dualmonitor -t $(DESTDIR)$(BINDIR)
|
||||
@install -Dm644 lock.png -t $(DESTDIR)$(SHRDIR)/$(PRGM)
|
||||
@install -Dm644 LICENSE -t $(DESTDIR)$(SHRDIR)/licenses/$(PRGM)
|
||||
22
README.md
22
README.md
@@ -5,7 +5,7 @@ This is an i3lock bash script that takes a screenshot of the desktop, blurs the
|
||||
|
||||
website: [github pages website](http://meskarune.github.io/i3lock-fancy/)
|
||||
|
||||

|
||||

|
||||
|
||||
Dependancies
|
||||
------------
|
||||
@@ -19,10 +19,22 @@ Dependancies
|
||||
|
||||
Installation
|
||||
------------
|
||||
Arch Linux Package: https://aur.archlinux.org/packages/i3lock-fancy-git/
|
||||
|
||||
git clone the repository and copy lock, lock.png and lockdark.png to
|
||||
"/usr/local/bin"
|
||||
Installation
|
||||
------------
|
||||
|
||||
To install i3lock-fancy-dualmonitor manually, git clone the repository, checkout
|
||||
the dual monitors branch and run the make file.:
|
||||
|
||||
git clone https://github.com/meskarune/i3lock-fancy.git
|
||||
cd i3lock-fancy
|
||||
git checkout i3lock-fancy-dualmonitors
|
||||
sudo make install
|
||||
|
||||
**IMPORTANT NOTE: the way to install i3lock-fancy has changed! If you are a
|
||||
package maintainer or previously installed manually you may have to review
|
||||
and update your configurations. The new change simplifies a lot of
|
||||
things so updates will be easier in the future.**
|
||||
|
||||
Usage
|
||||
-----
|
||||
@@ -55,7 +67,7 @@ Systemd Unit file (edit for your own use):
|
||||
Type=simple
|
||||
User=meskarune
|
||||
Environment=DISPLAY=:0
|
||||
ExecStart=/usr/bin/xautolock -time 5 -locker /usr/local/bin/lock/lock -detectsleep
|
||||
ExecStart=/usr/bin/xautolock -time 5 -locker /usr/bin/i3lock-fancy-dualmonitor -detectsleep
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
||||
|
||||
@@ -8,6 +8,7 @@ EFFECT=(-filter Gaussian -resize 20% -define filter:sigma=1.5 -resize 500.5%)
|
||||
# default system sans-serif font
|
||||
FONT="$(convert -list font | awk "{ a[NR] = \$2 } /family: $(fc-match sans -f "%{family}\n")/ { print a[NR-1]; exit }")"
|
||||
IMAGE="$(mktemp).png"
|
||||
DM=$(xdpyinfo | awk '/^ dimensions(.+([0-9]+))/{print $2}')
|
||||
|
||||
OPTIONS="Options:
|
||||
-h, --help This help menu.
|
||||
@@ -37,42 +38,56 @@ while true ; do
|
||||
esac
|
||||
done
|
||||
|
||||
# get path where the script is located to find the lock icon
|
||||
SCRIPTPATH=$(realpath "$0")
|
||||
SCRIPTPATH=${SCRIPTPATH%/*}
|
||||
|
||||
# l10n support
|
||||
TEXT="Type password to unlock"
|
||||
case "$LANG" in
|
||||
case "${LANG:-}" in
|
||||
de_* ) TEXT="Bitte Passwort eingeben" ;; # Deutsch
|
||||
da_* ) TEXT="Indtast adgangskode" ;; # Danish
|
||||
en_* ) TEXT="Type password to unlock" ;; # English
|
||||
es_* ) TEXT="Ingrese su contraseña" ;; # Española
|
||||
fr_* ) TEXT="Entrez votre mot de passe" ;; # Français
|
||||
he_* ) TEXT="הליענה לטבל המסיס דלקה" ;; # Hebrew עברית (convert doesn't play bidi well)
|
||||
id_* ) TEXT="Masukkan kata sandi Anda" ;; # Bahasa Indonesia
|
||||
it_* ) TEXT="Inserisci la password" ;; # Italian
|
||||
ja_* ) TEXT="パスワードを入力してください" ;; # Japanese
|
||||
lv_* ) TEXT="Ievadi paroli" ;; # Latvian
|
||||
pl_* ) TEXT="Podaj hasło" ;; # Polish
|
||||
pt_* ) TEXT="Digite a senha para desbloquear" ;; # Português
|
||||
ru_* ) TEXT="Введите пароль" ;; # Russian
|
||||
* ) TEXT="Type password to unlock" ;; # Default to English
|
||||
esac
|
||||
|
||||
VALUE="60" #brightness value to compare to
|
||||
scrot -z "$IMAGE"
|
||||
COLOR=$(convert "$IMAGE" -gravity center -crop 100x100+0+0 +repage -colorspace hsb \
|
||||
-resize 1x1 txt:- | awk -F '[%$]' 'NR==2{gsub(",",""); printf "%.0f\n", $(NF-1)}');
|
||||
if [ "$COLOR" -gt "$VALUE" ]; then #white background image and black text
|
||||
BW="black"
|
||||
ICON="$SCRIPTPATH/lockdark.png"
|
||||
PARAM=(--textcolor=00000000 --insidecolor=0000001c --ringcolor=0000003e \
|
||||
--linecolor=00000000 --keyhlcolor=ffffff80 --ringvercolor=ffffff00 \
|
||||
--separatorcolor=22222260 --insidevercolor=ffffff1c \
|
||||
--ringwrongcolor=ffffff55 --insidewrongcolor=ffffff1c)
|
||||
else #black
|
||||
BW="white"
|
||||
ICON="$SCRIPTPATH/lock.png"
|
||||
PARAM=(--textcolor=ffffff00 --insidecolor=ffffff1c --ringcolor=ffffff3e \
|
||||
--linecolor=ffffff00 --keyhlcolor=00000080 --ringvercolor=00000000 \
|
||||
--separatorcolor=22222260 --insidevercolor=0000001c \
|
||||
--ringwrongcolor=00000055 --insidewrongcolor=0000001c)
|
||||
fi
|
||||
ICON="/usr/share/i3lock-fancy-dualmonitor/lock.png"
|
||||
PARAM=("--insidecolor=0000001c" "--ringcolor=0000003e" \
|
||||
"--linecolor=00000000" "--keyhlcolor=ffffff80" "--ringvercolor=ffffff00" \
|
||||
"--separatorcolor=22222260" "--insidevercolor=ffffff1c" \
|
||||
"--ringwrongcolor=ffffff55" "--insidewrongcolor=ffffff1c" \
|
||||
"--verifcolor=ffffff00" "--wrongcolor=ff000000" "--timecolor=ffffff00" \
|
||||
"--datecolor=ffffff00" "--layoutcolor=ffffff00")
|
||||
|
||||
convert "$IMAGE" "${HUE[@]}" "${EFFECT[@]}" -font "$FONT" -pointsize 26 -fill "$BW" -gravity center \
|
||||
-annotate +0+160 "$TEXT" "$ICON" -gravity center -composite "$IMAGE"
|
||||
LOCK=()
|
||||
while read LINE
|
||||
do
|
||||
if [[ "$LINE" =~ ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) ]]; then
|
||||
W=${BASH_REMATCH[1]}
|
||||
H=${BASH_REMATCH[2]}
|
||||
Xoff=${BASH_REMATCH[3]}
|
||||
Yoff=${BASH_REMATCH[4]}
|
||||
MIDXi=$(($W / 2 + $Xoff - 60 / 2))
|
||||
MIDYi=$(($H / 2 + $Yoff - 60 / 2))
|
||||
MIDXt=$(($W / 2 + $Xoff - 285 / 2))
|
||||
MIDYt=$(($H / 2 + $Yoff + 320 / 2))
|
||||
MIDXts=$(($MIDXt + 2))
|
||||
MIDYts=$(($MIDYt + 2))
|
||||
LOCK+=(\( -size $DM xc:none -font $FONT -pointsize 26 -fill black -annotate +$MIDXts+$MIDYts "$TEXT" -blur 0x2 \
|
||||
-fill black -annotate +$MIDXts+$MIDYts "$TEXT" -blur 0x1 -fill white -annotate +$MIDXt+$MIDYt "$TEXT" \) \
|
||||
-flatten \
|
||||
$ICON -geometry +$MIDXi+$MIDYi -composite)
|
||||
fi
|
||||
done <<<"$(xrandr)"
|
||||
|
||||
convert "$IMAGE" "${HUE[@]}" "${EFFECT[@]}" "${LOCK[@]}" "$IMAGE"
|
||||
|
||||
# try to use a forked version of i3lock with prepared parameters
|
||||
if ! i3lock -n "${PARAM[@]}" -i "$IMAGE" > /dev/null 2>&1; then
|
||||
BIN
lock.png
BIN
lock.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
lockdark.png
BIN
lockdark.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 283 KiB |
Reference in New Issue
Block a user