17 Commits

Author SHA1 Message Date
Dolores Portalatin
f85e364140 fixed variable name 2018-08-08 18:44:05 -04:00
Dolores Portalatin
2a63d39bcd updated language support 2018-08-08 18:21:26 -04:00
Dolores Portalatin
953987819a updated screenshot in the readme 2018-08-07 16:41:09 -04:00
Dolores Portalatin
7d1b255144 updated readme 2018-08-07 16:37:41 -04:00
Dolores Portalatin
a9b34bb2e4 added makefile for easy install and updated script to hardlink to icon 2018-08-07 16:24:48 -04:00
Dolores Portalatin
fe317e078d changed lock to i3lock-fancy-dualmonitor 2018-08-07 16:19:40 -04:00
Dolores Portalatin
40a02ec59a changed font rendering so its prettier and more legible on white backgrounds 2018-08-07 16:16:40 -04:00
Dolores Portalatin
44e3ba3bd8 updated dual monitors locker with new ring color syntax 2018-08-06 22:19:04 -04:00
Dolores Portalatin
0fcb93355a Merge pull request #56 from MagiCrazy/dualmonitors
Resolves #35
2016-10-14 18:36:13 -04:00
Magic.Crazy
1d7ca7e193 fix bluriness on left screens 2016-10-14 15:04:52 +02:00
meskarune
1c32f7e2b4 changed text blur so its more defined around the font 2016-04-08 11:19:40 -04:00
meskarune
428daf38e4 fixed typo in shebang 2016-04-06 12:10:30 -04:00
meskarune
7602909dce removed uneeded icon and uneeded variable 2016-04-06 12:06:40 -04:00
meskarune
eeb4f1ee97 changed text style color to look better and added text shadow 2016-04-06 12:03:24 -04:00
meskarune
f6e88602d4 changed icon/font to grey with outline 2016-04-05 22:38:17 -04:00
meskarune
05324067c9 added text support 2016-04-03 21:33:12 -04:00
meskarune
15e0d6fdee added dual monitor support 2016-04-03 20:49:44 -04:00
6 changed files with 66 additions and 30 deletions

9
Makefile Normal file
View 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)

View File

@@ -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/)
![screen shot of lockscreen](https://raw.githubusercontent.com/meskarune/i3lock-fancy/master/screenshot.png)
![screen shot of lockscreen](https://raw.githubusercontent.com/meskarune/i3lock-fancy/dualmonitors/screenshot.png)
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

View File

@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 283 KiB