Use eww from repo

This commit is contained in:
Erwin Boskma 2023-07-10 13:42:25 +02:00
parent 56d23a2480
commit 2478135dc5
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg
4 changed files with 68 additions and 9 deletions

View file

@ -2,7 +2,7 @@
"nodes": {
"crane": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"flake-utils": [
"ha-now-playing",
"flake-utils"
@ -74,7 +74,47 @@
"type": "github"
}
},
"eww": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": [
"rust-overlay"
]
},
"locked": {
"lastModified": 1686423460,
"narHash": "sha256-8e6gHSg6FDp6nU5v89D44Tqb1lR5aQpS0lXOVqzoUS4=",
"owner": "elkowar",
"repo": "eww",
"rev": "25e50eda46379bccd8a7887c18ee35833e0460e8",
"type": "github"
},
"original": {
"owner": "elkowar",
"repo": "eww",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
@ -90,7 +130,7 @@
"type": "github"
}
},
"flake-compat_2": {
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
@ -446,7 +486,7 @@
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_3",
"flake-utils": [
"flake-utils"
],
@ -474,6 +514,7 @@
"inputs": {
"disko": "disko",
"emacs-overlay": "emacs-overlay",
"eww": "eww",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"ha-now-playing": "ha-now-playing",

View file

@ -72,6 +72,12 @@
url = "github:rytec-nl/nixpkgs/submit/add-nomachine-server";
};
eww = {
url = "github:elkowar/eww";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
};
ha-now-playing = {
url = "git+https://git.datarift.nl/erwin/ha-now-playing.git?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
@ -132,6 +138,8 @@
pamedia.overlays.${system}
emacs-overlay.overlay
nil.overlays.default
inputs.eww.overlays.default
inputs.rust-overlay.overlays.default
(_final: _prev: {
nomachine = nomachine-pkgs.nomachine;
})
@ -248,6 +256,8 @@
taplo
just
eww-wayland
disko.packages.${system}.disko
];
};

View file

@ -4,7 +4,7 @@
(defvar show-volume false)
(defvar volume-muted false)
(defvar ha-now-playing "/nix/store/n3364y7amwgjs94whqapvdvp9d7d3zrh-ha-now-playing-0.5.0/bin/ha-now-playing --host home.datarift.nl --token-file /run/secrets/ha_now_playing_token --entity media_player.sonos_woonkamer")
(defvar ha-now-playing "ha-now-playing --host home.datarift.nl --token-file /run/secrets/ha_now_playing_token --entity media_player.sonos_woonkamer")
;; Polls
(defpoll volume-current
:initial 0
@ -14,11 +14,11 @@
;; Listen
(deflisten sonos-now-playing
:initial "{\"muted\":false,\"text\":\"\"}"
`/nix/store/n3364y7amwgjs94whqapvdvp9d7d3zrh-ha-now-playing-0.5.0/bin/ha-now-playing --host home.datarift.nl --token-file /run/secrets/ha_now_playing_token --entity media_player.sonos_woonkamer`)
`ha-now-playing --host home.datarift.nl --token-file /run/secrets/ha_now_playing_token --entity media_player.sonos_woonkamer`)
(deflisten wm-info
:initial "{\"workspaces\":[],\"mode\":\"default\",\"title\":\"\"}"
`scripts/workspaces.nu`)
`./scripts/workspaces.nu`)
;; Widgets
(defwidget mode []
@ -64,6 +64,8 @@
(eventbox :onclick "${ha-now-playing} play-pause"
:onrightclick "${ha-now-playing} ${sonos-now-playing.muted ? 'unmute' : 'mute'}"
:onscroll "${ha-now-playing} volume-{}"
:active true
:halign "start"
(box :class "ha-now-playing"
:space-evenly false
:spacing 2
@ -188,6 +190,8 @@
(defwidget left []
(box :orientation "h"
:halign "start"
:space-evenly false
:spacing 5
(workspaces)
(ha-now-playing)))
@ -213,10 +217,10 @@
(centerbox
(left)
(title)
(end))))
(end))))
;; Bar windows
(defwindow bar-x11
(defwindow bar-home
:geometry (geometry :x "0"
:y "0"
:width "100%"

View file

@ -16,6 +16,8 @@ in
package = cfg.package;
};
home.packages = [ cfg.package ];
systemd.user.services.eww-daemon = {
Unit = {
Description = "eww";
@ -23,7 +25,9 @@ in
Service = {
ExecStart = "${cfg.package}/bin/eww --no-daemonize daemon";
Environment.PATH = makeBinPath [ pkgs.ha-now-playing pkgs.jaq pkgs.pamedia ];
Environment = [
"PATH=${makeBinPath [ pkgs.ha-now-playing pkgs.jaq pkgs.pamedia pkgs.bash ]}:${config.home.profileDirectory}/bin"
];
};
Install = {