71 Commits
0.2 ... master

Author SHA1 Message Date
Nicofolxarus
6731645a2d Merge branch 'meskarune:master' into master 2024-03-21 11:48:22 -07:00
Alad Wenter
55f5c30071 Merge pull request #192 from GPery/patch-1
Fix typo and BIDI in text
2023-04-28 15:03:00 +02:00
GPery
0feb479c2e Fix typo and BIDI in text
convert does handle bidi now

Also remove duplicated English line.
2022-07-11 18:54:18 +03:00
Dolores Portalatin
4cfcd47264 Merge pull request #190 from 4Evergreen4/fix-color-options
Fix i3lock-color command line color options
2022-07-06 15:50:27 +03:00
4Evergreen4
a62725e4ed Fix i3lock-color command line color options 2022-06-05 18:55:31 -04:00
Alad Wenter
2829bb580c Merge pull request #182 from tao12345666333/add-Chinese
Add Chinese language support
2022-04-12 16:11:21 +02:00
Jintao Zhang
9073a2a054 Add Chinese language support
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2021-09-11 12:10:40 +08:00
Nicofolxarus
d35078ced3 Add support for multiple monitor 2021-07-19 14:12:38 +02:00
Alad Wenter
3c65cbdee4 Merge pull request #169 from Raymo111/master
Update i3lock-color link
2021-03-26 15:22:52 +01:00
Alad Wenter
39f3f9f61d Merge pull request #172 from yagarea/patch-2
Add Czech and Slovak language support
2021-03-26 15:22:38 +01:00
Alad Wenter
dae922c79b Merge pull request #177 from hiimdoublej/feature/silent-shot
Use -silent option when taking screen shot
2021-03-26 15:22:23 +01:00
Johnny Chang
2753fab640 Use -silent option when taking screen shot 2021-03-12 03:07:14 +08:00
Jan Černý
c1b0eb6af0 Add Czech and Slovak language support 2020-11-25 05:19:00 +01:00
Raymond Li
ea830e8dab Update i3lock-color link
PandorasFox's repo redirects to mine (I'm the owner and maintainer)
2020-10-20 12:31:33 -04:00
Alad Wenter
997e6a40ae Merge pull request #165 from moonbeam87/master
Added Hindi Language Support
2020-07-18 13:31:57 +02:00
Alad Wenter
5e3d036797 Merge pull request #166 from jeanrafaellourenco/enhancementMakefile
Add uninstall option in the Makefile
2020-07-18 13:31:37 +02:00
Your Name
aee4f57cab add '$'\(DESTDIR) 2020-07-10 11:15:07 -03:00
Your Name
c054844276 Add uninstall option in the Makefile 2020-07-07 21:12:23 -03:00
Dev Patel
81e5d27725 Update i3lock-fancy 2020-06-30 10:44:35 -04:00
Alad Wenter
1734f7752f Merge pull request #140 from slugger7/afrikaans-wording
Updates afrikaans wording
2019-07-18 13:33:23 +02:00
Alad Wenter
8d327b0ea8 Merge pull request #145 from yigitsever/patch-1
Fix small help text typo
2019-07-18 13:32:47 +02:00
Alad Wenter
dd356ece43 Merge pull request #148 from cemkeylan/master
Add support for Turkish
2019-07-18 13:32:36 +02:00
Cem Keylan
b92d5a99ef Add support for Turkish 2019-06-02 20:56:09 +03:00
Yiğit Sever
cb791253ab Fix small help text typo 2019-03-07 23:31:08 +03:00
Kevin Bacon
c1da4ca540 Updates afrikaans wording
i3lock-fancy
2018-11-26 11:07:04 +02:00
Alad Wenter
7accfb2aa2 Merge pull request #137 from J-Senior/patch-1
Add support for Afrikaans
2018-11-25 17:25:58 +01:00
J-Senior
97303997fa Add support for Afrikaans 2018-10-27 19:35:25 +01:00
Dolores Portalatin
f2e9bdd1d2 Merge pull request #133 from barskern/feature/language-norwegian
Add support for norwegian
2018-08-27 01:22:07 -04:00
Ole Martin Ruud
421ffc0c33 Add support for norwegian 2018-08-27 01:34:24 +02:00
Dolores Portalatin
6a6e0e73bf Update README.md
changed distro package list so it has a header
2018-08-09 14:46:46 -04:00
Dolores Portalatin
9997e66217 Update README.md
Added some more text to the static image information in the readme.
2018-08-09 14:42:53 -04:00
Dolores Portalatin
98f5d8c620 Merge pull request #130 from Boruch-Baum/Hebrew_localization
Hebrew localization of default text
2018-08-08 11:59:37 -04:00
Alad Wenter
35e6ff3ca3 README.md: add howto on static image
#124
2018-08-08 12:52:27 +02:00
Boruch Baum
ec7a2f16a2 Hebrew localization of default text 2018-08-08 00:32:57 -04:00
Dolores Portalatin
7217cb5089 Merge pull request #128 from hcnelson99/master
Remove unnecessary mkdir and rename manpage
2018-08-07 23:14:24 -04:00
Henry Nelson
b77540eb2b Remove unnecessary mkdir and rename manpage
@install's -D flag will create any necessary parent directories.
Explicitly using mkdir leads to errors in the PKGBUILD because
$pkgdir/usr/share does not exist.
2018-08-07 22:10:11 -04:00
Dolores Portalatin
2c018760d0 added japanese translation 2018-08-07 19:58:34 -04:00
Dolores Portalatin
e128f9d97a fixed permissions as per @Boruch-Baum and added manpage 2018-08-07 19:25:08 -04:00
Alad Wenter
883fac2ce5 Merge pull request #123 from hcnelson99/master
Fix typo in Makefile
2018-08-07 16:34:44 +02:00
Henry Nelson
7d6517700d Fix typo in Makefile 2018-08-06 21:38:18 -04:00
Dolores Portalatin
e5e7d32759 updated readme with new information about make file 2018-08-06 20:46:05 -04:00
Dolores Portalatin
78c03700a9 added a makefile for easier install 2018-08-06 20:28:07 -04:00
Dolores Portalatin
0eedfa4149 changed file paths for lock icons to /usr/share/i3lock-fancy/icons 2018-08-06 20:27:51 -04:00
Dolores Portalatin
0892e09fc1 removed lock 2018-08-06 19:19:25 -04:00
Dolores Portalatin
8a3567f253 changed binary name to i3lock-fancy since packagers seem to want to use that instead of lock 2018-08-06 19:19:02 -04:00
Dolores Portalatin
de7e6fb319 Merge pull request #113 from TheKatze/patch-1
Change Readme usage from "lock" to "i3lock-fancy"
2018-08-06 03:51:11 -04:00
Dolores Portalatin
7ec676d31d Merge pull request #118 from cheapmon/master
Fix wrong i3lock-color arguments
2018-08-06 03:50:43 -04:00
Simon Kaleschke
ec522cdd8c Fix wrong i3lock-color arguments
--textcolor is no longer a valid argument in i3lock-color. Use new arguments instead.
2018-05-21 16:08:47 +02:00
TheKatze
95eed4b76f Change Readme usage from "lock" to "i3lock-fancy" 2018-04-03 11:16:21 +02:00
Dolores Portalatin
a12ce234a8 Merge pull request #106 from rhssk/greyscale
Too bright greyscale backround
2018-02-24 20:32:31 -05:00
Rihards Skuja
3873b0e56f Fix too bright greyscale backrounds 2018-01-02 00:50:29 +02:00
Alad Wenter
3734fba160 Merge pull request #105 from ng-0/master
README: GNU Guix install
2017-12-14 12:12:32 +01:00
ng0
9250f6a17f more grammar fixes 2017-12-14 11:02:42 +00:00
ng0
e96fc59ae4 follow-up, grammar fix 2017-12-14 11:01:26 +00:00
ng0
2ed5732153 Add GNU Guix and GuixSD to the installation. 2017-12-14 10:59:22 +00:00
Alad Wenter
471f73d5fb Merge pull request #102 from PandorasFox/patch-2
Update README.md
2017-12-09 16:12:05 +01:00
Chris Guillott
fa70629d05 Update README.md
Been meaning to change my github username for a while. I'd been avoiding doing that so that I wouldn't be potentially breaking any AUR packages, but some upstream changes in building required me to break the package.
2017-12-06 12:39:02 -05:00
Alad Wenter
819d3ef698 Merge pull request #94 from rhssk/lock-text
Add Latvian lock text
2017-09-09 14:37:48 +02:00
Rihards Skuja
20ab403e44 Add Latvian lock text 2017-09-09 15:32:35 +03:00
Alad Wenter
b81db647fa Merge pull request #91 from griffingarland/master
Using mktemp suffix functionality to prevent leaking tmp files
2017-07-22 00:34:41 +02:00
Griffin Garland
de145dffe7 Using suffix functionality in mktemp to prevent leaking tmp files 2017-07-20 00:40:56 -04:00
Alad Wenter
4d3931ace2 Update README.md
fix typo
2017-06-29 11:36:01 +02:00
Alad Wenter
695276663b Merge pull request #88 from patrick96/lock-manpage
Some manpage improvements
2017-06-29 11:22:18 +02:00
Alad Wenter
894076dd43 Merge pull request #85 from sim590/lock-manpage
doc: add lock manapge
2017-06-28 15:35:19 +02:00
patrick96
90d5ceb270 Make description more clear
For someone that doesn't know what i3lock-fancy does, this may clear
some things up
2017-06-28 12:20:59 +02:00
patrick96
4c909fd8d3 Don't use -h description used in script 2017-06-28 11:35:00 +02:00
patrick96
7df8c24d84 Add "SEE ALSO" section with i3lock 2017-06-28 11:34:40 +02:00
patrick96
7763b2c31f Use e-mail address listed in script 2017-06-28 11:34:26 +02:00
Simon Désaulniers
a974a4c7b4 doc: add lock manapge 2017-06-27 20:10:03 -04:00
Alad Wenter
765a37f87b lock: use single array for i3lock command line 2017-05-28 00:20:07 +02:00
Alad Wenter
e7eb9e7de4 Update README.md 2017-05-18 12:02:39 +02:00
4 changed files with 190 additions and 40 deletions

