mirror of
https://github.com/jbowdre/dotfiles.git
synced 2024-11-22 01:12:19 +00:00
add waybar
This commit is contained in:
parent
9a37482320
commit
3e0b5a1872
3 changed files with 52 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
imports = [
|
||||
./firefox.nix
|
||||
./gtk.nix
|
||||
./qt.nix
|
||||
./vscode.nix
|
||||
];
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./mako.nix
|
||||
./kitty.nix
|
||||
./mako.nix
|
||||
./waybar.nix
|
||||
];
|
||||
|
||||
xdg.mimeApps.enable = true;
|
||||
|
|
49
home/features/desktop/wayland-wm/waybar.nix
Normal file
49
home/features/desktop/wayland-wm/waybar.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ ouputs, cofig, lib, pkgs, ... }:
|
||||
let
|
||||
cat = "${pkgs.coreutils}/bin/cat";
|
||||
cut = "${pkgs.coreutils}/bin/cut";
|
||||
find = "${pkgs.findutils}/bin/find";
|
||||
grep = "${pkgs.gnugrep}/bin/grep";
|
||||
journalctl = "${pkgs.systemd}/bin/journalctl";
|
||||
jq = "${pkgs.jq}/bin/jq";
|
||||
pgrep = "${pkgs.procps}/bin/pgrep";
|
||||
ping = "${pkgs.iputils}/bin/ping";
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
playerctld = "${pkgs.playerctl}/bin/playerctld";
|
||||
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||
tail = "${pkgs.coreutils}/bin/tail";
|
||||
timeout = "${pkgs.coreutils}/bin/timeout";
|
||||
wc = "${pkgs.coreutils}/bin/wc";
|
||||
wofi = "${pkgs.wofi}/bin/wofi";
|
||||
xargs = "${pkgs.findutils}/bin/xargs";
|
||||
|
||||
jsonOutput = name: { pre ? "", text ? "", tooltip ? "", alt? "", class ? "", percentage ? "" }: "${pkgs.writeShellScriptBin "waybar-${name}" ''
|
||||
set -euo pipefail
|
||||
${pre}
|
||||
${jq} -cn \
|
||||
--arg text "${text}" \
|
||||
--arg tooltip "${tooltip}" \
|
||||
--arg alt "${alt}" \
|
||||
--arg class "${class}" \
|
||||
--arg percentage "${percentage}" \
|
||||
'{text:$text,tooltip:$tooltip,alt:$alt,class:$class,percentage:$percentage}'
|
||||
''}/bin/waybar-${name}";
|
||||
in
|
||||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
package = pkgs.waybar.overrideAttrs (oa: {
|
||||
mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ];
|
||||
});
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
primary = {
|
||||
mode = "dock";
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 24;
|
||||
margin = "6";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue