Skip to content

Commit

Permalink
Fully migrate to labwc, remove weston
Browse files Browse the repository at this point in the history
Full migration to labwc, removing Weston compositor support and adding
hi-res icons for apps.

This also fixes labwc performance issues and other bugs in Jetson Orin.

Signed-off-by: Humaid Alqasimi <humaid.alqassimi@tii.ae>
  • Loading branch information
humaidq-tii committed May 1, 2024
1 parent ffb5e1d commit fcc5575
Show file tree
Hide file tree
Showing 38 changed files with 156 additions and 1,231 deletions.
Binary file removed assets/icons/png/app.png
Binary file not shown.
Binary file removed assets/icons/png/appflowy.png
Binary file not shown.
Binary file removed assets/icons/png/browser.png
Binary file not shown.
Binary file removed assets/icons/png/element.png
Binary file not shown.
Binary file removed assets/icons/png/pdf.png
Binary file not shown.
Binary file removed assets/icons/png/settings.png
Binary file not shown.
Binary file removed assets/icons/png/windows.png
Binary file not shown.
27 changes: 0 additions & 27 deletions assets/icons/svg/app.svg

This file was deleted.

29 changes: 0 additions & 29 deletions assets/icons/svg/appflowy.svg

This file was deleted.

11 changes: 0 additions & 11 deletions assets/icons/svg/browser.svg

This file was deleted.

27 changes: 0 additions & 27 deletions assets/icons/svg/pdf.svg

This file was deleted.

9 changes: 0 additions & 9 deletions assets/icons/svg/settings.svg

This file was deleted.

6 changes: 0 additions & 6 deletions assets/icons/svg/windows.svg

This file was deleted.

