diff options
author | mhsn <mail@mhsn.net> | 2025-07-19 19:22:58 +0100 |
---|---|---|
committer | mhsn <mail@mhsn.net> | 2025-07-19 19:22:58 +0100 |
commit | d85bf3344b4c7cfde883a617dc69d55197e449bd (patch) | |
tree | 54fa2e351a8b8f1b80772af5fc6a228a05da5285 | |
parent | 84b04e9c609fd452402cd688be3adce096520959 (diff) | |
download | adelie-d85bf3344b4c7cfde883a617dc69d55197e449bd.tar.gz adelie-d85bf3344b4c7cfde883a617dc69d55197e449bd.zip |
add dmenu and slock
-rw-r--r-- | x11-misc/dmenu/dmenu-9999.ebuild | 59 | ||||
-rw-r--r-- | x11-misc/dmenu/files/51_theme.diff | 21 | ||||
-rw-r--r-- | x11-misc/dmenu/files/dmenu-5.2-gentoo.patch | 26 | ||||
-rw-r--r-- | x11-misc/dmenu/metadata.xml | 7 | ||||
-rw-r--r-- | x11-misc/slock/files/01-slock-fix-link-paths.patch | 18 | ||||
-rw-r--r-- | x11-misc/slock/files/02-slock-dpms-1.4.patch | 62 | ||||
-rw-r--r-- | x11-misc/slock/files/50-colors.patch | 17 | ||||
-rw-r--r-- | x11-misc/slock/metadata.xml | 7 | ||||
-rw-r--r-- | x11-misc/slock/slock-9999.ebuild | 62 |
9 files changed, 279 insertions, 0 deletions
diff --git a/x11-misc/dmenu/dmenu-9999.ebuild b/x11-misc/dmenu/dmenu-9999.ebuild new file mode 100644 index 0000000..b5e4ec7 --- /dev/null +++ b/x11-misc/dmenu/dmenu-9999.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit git-r3 toolchain-funcs + +DESCRIPTION="a generic, highly customizable, and efficient menu for the X Window System" +HOMEPAGE="https://tools.suckless.org/dmenu/" +EGIT_REPO_URI="https://git.suckless.org/dmenu" + +LICENSE="MIT" +SLOT="0" +IUSE="xinerama" + +RDEPEND=" + media-libs/fontconfig + x11-libs/libX11 + >=x11-libs/libXft-2.3.5 + xinerama? ( x11-libs/libXinerama ) +" +DEPEND="${RDEPEND} + x11-base/xorg-proto +" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-5.2-gentoo.patch + "${FILESDIR}/51_theme.diff" +) + +src_prepare() { + default + + sed -i \ + -e 's|^ @| |g' \ + -e '/^ echo/d' \ + Makefile || die +} + +src_compile() { + emake CC="$(tc-getCC)" \ + "FREETYPEINC=$($(tc-getPKG_CONFIG) --cflags x11 fontconfig xft 2>/dev/null)" \ + "FREETYPELIBS=$($(tc-getPKG_CONFIG) --libs x11 fontconfig xft 2>/dev/null)" \ + "X11INC=$($(tc-getPKG_CONFIG) --cflags x11 2>/dev/null)" \ + "X11LIB=$($(tc-getPKG_CONFIG) --libs x11 2>/dev/null)" \ + "XINERAMAFLAGS=$( + usex xinerama "-DXINERAMA $( + $(tc-getPKG_CONFIG) --cflags xinerama 2>/dev/null + )" '' + )" \ + "XINERAMALIBS=$( + usex xinerama "$($(tc-getPKG_CONFIG) --libs xinerama 2>/dev/null)" '' + )" +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install +} diff --git a/x11-misc/dmenu/files/51_theme.diff b/x11-misc/dmenu/files/51_theme.diff new file mode 100644 index 0000000..de83860 --- /dev/null +++ b/x11-misc/dmenu/files/51_theme.diff @@ -0,0 +1,21 @@ +diff --git i/config.def.h w/config.def.h +index 1edb647..ee33692 100644 +--- i/config.def.h ++++ w/config.def.h +@@ -4,13 +4,13 @@ + static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ + /* -fn option overrides fonts[0]; default X11 font or font set */ + static const char *fonts[] = { +- "monospace:size=10" ++ "monospace:size=20" + }; + static const char *prompt = NULL; /* -p option; prompt to the left of input field */ + static const char *colors[SchemeLast][2] = { + /* fg bg */ +- [SchemeNorm] = { "#bbbbbb", "#222222" }, +- [SchemeSel] = { "#eeeeee", "#005577" }, ++ [SchemeNorm] = { "#c0b1c2", "#152126" }, ++ [SchemeSel] = { "#e1e1e6", "#db498b" }, + [SchemeOut] = { "#000000", "#00ffff" }, + }; + /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ diff --git a/x11-misc/dmenu/files/dmenu-5.2-gentoo.patch b/x11-misc/dmenu/files/dmenu-5.2-gentoo.patch new file mode 100644 index 0000000..91ee6f3 --- /dev/null +++ b/x11-misc/dmenu/files/dmenu-5.2-gentoo.patch @@ -0,0 +1,26 @@ +From 3c494e2289c93ab6262409f9498866bdfd57bcf4 Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev <gyakovlev@gentoo.org> +Date: Fri, 7 Oct 2022 11:29:04 -0700 +Subject: [PATCH] gentoo patch + +--- a/config.mk ++++ b/config.mk +@@ -20,13 +20,13 @@ FREETYPEINC = /usr/include/freetype2 + #MANPREFIX = ${PREFIX}/man + + # includes and libs +-INCS = -I$(X11INC) -I$(FREETYPEINC) +-LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) ++INCS = $(X11INC) $(FREETYPEINC) ++LIBS = $(X11LIB) $(XINERAMALIBS) $(FREETYPELIBS) + + # flags +-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) +-CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS) +-LDFLAGS = $(LIBS) ++CPPFLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) ++CFLAGS += -std=c99 -pedantic -Wall $(INCS) $(CPPFLAGS) ++LDFLAGS += $(LIBS) + + # compiler and linker + CC = cc diff --git a/x11-misc/dmenu/metadata.xml b/x11-misc/dmenu/metadata.xml new file mode 100644 index 0000000..20ab0b4 --- /dev/null +++ b/x11-misc/dmenu/metadata.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mail@mhsn.net</email> + </maintainer> +</pkgmetadata> diff --git a/x11-misc/slock/files/01-slock-fix-link-paths.patch b/x11-misc/slock/files/01-slock-fix-link-paths.patch new file mode 100644 index 0000000..503c2e5 --- /dev/null +++ b/x11-misc/slock/files/01-slock-fix-link-paths.patch @@ -0,0 +1,18 @@ +From: Sam James <sam@gentoo.org> +Date: Wed, 30 Jun 2021 06:54:36 +0100 +Subject: [PATCH] Drop unnecessary include, library paths + +Closes: https://bugs.gentoo.org/732410 +--- a/config.mk ++++ b/config.mk +@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include + X11LIB = /usr/X11R6/lib + + # includes and libs +-INCS = -I. -I/usr/include -I${X11INC} +-LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr ++INCS = -I. -I${X11INC} ++LIBS = -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr + + # flags + CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H diff --git a/x11-misc/slock/files/02-slock-dpms-1.4.patch b/x11-misc/slock/files/02-slock-dpms-1.4.patch new file mode 100644 index 0000000..027bbf7 --- /dev/null +++ b/x11-misc/slock/files/02-slock-dpms-1.4.patch @@ -0,0 +1,62 @@ +diff --git a/config.def.h b/config.def.h +index 9855e21..d01bd38 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -10,3 +10,6 @@ static const char *colorname[NUMCOLS] = { + + /* treat a cleared input like a wrong password (color) */ + static const int failonclear = 1; ++ ++/* time in seconds before the monitor shuts down */ ++static const int monitortime = 5; +diff --git a/slock.c b/slock.c +index d2f0886..f65a43b 100644 +--- a/slock.c ++++ b/slock.c +@@ -15,6 +15,7 @@ + #include <unistd.h> + #include <sys/types.h> + #include <X11/extensions/Xrandr.h> ++#include <X11/extensions/dpms.h> + #include <X11/keysym.h> + #include <X11/Xlib.h> + #include <X11/Xutil.h> +@@ -306,6 +307,7 @@ main(int argc, char **argv) { + const char *hash; + Display *dpy; + int s, nlocks, nscreens; ++ CARD16 standby, suspend, off; + + ARGBEGIN { + case 'v': +@@ -366,6 +368,20 @@ main(int argc, char **argv) { + if (nlocks != nscreens) + return 1; + ++ /* DPMS magic to disable the monitor */ ++ if (!DPMSCapable(dpy)) ++ die("slock: DPMSCapable failed\n"); ++ if (!DPMSEnable(dpy)) ++ die("slock: DPMSEnable failed\n"); ++ if (!DPMSGetTimeouts(dpy, &standby, &suspend, &off)) ++ die("slock: DPMSGetTimeouts failed\n"); ++ if (!standby || !suspend || !off) ++ die("slock: at least one DPMS variable is zero\n"); ++ if (!DPMSSetTimeouts(dpy, monitortime, monitortime, monitortime)) ++ die("slock: DPMSSetTimeouts failed\n"); ++ ++ XSync(dpy, 0); ++ + /* run post-lock command */ + if (argc > 0) { + switch (fork()) { +@@ -383,5 +399,9 @@ main(int argc, char **argv) { + /* everything is now blank. Wait for the correct password */ + readpw(dpy, &rr, locks, nscreens, hash); + ++ /* reset DPMS values to inital ones */ ++ DPMSSetTimeouts(dpy, standby, suspend, off); ++ XSync(dpy, 0); ++ + return 0; + } diff --git a/x11-misc/slock/files/50-colors.patch b/x11-misc/slock/files/50-colors.patch new file mode 100644 index 0000000..b9b3509 --- /dev/null +++ b/x11-misc/slock/files/50-colors.patch @@ -0,0 +1,17 @@ +diff --git i/config.def.h w/config.def.h +index 9855e21..5aa29be 100644 +--- i/config.def.h ++++ w/config.def.h +@@ -3,9 +3,9 @@ static const char *user = "nobody"; + static const char *group = "nogroup"; + + static const char *colorname[NUMCOLS] = { +- [INIT] = "black", /* after initialization */ +- [INPUT] = "#005577", /* during input */ +- [FAILED] = "#CC3333", /* wrong password */ ++ [INIT] = "#152126", /* after initialization */ ++ [INPUT] = "#152126", /* during input */ ++ [FAILED] = "#682733", /* wrong password */ + }; + + /* treat a cleared input like a wrong password (color) */ diff --git a/x11-misc/slock/metadata.xml b/x11-misc/slock/metadata.xml new file mode 100644 index 0000000..20ab0b4 --- /dev/null +++ b/x11-misc/slock/metadata.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mail@mhsn.net</email> + </maintainer> +</pkgmetadata> diff --git a/x11-misc/slock/slock-9999.ebuild b/x11-misc/slock/slock-9999.ebuild new file mode 100644 index 0000000..14a676b --- /dev/null +++ b/x11-misc/slock/slock-9999.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit git-r3 fcaps toolchain-funcs + +DESCRIPTION="simple X display locker" +HOMEPAGE="https://tools.suckless.org/slock/" +EGIT_REPO_URI="https://git.suckless.org/slock" + +LICENSE="MIT" +SLOT="0" + +RDEPEND=" + virtual/libcrypt:= + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXrandr +" +DEPEND=" + ${RDEPEND} + x11-base/xorg-proto +" + +PATCHES=( + "${FILESDIR}"/01-slock-fix-link-paths.patch + "${FILESDIR}"/02-slock-dpms-1.4.patch + "${FILESDIR}"/50-colors.patch +) + +src_prepare() { + default + + sed -i \ + -e '/^CFLAGS/{s: -Os::g; s:= :+= :g}' \ + -e '/^CC/d' \ + -e '/^LDFLAGS/{s:-s::g; s:= :+= :g}' \ + config.mk || die + sed -i \ + -e 's|@${CC}|$(CC)|g' \ + Makefile || die + + tc-export CC +} + +src_compile() { + emake slock +} + +src_install() { + dobin slock +} + +pkg_postinst() { + # cap_dac_read_search used to be enough for shadow access + # but now slock wants to write to /proc/self/oom_score_adj + # and for that it needs: + fcaps \ + cap_dac_override,cap_setgid,cap_setuid,cap_sys_resource \ + /usr/bin/slock +} |