home: mobile improvements

This commit is contained in:
chayleaf 2024-08-14 08:48:30 +07:00
parent 63eab7c843
commit 4b560281bd
Signed by: chayleaf
GPG key ID: 78171AD46227E68E
7 changed files with 86 additions and 22 deletions

View file

@ -345,16 +345,15 @@
]
},
"locked": {
"lastModified": 1722906996,
"narHash": "sha256-QD6cZNmEJ+0b7G23E9qbcXiuy17k+0bgT7Z1dGUcHC0=",
"lastModified": 1723599998,
"narHash": "sha256-9a/Dq7WUhP35WrpqXUpDBsnKoKASsYB8FQjIeVlghm4=",
"owner": "chayleaf",
"repo": "home-manager",
"rev": "510b84097597d94f19f3231c7d657add01858dec",
"rev": "c29f1c444bbfe3cfa22e347923fe04245030bcda",
"type": "github"
},
"original": {
"owner": "chayleaf",
"ref": "librewolf",
"repo": "home-manager",
"type": "github"
}
@ -938,11 +937,11 @@
]
},
"locked": {
"lastModified": 1723517492,
"narHash": "sha256-I8+3ZSr/f73TxJmDQbjcbHmZGh7K3PEZRcGqeoXc1fw=",
"lastModified": 1723550937,
"narHash": "sha256-5gEXPy9qIrNi0nPk3D1ctVxh5Ndfrhyu+02R6BIcnHQ=",
"ref": "refs/heads/master",
"rev": "00418b649c67129f828182f81ed72c39f262922a",
"revCount": 14,
"rev": "e0f642180056f351fd712f2b4f3149fd9f02367f",
"revCount": 24,
"type": "git",
"url": "https://git.pavluk.org/chayleaf/unbound-rust-mod.git"
},

View file

@ -29,7 +29,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:chayleaf/home-manager/librewolf";
url = "github:chayleaf/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gaming = {

View file

@ -259,15 +259,25 @@ in
'';
wayland.windowManager.sway = {
wrapperFeatures.gtk = true;
package = pkgs.sway-unwrapped.overrideAttrs (old: {
package = let
cfg = config.wayland.windowManager.sway;
in pkgs.sway.override {
sway-unwrapped = pkgs.sway-unwrapped.overrideAttrs (old: {
patches = old.patches or [] ++ [
./sway.patch
../../pkgs/sway/allow-other.patch
/*(pkgs.fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/swaywm/sway/pull/6920.patch";
sha256 = "sha256-XgkysduhHbmprE334yeL65txpK0HNXeCmgCZMxpwsgU=";
})*/
];
] ++ lib.optionals config.phone.enable
(map
(x: ../../pkgs/sway/${x})
(builtins.filter (lib.hasInfix "-mobile-") (builtins.attrNames (builtins.readDir ../../pkgs/sway))));
});
inherit (cfg) extraSessionCommands extraOptions;
withBaseWrapper = cfg.wrapperFeatures.base;
withGtkWrapper = cfg.wrapperFeatures.gtk;
};
extraConfig = ''
title_align center
'';

View file

@ -19,8 +19,10 @@
sha256 = "sha256-zH4hbQ8+9TYRVW/XYqmAVsi0vsSPn1LPqXxr0gi0j1E=";
};
});*/
settings = lib.toList {
layer = "top";
settings = let
layer = if config.phone.enable then "overlay" else "top";
in lib.toList {
inherit layer;
position = "top";
ipc = true;
height = 40;
@ -151,7 +153,7 @@
};
} ++ lib.optionals config.phone.enable [
{
layer = "top";
inherit layer;
position = "top";
ipc = true;
height = 40;
@ -168,7 +170,7 @@
modules-right = [ "clock" ];
}
{
layer = "top";
inherit layer;
position = "bottom";
ipc = true;
height = 80;

View file

@ -0,0 +1,26 @@
From 7fead3cd2158fe913775ede5651291cf5f4ccf4d Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Wed, 14 Aug 2024 07:32:11 +0700
Subject: [PATCH 1/2] mobile: reverse layer order
This makes exclusive anchored layers that were added first be first
---
sway/desktop/layer_shell.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 8c6cedfe..41a638ee 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -129,7 +129,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
struct wlr_box full_area = { 0 };
wlr_output_effective_resolution(output->wlr_output,
&full_area.width, &full_area.height);
- wl_list_for_each(sway_layer, list, link) {
+ wl_list_for_each_reverse(sway_layer, list, link) {
struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface;
struct wlr_layer_surface_v1_state *state = &layer->current;
if (exclusive != (state->exclusive_zone > 0)) {
--
2.44.1

View file

@ -0,0 +1,27 @@
From 466d750b96184b793d276d9d0e30d37af4477fea Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Wed, 14 Aug 2024 08:17:44 +0700
Subject: [PATCH 2/2] mobile: don't idle_notify for volume keys
---
sway/input/keyboard.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 8927287f..d42f62b0 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -404,7 +404,9 @@ static void handle_key_event(struct sway_keyboard *keyboard,
keyboard->seat_device->input_device->wlr_device;
char *device_identifier = input_device_get_identifier(wlr_device);
bool exact_identifier = keyboard->wlr->group != NULL;
- seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD);
+ if (event->keycode != XKB_KEY_XF86AudioLowerVolume && event->keycode != XKB_KEY_XF86AudioRaiseVolume) {
+ seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD);
+ }
bool input_inhibited = seat->exclusive_client != NULL ||
server.session_lock.locked;
struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor =
--
2.44.1