16
Makefile Normal file
View File

@@ -0,0 +1,16 @@
PRGM = i3lock-fancy
PREFIX ?= /usr
SHRDIR ?= $(PREFIX)/share
BINDIR ?= $(PREFIX)/bin
install:
@install -Dm755 i3lock-fancy -t $(DESTDIR)$(BINDIR)
@install -Dm644 icons/* -t $(DESTDIR)$(SHRDIR)/$(PRGM)/icons
@install -Dm644 doc/i3lock-fancy.1 -t $(DESTDIR)$(SHRDIR)/man/man1
@install -Dm644 LICENSE -t $(DESTDIR)$(SHRDIR)/licenses/$(PRGM)
uninstall:
@unlink $(DESTDIR)$(BINDIR)/$(PRGM) # Remove binary
@rm -Rf $(DESTDIR)$(SHRDIR)/$(PRGM) # Remove icons
@unlink $(DESTDIR)$(SHRDIR)/man/man1/i3lock-fancy.1 # Remove man
@rm -Rf $(DESTDIR)$(SHRDIR)/licenses/$(PRGM) # Remove license

View File

@@ -10,11 +10,11 @@ website: [github pages website](http://meskarune.github.io/i3lock-fancy/)
Dependencies
------------
* <s>[i3lock-color-git](https://github.com/eBrnd/i3lock-color)</s>
* [i3lock-color-git](https://github.com/chrjguill/i3lock-color) - this is a fork of i3lock-color that is kept up to date with i3lock
* [i3lock-color-git](https://github.com/Raymo111/i3lock-color) - this is a fork of i3lock-color that is kept up to date with i3lock
* imagemagick
* bash
* awk
* utils-linux
* util-linux
Optional Dependencies
---------------------
@@ -23,14 +23,30 @@ Optional Dependencies
Installation
------------
Arch Linux Package: https://aur.archlinux.org/packages/i3lock-fancy-git/
git clone the repository and copy lock and /icons to "/usr/local/bin"
To install i3lock-fancy manually, git clone the repository:
git clone https://github.com/meskarune/i3lock-fancy.git
Then change to the directory and run make.
cd i3lock-fancy
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.**
### The following distro's have packages you can use to install:
* Arch Linux: https://aur.archlinux.org/packages/i3lock-fancy-git/
* GNU Guix: Run `guix package --install i3lock-fancy`
* Debian: https://packages.debian.org/sid/i3lock-fancy
Usage
-----
lock [options]
i3lock-fancy [options]
Options:
-h, --help This help menu.
@@ -44,17 +60,19 @@ Usage
-f <fontname>, --font <fontname> Set a custom font.
-t <text>, --text <text> Set a custom text prompt.
-l, --listfonts Display a list of possible fonts for use with -f/--font.
Note: this option will not lock the screen, it displays
the list and exits immediately.
-n, --nofork Do not fork i3lock after starting.
-- 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
custom flags like haing a delay.
custom flags like having a delay.
example: ```lock -gpf Comic-Sans-MS -- scrot -z```
example: ```i3lock-fancy -gpf Comic-Sans-MS -- scrot -z```
Extras
------
@@ -78,15 +96,34 @@ Systemd Unit file example (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 -detectsleep
[Install]
WantedBy=graphical.target
Multiple Monitors
-----------------
There is a branch called dual monitor with support for multiple monitors. This
branch uses a grey icon and text with outlines to make it visible on light and
dark backgrounds (though it looks better on dark backgrounds). I am still
working to get it looking just right right. The script is usable now, but it's
under developement and things may change.
There is a branch called dual monitor with support for multiple monitors.
(it is currently out of date compared to the main locker, I need to update
it with all the new features) This branch uses a grey icon and text with
outlines to make it visible on light and dark backgrounds (though it looks
better on dark backgrounds). I am still working to get it looking just right
right. The script is usable now, but it's under developement and things may change.
Static image
------------
If you would like to run `i3lock-color` with a static image in the style of
i3lock-fancy, run `convert` from image magick directly on the background image
you want to use. Then specify the result `newimage.png` to `i3lock -i`:
```
#!/bin/sh
# Add a lock icon and text to the center of an image
convert /path/to/background.png -font Liberation-Sans \
-pointsize 26 -fill white -gravity center \
-annotate +0+160 "Type Password to Unlock" lock.png \
-gravity center -composite newimage.png
```
```
i3lock -i newimage.png
```

67
doc/i3lock-fancy.1 Normal file
View File

@@ -0,0 +1,67 @@
.TH I3LOCK-FANCY 1 2017-06-26
.SH NAME
.B i3lock-fancy
- Bash script around i3lock for fancy effect
.SH DESCRIPTION
Takes a screenshot of the desktop, blurs the background and adds a lock icon and
text. This blurred image is then given to \fBi3lock\fR as the lockscreen
background.
.SH SYNOPSIS
.B i3lock-fancy [options]
.SH OPTIONS
.TP
\fB-h, --help\fP
Display a help screen and exit.
.TP
\fB-d, --desktop\fP
Attempt to minimize all windows before locking.
.TP
\fB-g, --greyscale\fP
Set background to greyscale instead of color.
.TP
\fB-p, --pixelate\fP
Pixelate the background instead of blur, runs faster.
.TP
\fB-f <fontname>, --font <fontname>\fP
Set a custom font.
.TP
\fB-t <text>, --text <text>\fP
Set a custom text prompt.
.TP
\fB-l, --listfonts\fP
Display a list of possible fonts for use with -f/--font.
.IP
Note: this option will not lock the screen, it displays the list and exits
immediately.
.TP
\fB-n, --nofork\fP
Do not fork i3lock after starting.
.TP
\fB--\fP
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 custom flags like having a delay.
.SH SEE ALSO
\fBi3lock\fR(1)
.SH AUTHORS
Dolores Portalatin <hello@doloresportalatin.info>

View File

@@ -3,18 +3,14 @@
# Dependencies: imagemagick, i3lock-color-git, scrot, wmctrl (optional)
set -o errexit -o noclobber -o nounset
# get path where the script is located to find the lock icon
scriptpath=$(readlink -f -- "$0")
scriptpath=${scriptpath%/*}
hue=(-level "0%,100%,0.6")
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"
shot=(import -window root)
font=$(convert -list font | awk "{ a[NR] = \$2 } /family: $(fc-match sans -f "%{family}\n")/ { print a[NR-1]; exit }")
image=$(mktemp --suffix=.png)
shot=(import -silent -window root)
desktop=""
param_add=("")
i3lock_cmd=(i3lock -i "$image")
shot_custom=false
options="Options:
@@ -48,18 +44,27 @@ temp="$(getopt -o :hdnpglt:f: -l desktop,help,listfonts,nofork,pixelate,greyscal
eval set -- "$temp"
# l10n support
text="Type password to unlock"
case "${LANG:-}" in
af_* ) text="Tik wagwoord om te ontsluit" ;; # Afrikaans
cs_* ) text="Pro odemčení zadajte heslo" ;; # Czech
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 עברית
hi_* ) text="अनलॉक करने के लिए पासवर्ड टाईप करें" ;; #Hindi
id_* ) text="Masukkan kata sandi Anda" ;; # Bahasa Indonesia
it_* ) text="Inserisci la password" ;; # Italian
ja_* ) text="パスワードを入力してください" ;; # Japanese
lv_* ) text="Ievadi paroli" ;; # Latvian
nb_* ) text="Skriv inn passord" ;; # Norwegian
pl_* ) text="Podaj hasło" ;; # Polish
pt_* ) text="Digite a senha para desbloquear" ;; # Português
sk_* ) text="Pre odomknutie zadajte heslo" ;; # Slovak
tr_* ) text="Giriş yapmak için şifrenizi girin" ;; # Turkish
ru_* ) text="Введите пароль" ;; # Russian
zh_* ) text="请输入密码以解锁" ;; # Chinese
* ) text="Type password to unlock" ;; # Default to English
esac
@@ -68,7 +73,7 @@ while true ; do
-h|--help)
printf "Usage: %s [options]\n\n%s\n\n" "${0##*/}" "$options"; exit 1 ;;
-d|--desktop) desktop=$(command -V wmctrl) ; shift ;;
-g|--greyscale) hue=(-level "0%,100%,0.6" -set colorspace Gray -separate -average) ; shift ;;
-g|--greyscale) hue=(-level "0%,100%,0.6" -set colorspace Gray -average) ; shift ;;
-p|--pixelate) effect=(-scale 10% -scale 1000%) ; shift ;;
-f|--font)
case "$2" in
@@ -79,7 +84,7 @@ while true ; do
-l|--listfonts)
convert -list font | awk -F: '/Font: / { print $2 }' | sort -du | command -- ${PAGER:-less}
exit 0 ;;
-n|--nofork) param_add=(--nofork) ; shift ;;
-n|--nofork) i3lock_cmd+=(--nofork) ; shift ;;
--) shift; shot_custom=true; break ;;
*) echo "error" ; exit 1 ;;
esac
@@ -98,31 +103,56 @@ color=$(convert "$image" -gravity center -crop 100x100+0+0 +repage -colorspace h
if [[ $color -gt $value ]]; then #white background image and black text
bw="black"
icon="$scriptpath/icons/lockdark.png"
param=("--textcolor=00000000" "--insidecolor=0000001c" "--ringcolor=0000003e" \
"--linecolor=00000000" "--keyhlcolor=ffffff80" "--ringvercolor=ffffff00" \
"--separatorcolor=22222260" "--insidevercolor=ffffff1c" \
"--ringwrongcolor=ffffff55" "--insidewrongcolor=ffffff1c")
icon="/usr/share/i3lock-fancy/icons/lockdark.png"
param=("--inside-color=0000001c" "--ring-color=0000003e" \
"--line-color=00000000" "--keyhl-color=ffffff80" "--ringver-color=ffffff00" \
"--separator-color=22222260" "--insidever-color=ffffff1c" \
"--ringwrong-color=ffffff55" "--insidewrong-color=ffffff1c" \
"--verif-color=ffffff00" "--wrong-color=ff000000" "--time-color=ffffff00" \
"--date-color=ffffff00" "--layout-color=ffffff00")
else #black
bw="white"
icon="$scriptpath/icons/lock.png"
param=("--textcolor=ffffff00" "--insidecolor=ffffff1c" "--ringcolor=ffffff3e" \
"--linecolor=ffffff00" "--keyhlcolor=00000080" "--ringvercolor=00000000" \
"--separatorcolor=22222260" "--insidevercolor=0000001c" \
"--ringwrongcolor=00000055" "--insidewrongcolor=0000001c")
icon="/usr/share/i3lock-fancy/icons/lock.png"
param=("--inside-color=ffffff1c" "--ring-color=ffffff3e" \
"--line-color=ffffff00" "--keyhl-color=00000080" "--ringver-color=00000000" \
"--separator-color=22222260" "--insidever-color=0000001c" \
"--ringwrong-color=00000055" "--insidewrong-color=0000001c" \
"--verif-color=00000000" "--wrong-color=ff000000" "--time-color=00000000" \
"--date-color=00000000" "--layout-color=00000000")
fi
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))
LOCK+=(-font $font -pointsize 26 -fill "$bw" -stroke grey10 \
-strokewidth 2 -annotate +$MIDXt+$MIDYt "$text" \
-fill "$bw" -stroke "$bw" -strokewidth 1 -annotate +$MIDXt+$MIDYt "$text" \
$icon -geometry +$MIDXi+$MIDYi -composite)
fi
done <<<"$(xrandr)"
convert "$image" "${hue[@]}" "${effect[@]}" "${LOCK[@]}" "$image"
#convert "$image" "${hue[@]}" "${effect[@]}" -font "$font" -pointsize 26 -fill "$bw" -gravity center \
# -annotate +0+160 "$text" "$icon" -gravity center -composite "$image"
# If invoked with -d/--desktop, we'll attempt to minimize all windows (ie. show
# the desktop) before locking.
${desktop} ${desktop:+-k on}
# try to use a forked version of i3lock with prepared parameters
if ! i3lock "${param_add[@]}" "${param[@]}" -i "$image" > /dev/null 2>&1; then
# try to use i3lock with prepared parameters
if ! "${i3lock_cmd[@]}" "${param[@]}" >/dev/null 2>&1; then
# We have failed, lets get back to stock one
i3lock "${param_add[@]}" -i "$image"
"${i3lock_cmd[@]}"
fi
# As above, if we were passed -d/--desktop, we'll attempt to restore all windows