Compare commits

..

5 commits

Author SHA1 Message Date
dd9ef0eda5 some work on the moon/sun-phase script 2023-11-06 21:00:12 -08:00
c540481dbd gcal resource files set up 2023-11-06 19:42:40 -08:00
8b11f985cd fixed screenshot alias 2023-11-06 17:27:13 -08:00
1db0b948ba added dashboard clock 2023-11-06 17:01:22 -08:00
43ca30abd1 added screenshot alias 2023-11-06 17:01:06 -08:00
10 changed files with 84 additions and 6 deletions

View file

@ -58,6 +58,7 @@ let
firefox # Internet access firefox # Internet access
freerdp # RDP client freerdp # RDP client
pkgs-stable.flameshot # screenshot utility pkgs-stable.flameshot # screenshot utility
pkgs-stable.grim pkgs-stable.slurp pkgs-stable.wl-clipboard # DIY wayland screenshots
pkgs-stable.frei0r # kdenlive video plugins pkgs-stable.frei0r # kdenlive video plugins
pkgs-stable.godot_4 pkgs-stable.godot_4
pkgs-stable.helvum # audio sink gui control pkgs-stable.helvum # audio sink gui control

View file

@ -6,11 +6,12 @@ in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
alsa-utils
gcal
jq
playerctl playerctl
pw-volume pw-volume
alsa-utils
socat socat
jq
]; ];
programs.eww = { programs.eww = {

View file

@ -3,6 +3,19 @@
border-radius: 16px; border-radius: 16px;
} }
.dash_clock {
background-image: linear-gradient(45deg, #7d7d7d, #262626 30%, #262626 60%, #10384a);
border-radius: 16px;
}
.dash_clock_time {
font-size: 30px;
}
.dash_clock_date {
font-size: 20px;
}
.btn_logout, .btn_restart, .btn_shutdown, .btn_switch_windows { .btn_logout, .btn_restart, .btn_shutdown, .btn_switch_windows {
font-size: 40px; font-size: 40px;
font-weight: bold; font-weight: bold;

View file

@ -18,6 +18,21 @@
:onaccept "eww update show_elevation_prompt=false;eww close elevate_to_windows; echo \"{}\" | sudo -S grub-reboot 1 && systemctl reboot") :onaccept "eww update show_elevation_prompt=false;eww close elevate_to_windows; echo \"{}\" | sudo -S grub-reboot 1 && systemctl reboot")
)))) ))))
(defwidget dash_clock []
(box :class "dash_clock"
:orientation "v"
:vexpand "false"
:hexpand "false"
:spacing 1
(label :class "dash_clock_time"
:halign "center"
:text {formattime(EWW_TIME, "%H:%M:%S")})
(label :class "dash_clock_date"
:halign "center"
:text {formattime(EWW_TIME, "%B, %d %Y")})
(box :vexpand "true")
))
(defwidget logout [] (defwidget logout []
(box :class "dash_window" (box :class "dash_window"
:vexpand "false" :vexpand "false"
@ -50,10 +65,17 @@
:onclick "eww open elevate_to_windows; eww update show_elevation_prompt=true" :onclick "eww open elevate_to_windows; eww update show_elevation_prompt=true"
""))) "")))
;; Set up prompt window for sudo password
;; that trigglers on reboot_windows,
;; and runs the windows command
(defwindow dash_clock
:stacking "bg"
:focusable "false"
:monitor 0
:geometry (geometry :x 760
:y 200
:width 400
:height 150)
(dash_clock)
)
(defwindow logout (defwindow logout
:stacking "bg" :stacking "bg"
@ -95,6 +117,9 @@
:height 75) :height 75)
(reboot_windows)) (reboot_windows))
;; Set up prompt window for sudo password
;; that trigglers on reboot_windows,
;; and runs the windows command
(defwindow elevate_to_windows (defwindow elevate_to_windows
:monitor 0 :monitor 0
:exclusive false :exclusive false

View file

@ -0,0 +1,4 @@
#!/usr/env bash
echo "{ }"

View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
moonstate=$(gcal --resource-file=$HOME/.config/eww/scripts/moontime | awk '{print $4}')
sunstate=$(gcal --resource-file=$HOME/.config/eww/scripts/suntime | awk '{print $4}')
moonrise=$(echo $moonstate | awk '{print $1}')
moonset=$(echo $moonstate | awk '{print $2}')
moonphase=$(echo $moonstate | awk '{print $3}')
sunrise=$(echo $sunstate | awk '{print $1}')
sunset=$(echo $sunstate | awk '{print $2}')
echo "{ \"has_color\": false, \"is_sun\": true, \"gradient_angle\": 45 }"

View file

@ -0,0 +1,11 @@
; ~/.gcal/astronomical
; %( = moonrise %) moonset +XX-XX == lat long, ,-X:XX time-offset from UTC
; gcal --resource-file=<thisfile> -H no -ox
; -H no == no highlight -ox don't show date on every line
; 0 Moonrise is at %(+47.20-122.24,-8:00
; 0 Moonset is at %)+47.20-122.24,-8:00
; 0 Moon phase %O
0 %(+47.20-122.24,-8:00
0 %)+47.20-122.24,-8:00
0 %O

View file

@ -0,0 +1,5 @@
; %o = sunrise %) sunset +XX-XX == lat long, ,-X:XX time-offset from UTC
; 0 Sunrise is at %o+47.20-122.24,-8:00
; 0 Sunset is at %s+47.20-122.244,-8:00
0 %o+47.20-122.24,-8:00
0 %s+47.20-122.244,-8:00

View file

@ -44,7 +44,7 @@ in
exec-once = [ exec-once = [
"${pkgs.swww}/bin/swww init & sleep 0.5 & ${pkgs.swww}/bin/swww /home/nixolas/Downloads/RecountERD.png" "${pkgs.swww}/bin/swww init & sleep 0.5 & ${pkgs.swww}/bin/swww /home/nixolas/Downloads/RecountERD.png"
"eww open bar;eww open logout;eww open restart;eww open shutdown;eww open reboot_windows" "eww open bar;eww open logout;eww open restart;eww open shutdown;eww open reboot_windows;eww open dash_clock"
]; ];
input = { input = {

View file

@ -46,6 +46,7 @@ in
rm = "rmtrash"; rm = "rmtrash";
open-config = "cd ~/Documents/nicks-nix-config; nvim"; open-config = "cd ~/Documents/nicks-nix-config; nvim";
switch-to-windows = "sudo grub-reboot 1; sudo reboot"; switch-to-windows = "sudo grub-reboot 1; sudo reboot";
screenshot = "grim -g \"$(slurp -d)\" - | wl-copy -t image/png";
}; };
}; };