Ver 1.0
This commit is contained in:
parent
b6b87d5aed
commit
9c72a71585
3546 changed files with 18655 additions and 0 deletions
BIN
nixosVista/homeManager/eww/widgets/assets/gif1.gif
Normal file
BIN
nixosVista/homeManager/eww/widgets/assets/gif1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
BIN
nixosVista/homeManager/eww/widgets/assets/gif2.gif
Normal file
BIN
nixosVista/homeManager/eww/widgets/assets/gif2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
nixosVista/homeManager/eww/widgets/assets/gif3.gif
Normal file
BIN
nixosVista/homeManager/eww/widgets/assets/gif3.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
nixosVista/homeManager/eww/widgets/assets/macscreen.png
Normal file
BIN
nixosVista/homeManager/eww/widgets/assets/macscreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
BIN
nixosVista/homeManager/eww/widgets/assets/os_logo.png
Normal file
BIN
nixosVista/homeManager/eww/widgets/assets/os_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
43
nixosVista/homeManager/eww/widgets/daybox.nix
Normal file
43
nixosVista/homeManager/eww/widgets/daybox.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkAfter;
|
||||
root = nixosVista.eww;
|
||||
cfg = root.widgets.daybox;
|
||||
in {
|
||||
options.nixosVista.eww.widgets.daybox.enable =
|
||||
mkEnableOption "Daybox widget";
|
||||
|
||||
config = mkIf (root.enable && cfg.enable) {
|
||||
home.file.".config/eww/daybox.yuck".text = ''
|
||||
(defwidget daybox []
|
||||
(box :halign "center" :valign "center" :class "container"
|
||||
(box :halign "center" :valign "center" :class "daybox"
|
||||
(label :class "date-label" :text DATE)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow daybox
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "noblur"
|
||||
:geometry (geometry
|
||||
:x "0px"
|
||||
:y "30px"
|
||||
:width "150px"
|
||||
:height "70px"
|
||||
:anchor "top center")
|
||||
(daybox)
|
||||
)
|
||||
'';
|
||||
|
||||
home.file.".config/eww/eww.yuck".text = mkAfter ''
|
||||
(include "daybox.yuck")
|
||||
'';
|
||||
};
|
||||
}
|
||||
110
nixosVista/homeManager/eww/widgets/diinkitemperature.nix
Normal file
110
nixosVista/homeManager/eww/widgets/diinkitemperature.nix
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types mkIf mkAfter;
|
||||
root = nixosVista.eww;
|
||||
cfg = root.widgets.diinkitemperature;
|
||||
in {
|
||||
options.nixosVista.eww.widgets.diinkitemperature = {
|
||||
enable = mkEnableOption "Temperature widget";
|
||||
|
||||
apiKey = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
cityID = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
unit = mkOption {
|
||||
type = types.enum ["metric" "imperial"];
|
||||
default = "metric";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (root.enable && cfg.enable) {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.apiKey != null && cfg.cityID != null;
|
||||
message = "Temperature widget requires apiKey and cityID.";
|
||||
}
|
||||
];
|
||||
|
||||
home.file = {
|
||||
".config/eww/images/macscreen.png".source =
|
||||
./assets/macscreen.png;
|
||||
|
||||
".config/eww/scripts/weather.sh" = {
|
||||
executable = true;
|
||||
source = pkgs.writeShellScript "eww-weather" ''
|
||||
API_KEY="${cfg.apiKey}"
|
||||
CITY_ID="${cfg.cityID}"
|
||||
UNIT="${cfg.unit}"
|
||||
|
||||
CACHE="$HOME/.cache/eww/weather.json"
|
||||
mkdir -p "$HOME/.cache/eww"
|
||||
|
||||
fetch() {
|
||||
${pkgs.curl}/bin/curl -s \
|
||||
"https://api.openweathermap.org/data/2.5/weather?id=$CITY_ID&appid=$API_KEY&units=$UNIT" \
|
||||
| ${pkgs.jq}/bin/jq '.' > "$CACHE"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--getdata)
|
||||
fetch
|
||||
;;
|
||||
--temp)
|
||||
${pkgs.jq}/bin/jq -r '.main.temp | tostring + "°"' "$CACHE"
|
||||
;;
|
||||
--stat)
|
||||
${pkgs.jq}/bin/jq -r '.weather[0].main' "$CACHE"
|
||||
;;
|
||||
--icon)
|
||||
${pkgs.jq}/bin/jq -r '.weather[0].icon' "$CACHE"
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
};
|
||||
|
||||
".config/eww/temperature.yuck".text = ''
|
||||
(defpoll TEMP :interval "30s" '~/.config/eww/scripts/weather.sh --temp')
|
||||
(defpoll WEATHER :interval "30s" '~/.config/eww/scripts/weather.sh --stat')
|
||||
(defpoll WEATHERICON :interval "30s" '~/.config/eww/scripts/weather.sh --icon')
|
||||
|
||||
(defwidget diinkitemperature []
|
||||
(overlay :halign "center" :valign "center" :class "temperature-container"
|
||||
(image :path "images/macscreen.png" :image-width 250)
|
||||
(label :text WEATHERICON :class "temp-label-header")
|
||||
(label :text TEMP :class "temp-label")
|
||||
(label :text WEATHER :class "weather-label")
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow diinkitemperature
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
:geometry (geometry
|
||||
:x "0px"
|
||||
:y "360px"
|
||||
:width "250px"
|
||||
:height "250px"
|
||||
:anchor "top right")
|
||||
(diinkitemperature)
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
home.file.".config/eww/eww.yuck".text = mkAfter ''
|
||||
(include "temperature.yuck")
|
||||
'';
|
||||
};
|
||||
}
|
||||
40
nixosVista/homeManager/eww/widgets/gif1.nix
Normal file
40
nixosVista/homeManager/eww/widgets/gif1.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkAfter;
|
||||
root = nixosVista.eww;
|
||||
cfg = root.widgets.gif1;
|
||||
in {
|
||||
options.nixosVista.eww.widgets.gif1.enable =
|
||||
mkEnableOption "Gif1 widget";
|
||||
|
||||
config = mkIf (root.enable && cfg.enable) {
|
||||
home.file = {
|
||||
".config/eww/images/gif1.gif".source =
|
||||
./assets/gif1.gif;
|
||||
|
||||
".config/eww/gif1.yuck".text = ''
|
||||
(defwidget gif1 []
|
||||
(box :halign "center" :valign "center" :class "container"
|
||||
(image :path "images/gif1.gif")
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow gif1
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
(gif1)
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
home.file.".config/eww/eww.yuck".text = mkAfter ''
|
||||
(include "gif1.yuck")
|
||||
'';
|
||||
};
|
||||
}
|
||||
40
nixosVista/homeManager/eww/widgets/gif2.nix
Normal file
40
nixosVista/homeManager/eww/widgets/gif2.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkAfter;
|
||||
root = nixosVista.eww;
|
||||
cfg = root.widgets.gif2;
|
||||
in {
|
||||
options.nixosVista.eww.widgets.gif2.enable =
|
||||
mkEnableOption "Gif2 widget";
|
||||
|
||||
config = mkIf (root.enable && cfg.enable) {
|
||||
home.file = {
|
||||
".config/eww/images/gif2.gif".source =
|
||||
./assets/gif2.gif;
|
||||
|
||||
".config/eww/gif2.yuck".text = ''
|
||||
(defwidget gif2 []
|
||||
(box :halign "center" :valign "center" :class "container"
|
||||
(image :path "images/gif2.gif")
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow gif2
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
(gif2)
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
home.file.".config/eww/eww.yuck".text = mkAfter ''
|
||||
(include "gif2.yuck")
|
||||
'';
|
||||
};
|
||||
}
|
||||
38
nixosVista/homeManager/eww/widgets/gif3.nix
Normal file
38
nixosVista/homeManager/eww/widgets/gif3.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkAfter;
|
||||
root = nixosVista.eww;
|
||||
cfg = root.widgets.gif3;
|
||||
in {
|
||||
options.nixosVista.eww.widgets.gif3.enable =
|
||||
mkEnableOption "Gif3 widget";
|
||||
|
||||
config = mkIf (root.enable && cfg.enable) {
|
||||
home.file = {
|
||||
".config/eww/images/gif3.gif".source =
|
||||
./assets/gif3.gif;
|
||||
|
||||
".config/eww/gif3.yuck".text = ''
|
||||
(defwidget gif3 []
|
||||
(image :path "images/gif3.gif")
|
||||
)
|
||||
|
||||
(defwindow gif3
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
(gif3)
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
home.file.".config/eww/eww.yuck".text = mkAfter ''
|
||||
(include "gif3.yuck")
|
||||
'';
|
||||
};
|
||||
}
|
||||
50
nixosVista/homeManager/eww/widgets/menu.nix
Normal file
50
nixosVista/homeManager/eww/widgets/menu.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkAfter;
|
||||
root = nixosVista.eww;
|
||||
cfg = root.widgets.menu;
|
||||
in {
|
||||
options.nixosVista.eww.widgets.menu.enable =
|
||||
mkEnableOption "Menu widget";
|
||||
|
||||
config = mkIf (root.enable && cfg.enable) {
|
||||
home.file = {
|
||||
".config/eww/images/os_logo.png".source =
|
||||
./assets/os_logo.png;
|
||||
|
||||
".config/eww/menu.yuck".text = ''
|
||||
(defwidget menu []
|
||||
(box :halign "center" :valign "center" :class "container"
|
||||
(button :onclick "wofi --show drun &" :class "button"
|
||||
(image :path "images/os_logo.png"
|
||||
:image-width 50
|
||||
:image-height 50)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow menu
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
:geometry (geometry
|
||||
:x "30px"
|
||||
:y "30px"
|
||||
:width "70px"
|
||||
:height "70px"
|
||||
:anchor "top right")
|
||||
(menu)
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
home.file.".config/eww/eww.yuck".text = mkAfter ''
|
||||
(include "menu.yuck")
|
||||
'';
|
||||
};
|
||||
}
|
||||
143
nixosVista/homeManager/eww/widgets/weather.nix
Normal file
143
nixosVista/homeManager/eww/widgets/weather.nix
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
cfg = nixosVista.eww;
|
||||
w = cfg.widgets;
|
||||
|
||||
############################################################
|
||||
# Window blocks
|
||||
############################################################
|
||||
|
||||
dayboxWindow = lib.optionalString w.daybox.enable ''
|
||||
(defwindow daybox
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "noblur"
|
||||
:geometry (geometry
|
||||
:x "0px"
|
||||
:y "30px"
|
||||
:width "150px"
|
||||
:height "70px"
|
||||
:anchor "top center")
|
||||
(daybox)
|
||||
)
|
||||
'';
|
||||
|
||||
menuWindow = lib.optionalString w.menu.enable ''
|
||||
(defwindow menu
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
:geometry (geometry
|
||||
:x "30px"
|
||||
:y "30px"
|
||||
:width "70px"
|
||||
:height "70px"
|
||||
:anchor "top right")
|
||||
(menu)
|
||||
)
|
||||
'';
|
||||
|
||||
temperatureWindow = lib.optionalString w.diinkitemperature.enable ''
|
||||
(defwindow diinkitemperature
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
:geometry (geometry
|
||||
:x "0px"
|
||||
:y "360px"
|
||||
:width "100px"
|
||||
:height "100px"
|
||||
:anchor "top right")
|
||||
(diinkitemperature)
|
||||
)
|
||||
'';
|
||||
|
||||
gif1Window = lib.optionalString w.gif1.enable ''
|
||||
(defwindow gif1
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
(gif1)
|
||||
)
|
||||
'';
|
||||
|
||||
############################################################
|
||||
# Final yuck
|
||||
############################################################
|
||||
|
||||
finalYuck = ''
|
||||
(include "eww_widgets.yuck")
|
||||
|
||||
${dayboxWindow}
|
||||
${menuWindow}
|
||||
${temperatureWindow}
|
||||
${gif1Window}
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.eww.enable = lib.mkIf cfg.enable true;
|
||||
|
||||
home.file.".config/eww/eww.yuck" = lib.mkIf cfg.enable {
|
||||
text = finalYuck;
|
||||
};
|
||||
}
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
nixosVista,
|
||||
...
|
||||
}: let
|
||||
root = nixosVista.eww;
|
||||
w = root.widgets.diinkitemperature;
|
||||
|
||||
weatherScript = pkgs.writeShellScript "weather.sh" ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
KEY="${w.apiKey}"
|
||||
ID="${w.cityID}"
|
||||
UNIT="${w.unit}"
|
||||
|
||||
echo "Weather stub"
|
||||
'';
|
||||
|
||||
windowBlock = lib.optionalString w.enable ''
|
||||
(defwindow diinkitemperature
|
||||
:monitor '["<primary>", 2, 1, 0]'
|
||||
:windowtype "dock"
|
||||
:stacking "bg"
|
||||
:namespace "eww"
|
||||
:geometry (geometry
|
||||
:x "0px"
|
||||
:y "360px"
|
||||
:width "100px"
|
||||
:height "100px"
|
||||
:anchor "top right")
|
||||
(diinkitemperature)
|
||||
)
|
||||
'';
|
||||
in {
|
||||
config = lib.mkIf (root.enable && w.enable) {
|
||||
home.packages = [
|
||||
pkgs.curl
|
||||
pkgs.jq
|
||||
];
|
||||
|
||||
home.file.".config/eww/scripts/weather.sh" = {
|
||||
source = weatherScript;
|
||||
executable = true;
|
||||
};
|
||||
|
||||
nixosVista.eww.generatedYuck =
|
||||
lib.mkAfter windowBlock;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue