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: add notification center, better cursors #784

Closed
wants to merge 1 commit into from
Closed
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
34 changes: 20 additions & 14 deletions modules/desktop/graphics/labwc.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,27 @@ let
</openbox_menu>
'';

makoConfig = ''
font=Inter 12
background-color=#202020e6
progress-color=source #3D8252e6
border-radius=5
border-size=0
padding=10
default-timeout=10000
swayncConfig = pkgs.writeText "config.json" ''
{
"control-center-margin-top": 10,
"control-center-margin-right": 10,
"control-center-margin-bottom": 5,
"image-visibility": "when-available",
"widgets": ["buttons-grid", "title", "notifications" ],
"buttons-grid": {
"actions": [
{
"label": "WiFi",
"command": "${pkgs.nm-launcher}/bin/nm-launcher"
}
]
}
}
'';

environment = ''
XCURSOR_THEME=breeze_cursors

XCURSOR_SIZE=24
XCURSOR_THEME=Adwaita
# Wayland compatibility
MOZ_ENABLE_WAYLAND=1
'';
Expand All @@ -208,8 +216,6 @@ in
"labwc/menu.xml".text = menuXml;
"labwc/environment".text = environment;

"mako/config".text = makoConfig;

"greetd/environments".text = lib.mkAfter "${labwc-session}/bin/labwc-session\n";
};

Expand Down Expand Up @@ -244,12 +250,12 @@ in
wantedBy = [ "ghaf-session.target" ];
};

systemd.user.services.mako = {
systemd.user.services.swaync = {
enable = true;
description = "Notification daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.mako}/bin/mako -c /etc/mako/config";
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync -c ${swayncConfig}";
};
partOf = [ "ghaf-session.target" ];
wantedBy = [ "ghaf-session.target" ];
Expand Down
19 changes: 10 additions & 9 deletions modules/desktop/graphics/waybar.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ in
"margin-bottom": 5,
"margin-left": 200,
"margin-right": 200,
"modules-right": ["pulseaudio", "custom/network1", "battery", "custom/admin", "clock", "tray"],
"modules-right": ["pulseaudio", "custom/network1", "battery", "clock", "tray", "custom/admin"],
"keyboard-state": {
"numlock": true,
"capslock": true,
Expand Down Expand Up @@ -101,12 +101,12 @@ in
"custom/ghaf-settings": {
"format": " ",
// Placeholder for the actual Ghaf settings app
"on-click": "${pkgs.libnotify}/bin/notify-send 'Ghaf Platform ${lib.strings.fileContents ../../../.version}'",
"on-click": "${pkgs.libnotify}/bin/notify-send -a 'Ghaf' 'Ghaf Platform ${lib.strings.fileContents ../../../.version}'",
"tooltip": false
},
"custom/admin": {
"format": " ",
"on-click": "${pkgs.nm-launcher}/bin/nm-launcher",
"on-click": "${pkgs.swaynotificationcenter}/bin/swaync-client -t",
"tooltip": false
},
"pulseaudio": {
Expand Down Expand Up @@ -211,8 +211,8 @@ in
#backlight,
#battery,
#clock {
padding-left: 10;
padding-right: 10;
padding-left: 10px;
padding-right: 10px;
}

label:focus {
Expand All @@ -236,17 +236,18 @@ in
background-image: url("${ghaf-icon}");
background-position: center;
background-repeat: no-repeat;
padding-left: 10;
padding-right: 10;
padding-left: 10px;
padding-right: 10px;
}

#custom-admin {
font-size: 20px;
background-image: url("${admin-icon}");
background-position: center;
background-repeat: no-repeat;
padding-left: 10;
padding-right: 10;
padding-left: 10px;
padding-right: 10px;
margin-right: 10px;
}
'';

Expand Down
2 changes: 0 additions & 2 deletions modules/desktop/profiles/graphics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ in
WLR_RENDERER = cfg.renderer;
XDG_SESSION_TYPE = "wayland";
WLR_NO_HARDWARE_CURSORS = if (cfg.renderer == "pixman") then 1 else 0;
# 24 is default value set in labwc
XCURSOR_SIZE = 24;
# To Fix "Fontconfig error : No writable cache directories" during new session login
XDG_CACHE_HOME = "$(mktemp -d)";
XKB_DEFAULT_LAYOUT = "us,ara,fi";
Expand Down
1 change: 1 addition & 0 deletions overlays/custom-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
mitmweb-ui = final.callPackage ../../packages/mitmweb-ui { };
gtklock = import ./gtklock { inherit prev; };
hardware-scan = final.callPackage ../../packages/hardware-scan { };
swaynotificationcenter = import ./swaynotificationcenter { inherit prev; };
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 83457033527496147e91746d9fc143b01f2d77c7 Mon Sep 17 00:00:00 2001
From: Humaid Alqasimi <humaid.alqassimi@tii.ae>
Date: Thu, 12 Sep 2024 12:08:05 +0400
Subject: [PATCH] Set ghaf color theme

Signed-off-by: Humaid Alqasimi <humaid.alqassimi@tii.ae>
---
data/style/style.scss | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/data/style/style.scss b/data/style/style.scss
index 23f07b7..14c2c4f 100644
--- a/data/style/style.scss
+++ b/data/style/style.scss
@@ -1,11 +1,11 @@
-@define-color cc-bg rgba(46, 46, 46, 0.7);
-
-@define-color noti-border-color rgba(255, 255, 255, 0.15);
-@define-color noti-bg rgba(48, 48, 48, 0.8);
-@define-color noti-bg-opaque rgb(48, 48, 48);
-@define-color noti-bg-darker rgb(38, 38, 38);
-@define-color noti-bg-hover rgb(56, 56, 56);
-@define-color noti-bg-hover-opaque rgb(56, 56, 56);
+@define-color cc-bg rgba(32, 32, 32, 0.9);
+
+@define-color noti-border-color rgba(21, 36, 24, 0.3);
+@define-color noti-bg rgba(32, 32, 32, 0.9);
+@define-color noti-bg-opaque rgb(43, 43, 43);
+@define-color noti-bg-darker rgb(29, 29, 29);
+@define-color noti-bg-hover rgb(29, 29, 29);
+@define-color noti-bg-hover-opaque rgb(29, 29, 29);
@define-color noti-bg-focus rgba(68, 68, 68, 0.6);
@define-color noti-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);
--
2.46.0

8 changes: 8 additions & 0 deletions overlays/custom-packages/swaynotificationcenter/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
#
# This overlay applies some scss customisations. This is set as an overlay as
# the scss files need to be compiled.
#
{ prev }:
prev.swaynotificationcenter.overrideAttrs { patches = [ ./0001-Set-ghaf-color-theme.patch ]; }
Loading