2 changes: 0 additions & 2 deletions modules/desktop/graphics/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
{
imports = [
./weston.nix
./labwc.nix
./weston.ini.nix
./waybar.config.nix
./demo-apps.nix
./fonts.nix
Expand Down
34 changes: 14 additions & 20 deletions modules/desktop/graphics/demo-apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@
...
}: let
cfg = config.ghaf.graphics.demo-apps;
inherit (import ../../../lib/icons.nix {inherit pkgs lib;}) resizePNG;

/*
Scaled down firefox icon
*/
firefox-icon = resizePNG "firefox" "${pkgs.firefox}/share/icons/hicolor/128x128/apps/firefox.png" "24x24";

/*
Generate launchers to be used in weston.ini
Generate launchers to be used in the application drawer
Type: mkProgramOption :: string -> bool -> option
Expand All @@ -28,7 +22,7 @@
description = "Include package ${name} to menu and system environment";
};
in {
options.ghaf.graphics.demo-apps = with lib; {
options.ghaf.graphics.demo-apps = {
chromium = mkProgramOption "Chromium browser" false;
firefox = mkProgramOption "Firefox browser" config.ghaf.graphics.enableDemoApplications;
gala-app = mkProgramOption "Gala App" false;
Expand All @@ -40,34 +34,34 @@ in {
config = lib.mkIf config.ghaf.profiles.graphics.enable {
ghaf.graphics.launchers =
lib.optional cfg.chromium {
name = "chromium";
name = "Chromium";
path = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform --ozone-platform=wayland";
icon = "${pkgs.chromium}/share/icons/hicolor/24x24/apps/chromium.png";
icon = "${pkgs.icon-pack}/chromium.svg";
}
++ lib.optional cfg.firefox {
name = "firefox";
name = "Firefox";
path = "${pkgs.firefox}/bin/firefox";
icon = "${firefox-icon}";
icon = "${pkgs.icon-theme}/firefox.svg";
}
++ lib.optional cfg.element-desktop {
name = "element";
name = "Element";
path = "${pkgs.element-desktop}/bin/element-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland";
icon = "${pkgs.element-desktop}/share/icons/hicolor/24x24/apps/element.png";
icon = "${pkgs.icon-theme}/element-desktop.svg";
}
++ lib.optional cfg.gala-app {
name = "gala";
name = "GALA";
path = "${pkgs.gala-app}/bin/gala --enable-features=UseOzonePlatform --ozone-platform=wayland";
icon = "${pkgs.gala-app}/gala/resources/icon-24x24.png";
icon = "${pkgs.icon-theme}/distributor-logo-android.svg";
}
++ lib.optional cfg.zathura {
name = "zathura";
name = "PDF Viewer";
path = "${pkgs.zathura}/bin/zathura";
icon = "${pkgs.zathura}/share/icons/hicolor/32x32/apps/org.pwmt.zathura.png";
icon = "${pkgs.icon-theme}/document-viewer.svg";
}
++ lib.optional (cfg.appflowy && pkgs.stdenv.isx86_64) {
name = "appflowy";
name = "AppFlowy";
path = "${pkgs.appflowy}/bin/appflowy";
icon = ../../../assets/icons/svg/appflowy.svg;
icon = "${pkgs.appflowy}/opt/data/flutter_assets/assets/images/flowy_logo.svg";
};
environment.systemPackages =
lib.optional cfg.chromium pkgs.chromium
Expand Down
5 changes: 3 additions & 2 deletions modules/desktop/graphics/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
config,
...
}: let
inherit (config.ghaf.graphics) weston labwc;
inherit (config.ghaf.graphics) labwc;
in {
config = lib.mkIf (weston.enable || labwc.enable) {
config = lib.mkIf labwc.enable {
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
inter
fira-code-nerdfont
Expand Down
4 changes: 4 additions & 0 deletions modules/desktop/graphics/ghaf-launcher.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
writeTextDir,
coreutils,
nwg-drawer,
callPackage,
config,
...
}: let
drawerCSS = writeTextDir "nwg-drawer/drawer.css" ''
Expand Down Expand Up @@ -53,12 +55,14 @@
border-radius: 15px
}
'';
launchers = callPackage ./launchers.nix {inherit config;};
in
writeShellScriptBin
"ghaf-launcher"
''
export XDG_CONFIG_HOME=${drawerCSS}
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_DIRS=${launchers}/share
${coreutils}/bin/mkdir -p $XDG_CACHE_HOME
${nwg-drawer}/bin/nwg-drawer -mb 20 -ml 440 -mr 440 -mt 420 -nofs -nocats
''
14 changes: 11 additions & 3 deletions modules/desktop/graphics/labwc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,19 @@
</menu>
</openbox_menu>
'';
launchers = pkgs.callPackage ./launchers.nix {inherit config;};
renderers = ["vulkan" "pixman" "egl2"];
in {
options.ghaf.graphics.labwc = {
enable = lib.mkEnableOption "labwc";
lock.enable = lib.mkEnableOption "labwc screen locking";
renderer = lib.mkOption {
type = lib.types.enum renderers;
default = "pixman";
description = ''
Which wlroots renderer to use.
Choose one of: ${lib.concatStringsSep "," renderers}
'';
};
wallpaper = lib.mkOption {
type = lib.types.path;
default = ../../../assets/wallpaper.png;
Expand Down Expand Up @@ -229,7 +237,7 @@ in {
ghaf.graphics.window-manager-common.enable = true;

environment.systemPackages = with pkgs;
[labwc launchers]
[labwc]
# Below sway packages needed for screen locking
++ lib.optionals config.ghaf.graphics.labwc.lock.enable [swaylock-effects swayidle]
# Grim screenshot tool is used for labwc debug-builds
Expand Down Expand Up @@ -276,7 +284,7 @@ in {
Environment = "PATH=${pkgs.openssh}/bin:$PATH";
};
environment = {
WLR_RENDERER = "pixman";
WLR_RENDERER = cfg.renderer;
# See: https://github.com/labwc/labwc/blob/0.6.5/docs/environment
XKB_DEFAULT_LAYOUT = "us,fi";
XKB_DEFAULT_OPTIONS = "XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle";
Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/graphics/waybar.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ in {
{
name = "Terminal";
path = "${pkgs.foot}/bin/foot";
icon = "${pkgs.foot}/share/icons/hicolor/48x48/apps/foot.png";
icon = "${pkgs.icon-pack}/utilities-terminal.svg";
}
];
environment.etc."waybar/config" = {
Expand Down
Loading

0 comments on commit fcc5575

Please sign in to comment.