add do-not-disturb

This commit is contained in:
Vivian 2022-09-24 13:57:01 +02:00
parent 771a693fe9
commit 70e557af91
10 changed files with 119 additions and 73 deletions

View file

@ -400,11 +400,11 @@
"wlroots": "wlroots" "wlroots": "wlroots"
}, },
"locked": { "locked": {
"lastModified": 1663877642, "lastModified": 1664023338,
"narHash": "sha256-Hqmme1q2z0cl9RCzfCD9M2ZeZgmxrPGO0RDeIia+yvE=", "narHash": "sha256-S2f84PqAS75UXK0Mdf9uBn89a4UVNthA3RnSKB+sP7k=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "e5d143b2386c3773f6fb5176752a1b381d3ee7a5", "rev": "73dbacd16d16d8a58d9c12e2a3ebcf4538faf55b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -511,11 +511,11 @@
"utils": "utils_4" "utils": "utils_4"
}, },
"locked": { "locked": {
"lastModified": 1663823263, "lastModified": 1663984587,
"narHash": "sha256-u2glihcKP6tr8tW5Glz0pXhxOwfuRdJQGslJsg4dIFQ=", "narHash": "sha256-BNq/NWT74mCg5eYo1NC9K+oJ1KqwQOL+fDesyO20a3E=",
"owner": "jyooru", "owner": "jyooru",
"repo": "nix-minecraft-servers", "repo": "nix-minecraft-servers",
"rev": "51b10b3388b367dfdf8dcd7f695bdfdfc5105256", "rev": "03e15c3aa8220c59d8b8c7454a288fc163fdf646",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -22,7 +22,7 @@ let vs = config.vault-secrets.secrets; in
config.services.outline.port config.services.outline.port
]; ];
vault-secrets.secrets.outline = { vault-secrets.secrets.outline = {
user = config.services.outline.user; user = config.services.outline.user;
group = config.services.outline.group; group = config.services.outline.group;
}; };
@ -44,12 +44,12 @@ let vs = config.vault-secrets.secrets; in
region = "us-east-1"; # fake region = "us-east-1"; # fake
}; };
oidcAuthentication = { oidcAuthentication = {
userinfoUrl= "https://git.0x76.dev/login/oauth/userinfo"; displayName = "Keycloak";
tokenUrl = "https://git.0x76.dev/login/oauth/access_token"; userinfoUrl = "https://id.0x76.dev/realms/master/protocol/openid-connect/userinfo";
displayName = "Gitea"; tokenUrl = "https://id.0x76.dev/realms/master/protocol/openid-connect/token";
clientId = "db58b9f0-aed1-4a60-a9bb-56077a790f5b"; clientId = "outline";
authUrl = "https://git.0x76.dev/login/oauth/authorize"; authUrl = "https://id.0x76.dev/realms/master/protocol/openid-connect/auth";
clientSecretFile = "${vs.outline}/giteaClientSecret"; clientSecretFile = "${vs.outline}/keycloakClientSecret";
}; };
}; };
} }

View file

@ -9,7 +9,8 @@
home.file.".config/eww/eww.yuck".source = ./eww.yuck; home.file.".config/eww/eww.yuck".source = ./eww.yuck;
home.file.".config/eww/eww.scss".text = builtins.readFile ./eww.scss; home.file.".config/eww/eww.scss".text = builtins.readFile ./eww.scss;
# scripts # scripts
# TODO: just link all scripts in ./scripts to .config/eww/scripts
home.file.".config/eww/scripts/volume.sh" = { home.file.".config/eww/scripts/volume.sh" = {
source = ./scripts/volume.sh; source = ./scripts/volume.sh;
executable = true; executable = true;
@ -29,4 +30,9 @@
source = ./scripts/workspaces.lua; source = ./scripts/workspaces.lua;
executable = true; executable = true;
}; };
home.file.".config/eww/scripts/do-not-disturb.sh" = {
source = ./scripts/do-not-disturb.sh;
executable = true;
};
} }

View file

