nwg-panel: fixup the formatting
especially, make it fit on moby
This commit is contained in:
parent
ebff35a378
commit
3c2347faba
2
TODO.md
2
TODO.md
|
@ -91,7 +91,7 @@
|
||||||
- replace starship prompt with something more efficient
|
- replace starship prompt with something more efficient
|
||||||
- watch `forkstat`: it does way too much
|
- watch `forkstat`: it does way too much
|
||||||
- cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds
|
- cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds
|
||||||
- nwg-panel: alerts on battery = 0 on desko even though there's no battery
|
- nwg-panel: swaync icon is stuck as the refresh icon
|
||||||
- nwg-panel: doesn't appear on all desktops
|
- nwg-panel: doesn't appear on all desktops
|
||||||
- nwg-panel: doesn't know that virtual-desktop 10/TV exists
|
- nwg-panel: doesn't know that virtual-desktop 10/TV exists
|
||||||
- install apps:
|
- install apps:
|
||||||
|
|
|
@ -35,6 +35,11 @@
|
||||||
sane.programs."gnome.geary".config.autostart = true;
|
sane.programs."gnome.geary".config.autostart = true;
|
||||||
sane.programs.signal-desktop.config.autostart = true;
|
sane.programs.signal-desktop.config.autostart = true;
|
||||||
|
|
||||||
|
sane.programs.nwg-panel.config = {
|
||||||
|
battery = false;
|
||||||
|
brightness = false;
|
||||||
|
};
|
||||||
|
|
||||||
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
||||||
|
|
||||||
# needed to use libimobiledevice/ifuse, for iphone sync
|
# needed to use libimobiledevice/ifuse, for iphone sync
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"controls": "right",
|
"controls": "right",
|
||||||
"width": "auto",
|
"width": "auto",
|
||||||
"height": @height@,
|
"height": @height@,
|
||||||
"homogeneous": true,
|
"homogeneous": false,
|
||||||
"margin-top": 0,
|
"margin-top": 0,
|
||||||
"margin-bottom": 0,
|
"margin-bottom": 0,
|
||||||
"padding-horizontal": 0,
|
"padding-horizontal": 0,
|
||||||
|
@ -26,11 +26,7 @@
|
||||||
"playerctl"
|
"playerctl"
|
||||||
],
|
],
|
||||||
"controls-settings": {
|
"controls-settings": {
|
||||||
"components": [
|
"components": @components@,
|
||||||
"brightness",
|
|
||||||
"volume",
|
|
||||||
"battery"
|
|
||||||
],
|
|
||||||
"commands": {
|
"commands": {
|
||||||
"battery": ""
|
"battery": ""
|
||||||
},
|
},
|
||||||
|
@ -41,6 +37,7 @@
|
||||||
"leave-closes": false,
|
"leave-closes": false,
|
||||||
"click-closes": false,
|
"click-closes": false,
|
||||||
"css-name": "controls-window",
|
"css-name": "controls-window",
|
||||||
|
"window-width": 400,
|
||||||
"custom-items": [],
|
"custom-items": [],
|
||||||
"menu": {
|
"menu": {
|
||||||
"name": "Exit",
|
"name": "Exit",
|
||||||
|
|
|
@ -18,6 +18,13 @@ in
|
||||||
default = {};
|
default = {};
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
clockFontSize = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
# what looks good:
|
||||||
|
# - 15px on moby
|
||||||
|
# - 24px on lappy
|
||||||
|
default = lib.min 24 (cfg.config.fontSize - 1);
|
||||||
|
};
|
||||||
fontSize = mkOption {
|
fontSize = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 16;
|
default = 16;
|
||||||
|
@ -29,6 +36,8 @@ in
|
||||||
height of the top bar in px.
|
height of the top bar in px.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
battery = mkEnableOption' true "display battery status";
|
||||||
|
brightness = mkEnableOption' true "display backlight level and slider";
|
||||||
mediaTitle = mkEnableOption' true "display title of current song/media";
|
mediaTitle = mkEnableOption' true "display title of current song/media";
|
||||||
mediaPrevNext = mkEnableOption' true "display prev/next button in media";
|
mediaPrevNext = mkEnableOption' true "display prev/next button in media";
|
||||||
windowIcon = mkEnableOption' true "display icon of active window";
|
windowIcon = mkEnableOption' true "display icon of active window";
|
||||||
|
@ -60,6 +69,15 @@ in
|
||||||
patches = (base.patches or []) ++ lib.optionals (!cfg.config.mediaPrevNext) [
|
patches = (base.patches or []) ++ lib.optionals (!cfg.config.mediaPrevNext) [
|
||||||
./playerctl-no-prev-next.diff
|
./playerctl-no-prev-next.diff
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# disable the drop-down chevron by the controls.
|
||||||
|
# it's precious space on moby, doesn't do much to help on lappy either.
|
||||||
|
postPatch = (base.postPatch or "") + ''
|
||||||
|
substituteInPlace nwg_panel/modules/controls.py --replace-fail \
|
||||||
|
'box.pack_start(self.pan_image, False, False, 4)' \
|
||||||
|
'# box.pack_start(self.pan_image, False, False, 4)'
|
||||||
|
'';
|
||||||
|
|
||||||
# XXX(2024/06/13) the bluetooth stuff doesn't cross compile, so disable it
|
# XXX(2024/06/13) the bluetooth stuff doesn't cross compile, so disable it
|
||||||
propagatedBuildInputs = lib.filter (p: p.pname != "pybluez") base.propagatedBuildInputs;
|
propagatedBuildInputs = lib.filter (p: p.pname != "pybluez") base.propagatedBuildInputs;
|
||||||
|
|
||||||
|
@ -70,20 +88,35 @@ in
|
||||||
# fs.".config/nwg-panel/style.css".symlink.target = ./style.css;
|
# fs.".config/nwg-panel/style.css".symlink.target = ./style.css;
|
||||||
fs.".config/nwg-panel/config".symlink.target = pkgs.substituteAll {
|
fs.".config/nwg-panel/config".symlink.target = pkgs.substituteAll {
|
||||||
src = ./config;
|
src = ./config;
|
||||||
inherit (cfg.config) height windowIcon windowTitle workspaceHideEmpty;
|
inherit (cfg.config) height;
|
||||||
playerctlChars = if cfg.config.mediaTitle then 30 else 0;
|
windowIcon = builtins.toJSON cfg.config.windowIcon;
|
||||||
|
windowTitle = builtins.toJSON cfg.config.windowTitle;
|
||||||
|
workspaceHideEmpty = builtins.toJSON cfg.config.workspaceHideEmpty;
|
||||||
|
components = builtins.toJSON (
|
||||||
|
# order matters, mostly for the drop-down.
|
||||||
|
# default for most tools (e.g. swaync) is brightness control above volume.
|
||||||
|
lib.optionals cfg.config.brightness [
|
||||||
|
"brightness"
|
||||||
|
] ++ [
|
||||||
|
"volume"
|
||||||
|
] ++ lib.optionals cfg.config.battery [
|
||||||
|
"battery"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
playerctlChars = if cfg.config.mediaTitle then 60 else 0;
|
||||||
workspaceNumbers = builtins.toJSON cfg.config.workspaceNumbers;
|
workspaceNumbers = builtins.toJSON cfg.config.workspaceNumbers;
|
||||||
};
|
};
|
||||||
fs.".config/nwg-panel/style.css".symlink.target = pkgs.substituteAll {
|
fs.".config/nwg-panel/style.css".symlink.target = pkgs.substituteAll {
|
||||||
src = ./style.css;
|
src = ./style.css;
|
||||||
inherit (cfg.config) fontSize;
|
inherit (cfg.config) clockFontSize fontSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nwg-panel = {
|
services.nwg-panel = {
|
||||||
description = "nwg-panel status/topbar for wayland";
|
description = "nwg-panel status/topbar for wayland";
|
||||||
partOf = [ "graphical-session" ];
|
partOf = [ "graphical-session" ];
|
||||||
|
|
||||||
command = "nwg-panel";
|
# to debug styling, run with GTK_DEBUG=interactive
|
||||||
|
command = "env G_MESSAGES_DEBUG=all nwg-panel";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,10 +145,10 @@ scale slider {
|
||||||
min-width: 25px;
|
min-width: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#clock {
|
#clock {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 16px
|
font-size: @clockFontSize@px;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
/* UNUSED IN MY CURRENT CONFIG: COPIED FROM SAMPLE CONFIG */
|
/* UNUSED IN MY CURRENT CONFIG: COPIED FROM SAMPLE CONFIG */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user