blob: 18bf714c84af7d1188354496546db1fe8ebf5315 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# desktop-pager in its own xterm, and its utilities, like desktops.
# usage:
# desktop-pager toggle [WINDOW_ID]
# desktop-pager shift [WINDOW_ID]
{ pkgs }:
let
desktop-pager = pkgs.withLocalBuild pkgs.haskellPackages.desktop-pager;
in
pkgs.symlinkJoin {
name = "desktop-pager-wrapper";
paths = [
(pkgs.writeDashBin "desktop-pager" ''
set -efu
pidfile=$XDG_RUNTIME_DIR/desktop-pager.lock
if test -e "$pidfile" &&
${pkgs.procps}/bin/pgrep --pidfile="$pidfile" >/dev/null
then
${pkgs.procps}/bin/pkill --pidfile="$pidfile"
${pkgs.coreutils}/bin/rm "$pidfile"
exit
fi
echo $$ > "$pidfile"
dpi=$(
${pkgs.haskellPackages.xoutinfo}/bin/xoutinfo |
${pkgs.jq}/bin/jq '.dpi_x | round'
)
exec ${pkgs.xterm}/bin/xterm \
-name DesktopPagerFloat \
-xrm "Xft.dpi: $dpi" \
-e ${desktop-pager}/bin/desktop-pager "$@"
'')
desktop-pager
];
}
|