@ -10,11 +10,6 @@ tooltip {
border-radius: 5px border-radius: 5px
} }
.icon {
font-family: monospace;
font-size: 1.4rem;
}
button { button {
transition: background-color 200ms, color 200ms; transition: background-color 200ms, color 200ms;
} }
@ -35,12 +30,6 @@ button {
.bar { .bar {
background-color: $mantle; background-color: $mantle;
border-left: 4px dotted $red;
}
.wifi {
font-size: 2rem;
color: $mauve;
} }
.clock { .clock {
@ -52,29 +41,28 @@ button {
margin: 0.5rem; margin: 0.5rem;
} }
.date { .date {
font-size: 1.5rem; font-size: 1.5rem;
color: $text; color: $text;
} }
.reg-btn {
font-size: 2rem;
margin: 2px 8px;
border-radius: 10px;
}
.battery { .battery {
font-family: monospace;
font-size: 1.5rem; font-size: 1.5rem;
color: $teal; color: $teal;
} }
.volume { .volume,
.dnd,
.wifi {
font-family: monospace;
font-size: 1.5rem; font-size: 1.5rem;
color: $mauve; color: $mauve;
padding: 0 5px;
} }
// battery menu // battery menu
.batterywindow { .batterywindow {
background-color: $mantle; background-color: $mantle;

View file

@ -1,12 +1,24 @@
(defwidget bar [] (defwidget bar []
(centerbox :orientation "v" :hexpand false (centerbox
(box :valign "start" :hexpand false :vexpand true :orientation "v" :space-evenly false :orientation "v"
(box
:valign "start"
:hexpand false
:vexpand false
:orientation "v"
:space-evenly false
) )
(workspaces :halign "center" :vexpand true :hexpand false :orientation "v") (workspaces
:halign "center"
:vexpand true
:hexpand false
:orientation "v"
)
(box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false (box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false
(wifi) (wifi)
(do-not-disturb)
(volume) (volume)
(battery) (battery)
(time) (time)
@ -14,23 +26,11 @@
) )
) )
;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defpoll wifi :interval "30s" "./scripts/wifi.sh")
(defwidget wifi []
(box :vexpand false :hexpand false :orientation "v"
(label :text {wifi.icon}
:limit-width 10
:tooltip {wifi.status}
:class "wifi"
)
)
)
;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defwidget battery [] (defwidget battery []
(eventbox :onclick "eww open batterywindow --toggle" (eventbox :onclick "eww open batterywindow --toggle"
(label :text `${ (label
:text `${
EWW_BATTERY.BAT0.status == "Charging" ? "" : EWW_BATTERY.BAT0.status == "Charging" ? "" :
EWW_BATTERY.BAT0.capacity < 10 ? "" : EWW_BATTERY.BAT0.capacity < 10 ? "" :
EWW_BATTERY.BAT0.capacity < 20 ? "" : EWW_BATTERY.BAT0.capacity < 20 ? "" :
@ -42,7 +42,6 @@
EWW_BATTERY.BAT0.capacity < 80 ? "" : EWW_BATTERY.BAT0.capacity < 80 ? "" :
EWW_BATTERY.BAT0.capacity < 90 ? "" : "" EWW_BATTERY.BAT0.capacity < 90 ? "" : ""
}` }`
:limit-width 10
:class "battery" :class "battery"
)) ))
) )
@ -65,12 +64,47 @@
(batterymenu) (batterymenu)
) )
; ━━━ do-not-disturb ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defvar dnd "")
(defwidget do-not-disturb []
(eventbox
:orientation "h"
:halign "center"
:space-evenly false
:onclick "nohup ./scripts/do-not-disturb.sh &"
(label
:text {dnd}
:class "dnd"
)
)
)
;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defpoll wifi :interval "30s" "./scripts/wifi.sh")
(defwidget wifi []
(box
:orientation "h"
:halign "center"
:space-evenly false
(label
:text {wifi.icon}
:tooltip {wifi.status}
:class "wifi"
)
)
)
;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defpoll volume :interval "1s" "./scripts/volume.sh") (defpoll volume :interval "1s" "./scripts/volume.sh")
(defwidget volume [] (defwidget volume []
(eventbox :onclick "pamixer -t" (eventbox
(label :text {volume.icon} :orientation "h"
:limit-width 10 :halign "center"
:space-evenly false
:onclick "pamixer -t"
(label
:text {volume.icon}
:tooltip "${volume.percent}%" :tooltip "${volume.percent}%"
:class "volume" :class "volume"
) )
@ -83,7 +117,10 @@
(defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'") (defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'")
(defwidget time [] (defwidget time []
(eventbox :cursor "hand" :hexpand false :vexpand false (eventbox
:cursor "hand"
:hexpand false
:vexpand false
:tooltip "${dateVar}" :tooltip "${dateVar}"
:onclick "eww open calendar --toggle &" :onclick "eww open calendar --toggle &"
(box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock" (box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock"

View file

@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#! nix-shell -p jq -i bash
if makoctl mode | grep -Fxq "do-not-disturb"; then
eww update dnd=""
makoctl mode -r do-not-disturb > /dev/null
else
eww update dnd=""
makoctl mode -a do-not-disturb > /dev/null
fi

View file

@ -1,15 +1,15 @@
#!/bin/sh #!/bin/sh
if nmcli g | rg -q "\bconnected\b"; then if nmcli g | rg -q "\bconnected\b"; then
icon="󰤨" icon=""
ssid=$(nmcli -t -f name connection show --active) ssid=$(nmcli -t -f name connection show --active | sed -z 's/\n/,/g;s/,$/\n/')
if echo $ssid | rg -q "Wired"; then if echo $ssid | rg -q "Wired"; then
status="Connected via cable" status="Connected via cable"
else else
status="Connected to ${ssid}" status="Connected to ${ssid}"
fi fi
else else
icon="󰤭" icon=""
status="offline" status="offline"
fi fi

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { { pkgs, inputs, config, ... }: {
home.file.".config/hypr/hyprpaper.conf".text = '' home.file.".config/hypr/hyprpaper.conf".text = ''
ipc = off ipc = off
preload = ~/cloud/Pictures/Wallpapers-Laptop/wallpaper-nix-pink.png preload = ~/cloud/Pictures/Wallpapers-Laptop/wallpaper-nix-pink.png
@ -9,7 +9,7 @@
let let
startup-script = pkgs.writeScriptBin "startup" '' startup-script = pkgs.writeScriptBin "startup" ''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
hyprctl setcursor Catppuccin-Frappe-Pink-Cursors 32 hyprctl setcursor Catppuccin-Frappe-Pink-Cursors ${builtins.toString config.home.pointerCursor.size}
${pkgs.hyprpaper}/bin/hyprpaper & ${pkgs.hyprpaper}/bin/hyprpaper &
${pkgs.xsettingsd}/bin/xsettingsd & ${pkgs.xsettingsd}/bin/xsettingsd &
foot --server & foot --server &
@ -22,6 +22,7 @@
in in
{ {
enable = true; enable = true;
recommendedEnvironment = true;
extraConfig = '' extraConfig = ''
monitor=eDP-1,1920x1080@60,0x0,1 monitor=eDP-1,1920x1080@60,0x0,1
monitor=eDP-1,addreserved,0,0,48,0 monitor=eDP-1,addreserved,0,0,48,0

View file

@ -1,9 +1,9 @@
{ lib, pkgs, ... }: { lib, pkgs, config, ... }:
let let
inherit (builtins) mapAttrs; inherit (builtins) mapAttrs;
theme = "Catppuccin-Pink-Dark"; theme = "Catppuccin-Pink-Dark";
cursorTheme = "Catppuccin-Frappe-Pink-Cursors"; cursorTheme = config.home.pointerCursor.name;
colour = rec { colour = rec {
rosewater = "f2d5cf"; rosewater = "f2d5cf";
flamingo = "eebebe"; flamingo = "eebebe";
@ -41,6 +41,12 @@ in
Gtk/CursorThemeName "${cursorTheme}" Gtk/CursorThemeName "${cursorTheme}"
''; '';
home.pointerCursor = {
name = "Catppuccin-Frappe-Pink-Cursors";
size = 32;
package = pkgs.catppuccin.cursors;
};
gtk = { gtk = {
enable = true; enable = true;
theme = { theme = {
@ -53,8 +59,8 @@ in
}; };
cursorTheme = { cursorTheme = {
name = cursorTheme; name = cursorTheme;
package = pkgs.catppuccin.cursors; package = config.home.pointerCursor.package;
size = 32; size = config.home.pointerCursor.size;
}; };
}; };

View file

@ -1,13 +1,10 @@
final: prev: { final: prev: {
hedgedoc = prev.hedgedoc.overrideAttrs (old: { # hedgedoc = prev.hedgedoc.overrideAttrs (old: {
# see https://github.com/NixOS/nixpkgs/issues/176127#issuecomment-1146782555 # # see https://github.com/NixOS/nixpkgs/issues/176127#issuecomment-1146782555
preBuild = '' # preBuild = ''
export HOME=$TMPDIR # export HOME=$TMPDIR
''; # '';
}); # });
discord-canary = prev.discord-canary.override { withOpenASAR = true; };
catppuccin.cursors = prev.callPackage ./catppuccin/cursors { }; catppuccin.cursors = prev.callPackage ./catppuccin/cursors { };
vmagent = prev.callPackage ./vmagent { }; vmagent = prev.callPackage ./vmagent { };
@ -21,6 +18,7 @@ final: prev: {
withDNSCrypt = true; withDNSCrypt = true;
withTFO = true; withTFO = true;
}; };
gitea-agatheme = prev.callPackage ./gitea-agatheme { }; gitea-agatheme = prev.callPackage ./gitea-agatheme { };
}; };
} }