sway: launch gui apps via sane-open-desktop instead of inline

this will allow for sandboxing, in the future
This commit is contained in:
2024-03-01 04:02:32 +00:00
parent daab5939e7
commit 4a3f59468c
4 changed files with 30 additions and 6 deletions

View File

@@ -5,6 +5,15 @@
{
sane.programs.splatmoji = {
packageUnwrapped = pkgs.splatmoji.overrideAttrs (upstream: {
desktopItems = (upstream.desktopItems or []) ++ [
(pkgs.makeDesktopItem {
name = "splatmoji";
exec = "splatmoji -s medium-light type";
desktopName = "Splatmoji Emoji Picker";
})
];
});
sandbox.method = "bwrap";
sandbox.whitelistWayland = true; # it calls into a dmenu helper
sandbox.extraHomePaths = [

View File

@@ -116,6 +116,7 @@ in
"pulsemixer" # for volume controls
"rofi" # menu/launcher
"rofi-snippets"
"sane-open-desktop"
"splatmoji" # used by sway config
"sway-contrib.grimshot" # used by sway config
# "swayidle" # enable if you need it

View File

@@ -68,11 +68,12 @@ bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
#### special functions
bindsym $mod+Print exec @screenshot_cmd@
bindsym $mod+l exec swaylock --indicator-idle-visible --indicator-radius 100 --indicator-thickness 30
bindsym $mod+s exec rofi-snippets
bindsym $mod+slash exec splatmoji -s medium-light type
bindsym $mod+d exec rofi -show
bindsym $mod+Return exec xdg-terminal-exec
bindsym $mod+l exec sane-open-desktop swaylock.desktop
bindsym $mod+s exec sane-open-desktop rofi-snippets.desktop
bindsym $mod+slash exec sane-open-desktop splatmoji.desktop
bindsym $mod+d exec sane-open-desktop rofi.desktop
bindsym $mod+Return exec sane-open-desktop xdg-terminal-exec.desktop
bindsym $mod+Shift+q kill
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
bindsym $mod+Shift+c reload

View File

@@ -1,9 +1,22 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.swaylock;
in
{
sane.programs.swaylock = {
packageUnwrapped = pkgs.swaylock.overrideAttrs (upstream: {
nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
pkgs.copyDesktopItems
];
desktopItems = (upstream.desktopItems or []) ++ [
(pkgs.makeDesktopItem {
name = "swaylock";
exec = "swaylock --indicator-idle-visible --indicator-radius 100 --indicator-thickness 30";
desktopName = "Sway session locker";
})
];
});
sandbox.method = "bwrap";
sandbox.extraPaths = [
# N.B.: we need to be able to follow /etc/shadow to wherever it's symlinked.