Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: Volume mixer widget, eww config refactor [WIP] #932

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,462 changes: 105 additions & 1,357 deletions modules/desktop/graphics/ewwbar.nix

Large diffs are not rendered by default.

423 changes: 423 additions & 0 deletions modules/desktop/graphics/ewwbar/config/scripts/default.nix

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions modules/desktop/graphics/ewwbar/config/variables/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0

{
callPackage,
writeText,
setxkbmap,
ewwScripts,
gawk,
...
}:
let
ghaf-workspace = callPackage ../../../../../../packages/ghaf-workspace { };
in
writeText "variables.yuck" ''
(defpoll keyboard_layout :interval "5s" "${setxkbmap}/bin/setxkbmap -query | ${gawk}/bin/awk '/layout/{print $2}' | tr a-z A-Z")
(defpoll battery :interval "5s" :initial "{}" "${ewwScripts.eww-bat}/bin/eww-bat get")
(deflisten brightness :initial "{}" "${ewwScripts.eww-brightness}/bin/eww-brightness listen")
(deflisten volume :initial "{}" "${ewwScripts.eww-volume}/bin/eww-volume listen")
(deflisten volume-sink-inputs :initial "[]" "${ewwScripts.eww-volume}/bin/eww-volume listen_sink_inputs")
(deflisten workspace :initial "1" "${ghaf-workspace}/bin/ghaf-workspace subscribe")

(defvar calendar_day "date '+%d'")
(defvar calendar_month "date '+%-m'")
(defvar calendar_year "date '+%Y'")

(defvar volume-popup-visible "false")
(defvar brightness-popup-visible "false")
(defvar workspace-popup-visible "false")
(defvar workspaces-visible "false")
(defvar volume-mixer-visible "false")
(defvar mixer-sliders "")
''
480 changes: 480 additions & 0 deletions modules/desktop/graphics/ewwbar/config/widgets/default.nix

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions modules/desktop/graphics/ewwbar/config/windows/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0

{
writeText,
lib,
useGivc,
...
}:
writeText "windows.yuck" ''
;; Bar Window ;;
(defwindow bar [screen]
:geometry (geometry
:x "0px"
:y "0px"
:height "28px"
:width "100%"
:anchor "top center")
:focusable "false"
:hexpand "false"
:vexpand "false"
:stacking "fg"
:exclusive "true"
(bar :screen screen))

;; Calendar Window ;;
(defwindow calendar
:geometry (geometry :y "0px"
:x "0px"
:anchor "top center")
:stacking "fg"
(cal))

;; Power menu window ;;
(defwindow power-menu
:geometry (geometry :y "0px"
:x "0px"
:anchor "top right")
:stacking "fg"
(power-menu-widget))

${lib.optionalString useGivc ''
;; Quick settings window ;;
(defwindow quick-settings
:geometry (geometry :y "0px"
:x "0px"
:anchor "top right")
:stacking "fg"
(quick-settings-widget))


;; Volume Popup Window ;;
(defwindow volume-popup
:monitor 0
:geometry (geometry :y "150px"
:x "0px"
:anchor "bottom center")
:stacking "overlay"
(volume-popup))

;; Brightness Popup Window ;;
(defwindow brightness-popup
:monitor 0
:geometry (geometry :y "150px"
:x "0px"
:anchor "bottom center")
:stacking "overlay"
(brightness-popup))

;; Workspace Popup Window ;;
(defwindow workspace-popup
:monitor 0
:geometry (geometry :y "150px"
:x "0px"
:anchor "bottom center")
:stacking "overlay"
(workspace-popup))
''}

;; Closer Window ;;
(defwindow closer [window]
:geometry (geometry :width "100%" :height "100%")
:stacking "fg"
:focusable false
(closer :window window))
''
2 changes: 1 addition & 1 deletion modules/desktop/graphics/labwc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ in
theme = "Adwaita";
iconTheme = "Papirus";
colorScheme = "prefer-dark";
fontName = "Cantarell";
fontName = "Inter";
fontSize = "11";
};
description = "Global gtk+ configuration";
Expand Down
Loading
Loading