Bug 257715 - [NEW PORT] x11/betterlockscreen: prettier lockscreen for i3lock-color
Summary: [NEW PORT] x11/betterlockscreen: prettier lockscreen for i3lock-color
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL: https://github.com/pavanjadhaw/better...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-09 16:37 UTC by Fadel
Modified: 2021-08-15 17:24 UTC (History)
2 users (show)

See Also:


Attachments
betterlockscreen 3.2.0 (1.18 KB, patch)
2021-08-09 16:37 UTC, Fadel
no flags Details | Diff
pkg-message added (1.83 KB, patch)
2021-08-09 16:49 UTC, Fadel
no flags Details | Diff
betterlockscreen 4.0.0 (1.97 KB, patch)
2021-08-10 16:24 UTC, Fadel
no flags Details | Diff
betterlockscreen 4.0.1 (760 bytes, patch)
2021-08-12 19:40 UTC, Fadel
no flags Details | Diff
license changed (331 bytes, patch)
2021-08-14 16:50 UTC, Fadel
no flags Details | Diff
GnuGrep added (1.77 KB, patch)
2021-08-15 00:48 UTC, Fadel
no flags Details | Diff
patch with gnused and gnugrep (2.46 KB, patch)
2021-08-15 06:27 UTC, Rainer Hurling
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fadel 2021-08-09 16:37:39 UTC
Created attachment 227051 [details]
betterlockscreen 3.2.0

Lockscreen with a prettier style
Comment 1 Fadel 2021-08-09 16:49:08 UTC
Created attachment 227052 [details]
pkg-message added
Comment 2 Rainer Hurling freebsd_committer freebsd_triage 2021-08-10 05:20:41 UTC
Hi Fadel,

Thanks for the new port. Did you recognize v4.0.0, released a few hours ago?
Comment 3 Fadel 2021-08-10 09:56:54 UTC
(In reply to Rainer Hurling from comment #2)
I did not realize it, since it came out a few hours after I uploaded it here, after a while I upload version 4.0.0
Comment 4 Fadel 2021-08-10 16:24:45 UTC
Created attachment 227088 [details]
betterlockscreen 4.0.0
Comment 5 Fadel 2021-08-12 19:40:13 UTC
Created attachment 227139 [details]
betterlockscreen 4.0.1
Comment 6 Rainer Hurling freebsd_committer freebsd_triage 2021-08-14 06:01:52 UTC
Hi Fadel,

I tried your patch. It compiles and installs fine, but did not work for me. All I get on the console is the message "[B] Betterlockscreen", no locking.

Did you test if it works for you?


BTW, the license it not BSD3CLAUSE, but MIT [1]

[1] https://github.com/betterlockscreen/betterlockscreen/blob/master/LICENSE
Comment 7 Fadel 2021-08-14 14:50:35 UTC
(In reply to Rainer Hurling from comment #6)
How strange, it works fine for me, I'm going to try a VM to see if everything is fine
Comment 8 Fadel 2021-08-14 16:49:23 UTC
I tested it on a virtual machine with freebsd 13.0 and it works fine.
now I attach a patch changing the license to "MIT"
Comment 9 Fadel 2021-08-14 16:50:17 UTC
Created attachment 227186 [details]
license changed
Comment 10 Joseph Mingrone freebsd_committer freebsd_triage 2021-08-14 19:21:47 UTC
It looks like it doesn't like our grep and sed.

% betterlockscreen -u ./img_0167.jpg
[B] Betterlockscreen
[*] Updating image cache...
[=] Detected 2 display(s) @ 1920x1848 total resolution
[=] Original image(s): img_0167.jpg img_0167.jpg
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
[=] Processing display: LVDS-1 (1)
[=] Resolution: 1366x768
[*] Resizing base image...
[*] Rendering 'dim' effect...
[*] Rendering 'blur' effect...
[*] Rendering 'dimblur' effect...
[*] Rendering 'pixel' effect...
[*] Rendering 'dimpixel' effect...
[*] Rendering 'color' effect...
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
[=] Processing display: HDMI-1 (2)
[=] Resolution: 1920x1080
[*] Resizing base image...
[*] Rendering 'dim' effect...
[*] Rendering 'blur' effect...
[*] Rendering 'dimblur' effect...
[*] Rendering 'pixel' effect...
[*] Rendering 'dimpixel' effect...
[*] Rendering 'color' effect...
[*] Creating canvas: 1920x1848
[*] Rendering final wallpaper images...
[*] Rendering final lockscreen images...
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]
sed: 1: "s/\s*resolution:\s*([0- ...": RE error: trailing backslash (\)
Comment 11 Fadel 2021-08-14 19:28:27 UTC
(In reply to Joseph Mingrone from comment #10)
I do not understand why that happens, I tried it on my PC, on a VM and on another PC and it does not give conflicts
Comment 12 Fadel 2021-08-15 00:48:49 UTC
Created attachment 227201 [details]
GnuGrep added
Comment 13 Rainer Hurling freebsd_committer freebsd_triage 2021-08-15 06:27:08 UTC
Created attachment 227210 [details]
patch with gnused and gnugrep

Hi Fadel,

If you want to use the GNU grep version, it is necessary to set the dependency in RUN_DEPENDS to the correct binary as well. Without ${LOCALBASE}/bin the base version is searched for.

It is also usually not a good idea to hardcode the path to a binary in a patch. This will no longer work if ${LOCALBASE} is set to a path other than /usr/local, i.e. the user wants to install his packages under a different path.

Therefore it is better to set this path via a REINPLACE_CMD in the Makefile.

I have attached a patch as a suggestion, which already contains both. This would make your 'files/patch-betterlockscreen' obsolete.

-----
Unfortunately 'betterlockscreen' doesn't work as expected for me either despite using the GNU versions. 

I am using a current 14.0-CURRENT and have no idea what the problem could be. Of course it could also be a local problem on my side ;)
Comment 14 Fadel 2021-08-15 13:46:36 UTC
(In reply to Rainer Hurling from comment #13)
try testing on a virtual machine
Comment 15 Jan Beich freebsd_committer freebsd_triage 2021-08-15 16:55:28 UTC
Have you tried replacing Perl extensions instead? \s is same as [[:space:]], see perlre(1) and isspace(3) manpages.

post-patch:
	@${REINPLACE_CMD} -E -e '/grep|sed/s,\\s,[[:space:]],g' \
                ${WRKSRC}/${PORTNAME}
Comment 16 Jan Beich freebsd_committer freebsd_triage 2021-08-15 17:24:51 UTC
(In reply to Jan Beich from comment #15)
Nevermind, it also has \d aka [[:digit:]] or isdigit(3) but \K isn't directly translatable. Probably easier to rewrite without preserving regexp quirks e.g.,

-    dpi=$(xrdb -q | grep -oP '^\s*Xft.dpi:\s*\K\d+' | bc)
+    dpi=$(xrdb -q | awk -F: '/Xft.dpi/ { gsub("[[:space:]]*",""); print $2 }')