fix(bbsteamie): use plasma wayland without annoying popups
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
d8ef7d99ed
commit
8aa6f5b2b0
6 changed files with 92 additions and 19 deletions
|
@ -1,6 +1,6 @@
|
|||
{pkgs, ...}: let
|
||||
# switch to wayland when possible
|
||||
defaultSession = "plasmax11";
|
||||
defaultSession = "plasma";
|
||||
in {
|
||||
imports = [
|
||||
(import ./session-switching.nix defaultSession)
|
||||
|
@ -22,6 +22,7 @@ in {
|
|||
# Misc Apps
|
||||
firefox
|
||||
kdePackages.discover
|
||||
kdePackages.krfb
|
||||
|
||||
# Libs
|
||||
wl-clipboard
|
||||
|
|
|
@ -27,9 +27,7 @@ defaultSession: {
|
|||
sudo ${pkgs.systemd}/bin/systemctl start to-gaming-mode.service
|
||||
'';
|
||||
in {
|
||||
services = {
|
||||
displayManager = {
|
||||
sddm = {
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
autoLogin.relogin = true;
|
||||
|
||||
|
@ -38,10 +36,6 @@ in {
|
|||
compositorCommand = "kwin";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xserver.enable = true;
|
||||
};
|
||||
|
||||
# Sets the default session at launch
|
||||
systemd.services."set-session" = {
|
||||
|
@ -100,5 +94,17 @@ in {
|
|||
config.home-manager.users.mariah.home.packages
|
||||
)
|
||||
+ "/share/applications/Gaming Mode.desktop";
|
||||
|
||||
# Fix remote control prompt showing up everytime
|
||||
xdg.configFile = let
|
||||
mkAutostart = name: flags: {
|
||||
"autostart/${name}.desktop".text = "[Desktop Entry]\nType=Application\nExec=${name} ${flags}";
|
||||
};
|
||||
in (
|
||||
# Needs xdg-desktop-portal-kde patch provided by `self.overlays.xdg-desktop-portal-kde`
|
||||
{"plasmaremotedesktoprc".text = "[Sharing]\nUnattended=true";}
|
||||
// (mkAutostart "krfb" "--nodialog %c")
|
||||
// (mkAutostart "steam" "-silent %U")
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -114,6 +114,8 @@
|
|||
perSystem (pkgs:
|
||||
import ./packages {inherit self pkgs mkVersion inputs;});
|
||||
|
||||
overlays = import ./overlays {};
|
||||
|
||||
apps =
|
||||
perSystem (pkgs:
|
||||
import ./apps {inherit inputs pkgs;});
|
||||
|
|
|
@ -12,11 +12,15 @@
|
|||
import input {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = map (i: inputs.${i}.overlays.default) [
|
||||
overlays =
|
||||
(map (i: inputs.${i}.overlays.default) [
|
||||
"discord-overlay"
|
||||
"grim-hyprland"
|
||||
"jovian"
|
||||
"nixpkgs-wayland"
|
||||
])
|
||||
++ [
|
||||
inputs.self.overlays.xdg-desktop-portal-kde
|
||||
];
|
||||
};
|
||||
|
||||
|
|
3
overlays/default.nix
Normal file
3
overlays/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{...}: {
|
||||
xdg-desktop-portal-kde = import ./xdg-desktop-portal-kde;
|
||||
}
|
57
overlays/xdg-desktop-portal-kde/default.nix
Normal file
57
overlays/xdg-desktop-portal-kde/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
(final: prev: {
|
||||
kdePackages = prev.kdePackages.overrideScope (kfinal: kprev: {
|
||||
xdg-desktop-portal-kde = kprev.xdg-desktop-portal-kde.overrideAttrs (o: {
|
||||
patches =
|
||||
(o.patches or [])
|
||||
++ [
|
||||
# https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/issues/15#note_906047
|
||||
(builtins.toFile
|
||||
"rdp.patch"
|
||||
# cpp
|
||||
''
|
||||
diff --git a/src/remotedesktop.cpp b/src/remotedesktop.cpp
|
||||
index 99ce57f..af64eff 100644
|
||||
--- a/src/remotedesktop.cpp
|
||||
+++ b/src/remotedesktop.cpp
|
||||
@@ -19,6 +19,8 @@
|
||||
#include <KNotification>
|
||||
#include <QGuiApplication>
|
||||
#include <QRegion>
|
||||
+#include <KSharedConfig>
|
||||
+#include <KConfigGroup>
|
||||
#include <QScreen>
|
||||
|
||||
RemoteDesktopPortal::RemoteDesktopPortal(QObject *parent)
|
||||
@@ -152,14 +154,19 @@ uint RemoteDesktopPortal::Start(const QDBusObjectPath &handle,
|
||||
notification->setIconName(QStringLiteral("krfb"));
|
||||
notification->sendEvent();
|
||||
} else {
|
||||
- QScopedPointer<RemoteDesktopDialog, QScopedPointerDeleteLater> remoteDesktopDialog(
|
||||
- new RemoteDesktopDialog(app_id, session->deviceTypes(), session->screenSharingEnabled()));
|
||||
- Utils::setParentWindow(remoteDesktopDialog->windowHandle(), parent_window);
|
||||
- Request::makeClosableDialogRequest(handle, remoteDesktopDialog.get());
|
||||
- connect(session, &Session::closed, remoteDesktopDialog.data(), &RemoteDesktopDialog::reject);
|
||||
-
|
||||
- if (!remoteDesktopDialog->exec()) {
|
||||
- return 1;
|
||||
+ auto cfg = KSharedConfig::openConfig(QStringLiteral("plasmaremotedesktoprc"));
|
||||
+ const auto unattendedAccess = cfg->group("Sharing").readEntry("Unattended", false);
|
||||
+ if (!unattendedAccess)
|
||||
+ {
|
||||
+ QScopedPointer<RemoteDesktopDialog, QScopedPointerDeleteLater> remoteDesktopDialog(
|
||||
+ new RemoteDesktopDialog(app_id, session->deviceTypes(), session->screenSharingEnabled()));
|
||||
+ Utils::setParentWindow(remoteDesktopDialog->windowHandle(), parent_window);
|
||||
+ Request::makeClosableDialogRequest(handle, remoteDesktopDialog.get());
|
||||
+ connect(session, &Session::closed, remoteDesktopDialog.data(), &RemoteDesktopDialog::reject);
|
||||
+
|
||||
+ if (!remoteDesktopDialog->exec()) {
|
||||
+ return 1;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
'')
|
||||
];
|
||||
});
|
||||
});
|
||||
})
|
Loading…
Reference in a new issue