add do-not-disturb
This commit is contained in:
parent
771a693fe9
commit
70e557af91
10 changed files with 119 additions and 73 deletions
|
@ -9,7 +9,8 @@
|
|||
home.file.".config/eww/eww.yuck".source = ./eww.yuck;
|
||||
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" = {
|
||||
source = ./scripts/volume.sh;
|
||||
executable = true;
|
||||
|
@ -29,4 +30,9 @@
|
|||
source = ./scripts/workspaces.lua;
|
||||
executable = true;
|
||||
};
|
||||
|
||||
home.file.".config/eww/scripts/do-not-disturb.sh" = {
|
||||
source = ./scripts/do-not-disturb.sh;
|
||||
executable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,11 +10,6 @@ tooltip {
|
|||
border-radius: 5px
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-family: monospace;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
button {
|
||||
transition: background-color 200ms, color 200ms;
|
||||
}
|
||||
|
@ -35,12 +30,6 @@ button {
|
|||
|
||||
.bar {
|
||||
background-color: $mantle;
|
||||
border-left: 4px dotted $red;
|
||||
}
|
||||
|
||||
.wifi {
|
||||
font-size: 2rem;
|
||||
color: $mauve;
|
||||
}
|
||||
|
||||
.clock {
|
||||
|
@ -52,29 +41,28 @@ button {
|
|||
margin: 0.5rem;
|
||||
}
|
||||
|
||||
|
||||
.date {
|
||||
font-size: 1.5rem;
|
||||
color: $text;
|
||||
}
|
||||
|
||||
.reg-btn {
|
||||
font-size: 2rem;
|
||||
margin: 2px 8px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
|
||||
.battery {
|
||||
font-family: monospace;
|
||||
font-size: 1.5rem;
|
||||
color: $teal;
|
||||
}
|
||||
|
||||
.volume {
|
||||
.volume,
|
||||
.dnd,
|
||||
.wifi {
|
||||
font-family: monospace;
|
||||
font-size: 1.5rem;
|
||||
color: $mauve;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
|
||||
// battery menu
|
||||
.batterywindow {
|
||||
background-color: $mantle;
|
||||
|
|
|
@ -1,12 +1,24 @@
|
|||
(defwidget bar []
|
||||
(centerbox :orientation "v" :hexpand false
|
||||
(box :valign "start" :hexpand false :vexpand true :orientation "v" :space-evenly false
|
||||
(centerbox
|
||||
: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
|
||||
(wifi)
|
||||
(do-not-disturb)
|
||||
(volume)
|
||||
(battery)
|
||||
(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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
(defwidget battery []
|
||||
(eventbox :onclick "eww open batterywindow --toggle"
|
||||
(label :text `${
|
||||
(label
|
||||
:text `${
|
||||
EWW_BATTERY.BAT0.status == "Charging" ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 10 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 20 ? "" :
|
||||
|
@ -42,7 +42,6 @@
|
|||
EWW_BATTERY.BAT0.capacity < 80 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 90 ? "" : ""
|
||||
}`
|
||||
:limit-width 10
|
||||
:class "battery"
|
||||
))
|
||||
)
|
||||
|
@ -65,12 +64,47 @@
|
|||
(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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
(defpoll volume :interval "1s" "./scripts/volume.sh")
|
||||
(defwidget volume []
|
||||
(eventbox :onclick "pamixer -t"
|
||||
(label :text {volume.icon}
|
||||
:limit-width 10
|
||||
(eventbox
|
||||
:orientation "h"
|
||||
:halign "center"
|
||||
:space-evenly false
|
||||
:onclick "pamixer -t"
|
||||
(label
|
||||
:text {volume.icon}
|
||||
:tooltip "${volume.percent}%"
|
||||
:class "volume"
|
||||
)
|
||||
|
@ -83,7 +117,10 @@
|
|||
(defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'")
|
||||
|
||||
(defwidget time []
|
||||
(eventbox :cursor "hand" :hexpand false :vexpand false
|
||||
(eventbox
|
||||
:cursor "hand"
|
||||
:hexpand false
|
||||
:vexpand false
|
||||
:tooltip "${dateVar}"
|
||||
:onclick "eww open calendar --toggle &"
|
||||
(box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock"
|
||||
|
|
10
nixos/hosts/thalassa/null/home/eww/scripts/do-not-disturb.sh
Executable file
10
nixos/hosts/thalassa/null/home/eww/scripts/do-not-disturb.sh
Executable 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
|
|
@ -1,15 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
if nmcli g | rg -q "\bconnected\b"; then
|
||||
icon=""
|
||||
ssid=$(nmcli -t -f name connection show --active)
|
||||
icon="直"
|
||||
ssid=$(nmcli -t -f name connection show --active | sed -z 's/\n/,/g;s/,$/\n/')
|
||||
if echo $ssid | rg -q "Wired"; then
|
||||
status="Connected via cable"
|
||||
else
|
||||
status="Connected to ${ssid}"
|
||||
fi
|
||||
else
|
||||
icon=""
|
||||
icon="睊"
|
||||
status="offline"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, inputs, ... }: {
|
||||
{ pkgs, inputs, config, ... }: {
|
||||
home.file.".config/hypr/hyprpaper.conf".text = ''
|
||||
ipc = off
|
||||
preload = ~/cloud/Pictures/Wallpapers-Laptop/wallpaper-nix-pink.png
|
||||
|
@ -9,7 +9,7 @@
|
|||
let
|
||||
startup-script = pkgs.writeScriptBin "startup" ''
|
||||
#!${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.xsettingsd}/bin/xsettingsd &
|
||||
foot --server &
|
||||
|
@ -22,6 +22,7 @@
|
|||
in
|
||||
{
|
||||
enable = true;
|
||||
recommendedEnvironment = true;
|
||||
extraConfig = ''
|
||||
monitor=eDP-1,1920x1080@60,0x0,1
|
||||
monitor=eDP-1,addreserved,0,0,48,0
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
inherit (builtins) mapAttrs;
|
||||
|
||||
theme = "Catppuccin-Pink-Dark";
|
||||
cursorTheme = "Catppuccin-Frappe-Pink-Cursors";
|
||||
cursorTheme = config.home.pointerCursor.name;
|
||||
colour = rec {
|
||||
rosewater = "f2d5cf";
|
||||
flamingo = "eebebe";
|
||||
|
@ -41,6 +41,12 @@ in
|
|||
Gtk/CursorThemeName "${cursorTheme}"
|
||||
'';
|
||||
|
||||
home.pointerCursor = {
|
||||
name = "Catppuccin-Frappe-Pink-Cursors";
|
||||
size = 32;
|
||||
package = pkgs.catppuccin.cursors;
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
|
@ -53,8 +59,8 @@ in
|
|||
};
|
||||
cursorTheme = {
|
||||
name = cursorTheme;
|
||||
package = pkgs.catppuccin.cursors;
|
||||
size = 32;
|
||||
package = config.home.pointerCursor.package;
|
||||
size = config.home.pointerCursor.size;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue