diff options
Diffstat (limited to 'accounts')
39 files changed, 4120 insertions, 575 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 92163dca..8e68eda9 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
@@ -450,20 +450,6 @@ in { | |||
450 | serverUrl = "https://etesync.yggdrasil.li"; | 450 | serverUrl = "https://etesync.yggdrasil.li"; |
451 | }; | 451 | }; |
452 | 452 | ||
453 | swayidle = { | ||
454 | enable = true; | ||
455 | events = [ | ||
456 | { event = "before-sleep"; command = lockCommand; } | ||
457 | { event = "lock"; command = lockCommand; } | ||
458 | ]; | ||
459 | timeouts = [ | ||
460 | { timeout = 600; command = lockCommand; } | ||
461 | ]; | ||
462 | extraArgs = [ | ||
463 | "-w" | ||
464 | "idlehint" "30" | ||
465 | ]; | ||
466 | }; | ||
467 | poweralertd.enable = true; | 453 | poweralertd.enable = true; |
468 | }; | 454 | }; |
469 | 455 | ||
@@ -595,10 +581,10 @@ in { | |||
595 | "--subst-var-by" "ksshaskpass" (lib.getExe pkgs.kdePackages.ksshaskpass) | 581 | "--subst-var-by" "ksshaskpass" (lib.getExe pkgs.kdePackages.ksshaskpass) |
596 | ]; | 582 | ]; |
597 | }; | 583 | }; |
598 | "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = '' | 584 | # "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = '' |
599 | [Unit] | 585 | # [Unit] |
600 | After=graphical-session.target | 586 | # After=graphical-session.target |
601 | ''; | 587 | # ''; |
602 | "systemd/user/home-manager.service.d/before-graphical-session.conf".text = '' | 588 | "systemd/user/home-manager.service.d/before-graphical-session.conf".text = '' |
603 | [Unit] | 589 | [Unit] |
604 | Before=graphical-session-pre.target | 590 | Before=graphical-session-pre.target |
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index 35a3d799..32d55f97 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix | |||
@@ -10,7 +10,6 @@ let | |||
10 | makoctl = lib.getExe' config.services.mako.package "makoctl"; | 10 | makoctl = lib.getExe' config.services.mako.package "makoctl"; |
11 | loginctl = lib.getExe' hostConfig.systemd.package "loginctl"; | 11 | loginctl = lib.getExe' hostConfig.systemd.package "loginctl"; |
12 | systemctl = lib.getExe' hostConfig.systemd.package "systemctl"; | 12 | systemctl = lib.getExe' hostConfig.systemd.package "systemctl"; |
13 | swayosd-client = lib.getExe' config.services.swayosd.package "swayosd-client"; | ||
14 | 13 | ||
15 | focus_or_spawn = pkgs.writeShellApplication { | 14 | focus_or_spawn = pkgs.writeShellApplication { |
16 | name = "focus-or-spawn"; | 15 | name = "focus-or-spawn"; |
@@ -168,7 +167,6 @@ in { | |||
168 | imports = [ | 167 | imports = [ |
169 | ./waybar.nix | 168 | ./waybar.nix |
170 | ./mako.nix | 169 | ./mako.nix |
171 | ./swayosd.nix | ||
172 | ]; | 170 | ]; |
173 | 171 | ||
174 | options = { | 172 | options = { |
@@ -231,36 +229,7 @@ in { | |||
231 | }; | 229 | }; |
232 | 230 | ||
233 | config = { | 231 | config = { |
234 | systemd.user.services.xwayland-satellite = { | 232 | home.packages = [ pkgs.xwayland-satellite-unstable ]; |
235 | Unit = { | ||
236 | BindsTo = [ "graphical-session.target" ]; | ||
237 | PartOf = [ "graphical-session.target" ]; | ||
238 | After = [ "graphical-session.target" ]; | ||
239 | Requisite = [ "graphical-session.target" ]; | ||
240 | }; | ||
241 | Service = { | ||
242 | Type = "notify"; | ||
243 | NotifyAccess = "all"; | ||
244 | Environment = [ "DISPLAY=:0" ]; | ||
245 | ExecStart = ''${lib.getExe pkgs.xwayland-satellite-unstable} ''${DISPLAY}''; | ||
246 | ExecStartPre = "${systemctl} --user import-environment DISPLAY"; | ||
247 | StandardOutput = "journal"; | ||
248 | }; | ||
249 | Install = { | ||
250 | WantedBy = [ "graphical-session.target" ]; | ||
251 | }; | ||
252 | }; | ||
253 | |||
254 | services.swayidle = { | ||
255 | events = [ | ||
256 | { event = "after-resume"; command = "${lib.getExe niri} msg action power-on-monitors"; } | ||
257 | ]; | ||
258 | timeouts = [ | ||
259 | { timeout = 540; | ||
260 | command = "${lib.getExe niri} msg action power-off-monitors"; | ||
261 | } | ||
262 | ]; | ||
263 | }; | ||
264 | 233 | ||
265 | systemd.user.sockets.niri-workspace-history = { | 234 | systemd.user.sockets.niri-workspace-history = { |
266 | Socket = { | 235 | Socket = { |
@@ -957,31 +926,6 @@ in { | |||
957 | allow-when-locked = true; | 926 | allow-when-locked = true; |
958 | }; | 927 | }; |
959 | 928 | ||
960 | "XF86MonBrightnessUp" = { | ||
961 | action = spawn swayosd-client "--brightness" "raise"; | ||
962 | allow-when-locked = true; | ||
963 | }; | ||
964 | "XF86MonBrightnessDown" = { | ||
965 | action = spawn swayosd-client "--brightness" "lower"; | ||
966 | allow-when-locked = true; | ||
967 | }; | ||
968 | "XF86AudioRaiseVolume" = { | ||
969 | action = spawn swayosd-client "--output-volume" "raise"; | ||
970 | allow-when-locked = true; | ||
971 | }; | ||
972 | "XF86AudioLowerVolume" = { | ||
973 | action = spawn swayosd-client "--output-volume" "lower"; | ||
974 | allow-when-locked = true; | ||
975 | }; | ||
976 | "XF86AudioMute" = { | ||
977 | action = spawn swayosd-client "--output-volume" "mute-toggle"; | ||
978 | allow-when-locked = true; | ||
979 | }; | ||
980 | "XF86AudioMicMute" = { | ||
981 | action = spawn swayosd-client "--input-volume" "mute-toggle"; | ||
982 | allow-when-locked = true; | ||
983 | }; | ||
984 | |||
985 | "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; | 929 | "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; |
986 | "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; | 930 | "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; |
987 | "Mod+Period".action = spawn makoctl "menu" "--" (lib.getExe config.programs.fuzzel.package) "--dmenu"; | 931 | "Mod+Period".action = spawn makoctl "menu" "--" (lib.getExe config.programs.fuzzel.package) "--dmenu"; |
@@ -1000,6 +944,37 @@ in { | |||
1000 | "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); | 944 | "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); |
1001 | "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop"); | 945 | "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop"); |
1002 | })) | 946 | })) |
947 | (lib.mapAttrsToList (name: cfg: node name [(lib.removeAttrs cfg ["action"])] [cfg.action]) (let | ||
948 | shell = obj: leaf "send-unix" [ | ||
949 | { path = ''''${XDG_RUNTIME_DIR}/shell.sock''; } | ||
950 | (builtins.toJSON obj + "\n") | ||
951 | ]; | ||
952 | in { | ||
953 | "XF86AudioRaiseVolume" = { | ||
954 | allow-when-locked = true; | ||
955 | action = shell { Volume.volume = "up"; }; | ||
956 | }; | ||
957 | "XF86AudioLowerVolume" = { | ||
958 | allow-when-locked = true; | ||
959 | action = shell { Volume.volume = "down"; }; | ||
960 | }; | ||
961 | "XF86AudioMute" = { | ||
962 | allow-when-locked = true; | ||
963 | action = shell { Volume.muted = "toggle"; }; | ||
964 | }; | ||
965 | "XF86AudioMicMute" = { | ||
966 | allow-when-locked = true; | ||
967 | action = shell { Volume."mic-muted" = "toggle"; }; | ||
968 | }; | ||
969 | "XF86MonBrightnessUp" = { | ||
970 | action = shell { Brightness = "up"; }; | ||
971 | allow-when-locked = true; | ||
972 | }; | ||
973 | "XF86MonBrightnessDown" = { | ||
974 | action = shell { Brightness = "down"; }; | ||
975 | allow-when-locked = true; | ||
976 | }; | ||
977 | })) | ||
1003 | (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) | 978 | (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) |
1004 | (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) | 979 | (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) |
1005 | ] | 980 | ] |
diff --git a/accounts/gkleen@sif/niri/swayosd.nix b/accounts/gkleen@sif/niri/swayosd.nix deleted file mode 100644 index 54ebb302..00000000 --- a/accounts/gkleen@sif/niri/swayosd.nix +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | { pkgs, ... }: | ||
2 | { | ||
3 | config = { | ||
4 | services.swayosd = { | ||
5 | enable = true; | ||
6 | topMargin = 0.4769706078; | ||
7 | stylePath = pkgs.runCommand "style.css" { | ||
8 | passAsFile = [ "src" ]; | ||
9 | src = '' | ||
10 | window#osd { | ||
11 | padding: 12px 20px; | ||
12 | border-radius: 999px; | ||
13 | border: none; | ||
14 | background: rgba(0, 0, 0, 0.87); | ||
15 | |||
16 | #container { | ||
17 | margin: 16px; | ||
18 | } | ||
19 | |||
20 | image, | ||
21 | label { | ||
22 | color: rgb(255, 255, 255); | ||
23 | |||
24 | &:disabled { | ||
25 | opacity: 1; | ||
26 | color: rgb(84, 84, 84); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | progressbar { | ||
31 | min-height: 6px; | ||
32 | border-radius: 999px; | ||
33 | background: transparent; | ||
34 | border: none; | ||
35 | |||
36 | trough, progress { | ||
37 | min-height: inherit; | ||
38 | border-radius: inherit; | ||
39 | border: none; | ||
40 | } | ||
41 | |||
42 | trough { | ||
43 | background: rgb(127, 127, 127); | ||
44 | } | ||
45 | progress { | ||
46 | background: rgb(255, 255, 255); | ||
47 | } | ||
48 | |||
49 | &:disabled { | ||
50 | opacity: 1; | ||
51 | |||
52 | trough { | ||
53 | background: rgb(19, 19, 19); | ||
54 | } | ||
55 | progress { | ||
56 | background: rgb(38, 38, 38); | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | ''; | ||
62 | buildInputs = with pkgs; [sass]; | ||
63 | } "scss -C --sourcemap=none --style=compact $srcPath $out"; | ||
64 | }; | ||
65 | }; | ||
66 | } | ||
diff --git a/accounts/gkleen@sif/shell/default.nix b/accounts/gkleen@sif/shell/default.nix index 84140072..5025dd90 100644 --- a/accounts/gkleen@sif/shell/default.nix +++ b/accounts/gkleen@sif/shell/default.nix | |||
@@ -4,6 +4,18 @@ | |||
4 | config = { | 4 | config = { |
5 | programs.quickshell = { | 5 | programs.quickshell = { |
6 | enable = true; | 6 | enable = true; |
7 | package = pkgs.symlinkJoin { | ||
8 | pname = pkgs.quickshell.pname + "-wrapped"; | ||
9 | inherit (pkgs.quickshell) version meta; | ||
10 | paths = [ pkgs.quickshell ]; | ||
11 | buildInputs = [ pkgs.makeWrapper ]; | ||
12 | postBuild = '' | ||
13 | for binary in quickshell qs; do | ||
14 | wrapProgram $out/bin/$binary \ | ||
15 | --prefix QML_IMPORT_PATH : ${pkgs.qt6Packages.callPackage ./quickshell-plugins {}}/${pkgs.qt6.qtbase.qtQmlPrefix} | ||
16 | done | ||
17 | ''; | ||
18 | }; | ||
7 | config = { | 19 | config = { |
8 | src = ./quickshell; | 20 | src = ./quickshell; |
9 | replacements = { | 21 | replacements = { |
@@ -76,12 +88,26 @@ | |||
76 | runHook postBuild | 88 | runHook postBuild |
77 | ''; | 89 | ''; |
78 | }); | 90 | }); |
91 | niri_session = builtins.toJSON [ | ||
92 | (pkgs.writeShellScript "niri-session" '' | ||
93 | exec ${lib.getExe pkgs.dex} -w ${config.programs.niri.package}/share/wayland-sessions/niri.desktop &>/tmp/niri-session-$$.log | ||
94 | '') | ||
95 | # (lib.getExe pkgs.dex) | ||
96 | # "${config.programs.niri.package}/share/wayland-sessions/niri.desktop" | ||
97 | ]; | ||
98 | username = builtins.toJSON config.home.username; | ||
99 | mdi = builtins.toJSON (pkgs.fetchFromGitHub { | ||
100 | owner = "Templarian"; | ||
101 | repo = "MaterialDesign"; | ||
102 | rev = "2424e748e0cc63ab7b9c095a099b9fe239b737c0"; | ||
103 | hash = "sha256-QMGl7soAhErrrnY3aKOZpt49yebkSNzy10p/v5OaqQ0="; | ||
104 | }); | ||
79 | }; | 105 | }; |
80 | }; | 106 | }; |
81 | }; | 107 | }; |
82 | systemd.user.services.quickshell = { | 108 | systemd.user.services.quickshell = { |
83 | Service = { | 109 | Service = { |
84 | Environment = "QML_IMPORT_PATH=${pkgs.qt6Packages.callPackage ./quickshell-plugins {}}/${pkgs.qt6.qtbase.qtQmlPrefix}"; | 110 | RuntimeDirectory = "quickshell"; |
85 | }; | 111 | }; |
86 | }; | 112 | }; |
87 | }; | 113 | }; |
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/CMakeLists.txt b/accounts/gkleen@sif/shell/quickshell-plugins/CMakeLists.txt index 2123ed35..020c0515 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/CMakeLists.txt +++ b/accounts/gkleen@sif/shell/quickshell-plugins/CMakeLists.txt | |||
@@ -92,7 +92,7 @@ endfunction() | |||
92 | cmake_minimum_required(VERSION 3.20) | 92 | cmake_minimum_required(VERSION 3.20) |
93 | project(custom LANGUAGES CXX) | 93 | project(custom LANGUAGES CXX) |
94 | 94 | ||
95 | find_package(Qt6 REQUIRED COMPONENTS Core Qml) | 95 | find_package(Qt6 REQUIRED COMPONENTS Core Qml DBus) |
96 | 96 | ||
97 | qt_standard_project_setup(REQUIRES 6.6) | 97 | qt_standard_project_setup(REQUIRES 6.6) |
98 | 98 | ||
@@ -102,16 +102,67 @@ qt6_add_qml_module(customplugin | |||
102 | PLUGIN_TARGET customplugin | 102 | PLUGIN_TARGET customplugin |
103 | ) | 103 | ) |
104 | 104 | ||
105 | target_sources(customplugin PRIVATE | 105 | set_source_files_properties(org.keepassxc.KeePassXC.MainWindow.xml PROPERTIES |
106 | Chrono.cpp Chrono.hpp | 106 | CLASSNAME DBusKeePassXC |
107 | FileSelector.cpp FileSelector.hpp | 107 | NO_NAMESPACE TRUE |
108 | ) | ||
109 | qt_add_dbus_interface(DBUS_INTERFACES | ||
110 | org.keepassxc.KeePassXC.MainWindow.xml | ||
111 | dbus_keepassxc | ||
112 | ) | ||
113 | |||
114 | set_source_files_properties(org.freedesktop.systemd1.Manager.xml PROPERTIES | ||
115 | CLASSNAME DBusSystemdManager | ||
116 | NO_NAMESPACE TRUE | ||
117 | ) | ||
118 | qt_add_dbus_interface(DBUS_INTERFACES | ||
119 | org.freedesktop.systemd1.Manager.xml | ||
120 | dbus_systemd_manager | ||
121 | ) | ||
122 | |||
123 | set_source_files_properties(org.freedesktop.login1.Manager.xml PROPERTIES | ||
124 | CLASSNAME DBusLogindManager | ||
125 | NO_NAMESPACE TRUE | ||
126 | ) | ||
127 | qt_add_dbus_interface(DBUS_INTERFACES | ||
128 | org.freedesktop.login1.Manager.xml | ||
129 | dbus_logind_manager | ||
130 | ) | ||
131 | |||
132 | set_source_files_properties(org.freedesktop.login1.Session.xml PROPERTIES | ||
133 | CLASSNAME DBusLogindSession | ||
134 | NO_NAMESPACE TRUE | ||
135 | ) | ||
136 | qt_add_dbus_interface(DBUS_INTERFACES | ||
137 | org.freedesktop.login1.Session.xml | ||
138 | dbus_logind_session | ||
139 | ) | ||
140 | |||
141 | set_source_files_properties(org.freedesktop.DBus.Properties.xml PROPERTIES | ||
142 | CLASSNAME DBusProperties | ||
143 | NO_NAMESPACE TRUE | ||
144 | ) | ||
145 | qt_add_dbus_interface(DBUS_INTERFACES | ||
146 | org.freedesktop.DBus.Properties.xml | ||
147 | dbus_properties | ||
108 | ) | 148 | ) |
109 | 149 | ||
150 | include_directories(${CMAKE_SOURCE_DIR}/build) | ||
151 | |||
110 | target_compile_features(customplugin PUBLIC cxx_std_26) | 152 | target_compile_features(customplugin PUBLIC cxx_std_26) |
111 | 153 | ||
112 | target_link_libraries(customplugin PRIVATE | 154 | target_link_libraries(customplugin PRIVATE |
113 | Qt6::Core | 155 | Qt6::Core |
114 | Qt6::Qml | 156 | Qt6::Qml |
157 | Qt6::DBus | ||
158 | ) | ||
159 | |||
160 | target_sources(customplugin PRIVATE | ||
161 | Chrono.cpp Chrono.hpp | ||
162 | FileSelector.cpp FileSelector.hpp | ||
163 | KeePassXC.cpp KeePassXC.hpp | ||
164 | Systemd.cpp Systemd.hpp | ||
165 | ${DBUS_INTERFACES} | ||
115 | ) | 166 | ) |
116 | 167 | ||
117 | install_qml_module(customplugin) | 168 | install_qml_module(customplugin) |
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/KeePassXC.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/KeePassXC.cpp new file mode 100644 index 00000000..f6e4dd6e --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/KeePassXC.cpp | |||
@@ -0,0 +1,18 @@ | |||
1 | #include "KeePassXC.hpp" | ||
2 | |||
3 | #include <QDBusConnection> | ||
4 | |||
5 | KeePassXC::KeePassXC() { | ||
6 | this->service = new DBusKeePassXC(DBusKeePassXC::staticInterfaceName(), "/keepassxc", QDBusConnection::sessionBus(), this); | ||
7 | } | ||
8 | KeePassXC::~KeePassXC() { | ||
9 | if (this->service) | ||
10 | delete this->service; | ||
11 | } | ||
12 | |||
13 | void KeePassXC::lockAllDatabases() { | ||
14 | if (!this->service) | ||
15 | return; | ||
16 | |||
17 | this->service->lockAllDatabases(); | ||
18 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/KeePassXC.hpp b/accounts/gkleen@sif/shell/quickshell-plugins/KeePassXC.hpp new file mode 100644 index 00000000..c4cd71e0 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/KeePassXC.hpp | |||
@@ -0,0 +1,21 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "dbus_keepassxc.h" | ||
4 | |||
5 | #include <QObject> | ||
6 | #include <QtQmlIntegration/qqmlintegration.h> | ||
7 | |||
8 | class KeePassXC : public QObject { | ||
9 | Q_OBJECT; | ||
10 | QML_SINGLETON; | ||
11 | QML_ELEMENT; | ||
12 | |||
13 | public: | ||
14 | explicit KeePassXC(); | ||
15 | ~KeePassXC(); | ||
16 | |||
17 | Q_INVOKABLE void lockAllDatabases(); | ||
18 | |||
19 | private: | ||
20 | DBusKeePassXC* service = nullptr; | ||
21 | }; | ||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp new file mode 100644 index 00000000..884ea17f --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp | |||
@@ -0,0 +1,207 @@ | |||
1 | #include "Systemd.hpp" | ||
2 | |||
3 | #include <sstream> | ||
4 | |||
5 | #include <QDBusConnection> | ||
6 | #include <QDBusReply> | ||
7 | #include <QDebug> | ||
8 | #include <QDBusUnixFileDescriptor> | ||
9 | #include <QDBusObjectPath> | ||
10 | |||
11 | Systemd::Systemd(QObject* parent) : QObject(parent) { | ||
12 | this->systemdManager = new DBusSystemdManager( | ||
13 | "org.freedesktop.systemd1", | ||
14 | "/org/freedesktop/systemd1", | ||
15 | QDBusConnection::sessionBus(), | ||
16 | this | ||
17 | ); | ||
18 | this->logindManager = new DBusLogindManager( | ||
19 | "org.freedesktop.login1", | ||
20 | "/org/freedesktop/login1", | ||
21 | QDBusConnection::systemBus(), | ||
22 | this | ||
23 | ); | ||
24 | |||
25 | QDBusReply<QDBusObjectPath> sessionPath = this->logindManager->GetSession("auto"); | ||
26 | qDebug() << sessionPath; | ||
27 | this->logindSession = new DBusLogindSession( | ||
28 | "org.freedesktop.login1", | ||
29 | sessionPath.value().path(), | ||
30 | QDBusConnection::systemBus(), | ||
31 | this | ||
32 | ); | ||
33 | this->logindSessionProperties = new DBusProperties( | ||
34 | "org.freedesktop.login1", | ||
35 | sessionPath.value().path(), | ||
36 | QDBusConnection::systemBus(), | ||
37 | this | ||
38 | ); | ||
39 | |||
40 | QObject::connect(this->logindManager, &DBusLogindManager::PrepareForShutdown, this, &Systemd::shutdown); | ||
41 | QObject::connect(this->logindManager, &DBusLogindManager::PrepareForSleep, this, &Systemd::sleep); | ||
42 | QObject::connect(this->logindSession, &DBusLogindSession::Lock, this, &Systemd::lock); | ||
43 | QObject::connect(this->logindSession, &DBusLogindSession::Unlock, this, &Systemd::unlock); | ||
44 | QObject::connect(this->logindSessionProperties, &DBusProperties::PropertiesChanged, this, &Systemd::onLogindSessionPropertiesChanged); | ||
45 | } | ||
46 | |||
47 | void Systemd::onLogindSessionPropertiesChanged(const QString& interface_name, const QVariantMap& changed_properties, const QStringList& invalidated_properties) { | ||
48 | if (changed_properties.contains("IdleHint") || invalidated_properties.contains("IdleHint")) | ||
49 | emit this->idleHintChanged(); | ||
50 | if (changed_properties.contains("LockedHint") || invalidated_properties.contains("LockedHint")) | ||
51 | emit this->lockedHintChanged(); | ||
52 | } | ||
53 | |||
54 | void Systemd::stopUserUnit(const QString& unit, const QString& mode) { | ||
55 | this->systemdManager->StopUnit(unit, mode); | ||
56 | } | ||
57 | |||
58 | void Systemd::setBrightness(const QString& subsystem, const QString& name, quint32 brightness) { | ||
59 | this->logindSession->SetBrightness(subsystem, name, brightness); | ||
60 | } | ||
61 | |||
62 | bool Systemd::idleHint() { | ||
63 | return this->logindSession->idleHint(); | ||
64 | } | ||
65 | void Systemd::setIdleHint(bool idle) { | ||
66 | this->logindSession->SetIdleHint(idle); | ||
67 | } | ||
68 | bool Systemd::lockedHint() { | ||
69 | return this->logindSession->lockedHint(); | ||
70 | } | ||
71 | void Systemd::setLockedHint(bool locked) { | ||
72 | this->logindSession->SetLockedHint(locked); | ||
73 | } | ||
74 | |||
75 | std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::WhatItem what) { | ||
76 | if (what == SystemdInhibitorParams::Shutdown) | ||
77 | return "shutdown"; | ||
78 | else if (what == SystemdInhibitorParams::Sleep) | ||
79 | return "sleep"; | ||
80 | else if (what == SystemdInhibitorParams::Idle) | ||
81 | return "idle"; | ||
82 | else if (what == SystemdInhibitorParams::HandlePowerKey) | ||
83 | return "handle-power-key"; | ||
84 | else if (what == SystemdInhibitorParams::HandleSuspendKey) | ||
85 | return "handle-suspend-key"; | ||
86 | else if (what == SystemdInhibitorParams::HandleHibernateKey) | ||
87 | return "handle-hibernate-key"; | ||
88 | else if (what == SystemdInhibitorParams::HandleLidSwitch) | ||
89 | return "handle-lid-switch"; | ||
90 | return ""; | ||
91 | } | ||
92 | |||
93 | std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::What what) { | ||
94 | std::ostringstream res; | ||
95 | bool first = true; | ||
96 | for (const WhatItem& item: SystemdInhibitorParams::allWhatItems) { | ||
97 | if (!(what & item)) | ||
98 | continue; | ||
99 | |||
100 | if (!first) | ||
101 | res << ":"; | ||
102 | else | ||
103 | first = false; | ||
104 | res << SystemdInhibitorParams::toString(item); | ||
105 | } | ||
106 | return res.str(); | ||
107 | } | ||
108 | |||
109 | std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::Mode mode) { | ||
110 | if (mode == SystemdInhibitorParams::Block) | ||
111 | return "block"; | ||
112 | else if (mode == SystemdInhibitorParams::BlockWeak) | ||
113 | return "block-weak"; | ||
114 | else if (mode == SystemdInhibitorParams::Delay) | ||
115 | return "delay"; | ||
116 | return ""; | ||
117 | } | ||
118 | |||
119 | bool SystemdInhibitor::enabled() const { return static_cast<bool>(this->activeInhibitor); } | ||
120 | void SystemdInhibitor::setEnabled(bool enabled) { | ||
121 | this->mEnabled = enabled; | ||
122 | |||
123 | if (enabled) | ||
124 | this->update(); | ||
125 | else | ||
126 | this->release(); | ||
127 | } | ||
128 | |||
129 | SystemdInhibitorParams::What SystemdInhibitor::what() const { return this->mWhat; } | ||
130 | void SystemdInhibitor::setWhat(SystemdInhibitorParams::What what) { | ||
131 | this->mWhat = what; | ||
132 | this->update(); | ||
133 | } | ||
134 | |||
135 | QString SystemdInhibitor::who() const { return this->mWho; } | ||
136 | void SystemdInhibitor::setWho(QString who) { | ||
137 | this->mWho = who; | ||
138 | this->update(); | ||
139 | } | ||
140 | |||
141 | QString SystemdInhibitor::why() const { return this->mWhy; } | ||
142 | void SystemdInhibitor::setWhy(QString why) { | ||
143 | this->mWhy = why; | ||
144 | this->update(); | ||
145 | } | ||
146 | |||
147 | SystemdInhibitorParams::Mode SystemdInhibitor::mode() const { return this->mMode; } | ||
148 | void SystemdInhibitor::setMode(SystemdInhibitorParams::Mode mode) { | ||
149 | this->mMode = mode; | ||
150 | this->update(); | ||
151 | } | ||
152 | |||
153 | SystemdInhibitor::ActiveSystemdInhibitor::ActiveSystemdInhibitor(SystemdInhibitorParams::What what_, QString who_, QString why_, SystemdInhibitorParams::Mode mode_): what(what_), who(who_), why(why_), mode(mode_) { | ||
154 | DBusLogindManager logindManager( | ||
155 | "org.freedesktop.login1", | ||
156 | "/org/freedesktop/login1", | ||
157 | QDBusConnection::systemBus() | ||
158 | ); | ||
159 | QDBusReply<QDBusUnixFileDescriptor> fd_ = logindManager.Inhibit(QString::fromStdString(SystemdInhibitorParams::toString(what)), who, why, QString::fromStdString(SystemdInhibitorParams::toString(mode))); | ||
160 | if (fd_.error().isValid()) | ||
161 | throw fd_.error(); | ||
162 | this->fd = ::dup(fd_.value().fileDescriptor()); | ||
163 | } | ||
164 | SystemdInhibitor::ActiveSystemdInhibitor::~ActiveSystemdInhibitor() { | ||
165 | if (this->fd != -1) | ||
166 | ::close(this->fd); | ||
167 | } | ||
168 | |||
169 | void SystemdInhibitor::release() { | ||
170 | if (!this->activeInhibitor) | ||
171 | return; | ||
172 | |||
173 | this->activeInhibitor.reset(); | ||
174 | emit this->enabledChanged(); | ||
175 | } | ||
176 | |||
177 | void SystemdInhibitor::update() { | ||
178 | if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode || !this->mEnabled) | ||
179 | if (this->activeInhibitor) | ||
180 | this->release(); | ||
181 | else | ||
182 | return; | ||
183 | |||
184 | if (this->activeInhibitor && this->mWhat == this->activeInhibitor->what && this->mWho == this->activeInhibitor->who && this->mWhy == this->activeInhibitor->why && this->mMode == this->activeInhibitor->mode) | ||
185 | return; | ||
186 | |||
187 | std::unique_ptr<ActiveSystemdInhibitor> otherInhibitor; | ||
188 | try { | ||
189 | otherInhibitor.reset(new SystemdInhibitor::ActiveSystemdInhibitor(this->mWhat, this->mWho, this->mWhy, this->mMode)); | ||
190 | } catch (const QDBusError& err) { | ||
191 | qCritical().noquote() | ||
192 | << err.name().toStdString() << " " << err.message().toStdString(); | ||
193 | return; | ||
194 | } | ||
195 | this->activeInhibitor.swap(otherInhibitor); | ||
196 | |||
197 | if (!otherInhibitor && this->activeInhibitor) | ||
198 | emit this->enabledChanged(); | ||
199 | if (otherInhibitor && otherInhibitor->what != this->activeInhibitor->what) | ||
200 | emit this->whatChanged(); | ||
201 | if (otherInhibitor && otherInhibitor->who != this->activeInhibitor->who) | ||
202 | emit this->whoChanged(); | ||
203 | if (otherInhibitor && otherInhibitor->why != this->activeInhibitor->why) | ||
204 | emit this->whyChanged(); | ||
205 | if (otherInhibitor && otherInhibitor->mode != this->activeInhibitor->mode) | ||
206 | emit this->modeChanged(); | ||
207 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp new file mode 100644 index 00000000..84752d76 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp | |||
@@ -0,0 +1,144 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <cstdint> | ||
4 | #include <memory> | ||
5 | #include <string> | ||
6 | |||
7 | #include <QObject> | ||
8 | #include <QDBusInterface> | ||
9 | #include <QtQmlIntegration/qqmlintegration.h> | ||
10 | |||
11 | #include "dbus_systemd_manager.h" | ||
12 | #include "dbus_logind_manager.h" | ||
13 | #include "dbus_logind_session.h" | ||
14 | #include "dbus_properties.h" | ||
15 | |||
16 | class Systemd : public QObject { | ||
17 | Q_OBJECT; | ||
18 | QML_SINGLETON; | ||
19 | QML_ELEMENT; | ||
20 | |||
21 | public: | ||
22 | explicit Systemd(QObject* parent = nullptr); | ||
23 | |||
24 | Q_PROPERTY(bool idleHint READ idleHint WRITE setIdleHint NOTIFY idleHintChanged) | ||
25 | Q_PROPERTY(bool lockedHint READ lockedHint WRITE setLockedHint NOTIFY lockedHintChanged) | ||
26 | |||
27 | Q_INVOKABLE void stopUserUnit(const QString& unit, const QString& mode); | ||
28 | Q_INVOKABLE void setBrightness(const QString& subsystem, const QString& name, quint32 brightness); | ||
29 | Q_INVOKABLE void setIdleHint(bool idle); | ||
30 | Q_INVOKABLE void setLockedHint(bool locked); | ||
31 | |||
32 | bool idleHint(); | ||
33 | bool lockedHint(); | ||
34 | |||
35 | signals: | ||
36 | void shutdown(bool before); | ||
37 | void sleep(bool before); | ||
38 | void lock(); | ||
39 | void unlock(); | ||
40 | void idleHintChanged(); | ||
41 | void lockedHintChanged(); | ||
42 | |||
43 | private slots: | ||
44 | void onLogindSessionPropertiesChanged(const QString& interface_name, const QVariantMap& changed_properties, const QStringList& invalidated_properties); | ||
45 | |||
46 | private: | ||
47 | DBusSystemdManager* systemdManager; | ||
48 | DBusLogindManager* logindManager; | ||
49 | DBusLogindSession* logindSession; | ||
50 | DBusProperties* logindSessionProperties; | ||
51 | }; | ||
52 | |||
53 | class SystemdInhibitorParams : public QObject { | ||
54 | Q_OBJECT; | ||
55 | QML_ELEMENT; | ||
56 | QML_SINGLETON; | ||
57 | |||
58 | public: | ||
59 | enum WhatItem : uint8_t { | ||
60 | Shutdown = 0b1, | ||
61 | Sleep = 0b10, | ||
62 | Idle = 0b100, | ||
63 | HandlePowerKey = 0b1000, | ||
64 | HandleSuspendKey = 0b10000, | ||
65 | HandleHibernateKey = 0b100000, | ||
66 | HandleLidSwitch = 0b1000000, | ||
67 | }; | ||
68 | Q_ENUM(WhatItem); | ||
69 | Q_DECLARE_FLAGS(What, WhatItem); | ||
70 | |||
71 | enum Mode : uint8_t { | ||
72 | Block = 1, | ||
73 | BlockWeak = 2, | ||
74 | Delay = 3, | ||
75 | }; | ||
76 | Q_ENUM(Mode); | ||
77 | |||
78 | Q_INVOKABLE static std::string toString(WhatItem what); | ||
79 | Q_INVOKABLE static std::string toString(What what); | ||
80 | Q_INVOKABLE static std::string toString(Mode mode); | ||
81 | |||
82 | static constexpr WhatItem allWhatItems[] = { Shutdown, Sleep, Idle, HandlePowerKey, HandleSuspendKey, HandleHibernateKey, HandleLidSwitch }; | ||
83 | }; | ||
84 | Q_DECLARE_OPERATORS_FOR_FLAGS(SystemdInhibitorParams::What) | ||
85 | |||
86 | class SystemdInhibitor : public QObject { | ||
87 | Q_OBJECT; | ||
88 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged); | ||
89 | Q_PROPERTY(SystemdInhibitorParams::What what READ what WRITE setWhat NOTIFY whatChanged); | ||
90 | Q_PROPERTY(QString who READ who WRITE setWho NOTIFY whoChanged); | ||
91 | Q_PROPERTY(QString why READ why WRITE setWhy NOTIFY whyChanged); | ||
92 | Q_PROPERTY(SystemdInhibitorParams::Mode mode READ mode WRITE setMode NOTIFY modeChanged); | ||
93 | QML_ELEMENT; | ||
94 | |||
95 | public: | ||
96 | explicit SystemdInhibitor(QObject* parent = nullptr): QObject(parent) {} | ||
97 | |||
98 | bool enabled() const; | ||
99 | void setEnabled(bool enabled); | ||
100 | |||
101 | SystemdInhibitorParams::What what() const; | ||
102 | void setWhat(SystemdInhibitorParams::What what); | ||
103 | |||
104 | QString who() const; | ||
105 | void setWho(QString who); | ||
106 | |||
107 | QString why() const; | ||
108 | void setWhy(QString why); | ||
109 | |||
110 | SystemdInhibitorParams::Mode mode() const; | ||
111 | void setMode(SystemdInhibitorParams::Mode mode); | ||
112 | |||
113 | Q_INVOKABLE void release(); | ||
114 | |||
115 | signals: | ||
116 | void enabledChanged(); | ||
117 | void whatChanged(); | ||
118 | void whoChanged(); | ||
119 | void whyChanged(); | ||
120 | void modeChanged(); | ||
121 | |||
122 | private: | ||
123 | class ActiveSystemdInhibitor { | ||
124 | public: | ||
125 | uint32_t fd = -1; | ||
126 | SystemdInhibitorParams::What what; | ||
127 | QString who; | ||
128 | QString why; | ||
129 | SystemdInhibitorParams::Mode mode; | ||
130 | |||
131 | ActiveSystemdInhibitor(SystemdInhibitorParams::What what_, QString who_, QString why_, SystemdInhibitorParams::Mode mode_); | ||
132 | ~ActiveSystemdInhibitor(); | ||
133 | }; | ||
134 | |||
135 | void update(); | ||
136 | |||
137 | bool mEnabled = true; | ||
138 | std::unique_ptr<ActiveSystemdInhibitor> activeInhibitor; | ||
139 | SystemdInhibitorParams::What mWhat = static_cast<SystemdInhibitorParams::What>(0); | ||
140 | QString mWho; | ||
141 | QString mWhy; | ||
142 | SystemdInhibitorParams::Mode mMode = static_cast<SystemdInhibitorParams::Mode>(0); | ||
143 | }; | ||
144 | |||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/default.nix b/accounts/gkleen@sif/shell/quickshell-plugins/default.nix index fafea90e..33b76f61 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/default.nix +++ b/accounts/gkleen@sif/shell/quickshell-plugins/default.nix | |||
@@ -3,11 +3,19 @@ | |||
3 | , cmake | 3 | , cmake |
4 | , qt6 | 4 | , qt6 |
5 | , fmt | 5 | , fmt |
6 | , keepassxc | ||
7 | , systemd | ||
6 | }: | 8 | }: |
9 | |||
7 | stdenv.mkDerivation rec { | 10 | stdenv.mkDerivation rec { |
8 | name = "quickshell-custom"; | 11 | name = "quickshell-custom"; |
9 | 12 | ||
10 | src = ./.; | 13 | src = ./.; |
14 | |||
15 | prePatch = '' | ||
16 | cp ${keepassxc.src}/src/gui/org.keepassxc.KeePassXC.MainWindow.xml . | ||
17 | ''; | ||
18 | |||
11 | nativeBuildInputs = [ cmake qt6.wrapQtAppsHook ]; | 19 | nativeBuildInputs = [ cmake qt6.wrapQtAppsHook ]; |
12 | buildInputs = [ | 20 | buildInputs = [ |
13 | qt6.qtbase | 21 | qt6.qtbase |
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.DBus.Properties.xml b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.DBus.Properties.xml new file mode 100644 index 00000000..7588e7a5 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.DBus.Properties.xml | |||
@@ -0,0 +1,28 @@ | |||
1 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
2 | "https://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
3 | <node> | ||
4 | <interface name="org.freedesktop.DBus.Properties"> | ||
5 | <method name="Get"> | ||
6 | <arg name="interface_name" direction="in" type="s"/> | ||
7 | <arg name="property_name" direction="in" type="s"/> | ||
8 | <arg name="value" direction="out" type="v"/> | ||
9 | </method> | ||
10 | <method name="GetAll"> | ||
11 | <arg name="interface_name" direction="in" type="s"/> | ||
12 | <arg name="props" direction="out" type="a{sv}"/> | ||
13 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
14 | </method> | ||
15 | <method name="Set"> | ||
16 | <arg name="interface_name" direction="in" type="s"/> | ||
17 | <arg name="property_name" direction="in" type="s"/> | ||
18 | <arg name="value" direction="in" type="v"/> | ||
19 | </method> | ||
20 | <signal name="PropertiesChanged"> | ||
21 | <arg type="s" name="interface_name"/> | ||
22 | <arg type="a{sv}" name="changed_properties"/> | ||
23 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> | ||
24 | <arg type="as" name="invalidated_properties"/> | ||
25 | </signal> | ||
26 | </interface> | ||
27 | </node> | ||
28 | |||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.login1.Manager.xml b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.login1.Manager.xml new file mode 100644 index 00000000..120a06d9 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.login1.Manager.xml | |||
@@ -0,0 +1,445 @@ | |||
1 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
2 | "https://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
3 | <node> | ||
4 | <interface name="org.freedesktop.login1.Manager"> | ||
5 | <property name="EnableWallMessages" type="b" access="readwrite"> | ||
6 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
7 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
8 | </property> | ||
9 | <property name="WallMessage" type="s" access="readwrite"> | ||
10 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
11 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
12 | </property> | ||
13 | <property name="NAutoVTs" type="u" access="read"> | ||
14 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
15 | </property> | ||
16 | <property name="KillOnlyUsers" type="as" access="read"> | ||
17 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
18 | </property> | ||
19 | <property name="KillExcludeUsers" type="as" access="read"> | ||
20 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
21 | </property> | ||
22 | <property name="KillUserProcesses" type="b" access="read"> | ||
23 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
24 | </property> | ||
25 | <property name="RebootParameter" type="s" access="read"> | ||
26 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
27 | </property> | ||
28 | <property name="RebootToFirmwareSetup" type="b" access="read"> | ||
29 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
30 | </property> | ||
31 | <property name="RebootToBootLoaderMenu" type="t" access="read"> | ||
32 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
33 | </property> | ||
34 | <property name="RebootToBootLoaderEntry" type="s" access="read"> | ||
35 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
36 | </property> | ||
37 | <property name="BootLoaderEntries" type="as" access="read"> | ||
38 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
39 | </property> | ||
40 | <property name="IdleHint" type="b" access="read"> | ||
41 | </property> | ||
42 | <property name="IdleSinceHint" type="t" access="read"> | ||
43 | </property> | ||
44 | <property name="IdleSinceHintMonotonic" type="t" access="read"> | ||
45 | </property> | ||
46 | <property name="BlockInhibited" type="s" access="read"> | ||
47 | </property> | ||
48 | <property name="BlockWeakInhibited" type="s" access="read"> | ||
49 | </property> | ||
50 | <property name="DelayInhibited" type="s" access="read"> | ||
51 | </property> | ||
52 | <property name="InhibitDelayMaxUSec" type="t" access="read"> | ||
53 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
54 | </property> | ||
55 | <property name="UserStopDelayUSec" type="t" access="read"> | ||
56 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
57 | </property> | ||
58 | <property name="SleepOperation" type="as" access="read"> | ||
59 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
60 | </property> | ||
61 | <property name="HandlePowerKey" type="s" access="read"> | ||
62 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
63 | </property> | ||
64 | <property name="HandlePowerKeyLongPress" type="s" access="read"> | ||
65 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
66 | </property> | ||
67 | <property name="HandleRebootKey" type="s" access="read"> | ||
68 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
69 | </property> | ||
70 | <property name="HandleRebootKeyLongPress" type="s" access="read"> | ||
71 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
72 | </property> | ||
73 | <property name="HandleSuspendKey" type="s" access="read"> | ||
74 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
75 | </property> | ||
76 | <property name="HandleSuspendKeyLongPress" type="s" access="read"> | ||
77 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
78 | </property> | ||
79 | <property name="HandleHibernateKey" type="s" access="read"> | ||
80 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
81 | </property> | ||
82 | <property name="HandleHibernateKeyLongPress" type="s" access="read"> | ||
83 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
84 | </property> | ||
85 | <property name="HandleLidSwitch" type="s" access="read"> | ||
86 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
87 | </property> | ||
88 | <property name="HandleLidSwitchExternalPower" type="s" access="read"> | ||
89 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
90 | </property> | ||
91 | <property name="HandleLidSwitchDocked" type="s" access="read"> | ||
92 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
93 | </property> | ||
94 | <property name="HandleSecureAttentionKey" type="s" access="read"> | ||
95 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
96 | </property> | ||
97 | <property name="HoldoffTimeoutUSec" type="t" access="read"> | ||
98 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
99 | </property> | ||
100 | <property name="IdleAction" type="s" access="read"> | ||
101 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
102 | </property> | ||
103 | <property name="IdleActionUSec" type="t" access="read"> | ||
104 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
105 | </property> | ||
106 | <property name="PreparingForShutdown" type="b" access="read"> | ||
107 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
108 | </property> | ||
109 | <property name="PreparingForShutdownWithMetadata" type="a{sv}" access="read"> | ||
110 | <annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariantMap"/> | ||
111 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
112 | </property> | ||
113 | <property name="PreparingForSleep" type="b" access="read"> | ||
114 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
115 | </property> | ||
116 | <!-- <property name="ScheduledShutdown" type="(st)" access="read"> --> | ||
117 | <!-- </property> --> | ||
118 | <property name="DesignatedMaintenanceTime" type="s" access="read"> | ||
119 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
120 | </property> | ||
121 | <property name="Docked" type="b" access="read"> | ||
122 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
123 | </property> | ||
124 | <property name="LidClosed" type="b" access="read"> | ||
125 | </property> | ||
126 | <property name="OnExternalPower" type="b" access="read"> | ||
127 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
128 | </property> | ||
129 | <property name="RemoveIPC" type="b" access="read"> | ||
130 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
131 | </property> | ||
132 | <property name="RuntimeDirectorySize" type="t" access="read"> | ||
133 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
134 | </property> | ||
135 | <property name="RuntimeDirectoryInodesMax" type="t" access="read"> | ||
136 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
137 | </property> | ||
138 | <property name="InhibitorsMax" type="t" access="read"> | ||
139 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
140 | </property> | ||
141 | <property name="NCurrentInhibitors" type="t" access="read"> | ||
142 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
143 | </property> | ||
144 | <property name="SessionsMax" type="t" access="read"> | ||
145 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
146 | </property> | ||
147 | <property name="NCurrentSessions" type="t" access="read"> | ||
148 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
149 | </property> | ||
150 | <property name="StopIdleSessionUSec" type="t" access="read"> | ||
151 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
152 | </property> | ||
153 | <method name="GetSession"> | ||
154 | <arg type="s" name="session_id" direction="in"/> | ||
155 | <arg type="o" name="object_path" direction="out"/> | ||
156 | </method> | ||
157 | <method name="GetSessionByPID"> | ||
158 | <arg type="u" name="pid" direction="in"/> | ||
159 | <arg type="o" name="object_path" direction="out"/> | ||
160 | </method> | ||
161 | <method name="GetUser"> | ||
162 | <arg type="u" name="uid" direction="in"/> | ||
163 | <arg type="o" name="object_path" direction="out"/> | ||
164 | </method> | ||
165 | <method name="GetUserByPID"> | ||
166 | <arg type="u" name="pid" direction="in"/> | ||
167 | <arg type="o" name="object_path" direction="out"/> | ||
168 | </method> | ||
169 | <method name="GetSeat"> | ||
170 | <arg type="s" name="seat_id" direction="in"/> | ||
171 | <arg type="o" name="object_path" direction="out"/> | ||
172 | </method> | ||
173 | <!-- <method name="ListSessions"> --> | ||
174 | <!-- <arg type="a(susso)" name="sessions" direction="out"/> --> | ||
175 | <!-- </method> --> | ||
176 | <!-- <method name="ListSessionsEx"> --> | ||
177 | <!-- <arg type="a(sussussbto)" name="sessions" direction="out"/> --> | ||
178 | <!-- </method> --> | ||
179 | <!-- <method name="ListUsers"> --> | ||
180 | <!-- <arg type="a(uso)" name="users" direction="out"/> --> | ||
181 | <!-- </method> --> | ||
182 | <!-- <method name="ListSeats"> --> | ||
183 | <!-- <arg type="a(so)" name="seats" direction="out"/> --> | ||
184 | <!-- </method> --> | ||
185 | <!-- <method name="ListInhibitors"> --> | ||
186 | <!-- <arg type="a(ssssuu)" name="inhibitors" direction="out"/> --> | ||
187 | <!-- </method> --> | ||
188 | <!-- <method name="CreateSession"> --> | ||
189 | <!-- <arg type="u" name="uid" direction="in"/> --> | ||
190 | <!-- <arg type="u" name="pid" direction="in"/> --> | ||
191 | <!-- <arg type="s" name="service" direction="in"/> --> | ||
192 | <!-- <arg type="s" name="type" direction="in"/> --> | ||
193 | <!-- <arg type="s" name="class" direction="in"/> --> | ||
194 | <!-- <arg type="s" name="desktop" direction="in"/> --> | ||
195 | <!-- <arg type="s" name="seat_id" direction="in"/> --> | ||
196 | <!-- <arg type="u" name="vtnr" direction="in"/> --> | ||
197 | <!-- <arg type="s" name="tty" direction="in"/> --> | ||
198 | <!-- <arg type="s" name="display" direction="in"/> --> | ||
199 | <!-- <arg type="b" name="remote" direction="in"/> --> | ||
200 | <!-- <arg type="s" name="remote_user" direction="in"/> --> | ||
201 | <!-- <arg type="s" name="remote_host" direction="in"/> --> | ||
202 | <!-- <arg type="a(sv)" name="properties" direction="in"/> --> | ||
203 | <!-- <arg type="s" name="session_id" direction="out"/> --> | ||
204 | <!-- <arg type="o" name="object_path" direction="out"/> --> | ||
205 | <!-- <arg type="s" name="runtime_path" direction="out"/> --> | ||
206 | <!-- <arg type="h" name="fifo_fd" direction="out"/> --> | ||
207 | <!-- <arg type="u" name="uid" direction="out"/> --> | ||
208 | <!-- <arg type="s" name="seat_id" direction="out"/> --> | ||
209 | <!-- <arg type="u" name="vtnr" direction="out"/> --> | ||
210 | <!-- <arg type="b" name="existing" direction="out"/> --> | ||
211 | <!-- <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> --> | ||
212 | <!-- </method> --> | ||
213 | <!-- <method name="CreateSessionWithPIDFD"> --> | ||
214 | <!-- <arg type="u" name="uid" direction="in"/> --> | ||
215 | <!-- <arg type="h" name="pidfd" direction="in"/> --> | ||
216 | <!-- <arg type="s" name="service" direction="in"/> --> | ||
217 | <!-- <arg type="s" name="type" direction="in"/> --> | ||
218 | <!-- <arg type="s" name="class" direction="in"/> --> | ||
219 | <!-- <arg type="s" name="desktop" direction="in"/> --> | ||
220 | <!-- <arg type="s" name="seat_id" direction="in"/> --> | ||
221 | <!-- <arg type="u" name="vtnr" direction="in"/> --> | ||
222 | <!-- <arg type="s" name="tty" direction="in"/> --> | ||
223 | <!-- <arg type="s" name="display" direction="in"/> --> | ||
224 | <!-- <arg type="b" name="remote" direction="in"/> --> | ||
225 | <!-- <arg type="s" name="remote_user" direction="in"/> --> | ||
226 | <!-- <arg type="s" name="remote_host" direction="in"/> --> | ||
227 | <!-- <arg type="t" name="flags" direction="in"/> --> | ||
228 | <!-- <arg type="a(sv)" name="properties" direction="in"/> --> | ||
229 | <!-- <arg type="s" name="session_id" direction="out"/> --> | ||
230 | <!-- <arg type="o" name="object_path" direction="out"/> --> | ||
231 | <!-- <arg type="s" name="runtime_path" direction="out"/> --> | ||
232 | <!-- <arg type="h" name="fifo_fd" direction="out"/> --> | ||
233 | <!-- <arg type="u" name="uid" direction="out"/> --> | ||
234 | <!-- <arg type="s" name="seat_id" direction="out"/> --> | ||
235 | <!-- <arg type="u" name="vtnr" direction="out"/> --> | ||
236 | <!-- <arg type="b" name="existing" direction="out"/> --> | ||
237 | <!-- <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> --> | ||
238 | <!-- </method> --> | ||
239 | <method name="ReleaseSession"> | ||
240 | <arg type="s" name="session_id" direction="in"/> | ||
241 | </method> | ||
242 | <method name="ActivateSession"> | ||
243 | <arg type="s" name="session_id" direction="in"/> | ||
244 | </method> | ||
245 | <method name="ActivateSessionOnSeat"> | ||
246 | <arg type="s" name="session_id" direction="in"/> | ||
247 | <arg type="s" name="seat_id" direction="in"/> | ||
248 | </method> | ||
249 | <method name="LockSession"> | ||
250 | <arg type="s" name="session_id" direction="in"/> | ||
251 | </method> | ||
252 | <method name="UnlockSession"> | ||
253 | <arg type="s" name="session_id" direction="in"/> | ||
254 | </method> | ||
255 | <method name="LockSessions"> | ||
256 | </method> | ||
257 | <method name="UnlockSessions"> | ||
258 | </method> | ||
259 | <method name="KillSession"> | ||
260 | <arg type="s" name="session_id" direction="in"/> | ||
261 | <arg type="s" name="whom" direction="in"/> | ||
262 | <arg type="i" name="signal_number" direction="in"/> | ||
263 | </method> | ||
264 | <method name="KillUser"> | ||
265 | <arg type="u" name="uid" direction="in"/> | ||
266 | <arg type="i" name="signal_number" direction="in"/> | ||
267 | </method> | ||
268 | <method name="TerminateSession"> | ||
269 | <arg type="s" name="session_id" direction="in"/> | ||
270 | </method> | ||
271 | <method name="TerminateUser"> | ||
272 | <arg type="u" name="uid" direction="in"/> | ||
273 | </method> | ||
274 | <method name="TerminateSeat"> | ||
275 | <arg type="s" name="seat_id" direction="in"/> | ||
276 | </method> | ||
277 | <method name="SetUserLinger"> | ||
278 | <arg type="u" name="uid" direction="in"/> | ||
279 | <arg type="b" name="enable" direction="in"/> | ||
280 | <arg type="b" name="interactive" direction="in"/> | ||
281 | </method> | ||
282 | <method name="AttachDevice"> | ||
283 | <arg type="s" name="seat_id" direction="in"/> | ||
284 | <arg type="s" name="sysfs_path" direction="in"/> | ||
285 | <arg type="b" name="interactive" direction="in"/> | ||
286 | </method> | ||
287 | <method name="FlushDevices"> | ||
288 | <arg type="b" name="interactive" direction="in"/> | ||
289 | </method> | ||
290 | <method name="PowerOff"> | ||
291 | <arg type="b" name="interactive" direction="in"/> | ||
292 | </method> | ||
293 | <method name="PowerOffWithFlags"> | ||
294 | <arg type="t" name="flags" direction="in"/> | ||
295 | </method> | ||
296 | <method name="Reboot"> | ||
297 | <arg type="b" name="interactive" direction="in"/> | ||
298 | </method> | ||
299 | <method name="RebootWithFlags"> | ||
300 | <arg type="t" name="flags" direction="in"/> | ||
301 | </method> | ||
302 | <method name="Halt"> | ||
303 | <arg type="b" name="interactive" direction="in"/> | ||
304 | </method> | ||
305 | <method name="HaltWithFlags"> | ||
306 | <arg type="t" name="flags" direction="in"/> | ||
307 | </method> | ||
308 | <method name="Suspend"> | ||
309 | <arg type="b" name="interactive" direction="in"/> | ||
310 | </method> | ||
311 | <method name="SuspendWithFlags"> | ||
312 | <arg type="t" name="flags" direction="in"/> | ||
313 | </method> | ||
314 | <method name="Hibernate"> | ||
315 | <arg type="b" name="interactive" direction="in"/> | ||
316 | </method> | ||
317 | <method name="HibernateWithFlags"> | ||
318 | <arg type="t" name="flags" direction="in"/> | ||
319 | </method> | ||
320 | <method name="HybridSleep"> | ||
321 | <arg type="b" name="interactive" direction="in"/> | ||
322 | </method> | ||
323 | <method name="HybridSleepWithFlags"> | ||
324 | <arg type="t" name="flags" direction="in"/> | ||
325 | </method> | ||
326 | <method name="SuspendThenHibernate"> | ||
327 | <arg type="b" name="interactive" direction="in"/> | ||
328 | </method> | ||
329 | <method name="SuspendThenHibernateWithFlags"> | ||
330 | <arg type="t" name="flags" direction="in"/> | ||
331 | </method> | ||
332 | <method name="Sleep"> | ||
333 | <arg type="t" name="flags" direction="in"/> | ||
334 | </method> | ||
335 | <method name="CanPowerOff"> | ||
336 | <arg type="s" name="result" direction="out"/> | ||
337 | </method> | ||
338 | <method name="CanReboot"> | ||
339 | <arg type="s" name="result" direction="out"/> | ||
340 | </method> | ||
341 | <method name="CanHalt"> | ||
342 | <arg type="s" name="result" direction="out"/> | ||
343 | </method> | ||
344 | <method name="CanSuspend"> | ||
345 | <arg type="s" name="result" direction="out"/> | ||
346 | </method> | ||
347 | <method name="CanHibernate"> | ||
348 | <arg type="s" name="result" direction="out"/> | ||
349 | </method> | ||
350 | <method name="CanHybridSleep"> | ||
351 | <arg type="s" name="result" direction="out"/> | ||
352 | </method> | ||
353 | <method name="CanSuspendThenHibernate"> | ||
354 | <arg type="s" name="result" direction="out"/> | ||
355 | </method> | ||
356 | <method name="CanSleep"> | ||
357 | <arg type="s" name="result" direction="out"/> | ||
358 | </method> | ||
359 | <method name="ScheduleShutdown"> | ||
360 | <arg type="s" name="type" direction="in"/> | ||
361 | <arg type="t" name="usec" direction="in"/> | ||
362 | </method> | ||
363 | <method name="CancelScheduledShutdown"> | ||
364 | <arg type="b" name="cancelled" direction="out"/> | ||
365 | </method> | ||
366 | <method name="Inhibit"> | ||
367 | <arg type="s" name="what" direction="in"/> | ||
368 | <arg type="s" name="who" direction="in"/> | ||
369 | <arg type="s" name="why" direction="in"/> | ||
370 | <arg type="s" name="mode" direction="in"/> | ||
371 | <arg type="h" name="pipe_fd" direction="out"/> | ||
372 | </method> | ||
373 | <method name="CanRebootParameter"> | ||
374 | <arg type="s" name="result" direction="out"/> | ||
375 | </method> | ||
376 | <method name="SetRebootParameter"> | ||
377 | <arg type="s" name="parameter" direction="in"/> | ||
378 | </method> | ||
379 | <method name="CanRebootToFirmwareSetup"> | ||
380 | <arg type="s" name="result" direction="out"/> | ||
381 | </method> | ||
382 | <method name="SetRebootToFirmwareSetup"> | ||
383 | <arg type="b" name="enable" direction="in"/> | ||
384 | </method> | ||
385 | <method name="CanRebootToBootLoaderMenu"> | ||
386 | <arg type="s" name="result" direction="out"/> | ||
387 | </method> | ||
388 | <method name="SetRebootToBootLoaderMenu"> | ||
389 | <arg type="t" name="timeout" direction="in"/> | ||
390 | </method> | ||
391 | <method name="CanRebootToBootLoaderEntry"> | ||
392 | <arg type="s" name="result" direction="out"/> | ||
393 | </method> | ||
394 | <method name="SetRebootToBootLoaderEntry"> | ||
395 | <arg type="s" name="boot_loader_entry" direction="in"/> | ||
396 | </method> | ||
397 | <method name="SetWallMessage"> | ||
398 | <arg type="s" name="wall_message" direction="in"/> | ||
399 | <arg type="b" name="enable" direction="in"/> | ||
400 | </method> | ||
401 | <signal name="SecureAttentionKey"> | ||
402 | <arg type="s" name="seat_id"/> | ||
403 | <arg type="o" name="object_path"/> | ||
404 | </signal> | ||
405 | <signal name="SessionNew"> | ||
406 | <arg type="s" name="session_id"/> | ||
407 | <arg type="o" name="object_path"/> | ||
408 | </signal> | ||
409 | <signal name="SessionRemoved"> | ||
410 | <arg type="s" name="session_id"/> | ||
411 | <arg type="o" name="object_path"/> | ||
412 | </signal> | ||
413 | <signal name="UserNew"> | ||
414 | <arg type="u" name="uid"/> | ||
415 | <arg type="o" name="object_path"/> | ||
416 | </signal> | ||
417 | <signal name="UserRemoved"> | ||
418 | <arg type="u" name="uid"/> | ||
419 | <arg type="o" name="object_path"/> | ||
420 | </signal> | ||
421 | <signal name="SeatNew"> | ||
422 | <arg type="s" name="seat_id"/> | ||
423 | <arg type="o" name="object_path"/> | ||
424 | </signal> | ||
425 | <signal name="SeatRemoved"> | ||
426 | <arg type="s" name="seat_id"/> | ||
427 | <arg type="o" name="object_path"/> | ||
428 | </signal> | ||
429 | <signal name="PrepareForShutdown"> | ||
430 | <arg type="b" name="start"/> | ||
431 | </signal> | ||
432 | <signal name="PrepareForShutdownWithMetadata"> | ||
433 | <arg type="b" name="start"/> | ||
434 | <arg type="a{sv}" name="metadata"/> | ||
435 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> | ||
436 | </signal> | ||
437 | <signal name="PrepareForSleep"> | ||
438 | <arg type="b" name="start"/> | ||
439 | </signal> | ||
440 | </interface> | ||
441 | <node name="user"/> | ||
442 | <node name="session"/> | ||
443 | <node name="seat"/> | ||
444 | </node> | ||
445 | |||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.login1.Session.xml b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.login1.Session.xml new file mode 100644 index 00000000..7d6fc8ee --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.login1.Session.xml | |||
@@ -0,0 +1,146 @@ | |||
1 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
2 | "https://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
3 | <node> | ||
4 | <interface name="org.freedesktop.login1.Session"> | ||
5 | <property name="Id" type="s" access="read"> | ||
6 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
7 | </property> | ||
8 | <property name="User" type="o" access="read"> | ||
9 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
10 | </property> | ||
11 | <property name="Name" type="s" access="read"> | ||
12 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
13 | </property> | ||
14 | <property name="Timestamp" type="t" access="read"> | ||
15 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
16 | </property> | ||
17 | <property name="TimestampMonotonic" type="t" access="read"> | ||
18 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
19 | </property> | ||
20 | <property name="VTNr" type="u" access="read"> | ||
21 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
22 | </property> | ||
23 | <property name="Seat" type="o" access="read"> | ||
24 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
25 | </property> | ||
26 | <property name="TTY" type="s" access="read"> | ||
27 | </property> | ||
28 | <property name="Display" type="s" access="read"> | ||
29 | </property> | ||
30 | <property name="Remote" type="b" access="read"> | ||
31 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
32 | </property> | ||
33 | <property name="RemoteHost" type="s" access="read"> | ||
34 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
35 | </property> | ||
36 | <property name="RemoteUser" type="s" access="read"> | ||
37 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
38 | </property> | ||
39 | <property name="Service" type="s" access="read"> | ||
40 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
41 | </property> | ||
42 | <property name="Desktop" type="s" access="read"> | ||
43 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
44 | </property> | ||
45 | <property name="Scope" type="s" access="read"> | ||
46 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
47 | </property> | ||
48 | <property name="Leader" type="u" access="read"> | ||
49 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
50 | </property> | ||
51 | <property name="Audit" type="u" access="read"> | ||
52 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
53 | </property> | ||
54 | <property name="Type" type="s" access="read"> | ||
55 | </property> | ||
56 | <!-- <property name="Class" type="s" access="read"> --> | ||
57 | <!-- </property> --> | ||
58 | <property name="Active" type="b" access="read"> | ||
59 | </property> | ||
60 | <property name="State" type="s" access="read"> | ||
61 | </property> | ||
62 | <property name="IdleHint" type="b" access="read"> | ||
63 | </property> | ||
64 | <property name="IdleSinceHint" type="t" access="read"> | ||
65 | </property> | ||
66 | <property name="IdleSinceHintMonotonic" type="t" access="read"> | ||
67 | </property> | ||
68 | <property name="CanIdle" type="b" access="read"> | ||
69 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
70 | </property> | ||
71 | <property name="CanLock" type="b" access="read"> | ||
72 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
73 | </property> | ||
74 | <property name="LockedHint" type="b" access="read"> | ||
75 | </property> | ||
76 | <method name="Terminate"> | ||
77 | </method> | ||
78 | <method name="Activate"> | ||
79 | </method> | ||
80 | <!-- <method name="Lock"> --> | ||
81 | <!-- </method> --> | ||
82 | <!-- <method name="Unlock"> --> | ||
83 | <!-- </method> --> | ||
84 | <method name="SetIdleHint"> | ||
85 | <arg type="b" name="idle" direction="in"/> | ||
86 | </method> | ||
87 | <method name="SetLockedHint"> | ||
88 | <arg type="b" name="locked" direction="in"/> | ||
89 | </method> | ||
90 | <method name="Kill"> | ||
91 | <arg type="s" name="whom" direction="in"/> | ||
92 | <arg type="i" name="signal_number" direction="in"/> | ||
93 | </method> | ||
94 | <method name="TakeControl"> | ||
95 | <arg type="b" name="force" direction="in"/> | ||
96 | </method> | ||
97 | <method name="ReleaseControl"> | ||
98 | </method> | ||
99 | <method name="SetType"> | ||
100 | <arg type="s" name="type" direction="in"/> | ||
101 | </method> | ||
102 | <!-- <method name="SetClass"> --> | ||
103 | <!-- <arg type="s" name="class" direction="in"/> --> | ||
104 | <!-- </method> --> | ||
105 | <method name="SetDisplay"> | ||
106 | <arg type="s" name="display" direction="in"/> | ||
107 | </method> | ||
108 | <method name="SetTTY"> | ||
109 | <arg type="h" name="tty_fd" direction="in"/> | ||
110 | </method> | ||
111 | <method name="TakeDevice"> | ||
112 | <arg type="u" name="major" direction="in"/> | ||
113 | <arg type="u" name="minor" direction="in"/> | ||
114 | <arg type="h" name="fd" direction="out"/> | ||
115 | <arg type="b" name="inactive" direction="out"/> | ||
116 | </method> | ||
117 | <method name="ReleaseDevice"> | ||
118 | <arg type="u" name="major" direction="in"/> | ||
119 | <arg type="u" name="minor" direction="in"/> | ||
120 | </method> | ||
121 | <method name="PauseDeviceComplete"> | ||
122 | <arg type="u" name="major" direction="in"/> | ||
123 | <arg type="u" name="minor" direction="in"/> | ||
124 | </method> | ||
125 | <method name="SetBrightness"> | ||
126 | <arg type="s" name="subsystem" direction="in"/> | ||
127 | <arg type="s" name="name" direction="in"/> | ||
128 | <arg type="u" name="brightness" direction="in"/> | ||
129 | </method> | ||
130 | <signal name="PauseDevice"> | ||
131 | <arg type="u" name="major"/> | ||
132 | <arg type="u" name="minor"/> | ||
133 | <arg type="s" name="type"/> | ||
134 | </signal> | ||
135 | <signal name="ResumeDevice"> | ||
136 | <arg type="u" name="major"/> | ||
137 | <arg type="u" name="minor"/> | ||
138 | <arg type="h" name="fd"/> | ||
139 | </signal> | ||
140 | <signal name="Lock"> | ||
141 | </signal> | ||
142 | <signal name="Unlock"> | ||
143 | </signal> | ||
144 | </interface> | ||
145 | </node> | ||
146 | |||
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.systemd1.Manager.xml b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.systemd1.Manager.xml new file mode 100644 index 00000000..b4f84a13 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell-plugins/org.freedesktop.systemd1.Manager.xml | |||
@@ -0,0 +1,817 @@ | |||
1 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
2 | "https://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
3 | <node> | ||
4 | <interface name="org.freedesktop.systemd1.Manager"> | ||
5 | <property name="Version" type="s" access="read"> | ||
6 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
7 | </property> | ||
8 | <property name="Features" type="s" access="read"> | ||
9 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
10 | </property> | ||
11 | <property name="Virtualization" type="s" access="read"> | ||
12 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
13 | </property> | ||
14 | <property name="ConfidentialVirtualization" type="s" access="read"> | ||
15 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
16 | </property> | ||
17 | <property name="Architecture" type="s" access="read"> | ||
18 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
19 | </property> | ||
20 | <property name="Tainted" type="s" access="read"> | ||
21 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
22 | </property> | ||
23 | <property name="FirmwareTimestamp" type="t" access="read"> | ||
24 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
25 | </property> | ||
26 | <property name="FirmwareTimestampMonotonic" type="t" access="read"> | ||
27 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
28 | </property> | ||
29 | <property name="LoaderTimestamp" type="t" access="read"> | ||
30 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
31 | </property> | ||
32 | <property name="LoaderTimestampMonotonic" type="t" access="read"> | ||
33 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
34 | </property> | ||
35 | <property name="KernelTimestamp" type="t" access="read"> | ||
36 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
37 | </property> | ||
38 | <property name="KernelTimestampMonotonic" type="t" access="read"> | ||
39 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
40 | </property> | ||
41 | <property name="InitRDTimestamp" type="t" access="read"> | ||
42 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
43 | </property> | ||
44 | <property name="InitRDTimestampMonotonic" type="t" access="read"> | ||
45 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
46 | </property> | ||
47 | <property name="UserspaceTimestamp" type="t" access="read"> | ||
48 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
49 | </property> | ||
50 | <property name="UserspaceTimestampMonotonic" type="t" access="read"> | ||
51 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
52 | </property> | ||
53 | <property name="FinishTimestamp" type="t" access="read"> | ||
54 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
55 | </property> | ||
56 | <property name="FinishTimestampMonotonic" type="t" access="read"> | ||
57 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
58 | </property> | ||
59 | <property name="ShutdownStartTimestamp" type="t" access="read"> | ||
60 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
61 | </property> | ||
62 | <property name="ShutdownStartTimestampMonotonic" type="t" access="read"> | ||
63 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
64 | </property> | ||
65 | <property name="SecurityStartTimestamp" type="t" access="read"> | ||
66 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
67 | </property> | ||
68 | <property name="SecurityStartTimestampMonotonic" type="t" access="read"> | ||
69 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
70 | </property> | ||
71 | <property name="SecurityFinishTimestamp" type="t" access="read"> | ||
72 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
73 | </property> | ||
74 | <property name="SecurityFinishTimestampMonotonic" type="t" access="read"> | ||
75 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
76 | </property> | ||
77 | <property name="GeneratorsStartTimestamp" type="t" access="read"> | ||
78 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
79 | </property> | ||
80 | <property name="GeneratorsStartTimestampMonotonic" type="t" access="read"> | ||
81 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
82 | </property> | ||
83 | <property name="GeneratorsFinishTimestamp" type="t" access="read"> | ||
84 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
85 | </property> | ||
86 | <property name="GeneratorsFinishTimestampMonotonic" type="t" access="read"> | ||
87 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
88 | </property> | ||
89 | <property name="UnitsLoadStartTimestamp" type="t" access="read"> | ||
90 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
91 | </property> | ||
92 | <property name="UnitsLoadStartTimestampMonotonic" type="t" access="read"> | ||
93 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
94 | </property> | ||
95 | <property name="UnitsLoadFinishTimestamp" type="t" access="read"> | ||
96 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
97 | </property> | ||
98 | <property name="UnitsLoadFinishTimestampMonotonic" type="t" access="read"> | ||
99 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
100 | </property> | ||
101 | <property name="UnitsLoadTimestamp" type="t" access="read"> | ||
102 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
103 | </property> | ||
104 | <property name="UnitsLoadTimestampMonotonic" type="t" access="read"> | ||
105 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
106 | </property> | ||
107 | <property name="InitRDSecurityStartTimestamp" type="t" access="read"> | ||
108 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
109 | </property> | ||
110 | <property name="InitRDSecurityStartTimestampMonotonic" type="t" access="read"> | ||
111 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
112 | </property> | ||
113 | <property name="InitRDSecurityFinishTimestamp" type="t" access="read"> | ||
114 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
115 | </property> | ||
116 | <property name="InitRDSecurityFinishTimestampMonotonic" type="t" access="read"> | ||
117 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
118 | </property> | ||
119 | <property name="InitRDGeneratorsStartTimestamp" type="t" access="read"> | ||
120 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
121 | </property> | ||
122 | <property name="InitRDGeneratorsStartTimestampMonotonic" type="t" access="read"> | ||
123 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
124 | </property> | ||
125 | <property name="InitRDGeneratorsFinishTimestamp" type="t" access="read"> | ||
126 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
127 | </property> | ||
128 | <property name="InitRDGeneratorsFinishTimestampMonotonic" type="t" access="read"> | ||
129 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
130 | </property> | ||
131 | <property name="InitRDUnitsLoadStartTimestamp" type="t" access="read"> | ||
132 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
133 | </property> | ||
134 | <property name="InitRDUnitsLoadStartTimestampMonotonic" type="t" access="read"> | ||
135 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
136 | </property> | ||
137 | <property name="InitRDUnitsLoadFinishTimestamp" type="t" access="read"> | ||
138 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
139 | </property> | ||
140 | <property name="InitRDUnitsLoadFinishTimestampMonotonic" type="t" access="read"> | ||
141 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
142 | </property> | ||
143 | <property name="LogLevel" type="s" access="readwrite"> | ||
144 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
145 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
146 | </property> | ||
147 | <property name="LogTarget" type="s" access="readwrite"> | ||
148 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
149 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
150 | </property> | ||
151 | <property name="NNames" type="u" access="read"> | ||
152 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
153 | </property> | ||
154 | <property name="NFailedUnits" type="u" access="read"> | ||
155 | </property> | ||
156 | <property name="NJobs" type="u" access="read"> | ||
157 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
158 | </property> | ||
159 | <property name="NInstalledJobs" type="u" access="read"> | ||
160 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
161 | </property> | ||
162 | <property name="NFailedJobs" type="u" access="read"> | ||
163 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
164 | </property> | ||
165 | <property name="Progress" type="d" access="read"> | ||
166 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
167 | </property> | ||
168 | <property name="Environment" type="as" access="read"> | ||
169 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
170 | </property> | ||
171 | <property name="ConfirmSpawn" type="b" access="read"> | ||
172 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
173 | </property> | ||
174 | <property name="ShowStatus" type="b" access="read"> | ||
175 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
176 | </property> | ||
177 | <property name="UnitPath" type="as" access="read"> | ||
178 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
179 | </property> | ||
180 | <property name="DefaultStandardOutput" type="s" access="read"> | ||
181 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
182 | </property> | ||
183 | <property name="DefaultStandardError" type="s" access="read"> | ||
184 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
185 | </property> | ||
186 | <property name="WatchdogDevice" type="s" access="read"> | ||
187 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
188 | </property> | ||
189 | <property name="WatchdogLastPingTimestamp" type="t" access="read"> | ||
190 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
191 | </property> | ||
192 | <property name="WatchdogLastPingTimestampMonotonic" type="t" access="read"> | ||
193 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
194 | </property> | ||
195 | <property name="RuntimeWatchdogUSec" type="t" access="readwrite"> | ||
196 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
197 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
198 | </property> | ||
199 | <property name="RuntimeWatchdogPreUSec" type="t" access="readwrite"> | ||
200 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
201 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
202 | </property> | ||
203 | <property name="RuntimeWatchdogPreGovernor" type="s" access="readwrite"> | ||
204 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
205 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
206 | </property> | ||
207 | <property name="RebootWatchdogUSec" type="t" access="readwrite"> | ||
208 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
209 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
210 | </property> | ||
211 | <property name="KExecWatchdogUSec" type="t" access="readwrite"> | ||
212 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
213 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
214 | </property> | ||
215 | <property name="ServiceWatchdogs" type="b" access="readwrite"> | ||
216 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
217 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
218 | </property> | ||
219 | <property name="ControlGroup" type="s" access="read"> | ||
220 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
221 | </property> | ||
222 | <property name="SystemState" type="s" access="read"> | ||
223 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
224 | </property> | ||
225 | <property name="ExitCode" type="y" access="read"> | ||
226 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
227 | </property> | ||
228 | <property name="DefaultTimerAccuracyUSec" type="t" access="read"> | ||
229 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
230 | </property> | ||
231 | <property name="DefaultTimeoutStartUSec" type="t" access="read"> | ||
232 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
233 | </property> | ||
234 | <property name="DefaultTimeoutStopUSec" type="t" access="read"> | ||
235 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
236 | </property> | ||
237 | <property name="DefaultTimeoutAbortUSec" type="t" access="read"> | ||
238 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
239 | </property> | ||
240 | <property name="DefaultDeviceTimeoutUSec" type="t" access="read"> | ||
241 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
242 | </property> | ||
243 | <property name="DefaultRestartUSec" type="t" access="read"> | ||
244 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
245 | </property> | ||
246 | <property name="DefaultStartLimitIntervalUSec" type="t" access="read"> | ||
247 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
248 | </property> | ||
249 | <property name="DefaultStartLimitBurst" type="u" access="read"> | ||
250 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
251 | </property> | ||
252 | <property name="DefaultCPUAccounting" type="b" access="read"> | ||
253 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
254 | </property> | ||
255 | <property name="DefaultBlockIOAccounting" type="b" access="read"> | ||
256 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
257 | </property> | ||
258 | <property name="DefaultIOAccounting" type="b" access="read"> | ||
259 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
260 | </property> | ||
261 | <property name="DefaultIPAccounting" type="b" access="read"> | ||
262 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
263 | </property> | ||
264 | <property name="DefaultMemoryAccounting" type="b" access="read"> | ||
265 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
266 | </property> | ||
267 | <property name="DefaultTasksAccounting" type="b" access="read"> | ||
268 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
269 | </property> | ||
270 | <property name="DefaultLimitCPU" type="t" access="read"> | ||
271 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
272 | </property> | ||
273 | <property name="DefaultLimitCPUSoft" type="t" access="read"> | ||
274 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
275 | </property> | ||
276 | <property name="DefaultLimitFSIZE" type="t" access="read"> | ||
277 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
278 | </property> | ||
279 | <property name="DefaultLimitFSIZESoft" type="t" access="read"> | ||
280 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
281 | </property> | ||
282 | <property name="DefaultLimitDATA" type="t" access="read"> | ||
283 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
284 | </property> | ||
285 | <property name="DefaultLimitDATASoft" type="t" access="read"> | ||
286 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
287 | </property> | ||
288 | <property name="DefaultLimitSTACK" type="t" access="read"> | ||
289 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
290 | </property> | ||
291 | <property name="DefaultLimitSTACKSoft" type="t" access="read"> | ||
292 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
293 | </property> | ||
294 | <property name="DefaultLimitCORE" type="t" access="read"> | ||
295 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
296 | </property> | ||
297 | <property name="DefaultLimitCORESoft" type="t" access="read"> | ||
298 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
299 | </property> | ||
300 | <property name="DefaultLimitRSS" type="t" access="read"> | ||
301 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
302 | </property> | ||
303 | <property name="DefaultLimitRSSSoft" type="t" access="read"> | ||
304 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
305 | </property> | ||
306 | <property name="DefaultLimitNOFILE" type="t" access="read"> | ||
307 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
308 | </property> | ||
309 | <property name="DefaultLimitNOFILESoft" type="t" access="read"> | ||
310 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
311 | </property> | ||
312 | <property name="DefaultLimitAS" type="t" access="read"> | ||
313 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
314 | </property> | ||
315 | <property name="DefaultLimitASSoft" type="t" access="read"> | ||
316 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
317 | </property> | ||
318 | <property name="DefaultLimitNPROC" type="t" access="read"> | ||
319 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
320 | </property> | ||
321 | <property name="DefaultLimitNPROCSoft" type="t" access="read"> | ||
322 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
323 | </property> | ||
324 | <property name="DefaultLimitMEMLOCK" type="t" access="read"> | ||
325 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
326 | </property> | ||
327 | <property name="DefaultLimitMEMLOCKSoft" type="t" access="read"> | ||
328 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
329 | </property> | ||
330 | <property name="DefaultLimitLOCKS" type="t" access="read"> | ||
331 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
332 | </property> | ||
333 | <property name="DefaultLimitLOCKSSoft" type="t" access="read"> | ||
334 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
335 | </property> | ||
336 | <property name="DefaultLimitSIGPENDING" type="t" access="read"> | ||
337 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
338 | </property> | ||
339 | <property name="DefaultLimitSIGPENDINGSoft" type="t" access="read"> | ||
340 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
341 | </property> | ||
342 | <property name="DefaultLimitMSGQUEUE" type="t" access="read"> | ||
343 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
344 | </property> | ||
345 | <property name="DefaultLimitMSGQUEUESoft" type="t" access="read"> | ||
346 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
347 | </property> | ||
348 | <property name="DefaultLimitNICE" type="t" access="read"> | ||
349 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
350 | </property> | ||
351 | <property name="DefaultLimitNICESoft" type="t" access="read"> | ||
352 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
353 | </property> | ||
354 | <property name="DefaultLimitRTPRIO" type="t" access="read"> | ||
355 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
356 | </property> | ||
357 | <property name="DefaultLimitRTPRIOSoft" type="t" access="read"> | ||
358 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
359 | </property> | ||
360 | <property name="DefaultLimitRTTIME" type="t" access="read"> | ||
361 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
362 | </property> | ||
363 | <property name="DefaultLimitRTTIMESoft" type="t" access="read"> | ||
364 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
365 | </property> | ||
366 | <property name="DefaultTasksMax" type="t" access="read"> | ||
367 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
368 | </property> | ||
369 | <property name="DefaultMemoryPressureThresholdUSec" type="t" access="read"> | ||
370 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
371 | </property> | ||
372 | <property name="DefaultMemoryPressureWatch" type="s" access="read"> | ||
373 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> | ||
374 | </property> | ||
375 | <property name="TimerSlackNSec" type="t" access="read"> | ||
376 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
377 | </property> | ||
378 | <property name="DefaultOOMPolicy" type="s" access="read"> | ||
379 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
380 | </property> | ||
381 | <property name="DefaultOOMScoreAdjust" type="i" access="read"> | ||
382 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
383 | </property> | ||
384 | <property name="CtrlAltDelBurstAction" type="s" access="read"> | ||
385 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
386 | </property> | ||
387 | <property name="SoftRebootsCount" type="u" access="read"> | ||
388 | <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> | ||
389 | </property> | ||
390 | <method name="GetUnit"> | ||
391 | <arg type="s" name="name" direction="in"/> | ||
392 | <arg type="o" name="unit" direction="out"/> | ||
393 | </method> | ||
394 | <method name="GetUnitByPID"> | ||
395 | <arg type="u" name="pid" direction="in"/> | ||
396 | <arg type="o" name="unit" direction="out"/> | ||
397 | </method> | ||
398 | <method name="GetUnitByInvocationID"> | ||
399 | <arg type="ay" name="invocation_id" direction="in"/> | ||
400 | <arg type="o" name="unit" direction="out"/> | ||
401 | </method> | ||
402 | <method name="GetUnitByControlGroup"> | ||
403 | <arg type="s" name="cgroup" direction="in"/> | ||
404 | <arg type="o" name="unit" direction="out"/> | ||
405 | </method> | ||
406 | <method name="GetUnitByPIDFD"> | ||
407 | <arg type="h" name="pidfd" direction="in"/> | ||
408 | <arg type="o" name="unit" direction="out"/> | ||
409 | <arg type="s" name="unit_id" direction="out"/> | ||
410 | <arg type="ay" name="invocation_id" direction="out"/> | ||
411 | </method> | ||
412 | <method name="LoadUnit"> | ||
413 | <arg type="s" name="name" direction="in"/> | ||
414 | <arg type="o" name="unit" direction="out"/> | ||
415 | </method> | ||
416 | <method name="StartUnit"> | ||
417 | <arg type="s" name="name" direction="in"/> | ||
418 | <arg type="s" name="mode" direction="in"/> | ||
419 | <arg type="o" name="job" direction="out"/> | ||
420 | </method> | ||
421 | <method name="StartUnitWithFlags"> | ||
422 | <arg type="s" name="name" direction="in"/> | ||
423 | <arg type="s" name="mode" direction="in"/> | ||
424 | <arg type="t" name="flags" direction="in"/> | ||
425 | <arg type="o" name="job" direction="out"/> | ||
426 | </method> | ||
427 | <method name="StartUnitReplace"> | ||
428 | <arg type="s" name="old_unit" direction="in"/> | ||
429 | <arg type="s" name="new_unit" direction="in"/> | ||
430 | <arg type="s" name="mode" direction="in"/> | ||
431 | <arg type="o" name="job" direction="out"/> | ||
432 | </method> | ||
433 | <method name="StopUnit"> | ||
434 | <arg type="s" name="name" direction="in"/> | ||
435 | <arg type="s" name="mode" direction="in"/> | ||
436 | <arg type="o" name="job" direction="out"/> | ||
437 | </method> | ||
438 | <method name="ReloadUnit"> | ||
439 | <arg type="s" name="name" direction="in"/> | ||
440 | <arg type="s" name="mode" direction="in"/> | ||
441 | <arg type="o" name="job" direction="out"/> | ||
442 | </method> | ||
443 | <method name="RestartUnit"> | ||
444 | <arg type="s" name="name" direction="in"/> | ||
445 | <arg type="s" name="mode" direction="in"/> | ||
446 | <arg type="o" name="job" direction="out"/> | ||
447 | </method> | ||
448 | <method name="TryRestartUnit"> | ||
449 | <arg type="s" name="name" direction="in"/> | ||
450 | <arg type="s" name="mode" direction="in"/> | ||
451 | <arg type="o" name="job" direction="out"/> | ||
452 | </method> | ||
453 | <method name="ReloadOrRestartUnit"> | ||
454 | <arg type="s" name="name" direction="in"/> | ||
455 | <arg type="s" name="mode" direction="in"/> | ||
456 | <arg type="o" name="job" direction="out"/> | ||
457 | </method> | ||
458 | <method name="ReloadOrTryRestartUnit"> | ||
459 | <arg type="s" name="name" direction="in"/> | ||
460 | <arg type="s" name="mode" direction="in"/> | ||
461 | <arg type="o" name="job" direction="out"/> | ||
462 | </method> | ||
463 | <!-- <method name="EnqueueUnitJob"> --> | ||
464 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
465 | <!-- <arg type="s" name="job_type" direction="in"/> --> | ||
466 | <!-- <arg type="s" name="job_mode" direction="in"/> --> | ||
467 | <!-- <arg type="u" name="job_id" direction="out"/> --> | ||
468 | <!-- <arg type="o" name="job_path" direction="out"/> --> | ||
469 | <!-- <arg type="s" name="unit_id" direction="out"/> --> | ||
470 | <!-- <arg type="o" name="unit_path" direction="out"/> --> | ||
471 | <!-- <arg type="s" name="job_type" direction="out"/> --> | ||
472 | <!-- <arg type="a(uosos)" name="affected_jobs" direction="out"/> --> | ||
473 | <!-- </method> --> | ||
474 | <method name="KillUnit"> | ||
475 | <arg type="s" name="name" direction="in"/> | ||
476 | <arg type="s" name="whom" direction="in"/> | ||
477 | <arg type="i" name="signal" direction="in"/> | ||
478 | </method> | ||
479 | <method name="QueueSignalUnit"> | ||
480 | <arg type="s" name="name" direction="in"/> | ||
481 | <arg type="s" name="whom" direction="in"/> | ||
482 | <arg type="i" name="signal" direction="in"/> | ||
483 | <arg type="i" name="value" direction="in"/> | ||
484 | </method> | ||
485 | <method name="CleanUnit"> | ||
486 | <arg type="s" name="name" direction="in"/> | ||
487 | <arg type="as" name="mask" direction="in"/> | ||
488 | </method> | ||
489 | <method name="FreezeUnit"> | ||
490 | <arg type="s" name="name" direction="in"/> | ||
491 | </method> | ||
492 | <method name="ThawUnit"> | ||
493 | <arg type="s" name="name" direction="in"/> | ||
494 | </method> | ||
495 | <method name="ResetFailedUnit"> | ||
496 | <arg type="s" name="name" direction="in"/> | ||
497 | </method> | ||
498 | <!-- <method name="SetUnitProperties"> --> | ||
499 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
500 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
501 | <!-- <arg type="a(sv)" name="properties" direction="in"/> --> | ||
502 | <!-- </method> --> | ||
503 | <method name="BindMountUnit"> | ||
504 | <arg type="s" name="name" direction="in"/> | ||
505 | <arg type="s" name="source" direction="in"/> | ||
506 | <arg type="s" name="destination" direction="in"/> | ||
507 | <arg type="b" name="read_only" direction="in"/> | ||
508 | <arg type="b" name="mkdir" direction="in"/> | ||
509 | </method> | ||
510 | <!-- <method name="MountImageUnit"> --> | ||
511 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
512 | <!-- <arg type="s" name="source" direction="in"/> --> | ||
513 | <!-- <arg type="s" name="destination" direction="in"/> --> | ||
514 | <!-- <arg type="b" name="read_only" direction="in"/> --> | ||
515 | <!-- <arg type="b" name="mkdir" direction="in"/> --> | ||
516 | <!-- <arg type="a(ss)" name="options" direction="in"/> --> | ||
517 | <!-- </method> --> | ||
518 | <method name="RefUnit"> | ||
519 | <arg type="s" name="name" direction="in"/> | ||
520 | </method> | ||
521 | <method name="UnrefUnit"> | ||
522 | <arg type="s" name="name" direction="in"/> | ||
523 | </method> | ||
524 | <!-- <method name="StartTransientUnit"> --> | ||
525 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
526 | <!-- <arg type="s" name="mode" direction="in"/> --> | ||
527 | <!-- <arg type="a(sv)" name="properties" direction="in"/> --> | ||
528 | <!-- <arg type="a(sa(sv))" name="aux" direction="in"/> --> | ||
529 | <!-- <arg type="o" name="job" direction="out"/> --> | ||
530 | <!-- </method> --> | ||
531 | <!-- <method name="GetUnitProcesses"> --> | ||
532 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
533 | <!-- <arg type="a(sus)" name="processes" direction="out"/> --> | ||
534 | <!-- </method> --> | ||
535 | <!-- <method name="AttachProcessesToUnit"> --> | ||
536 | <!-- <arg type="s" name="unit_name" direction="in"/> --> | ||
537 | <!-- <arg type="s" name="subcgroup" direction="in"/> --> | ||
538 | <!-- <arg type="au" name="pids" direction="in"/> --> | ||
539 | <!-- </method> --> | ||
540 | <method name="AbandonScope"> | ||
541 | <arg type="s" name="name" direction="in"/> | ||
542 | </method> | ||
543 | <method name="GetJob"> | ||
544 | <arg type="u" name="id" direction="in"/> | ||
545 | <arg type="o" name="job" direction="out"/> | ||
546 | </method> | ||
547 | <!-- <method name="GetJobAfter"> --> | ||
548 | <!-- <arg type="u" name="id" direction="in"/> --> | ||
549 | <!-- <arg type="a(usssoo)" name="jobs" direction="out"/> --> | ||
550 | <!-- </method> --> | ||
551 | <!-- <method name="GetJobBefore"> --> | ||
552 | <!-- <arg type="u" name="id" direction="in"/> --> | ||
553 | <!-- <arg type="a(usssoo)" name="jobs" direction="out"/> --> | ||
554 | <!-- </method> --> | ||
555 | <method name="CancelJob"> | ||
556 | <arg type="u" name="id" direction="in"/> | ||
557 | </method> | ||
558 | <method name="ClearJobs"> | ||
559 | </method> | ||
560 | <method name="ResetFailed"> | ||
561 | </method> | ||
562 | <method name="SetShowStatus"> | ||
563 | <arg type="s" name="mode" direction="in"/> | ||
564 | </method> | ||
565 | <!-- <method name="ListUnits"> --> | ||
566 | <!-- <arg type="a(ssssssouso)" name="units" direction="out"/> --> | ||
567 | <!-- </method> --> | ||
568 | <!-- <method name="ListUnitsFiltered"> --> | ||
569 | <!-- <arg type="as" name="states" direction="in"/> --> | ||
570 | <!-- <arg type="a(ssssssouso)" name="units" direction="out"/> --> | ||
571 | <!-- </method> --> | ||
572 | <!-- <method name="ListUnitsByPatterns"> --> | ||
573 | <!-- <arg type="as" name="states" direction="in"/> --> | ||
574 | <!-- <arg type="as" name="patterns" direction="in"/> --> | ||
575 | <!-- <arg type="a(ssssssouso)" name="units" direction="out"/> --> | ||
576 | <!-- </method> --> | ||
577 | <!-- <method name="ListUnitsByNames"> --> | ||
578 | <!-- <arg type="as" name="names" direction="in"/> --> | ||
579 | <!-- <arg type="a(ssssssouso)" name="units" direction="out"/> --> | ||
580 | <!-- </method> --> | ||
581 | <!-- <method name="ListJobs"> --> | ||
582 | <!-- <arg type="a(usssoo)" name="jobs" direction="out"/> --> | ||
583 | <!-- </method> --> | ||
584 | <method name="Subscribe"> | ||
585 | </method> | ||
586 | <method name="Unsubscribe"> | ||
587 | </method> | ||
588 | <method name="Dump"> | ||
589 | <arg type="s" name="output" direction="out"/> | ||
590 | </method> | ||
591 | <method name="DumpUnitsMatchingPatterns"> | ||
592 | <arg type="as" name="patterns" direction="in"/> | ||
593 | <arg type="s" name="output" direction="out"/> | ||
594 | </method> | ||
595 | <method name="DumpByFileDescriptor"> | ||
596 | <arg type="h" name="fd" direction="out"/> | ||
597 | </method> | ||
598 | <method name="DumpUnitsMatchingPatternsByFileDescriptor"> | ||
599 | <arg type="as" name="patterns" direction="in"/> | ||
600 | <arg type="h" name="fd" direction="out"/> | ||
601 | </method> | ||
602 | <method name="Reload"> | ||
603 | </method> | ||
604 | <method name="Reexecute"> | ||
605 | <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/> | ||
606 | </method> | ||
607 | <method name="Exit"> | ||
608 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
609 | </method> | ||
610 | <method name="Reboot"> | ||
611 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
612 | </method> | ||
613 | <method name="SoftReboot"> | ||
614 | <arg type="s" name="new_root" direction="in"/> | ||
615 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
616 | </method> | ||
617 | <method name="PowerOff"> | ||
618 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
619 | </method> | ||
620 | <method name="Halt"> | ||
621 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
622 | </method> | ||
623 | <method name="KExec"> | ||
624 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
625 | </method> | ||
626 | <method name="SwitchRoot"> | ||
627 | <arg type="s" name="new_root" direction="in"/> | ||
628 | <arg type="s" name="init" direction="in"/> | ||
629 | <annotation name="org.freedesktop.systemd1.Privileged" value="true"/> | ||
630 | </method> | ||
631 | <method name="SetEnvironment"> | ||
632 | <arg type="as" name="assignments" direction="in"/> | ||
633 | </method> | ||
634 | <method name="UnsetEnvironment"> | ||
635 | <arg type="as" name="names" direction="in"/> | ||
636 | </method> | ||
637 | <method name="UnsetAndSetEnvironment"> | ||
638 | <arg type="as" name="names" direction="in"/> | ||
639 | <arg type="as" name="assignments" direction="in"/> | ||
640 | </method> | ||
641 | <method name="EnqueueMarkedJobs"> | ||
642 | <arg type="ao" name="jobs" direction="out"/> | ||
643 | </method> | ||
644 | <!-- <method name="ListUnitFiles"> --> | ||
645 | <!-- <arg type="a(ss)" name="unit_files" direction="out"/> --> | ||
646 | <!-- </method> --> | ||
647 | <!-- <method name="ListUnitFilesByPatterns"> --> | ||
648 | <!-- <arg type="as" name="states" direction="in"/> --> | ||
649 | <!-- <arg type="as" name="patterns" direction="in"/> --> | ||
650 | <!-- <arg type="a(ss)" name="unit_files" direction="out"/> --> | ||
651 | <!-- </method> --> | ||
652 | <method name="GetUnitFileState"> | ||
653 | <arg type="s" name="file" direction="in"/> | ||
654 | <arg type="s" name="state" direction="out"/> | ||
655 | </method> | ||
656 | <!-- <method name="EnableUnitFiles"> --> | ||
657 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
658 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
659 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
660 | <!-- <arg type="b" name="carries_install_info" direction="out"/> --> | ||
661 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
662 | <!-- </method> --> | ||
663 | <!-- <method name="DisableUnitFiles"> --> | ||
664 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
665 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
666 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
667 | <!-- </method> --> | ||
668 | <!-- <method name="EnableUnitFilesWithFlags"> --> | ||
669 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
670 | <!-- <arg type="t" name="flags" direction="in"/> --> | ||
671 | <!-- <arg type="b" name="carries_install_info" direction="out"/> --> | ||
672 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
673 | <!-- </method> --> | ||
674 | <!-- <method name="DisableUnitFilesWithFlags"> --> | ||
675 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
676 | <!-- <arg type="t" name="flags" direction="in"/> --> | ||
677 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
678 | <!-- </method> --> | ||
679 | <!-- <method name="DisableUnitFilesWithFlagsAndInstallInfo"> --> | ||
680 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
681 | <!-- <arg type="t" name="flags" direction="in"/> --> | ||
682 | <!-- <arg type="b" name="carries_install_info" direction="out"/> --> | ||
683 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
684 | <!-- </method> --> | ||
685 | <!-- <method name="ReenableUnitFiles"> --> | ||
686 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
687 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
688 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
689 | <!-- <arg type="b" name="carries_install_info" direction="out"/> --> | ||
690 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
691 | <!-- </method> --> | ||
692 | <!-- <method name="LinkUnitFiles"> --> | ||
693 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
694 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
695 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
696 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
697 | <!-- </method> --> | ||
698 | <!-- <method name="PresetUnitFiles"> --> | ||
699 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
700 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
701 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
702 | <!-- <arg type="b" name="carries_install_info" direction="out"/> --> | ||
703 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
704 | <!-- </method> --> | ||
705 | <!-- <method name="PresetUnitFilesWithMode"> --> | ||
706 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
707 | <!-- <arg type="s" name="mode" direction="in"/> --> | ||
708 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
709 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
710 | <!-- <arg type="b" name="carries_install_info" direction="out"/> --> | ||
711 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
712 | <!-- </method> --> | ||
713 | <!-- <method name="MaskUnitFiles"> --> | ||
714 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
715 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
716 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
717 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
718 | <!-- </method> --> | ||
719 | <!-- <method name="UnmaskUnitFiles"> --> | ||
720 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
721 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
722 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
723 | <!-- </method> --> | ||
724 | <!-- <method name="RevertUnitFiles"> --> | ||
725 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
726 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
727 | <!-- </method> --> | ||
728 | <!-- <method name="SetDefaultTarget"> --> | ||
729 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
730 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
731 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
732 | <!-- </method> --> | ||
733 | <method name="GetDefaultTarget"> | ||
734 | <arg type="s" name="name" direction="out"/> | ||
735 | </method> | ||
736 | <!-- <method name="PresetAllUnitFiles"> --> | ||
737 | <!-- <arg type="s" name="mode" direction="in"/> --> | ||
738 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
739 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
740 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
741 | <!-- </method> --> | ||
742 | <!-- <method name="AddDependencyUnitFiles"> --> | ||
743 | <!-- <arg type="as" name="files" direction="in"/> --> | ||
744 | <!-- <arg type="s" name="target" direction="in"/> --> | ||
745 | <!-- <arg type="s" name="type" direction="in"/> --> | ||
746 | <!-- <arg type="b" name="runtime" direction="in"/> --> | ||
747 | <!-- <arg type="b" name="force" direction="in"/> --> | ||
748 | <!-- <arg type="a(sss)" name="changes" direction="out"/> --> | ||
749 | <!-- </method> --> | ||
750 | <method name="GetUnitFileLinks"> | ||
751 | <arg type="s" name="name" direction="in"/> | ||
752 | <arg type="b" name="runtime" direction="in"/> | ||
753 | <arg type="as" name="links" direction="out"/> | ||
754 | </method> | ||
755 | <method name="SetExitCode"> | ||
756 | <arg type="y" name="number" direction="in"/> | ||
757 | </method> | ||
758 | <method name="LookupDynamicUserByName"> | ||
759 | <arg type="s" name="name" direction="in"/> | ||
760 | <arg type="u" name="uid" direction="out"/> | ||
761 | </method> | ||
762 | <method name="LookupDynamicUserByUID"> | ||
763 | <arg type="u" name="uid" direction="in"/> | ||
764 | <arg type="s" name="name" direction="out"/> | ||
765 | </method> | ||
766 | <!-- <method name="GetDynamicUsers"> --> | ||
767 | <!-- <arg type="a(us)" name="users" direction="out"/> --> | ||
768 | <!-- </method> --> | ||
769 | <!-- <method name="DumpUnitFileDescriptorStore"> --> | ||
770 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
771 | <!-- <arg type="a(suuutuusu)" name="entries" direction="out"/> --> | ||
772 | <!-- </method> --> | ||
773 | <!-- <method name="StartAuxiliaryScope"> --> | ||
774 | <!-- <arg type="s" name="name" direction="in"/> --> | ||
775 | <!-- <arg type="ah" name="pidfds" direction="in"/> --> | ||
776 | <!-- <arg type="t" name="flags" direction="in"/> --> | ||
777 | <!-- <arg type="a(sv)" name="properties" direction="in"/> --> | ||
778 | <!-- <arg type="o" name="job" direction="out"/> --> | ||
779 | <!-- <annotation name="org.freedesktop.DBus.Deprecated" value="true"/> --> | ||
780 | <!-- </method> --> | ||
781 | <signal name="UnitNew"> | ||
782 | <arg type="s" name="id"/> | ||
783 | <arg type="o" name="unit"/> | ||
784 | </signal> | ||
785 | <signal name="UnitRemoved"> | ||
786 | <arg type="s" name="id"/> | ||
787 | <arg type="o" name="unit"/> | ||
788 | </signal> | ||
789 | <signal name="JobNew"> | ||
790 | <arg type="u" name="id"/> | ||
791 | <arg type="o" name="job"/> | ||
792 | <arg type="s" name="unit"/> | ||
793 | </signal> | ||
794 | <signal name="JobRemoved"> | ||
795 | <arg type="u" name="id"/> | ||
796 | <arg type="o" name="job"/> | ||
797 | <arg type="s" name="unit"/> | ||
798 | <arg type="s" name="result"/> | ||
799 | </signal> | ||
800 | <signal name="StartupFinished"> | ||
801 | <arg type="t" name="firmware"/> | ||
802 | <arg type="t" name="loader"/> | ||
803 | <arg type="t" name="kernel"/> | ||
804 | <arg type="t" name="initrd"/> | ||
805 | <arg type="t" name="userspace"/> | ||
806 | <arg type="t" name="total"/> | ||
807 | </signal> | ||
808 | <signal name="UnitFilesChanged"> | ||
809 | </signal> | ||
810 | <signal name="Reloading"> | ||
811 | <arg type="b" name="active"/> | ||
812 | </signal> | ||
813 | </interface> | ||
814 | <node name="unit"/> | ||
815 | <node name="job"/> | ||
816 | </node> | ||
817 | |||
diff --git a/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml b/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml index 57ade488..883f9001 100644 --- a/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml +++ b/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml | |||
@@ -22,72 +22,144 @@ Item { | |||
22 | width: activeWindowDisplayContent.width | 22 | width: activeWindowDisplayContent.width |
23 | height: parent.height | 23 | height: parent.height |
24 | 24 | ||
25 | Row { | 25 | WrapperMouseArea { |
26 | id: activeWindowDisplayContent | 26 | id: widgetMouseArea |
27 | 27 | ||
28 | width: childrenRect.width | 28 | anchors.fill: parent |
29 | height: parent.height | ||
30 | anchors.verticalCenter: parent.verticalCenter | ||
31 | spacing: 8 | ||
32 | 29 | ||
33 | IconImage { | 30 | hoverEnabled: true |
34 | id: activeWindowIcon | ||
35 | 31 | ||
36 | height: 14 | 32 | Item { |
37 | width: 14 | 33 | anchors.fill: parent |
38 | 34 | ||
39 | anchors.verticalCenter: parent.verticalCenter | 35 | Row { |
36 | id: activeWindowDisplayContent | ||
40 | 37 | ||
41 | source: { | 38 | width: childrenRect.width |
42 | let icon = activeWindowDisplay.windowEntry?.icon | 39 | height: parent.height |
43 | if (typeof icon === 'string' || icon instanceof String) { | 40 | anchors.verticalCenter: parent.verticalCenter |
44 | if (icon.includes("?path=")) { | 41 | spacing: 8 |
45 | const split = icon.split("?path=") | 42 | |
46 | if (split.length !== 2) | 43 | IconImage { |
44 | id: activeWindowIcon | ||
45 | |||
46 | implicitSize: 14 | ||
47 | |||
48 | anchors.verticalCenter: parent.verticalCenter | ||
49 | |||
50 | source: { | ||
51 | let icon = activeWindowDisplay.windowEntry?.icon | ||
52 | if (typeof icon === 'string' || icon instanceof String) { | ||
53 | if (icon.includes("?path=")) { | ||
54 | const split = icon.split("?path=") | ||
55 | if (split.length !== 2) | ||
56 | return icon | ||
57 | const name = split[0] | ||
58 | const path = split[1] | ||
59 | const fileName = name.substring( | ||
60 | name.lastIndexOf("/") + 1) | ||
61 | return `file://${path}/${fileName}` | ||
62 | } else | ||
63 | icon = Quickshell.iconPath(icon); | ||
47 | return icon | 64 | return icon |
48 | const name = split[0] | 65 | } |
49 | const path = split[1] | 66 | return "" |
50 | const fileName = name.substring( | 67 | } |
51 | name.lastIndexOf("/") + 1) | 68 | asynchronous: true |
52 | return `file://${path}/${fileName}` | 69 | smooth: true |
53 | } else | 70 | mipmap: true |
54 | icon = Quickshell.iconPath(icon); | 71 | } |
55 | return icon | 72 | |
73 | Text { | ||
74 | id: windowTitle | ||
75 | |||
76 | width: Math.min(implicitWidth, activeWindowDisplay.maxWidth - activeWindowIcon.width - activeWindowDisplayContent.spacing) | ||
77 | |||
78 | property var appAliases: { "Firefox": "Mozilla Firefox", "mpv Media Player": "mpv", "Thunderbird": "Mozilla Thunderbird", "Thunderbird (LMU)": "Mozilla Thunderbird" } | ||
79 | |||
80 | elide: Text.ElideRight | ||
81 | maximumLineCount: 1 | ||
82 | color: "white" | ||
83 | anchors.verticalCenter: parent.verticalCenter | ||
84 | text: { | ||
85 | if (!activeWindowDisplay.activeWindow) | ||
86 | return ""; | ||
87 | |||
88 | var title = activeWindowDisplay.activeWindow.title; | ||
89 | var appName = activeWindowDisplay.windowEntry?.name; | ||
90 | if (appAliases[appName]) | ||
91 | appName = appAliases[appName]; | ||
92 | if (appName && title.endsWith(appName)) { | ||
93 | const oldTitle = title; | ||
94 | title = title.substring(0, title.length - appName.length); | ||
95 | title = title.replace(/\s*(—|-)\s*$/, ""); | ||
96 | if (!title) | ||
97 | title = oldTitle; | ||
98 | } | ||
99 | return title; | ||
100 | } | ||
56 | } | 101 | } |
57 | return "" | ||
58 | } | 102 | } |
59 | asynchronous: true | ||
60 | smooth: true | ||
61 | mipmap: true | ||
62 | } | 103 | } |
104 | } | ||
105 | |||
106 | Loader { | ||
107 | id: tooltipLoader | ||
108 | |||
109 | active: false | ||
110 | |||
111 | Connections { | ||
112 | target: widgetMouseArea | ||
113 | function onContainsMouseChanged() { | ||
114 | if (widgetMouseArea.containsMouse) | ||
115 | tooltipLoader.active = true; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | PopupWindow { | ||
120 | id: tooltip | ||
121 | |||
122 | property bool nextVisible: widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse | ||
123 | |||
124 | anchor { | ||
125 | item: widgetMouseArea | ||
126 | edges: Edges.Bottom | Edges.Left | ||
127 | } | ||
128 | visible: false | ||
129 | |||
130 | onNextVisibleChanged: hangTimer.restart() | ||
131 | |||
132 | Timer { | ||
133 | id: hangTimer | ||
134 | interval: tooltip.visible ? 100 : 500 | ||
135 | onTriggered: { | ||
136 | tooltip.visible = tooltip.nextVisible; | ||
137 | if (!tooltip.visible) | ||
138 | tooltipLoader.active = false; | ||
139 | } | ||
140 | } | ||
141 | |||
142 | implicitWidth: widgetTooltipText.contentWidth + 16 | ||
143 | implicitHeight: widgetTooltipText.contentHeight + 16 | ||
144 | color: "black" | ||
145 | |||
146 | WrapperMouseArea { | ||
147 | id: tooltipMouseArea | ||
148 | |||
149 | hoverEnabled: true | ||
150 | enabled: true | ||
151 | |||
152 | anchors.centerIn: parent | ||
153 | |||
154 | Text { | ||
155 | id: widgetTooltipText | ||
156 | |||
157 | font.pointSize: 10 | ||
158 | font.family: "Fira Mono" | ||
159 | color: "white" | ||
63 | 160 | ||
64 | Text { | 161 | text: JSON.stringify(Object.assign({}, activeWindowDisplay.activeWindow), null, 2) |
65 | id: windowTitle | ||
66 | |||
67 | width: Math.min(implicitWidth, activeWindowDisplay.maxWidth - activeWindowIcon.width - activeWindowDisplayContent.spacing) | ||
68 | |||
69 | property var appAliases: { "Firefox": "Mozilla Firefox", "mpv Media Player": "mpv", "Thunderbird": "Mozilla Thunderbird", "Thunderbird (LMU)": "Mozilla Thunderbird" } | ||
70 | |||
71 | elide: Text.ElideRight | ||
72 | maximumLineCount: 1 | ||
73 | color: "white" | ||
74 | anchors.verticalCenter: parent.verticalCenter | ||
75 | text: { | ||
76 | if (!activeWindowDisplay.activeWindow) | ||
77 | return ""; | ||
78 | |||
79 | var title = activeWindowDisplay.activeWindow.title; | ||
80 | var appName = activeWindowDisplay.windowEntry?.name; | ||
81 | if (appAliases[appName]) | ||
82 | appName = appAliases[appName]; | ||
83 | if (appName && title.endsWith(appName)) { | ||
84 | const oldTitle = title; | ||
85 | title = title.substring(0, title.length - appName.length); | ||
86 | title = title.replace(/\s*(—|-)\s*$/, ""); | ||
87 | if (!title) | ||
88 | title = oldTitle; | ||
89 | } | 162 | } |
90 | return title; | ||
91 | } | 163 | } |
92 | } | 164 | } |
93 | } | 165 | } |
diff --git a/accounts/gkleen@sif/shell/quickshell/Bar.qml b/accounts/gkleen@sif/shell/quickshell/Bar.qml index aab1607f..f8092604 100644 --- a/accounts/gkleen@sif/shell/quickshell/Bar.qml +++ b/accounts/gkleen@sif/shell/quickshell/Bar.qml | |||
@@ -1,14 +1,11 @@ | |||
1 | import Quickshell | 1 | import Quickshell |
2 | import QtQuick | 2 | import QtQuick |
3 | 3 | ||
4 | |||
5 | PanelWindow { | 4 | PanelWindow { |
6 | id: bar | 5 | id: bar |
7 | 6 | ||
8 | required property var screen | 7 | required property var screen |
9 | 8 | ||
10 | property var calendarMouseArea: clock.calendarMouseArea | ||
11 | |||
12 | anchors { | 9 | anchors { |
13 | top: true | 10 | top: true |
14 | left: true | 11 | left: true |
@@ -66,22 +63,43 @@ PanelWindow { | |||
66 | anchors.verticalCenter: parent.verticalCenter | 63 | anchors.verticalCenter: parent.verticalCenter |
67 | spacing: 0 | 64 | spacing: 0 |
68 | 65 | ||
69 | SystemTray {} | 66 | KeyboardLayout {} |
70 | 67 | ||
71 | Item { | 68 | Item { |
69 | visible: privacy.visible | ||
72 | height: parent.height | 70 | height: parent.height |
73 | width: 4 | 71 | width: 8 - 4 |
74 | } | 72 | } |
75 | 73 | ||
76 | KeyboardLayout {} | 74 | PrivacyWidget { |
75 | id: privacy | ||
76 | } | ||
77 | 77 | ||
78 | Item { | 78 | Item { |
79 | visible: privacy.visible | ||
79 | height: parent.height | 80 | height: parent.height |
80 | width: 4 | 81 | width: 8 - 4 |
81 | } | 82 | } |
82 | 83 | ||
83 | Clock { | 84 | SystemTray {} |
84 | id: clock | 85 | |
86 | PipewireWidget {} | ||
87 | |||
88 | BrightnessWidget {} | ||
89 | |||
90 | BatteryWidget {} | ||
91 | |||
92 | WaylandInhibitorWidget { | ||
93 | window: bar | ||
94 | } | ||
95 | |||
96 | LidSwitchInhibitorWidget {} | ||
97 | |||
98 | Item { | ||
99 | height: parent.height | ||
100 | width: 8 - 4 | ||
85 | } | 101 | } |
102 | |||
103 | Clock {} | ||
86 | } | 104 | } |
87 | } \ No newline at end of file | 105 | } \ No newline at end of file |
diff --git a/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml b/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml new file mode 100644 index 00000000..fd031627 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/BatteryWidget.qml | |||
@@ -0,0 +1,130 @@ | |||
1 | import QtQuick | ||
2 | import Quickshell | ||
3 | import Quickshell.Widgets | ||
4 | import Quickshell.Services.UPower | ||
5 | |||
6 | Item { | ||
7 | id: root | ||
8 | |||
9 | height: parent.height | ||
10 | width: batteryIcon.width + 8 | ||
11 | anchors.verticalCenter: parent.verticalCenter | ||
12 | |||
13 | property var batteryDevice: Array.from(UPower.devices.values).find(dev => dev.isLaptopBattery) | ||
14 | |||
15 | WrapperMouseArea { | ||
16 | id: widgetMouseArea | ||
17 | |||
18 | anchors.fill: parent | ||
19 | |||
20 | hoverEnabled: true | ||
21 | |||
22 | Item { | ||
23 | anchors.fill: parent | ||
24 | |||
25 | MaterialDesignIcon { | ||
26 | id: batteryIcon | ||
27 | |||
28 | implicitSize: 14 | ||
29 | anchors.centerIn: parent | ||
30 | |||
31 | icon: { | ||
32 | if (!root.batteryDevice?.ready) | ||
33 | return "battery-unknown"; | ||
34 | |||
35 | if (root.batteryDevice.state == UPowerDeviceState.FullyCharged) | ||
36 | return "power-plug-battery"; | ||
37 | |||
38 | const perdec = 10 * Math.max(1, Math.ceil(root.batteryDevice.percentage * 10)); | ||
39 | if (root.batteryDevice.state == UPowerDeviceState.Charging) | ||
40 | return `battery-charging-${perdec}`; | ||
41 | if (perdec == 100) | ||
42 | return "battery"; | ||
43 | return `battery-${perdec}`; | ||
44 | } | ||
45 | color: { | ||
46 | if (!root.batteryDevice?.ready) | ||
47 | return "#555"; | ||
48 | |||
49 | if (root.batteryDevice.state != UPowerDeviceState.FullyCharged && root.batteryDevice.state != UPowerDeviceState.Charging && root.batteryDevice.timeToEmpty < 20 * 60) | ||
50 | return "#f2201f"; | ||
51 | if (root.batteryDevice.state != UPowerDeviceState.FullyCharged && root.batteryDevice.state != UPowerDeviceState.Charging && root.batteryDevice.timeToEmpty < 40 * 60) | ||
52 | return "#f28a21"; | ||
53 | if (root.batteryDevice.state != UPowerDeviceState.FullyCharged) | ||
54 | return "#fff"; | ||
55 | return "#555"; | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | |||
61 | PopupWindow { | ||
62 | id: tooltip | ||
63 | |||
64 | property bool nextVisible: widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse | ||
65 | |||
66 | anchor { | ||
67 | item: widgetMouseArea | ||
68 | edges: Edges.Bottom | Edges.Left | ||
69 | } | ||
70 | visible: false | ||
71 | |||
72 | onNextVisibleChanged: hangTimer.restart() | ||
73 | |||
74 | Timer { | ||
75 | id: hangTimer | ||
76 | interval: 100 | ||
77 | onTriggered: tooltip.visible = tooltip.nextVisible | ||
78 | } | ||
79 | |||
80 | implicitWidth: widgetTooltipText.contentWidth + 16 | ||
81 | implicitHeight: widgetTooltipText.contentHeight + 16 | ||
82 | color: "black" | ||
83 | |||
84 | WrapperMouseArea { | ||
85 | id: tooltipMouseArea | ||
86 | |||
87 | hoverEnabled: true | ||
88 | enabled: true | ||
89 | |||
90 | anchors.centerIn: parent | ||
91 | |||
92 | Text { | ||
93 | id: widgetTooltipText | ||
94 | |||
95 | font.pointSize: 10 | ||
96 | font.family: "Fira Sans" | ||
97 | color: "white" | ||
98 | |||
99 | text: { | ||
100 | const stateStr = UPowerDeviceState.toString(root.batteryDevice.state); | ||
101 | var outStr = stateStr; | ||
102 | if (root.batteryDevice.state != UPowerDeviceState.FullyCharged) | ||
103 | outStr += ` ${Math.round(root.batteryDevice.percentage * 100)}%`; | ||
104 | |||
105 | function formatTime(t) { | ||
106 | var res = ""; | ||
107 | for (const unit of [{ "s": "h", "v": 3600 }, { "s": "m", "v": 60 }, { "s": "s", "v": 1 }]) { | ||
108 | if (t < unit.v) | ||
109 | continue; | ||
110 | res += Math.floor(t / unit.v) + unit.s; | ||
111 | t %= unit.v; | ||
112 | } | ||
113 | return res; | ||
114 | } | ||
115 | if (root.batteryDevice.timeToEmpty != 0) { | ||
116 | const tStr = formatTime(Math.floor(root.batteryDevice.timeToEmpty / 60) * 60); | ||
117 | if (tStr) | ||
118 | outStr += " " + tStr; | ||
119 | } else if (root.batteryDevice.timeToFull != 0) { | ||
120 | const tStr = formatTime(Math.ceil(root.batteryDevice.timeToFull / 60) * 60); | ||
121 | if (tStr) | ||
122 | outStr += " " + tStr; | ||
123 | } | ||
124 | |||
125 | return outStr; | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/BrightnessOSD.qml b/accounts/gkleen@sif/shell/quickshell/BrightnessOSD.qml new file mode 100644 index 00000000..a432179e --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/BrightnessOSD.qml | |||
@@ -0,0 +1,117 @@ | |||
1 | import QtQuick | ||
2 | import QtQuick.Layouts | ||
3 | import Quickshell | ||
4 | import Quickshell.Widgets | ||
5 | import qs.Services | ||
6 | |||
7 | Scope { | ||
8 | id: root | ||
9 | |||
10 | property bool show: false | ||
11 | property bool inhibited: true | ||
12 | |||
13 | Connections { | ||
14 | target: Brightness | ||
15 | |||
16 | function onCurrBrightnessChanged() { | ||
17 | root.show = true; | ||
18 | hideTimer.restart(); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | onShowChanged: { | ||
23 | if (show) | ||
24 | hideTimer.restart(); | ||
25 | } | ||
26 | |||
27 | Timer { | ||
28 | id: hideTimer | ||
29 | interval: 1000 | ||
30 | onTriggered: root.show = false | ||
31 | } | ||
32 | |||
33 | Timer { | ||
34 | id: startInhibit | ||
35 | interval: 100 | ||
36 | running: true | ||
37 | onTriggered: { | ||
38 | root.show = false; | ||
39 | root.inhibited = false; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | LazyLoader { | ||
44 | active: root.show && !root.inhibited | ||
45 | |||
46 | Variants { | ||
47 | model: Quickshell.screens | ||
48 | |||
49 | delegate: Scope { | ||
50 | id: screenScope | ||
51 | |||
52 | required property var modelData | ||
53 | |||
54 | PanelWindow { | ||
55 | id: window | ||
56 | |||
57 | screen: screenScope.modelData | ||
58 | |||
59 | anchors.top: true | ||
60 | margins.top: screen.height / 2 - 50 + 3.5 | ||
61 | exclusiveZone: 0 | ||
62 | exclusionMode: ExclusionMode.Ignore | ||
63 | |||
64 | implicitWidth: 400 | ||
65 | implicitHeight: 50 | ||
66 | |||
67 | mask: Region {} | ||
68 | |||
69 | color: "transparent" | ||
70 | |||
71 | Rectangle { | ||
72 | anchors.fill: parent | ||
73 | color: Qt.rgba(0, 0, 0, 0.75) | ||
74 | } | ||
75 | |||
76 | RowLayout { | ||
77 | id: layout | ||
78 | |||
79 | anchors.centerIn: parent | ||
80 | |||
81 | height: 50 - 8*2 | ||
82 | width: 400 - 8*2 | ||
83 | |||
84 | MaterialDesignIcon { | ||
85 | id: volumeIcon | ||
86 | |||
87 | implicitWidth: parent.height | ||
88 | implicitHeight: parent.height | ||
89 | |||
90 | icon: `brightness-${Math.min(7, Math.floor(Brightness.currBrightness * 7) + 1)}` | ||
91 | } | ||
92 | |||
93 | Rectangle { | ||
94 | Layout.fillWidth: true | ||
95 | |||
96 | implicitHeight: 10 | ||
97 | |||
98 | color: "#50ffffff" | ||
99 | |||
100 | Rectangle { | ||
101 | anchors { | ||
102 | left: parent.left | ||
103 | top: parent.top | ||
104 | bottom: parent.bottom | ||
105 | } | ||
106 | |||
107 | color: "white" | ||
108 | |||
109 | implicitWidth: parent.width * Brightness.currBrightness | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | } | ||
116 | } | ||
117 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml b/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml new file mode 100644 index 00000000..7f9c1ad0 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/BrightnessWidget.qml | |||
@@ -0,0 +1,78 @@ | |||
1 | import QtQuick | ||
2 | import Quickshell | ||
3 | import Quickshell.Widgets | ||
4 | import qs.Services | ||
5 | |||
6 | Item { | ||
7 | height: parent.height | ||
8 | width: brightnessIcon.width + 8 | ||
9 | anchors.verticalCenter: parent.verticalCenter | ||
10 | |||
11 | WrapperMouseArea { | ||
12 | id: widgetMouseArea | ||
13 | |||
14 | anchors.fill: parent | ||
15 | |||
16 | hoverEnabled: true | ||
17 | |||
18 | property real sensitivity: (1 / 50) / 120 | ||
19 | onWheel: event => Brightness.currBrightness += event.angleDelta.y * sensitivity | ||
20 | |||
21 | Item { | ||
22 | anchors.fill: parent | ||
23 | |||
24 | MaterialDesignIcon { | ||
25 | id: brightnessIcon | ||
26 | |||
27 | implicitSize: 14 | ||
28 | anchors.centerIn: parent | ||
29 | |||
30 | icon: `brightness-${Math.min(7, Math.floor(Brightness.currBrightness * 7) + 1)}` | ||
31 | color: "#555" | ||
32 | } | ||
33 | } | ||
34 | } | ||
35 | |||
36 | PopupWindow { | ||
37 | id: tooltip | ||
38 | |||
39 | property bool nextVisible: widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse | ||
40 | |||
41 | anchor { | ||
42 | item: widgetMouseArea | ||
43 | edges: Edges.Bottom | Edges.Left | ||
44 | } | ||
45 | visible: false | ||
46 | |||
47 | onNextVisibleChanged: hangTimer.restart() | ||
48 | |||
49 | Timer { | ||
50 | id: hangTimer | ||
51 | interval: 100 | ||
52 | onTriggered: tooltip.visible = tooltip.nextVisible | ||
53 | } | ||
54 | |||
55 | implicitWidth: widgetTooltipText.contentWidth + 16 | ||
56 | implicitHeight: widgetTooltipText.contentHeight + 16 | ||
57 | color: "black" | ||
58 | |||
59 | WrapperMouseArea { | ||
60 | id: tooltipMouseArea | ||
61 | |||
62 | hoverEnabled: true | ||
63 | enabled: true | ||
64 | |||
65 | anchors.centerIn: parent | ||
66 | |||
67 | Text { | ||
68 | id: widgetTooltipText | ||
69 | |||
70 | font.pointSize: 10 | ||
71 | font.family: "Fira Sans" | ||
72 | color: "white" | ||
73 | |||
74 | text: `${Math.round(Brightness.currBrightness * 100)}%` | ||
75 | } | ||
76 | } | ||
77 | } | ||
78 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Clock.qml b/accounts/gkleen@sif/shell/quickshell/Clock.qml index d0c9178b..bb618f6a 100644 --- a/accounts/gkleen@sif/shell/quickshell/Clock.qml +++ b/accounts/gkleen@sif/shell/quickshell/Clock.qml | |||
@@ -22,18 +22,6 @@ Item { | |||
22 | hoverEnabled: true | 22 | hoverEnabled: true |
23 | enabled: clockItem.calendarPopup | 23 | enabled: clockItem.calendarPopup |
24 | 24 | ||
25 | property real angleRem: 0 | ||
26 | property real sensitivity: 1 / 120 | ||
27 | |||
28 | function scrollYear(event) { | ||
29 | angleRem += event.angleDelta.y; | ||
30 | const d = Math.round(angleRem * sensitivity); | ||
31 | yearCalendar.year += d; | ||
32 | angleRem -= d / sensitivity; | ||
33 | } | ||
34 | |||
35 | onWheel: event => scrollYear(event) | ||
36 | |||
37 | Item { | 25 | Item { |
38 | anchors.fill: parent | 26 | anchors.fill: parent |
39 | 27 | ||
@@ -56,204 +44,238 @@ Item { | |||
56 | } | 44 | } |
57 | } | 45 | } |
58 | 46 | ||
59 | PopupWindow { | 47 | Loader { |
60 | id: tooltip | 48 | id: tooltipLoader |
61 | 49 | ||
62 | property bool nextVisible: clockMouseArea.containsMouse || tooltipMouseArea.containsMouse | 50 | active: false |
63 | 51 | ||
64 | anchor { | 52 | Connections { |
65 | item: clockMouseArea | 53 | target: clockMouseArea |
66 | edges: Edges.Bottom | Edges.Left | 54 | function onContainsMouseChanged() { |
55 | if (clockMouseArea.containsMouse) | ||
56 | tooltipLoader.active = true; | ||
57 | } | ||
67 | } | 58 | } |
68 | visible: false | ||
69 | 59 | ||
70 | onNextVisibleChanged: hangTimer.restart() | 60 | sourceComponent: PopupWindow { |
61 | id: tooltip | ||
71 | 62 | ||
72 | Timer { | 63 | property bool nextVisible: clockMouseArea.containsMouse || tooltipMouseArea.containsMouse |
73 | id: hangTimer | ||
74 | interval: 100 | ||
75 | onTriggered: tooltip.visible = tooltip.nextVisible | ||
76 | } | ||
77 | 64 | ||
78 | implicitWidth: clockTooltipContent.width | 65 | anchor { |
79 | implicitHeight: clockTooltipContent.height | 66 | item: clockMouseArea |
80 | color: "black" | 67 | edges: Edges.Bottom | Edges.Left |
68 | } | ||
69 | visible: false | ||
81 | 70 | ||
82 | onVisibleChanged: { | 71 | onNextVisibleChanged: hangTimer.restart() |
83 | yearCalendar.year = chrono.date.getFullYear(); | ||
84 | clockMouseArea.angleRem = 0; | ||
85 | } | ||
86 | 72 | ||
87 | WrapperMouseArea { | 73 | Timer { |
88 | id: tooltipMouseArea | 74 | id: hangTimer |
75 | interval: 100 | ||
76 | onTriggered: { | ||
77 | tooltip.visible = tooltip.nextVisible; | ||
78 | if (!tooltip.visible) | ||
79 | tooltipLoader.active = false; | ||
80 | } | ||
81 | } | ||
89 | 82 | ||
90 | hoverEnabled: true | 83 | implicitWidth: clockTooltipContent.width |
91 | enabled: true | 84 | implicitHeight: clockTooltipContent.height |
85 | color: "black" | ||
92 | 86 | ||
93 | onWheel: event => clockMouseArea.scrollYear(event) | 87 | onVisibleChanged: { |
88 | yearCalendar.year = chrono.date.getFullYear(); | ||
89 | yearCalendar.angleRem = 0; | ||
90 | } | ||
94 | 91 | ||
95 | anchors.fill: parent | 92 | WrapperMouseArea { |
93 | id: tooltipMouseArea | ||
96 | 94 | ||
97 | WrapperItem { | 95 | hoverEnabled: true |
98 | id: clockTooltipContent | 96 | enabled: true |
99 | 97 | ||
100 | margin: 8 | 98 | onWheel: event => yearCalendar.scrollYear(event) |
101 | leftMargin: 0 | ||
102 | 99 | ||
103 | ColumnLayout { | 100 | anchors.fill: parent |
104 | Text { | ||
105 | id: yearLabel | ||
106 | 101 | ||
107 | horizontalAlignment: Text.AlignHCenter | 102 | WrapperItem { |
103 | id: clockTooltipContent | ||
108 | 104 | ||
109 | font.pointSize: 14 | 105 | margin: 8 |
110 | font.family: "Fira Sans" | ||
111 | font.features: { "tnum": 1 } | ||
112 | color: "white" | ||
113 | 106 | ||
114 | text: yearCalendar.year | 107 | ColumnLayout { |
108 | anchors.centerIn: parent | ||
115 | 109 | ||
116 | Layout.fillWidth: true | 110 | Text { |
117 | Layout.bottomMargin: 8 | 111 | id: yearLabel |
118 | } | ||
119 | 112 | ||
120 | GridLayout { | 113 | horizontalAlignment: Text.AlignHCenter |
121 | property int year: chrono.date.getFullYear() | ||
122 | 114 | ||
123 | id: yearCalendar | 115 | font.pointSize: 14 |
116 | font.family: "Fira Sans" | ||
117 | font.features: { "tnum": 1 } | ||
118 | color: "white" | ||
124 | 119 | ||
125 | columns: 3 | 120 | text: yearCalendar.year |
126 | columnSpacing: 16 | ||
127 | rowSpacing: 16 | ||
128 | 121 | ||
129 | Layout.alignment: Qt.AlignHCenter | 122 | Layout.fillWidth: true |
130 | Layout.fillWidth: false | 123 | Layout.bottomMargin: 8 |
124 | } | ||
131 | 125 | ||
132 | Repeater { | 126 | GridLayout { |
133 | model: 12 | 127 | property int year: chrono.date.getFullYear() |
134 | 128 | ||
135 | GridLayout { | 129 | id: yearCalendar |
136 | columns: 2 | ||
137 | 130 | ||
138 | required property int index | 131 | columns: 3 |
139 | property int month: index | 132 | columnSpacing: 16 |
133 | rowSpacing: 16 | ||
140 | 134 | ||
141 | id: monthCalendar | 135 | Layout.alignment: Qt.AlignHCenter |
136 | Layout.fillWidth: false | ||
142 | 137 | ||
143 | Layout.alignment: Qt.AlignTop | Qt.AlignRight | 138 | property real angleRem: 0 |
144 | Layout.fillWidth: false | 139 | property real sensitivity: 1 / 120 |
145 | 140 | ||
146 | Text { | 141 | function scrollYear(event) { |
147 | Layout.column: 1 | 142 | angleRem += event.angleDelta.y; |
148 | Layout.fillWidth: true | 143 | const d = Math.round(angleRem * sensitivity); |
144 | yearCalendar.year += d; | ||
145 | angleRem -= d / sensitivity; | ||
146 | } | ||
149 | 147 | ||
150 | horizontalAlignment: Text.AlignHCenter | 148 | Connections { |
149 | target: clockMouseArea | ||
150 | function onWheel(event) { yearCalendar.scrollYear(event); } | ||
151 | } | ||
151 | 152 | ||
152 | font.pointSize: 10 | 153 | Repeater { |
153 | font.family: "Fira Sans" | 154 | model: 12 |
154 | 155 | ||
155 | text: new Date(yearCalendar.year, monthCalendar.month, 1).toLocaleString(Qt.locale("en_DK"), "MMMM") | 156 | GridLayout { |
157 | columns: 2 | ||
156 | 158 | ||
157 | color: "#ffead3" | 159 | required property int index |
158 | } | 160 | property int month: index |
159 | 161 | ||
160 | DayOfWeekRow { | 162 | id: monthCalendar |
161 | locale: grid.locale | ||
162 | 163 | ||
163 | Layout.row: 1 | 164 | Layout.alignment: Qt.AlignTop | Qt.AlignRight |
164 | Layout.column: 1 | 165 | Layout.fillWidth: false |
165 | Layout.fillWidth: true | ||
166 | 166 | ||
167 | delegate: WrapperItem { | 167 | Text { |
168 | required property string shortName | 168 | Layout.column: 1 |
169 | Layout.fillWidth: true | ||
169 | 170 | ||
170 | width: dowLabel.contentWidth + 6 | 171 | horizontalAlignment: Text.AlignHCenter |
171 | 172 | ||
172 | Text { | 173 | font.pointSize: 10 |
173 | id: dowLabel | 174 | font.family: "Fira Sans" |
174 | 175 | ||
175 | anchors.fill: parent | 176 | text: new Date(yearCalendar.year, monthCalendar.month, 1).toLocaleString(Qt.locale("en_DK"), "MMMM") |
176 | 177 | ||
177 | font.pointSize: 10 | 178 | color: "#ffead3" |
178 | font.family: "Fira Sans" | 179 | } |
179 | 180 | ||
180 | text: parent.shortName | 181 | DayOfWeekRow { |
181 | color: "#ffcc66" | 182 | locale: grid.locale |
182 | 183 | ||
183 | horizontalAlignment: Text.AlignHCenter | 184 | Layout.row: 1 |
184 | verticalAlignment: Text.AlignVCenter | 185 | Layout.column: 1 |
185 | } | 186 | Layout.fillWidth: true |
186 | } | ||
187 | } | ||
188 | 187 | ||
189 | WeekNumberColumn { | 188 | delegate: WrapperItem { |
190 | month: grid.month | 189 | required property string shortName |
191 | year: grid.year | ||
192 | locale: grid.locale | ||
193 | 190 | ||
194 | Layout.fillHeight: true | 191 | width: dowLabel.contentWidth + 6 |
195 | 192 | ||
196 | delegate: Text { | 193 | Text { |
197 | required property int weekNumber | 194 | id: dowLabel |
198 | 195 | ||
199 | opacity: { | 196 | anchors.fill: parent |
200 | const simple = new Date(weekNumber == 1 && monthCalendar.month == 12 ? yearCalendar.year + 1 : yearCalendar.year, 0, 1 + (weekNumber - 1) * 7); | ||
201 | const dayOfWeek = simple.getDay(); | ||
202 | const isoWeekStart = simple; | ||
203 | 197 | ||
204 | isoWeekStart.setDate(simple.getDate() - dayOfWeek + 1); | 198 | font.pointSize: 10 |
205 | if (dayOfWeek > 4) { | 199 | font.family: "Fira Sans" |
206 | isoWeekStart.setDate(isoWeekStart.getDate() + 7); | ||
207 | } | ||
208 | 200 | ||
209 | for (let i = 0; i < 7; i++) { | 201 | text: parent.shortName |
210 | const dayInWeek = new Date(isoWeekStart); | 202 | color: "#ffcc66" |
211 | dayInWeek.setDate(dayInWeek.getDate() + i); | ||
212 | if (dayInWeek.getMonth() == monthCalendar.month) | ||
213 | return 1; | ||
214 | } | ||
215 | 203 | ||
216 | return 0; | 204 | horizontalAlignment: Text.AlignHCenter |
205 | verticalAlignment: Text.AlignVCenter | ||
206 | } | ||
217 | } | 207 | } |
208 | } | ||
218 | 209 | ||
219 | font.pointSize: 10 | 210 | WeekNumberColumn { |
220 | font.family: "Fira Sans" | 211 | month: grid.month |
221 | font.features: { "tnum": 1 } | 212 | year: grid.year |
222 | 213 | locale: grid.locale | |
223 | text: weekNumber | ||
224 | color: "#99ffdd" | ||
225 | 214 | ||
226 | horizontalAlignment: Text.AlignRight | 215 | Layout.fillHeight: true |
227 | verticalAlignment: Text.AlignVCenter | ||
228 | } | ||
229 | } | ||
230 | 216 | ||
231 | MonthGrid { | 217 | delegate: Text { |
232 | id: grid | 218 | required property int weekNumber |
233 | 219 | ||
234 | year: yearCalendar.year | 220 | opacity: { |
235 | month: monthCalendar.month | 221 | const simple = new Date(weekNumber == 1 && monthCalendar.month == 12 ? yearCalendar.year + 1 : yearCalendar.year, 0, 1 + (weekNumber - 1) * 7); |
236 | locale: Qt.locale("en_DK") | 222 | const dayOfWeek = simple.getDay(); |
223 | const isoWeekStart = simple; | ||
237 | 224 | ||
238 | Layout.fillWidth: true | 225 | isoWeekStart.setDate(simple.getDate() - dayOfWeek + 1); |
239 | Layout.fillHeight: true | 226 | if (dayOfWeek > 4) { |
227 | isoWeekStart.setDate(isoWeekStart.getDate() + 7); | ||
228 | } | ||
240 | 229 | ||
241 | delegate: Text { | 230 | for (let i = 0; i < 7; i++) { |
242 | required property var model | 231 | const dayInWeek = new Date(isoWeekStart); |
232 | dayInWeek.setDate(dayInWeek.getDate() + i); | ||
233 | if (dayInWeek.getMonth() == monthCalendar.month) | ||
234 | return 1; | ||
235 | } | ||
243 | 236 | ||
244 | opacity: model.month === monthCalendar.month ? 1 : 0 | 237 | return 0; |
238 | } | ||
245 | 239 | ||
246 | font.pointSize: 10 | 240 | font.pointSize: 10 |
247 | font.family: "Fira Sans" | 241 | font.family: "Fira Sans" |
248 | font.features: { "tnum": 1 } | 242 | font.features: { "tnum": 1 } |
249 | 243 | ||
250 | property bool today: chrono.date.getFullYear() == model.year && chrono.date.getMonth() == model.month && chrono.date.getDate() == model.day | 244 | text: weekNumber |
251 | 245 | color: "#99ffdd" | |
252 | text: model.day | ||
253 | color: today ? "#ff6699" : "white" | ||
254 | 246 | ||
255 | horizontalAlignment: Text.AlignRight | 247 | horizontalAlignment: Text.AlignRight |
256 | verticalAlignment: Text.AlignVCenter | 248 | verticalAlignment: Text.AlignVCenter |
249 | } | ||
250 | } | ||
251 | |||
252 | MonthGrid { | ||
253 | id: grid | ||
254 | |||
255 | year: yearCalendar.year | ||
256 | month: monthCalendar.month | ||
257 | locale: Qt.locale("en_DK") | ||
258 | |||
259 | Layout.fillWidth: true | ||
260 | Layout.fillHeight: true | ||
261 | |||
262 | delegate: Text { | ||
263 | required property var model | ||
264 | |||
265 | opacity: model.month === monthCalendar.month ? 1 : 0 | ||
266 | |||
267 | font.pointSize: 10 | ||
268 | font.family: "Fira Sans" | ||
269 | font.features: { "tnum": 1 } | ||
270 | |||
271 | property bool today: chrono.date.getFullYear() == model.year && chrono.date.getMonth() == model.month && chrono.date.getDate() == model.day | ||
272 | |||
273 | text: model.day | ||
274 | color: today ? "#ff6699" : "white" | ||
275 | |||
276 | horizontalAlignment: Text.AlignRight | ||
277 | verticalAlignment: Text.AlignVCenter | ||
278 | } | ||
257 | } | 279 | } |
258 | } | 280 | } |
259 | } | 281 | } |
diff --git a/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml new file mode 100644 index 00000000..2be0692a --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LidSwitchInhibitorWidget.qml | |||
@@ -0,0 +1,46 @@ | |||
1 | import Quickshell | ||
2 | import QtQuick | ||
3 | import Quickshell.Widgets | ||
4 | import qs.Services | ||
5 | |||
6 | Item { | ||
7 | id: root | ||
8 | |||
9 | width: icon.width + 8 | ||
10 | height: parent.height | ||
11 | anchors.verticalCenter: parent.verticalCenter | ||
12 | |||
13 | WrapperMouseArea { | ||
14 | id: widgetMouseArea | ||
15 | |||
16 | anchors.fill: parent | ||
17 | |||
18 | hoverEnabled: true | ||
19 | |||
20 | onClicked: InhibitorState.lidSwitchInhibited = !InhibitorState.lidSwitchInhibited | ||
21 | |||
22 | Rectangle { | ||
23 | anchors.fill: parent | ||
24 | color: { | ||
25 | if (widgetMouseArea.containsMouse) { | ||
26 | return "#33808080"; | ||
27 | } | ||
28 | return "transparent"; | ||
29 | } | ||
30 | |||
31 | Item { | ||
32 | anchors.fill: parent | ||
33 | |||
34 | MaterialDesignIcon { | ||
35 | id: icon | ||
36 | |||
37 | implicitSize: 14 | ||
38 | anchors.centerIn: parent | ||
39 | |||
40 | icon: InhibitorState.lidSwitchInhibited ? "laptop-off" : "laptop" | ||
41 | color: InhibitorState.lidSwitchInhibited ? "#f28a21" : "#555" | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/LockSurface.qml b/accounts/gkleen@sif/shell/quickshell/LockSurface.qml new file mode 100644 index 00000000..18698725 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/LockSurface.qml | |||
@@ -0,0 +1,223 @@ | |||
1 | import Quickshell.Widgets | ||
2 | import QtQuick.Effects | ||
3 | import QtQuick.Layouts | ||
4 | import QtQuick | ||
5 | import QtQuick.Controls | ||
6 | import QtQuick.Controls.Fusion | ||
7 | import qs.Services | ||
8 | import QtQml | ||
9 | |||
10 | Item { | ||
11 | id: lockSurface | ||
12 | |||
13 | property var screen | ||
14 | property list<var> messages: [] | ||
15 | property bool responseRequired: false | ||
16 | property bool responseVisible: false | ||
17 | property string currentText: "" | ||
18 | property bool authRunning: false | ||
19 | |||
20 | signal response(string responseText) | ||
21 | |||
22 | anchors.fill: parent | ||
23 | |||
24 | Item { | ||
25 | id: background | ||
26 | |||
27 | anchors.fill: parent | ||
28 | |||
29 | property Img current: one | ||
30 | property string source: selector.selected | ||
31 | |||
32 | WallpaperSelector { | ||
33 | id: selector | ||
34 | seed: lockSurface.screen?.name || "" | ||
35 | } | ||
36 | |||
37 | onSourceChanged: { | ||
38 | if (!source) | ||
39 | current = null; | ||
40 | else if (current === one) | ||
41 | two.update() | ||
42 | else | ||
43 | one.update() | ||
44 | } | ||
45 | |||
46 | Img { id: one } | ||
47 | Img { id: two } | ||
48 | |||
49 | component Img: Item { | ||
50 | id: img | ||
51 | |||
52 | property string source | ||
53 | |||
54 | function update() { | ||
55 | source = background.source || "" | ||
56 | } | ||
57 | |||
58 | anchors.fill: parent | ||
59 | |||
60 | Image { | ||
61 | id: imageSource | ||
62 | |||
63 | source: img.source | ||
64 | sourceSize: Qt.size(parent.width, parent.height) | ||
65 | fillMode: Image.PreserveAspectCrop | ||
66 | smooth: true | ||
67 | visible: false | ||
68 | asynchronous: true | ||
69 | cache: false | ||
70 | |||
71 | onStatusChanged: { | ||
72 | if (status === Image.Ready) { | ||
73 | background.current = img | ||
74 | } | ||
75 | } | ||
76 | } | ||
77 | |||
78 | MultiEffect { | ||
79 | id: imageEffect | ||
80 | |||
81 | source: imageSource | ||
82 | anchors.fill: parent | ||
83 | blurEnabled: true | ||
84 | blur: 1 | ||
85 | blurMax: 64 | ||
86 | blurMultiplier: 2 | ||
87 | |||
88 | opacity: 0 | ||
89 | |||
90 | states: State { | ||
91 | name: "visible" | ||
92 | when: background.current === img | ||
93 | |||
94 | PropertyChanges { | ||
95 | imageEffect.opacity: 1 | ||
96 | } | ||
97 | StateChangeScript { | ||
98 | name: "unloadOther" | ||
99 | script: { | ||
100 | if (img === one) | ||
101 | two.source = "" | ||
102 | if (img === two) | ||
103 | one.source = "" | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | |||
108 | transitions: Transition { | ||
109 | SequentialAnimation { | ||
110 | NumberAnimation { | ||
111 | target: imageEffect | ||
112 | properties: "opacity" | ||
113 | duration: 5000 | ||
114 | easing.type: Easing.OutCubic | ||
115 | } | ||
116 | ScriptAction { | ||
117 | scriptName: "unloadOther" | ||
118 | } | ||
119 | } | ||
120 | } | ||
121 | } | ||
122 | } | ||
123 | } | ||
124 | |||
125 | Item { | ||
126 | anchors { | ||
127 | top: lockSurface.top | ||
128 | left: lockSurface.left | ||
129 | right: lockSurface.right | ||
130 | } | ||
131 | |||
132 | implicitWidth: lockSurface.width | ||
133 | implicitHeight: 21 | ||
134 | |||
135 | Rectangle { | ||
136 | anchors.fill: parent | ||
137 | color: Qt.rgba(0, 0, 0, 0.75) | ||
138 | } | ||
139 | |||
140 | Clock { | ||
141 | anchors.centerIn: parent | ||
142 | calendarPopup: false | ||
143 | } | ||
144 | } | ||
145 | |||
146 | WrapperRectangle { | ||
147 | id: unlockUi | ||
148 | |||
149 | Keys.onPressed: event => { | ||
150 | if (!lockSurface.authRunning) { | ||
151 | event.accepted = true; | ||
152 | lockSurface.authRunning = true; | ||
153 | } | ||
154 | } | ||
155 | focus: !passwordBox.visible | ||
156 | |||
157 | visible: lockSurface.authRunning | ||
158 | |||
159 | color: Qt.rgba(0, 0, 0, 0.75) | ||
160 | margin: 8 | ||
161 | |||
162 | anchors.centerIn: parent | ||
163 | |||
164 | ColumnLayout { | ||
165 | spacing: 4 | ||
166 | |||
167 | BusyIndicator { | ||
168 | visible: running | ||
169 | running: !Array.from(lockSurface.messages).length && !lockSurface.responseRequired | ||
170 | } | ||
171 | |||
172 | Repeater { | ||
173 | model: lockSurface.messages | ||
174 | |||
175 | Text { | ||
176 | required property var modelData | ||
177 | |||
178 | font.pointSize: 10 | ||
179 | font.family: "Fira Sans" | ||
180 | color: modelData.error ? "#f28a21" : "#ffffff" | ||
181 | |||
182 | text: String(modelData.text).trim() | ||
183 | |||
184 | Layout.fillWidth: true | ||
185 | horizontalAlignment: Text.AlignHCenter | ||
186 | } | ||
187 | } | ||
188 | |||
189 | TextField { | ||
190 | id: passwordBox | ||
191 | |||
192 | visible: lockSurface.responseRequired | ||
193 | echoMode: lockSurface.responseVisible ? TextInput.Normal : TextInput.Password | ||
194 | inputMethodHints: Qt.ImhSensitiveData | ||
195 | |||
196 | onTextChanged: lockSurface.currentText = passwordBox.text | ||
197 | onAccepted: { | ||
198 | passwordBox.readOnly = true; | ||
199 | lockSurface.response(lockSurface.currentText); | ||
200 | } | ||
201 | |||
202 | Connections { | ||
203 | target: lockSurface | ||
204 | function onCurrentTextChanged() { | ||
205 | passwordBox.text = lockSurface.currentText | ||
206 | } | ||
207 | } | ||
208 | Connections { | ||
209 | target: lockSurface | ||
210 | function onResponseRequiredChanged() { | ||
211 | if (lockSurface.responseRequired) | ||
212 | passwordBox.readOnly = false; | ||
213 | passwordBox.focus = true; | ||
214 | passwordBox.selectAll(); | ||
215 | } | ||
216 | } | ||
217 | |||
218 | Layout.topMargin: 4 | ||
219 | Layout.fillWidth: true | ||
220 | } | ||
221 | } | ||
222 | } | ||
223 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml index 7cb1cc67..e4f8e1c9 100644 --- a/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml +++ b/accounts/gkleen@sif/shell/quickshell/Lockscreen.qml | |||
@@ -2,14 +2,10 @@ import Quickshell | |||
2 | import Quickshell.Wayland | 2 | import Quickshell.Wayland |
3 | import Quickshell.Io | 3 | import Quickshell.Io |
4 | import Quickshell.Services.Pam | 4 | import Quickshell.Services.Pam |
5 | import Quickshell.Widgets | 5 | import Quickshell.Services.Mpris |
6 | import QtQuick.Effects | 6 | import Custom as Custom |
7 | import QtQuick.Layouts | ||
8 | import QtQuick | ||
9 | import QtQuick.Controls | ||
10 | import QtQuick.Controls.Fusion | ||
11 | import qs.Services | 7 | import qs.Services |
12 | // import QtQml.Models | 8 | import QtQml |
13 | 9 | ||
14 | Scope { | 10 | Scope { |
15 | id: lockscreen | 11 | id: lockscreen |
@@ -42,216 +38,85 @@ Scope { | |||
42 | function getLocked(): bool { return lock.locked; } | 38 | function getLocked(): bool { return lock.locked; } |
43 | } | 39 | } |
44 | 40 | ||
45 | WlSessionLock { | 41 | Connections { |
46 | id: lock | 42 | target: Custom.Systemd |
47 | 43 | function onSleep(before: bool) { | |
48 | onLockedChanged: { | 44 | console.log(`received prepare for sleep ${before}`); |
49 | if (!locked && pam.active) | 45 | if (before) |
50 | pam.abort(); | 46 | lock.locked = true; |
51 | } | 47 | } |
48 | function onLock() { lock.locked = true; } | ||
49 | function onUnlock() { lock.locked = false; } | ||
50 | } | ||
52 | 51 | ||
53 | WlSessionLockSurface { | 52 | IdleMonitor { |
54 | id: lockSurface | 53 | id: idleMonitor |
55 | 54 | enabled: !lock.secure | |
56 | color: "#000000" | 55 | timeout: 600 |
57 | 56 | respectInhibitors: true | |
58 | Item { | ||
59 | id: background | ||
60 | |||
61 | anchors.fill: parent | ||
62 | |||
63 | property Img current: one | ||
64 | property string source: selector.selected | ||
65 | |||
66 | WallpaperSelector { | ||
67 | id: selector | ||
68 | seed: lockSurface.screen?.name || "" | ||
69 | } | ||
70 | |||
71 | onSourceChanged: { | ||
72 | if (!source) | ||
73 | current = null; | ||
74 | else if (current === one) | ||
75 | two.update() | ||
76 | else | ||
77 | one.update() | ||
78 | } | ||
79 | |||
80 | Img { id: one } | ||
81 | Img { id: two } | ||
82 | |||
83 | component Img: Item { | ||
84 | id: img | ||
85 | |||
86 | property string source | ||
87 | |||
88 | function update() { | ||
89 | source = background.source || "" | ||
90 | } | ||
91 | |||
92 | anchors.fill: parent | ||
93 | |||
94 | Image { | ||
95 | id: imageSource | ||
96 | |||
97 | source: img.source | ||
98 | sourceSize: Qt.size(parent.width, parent.height) | ||
99 | fillMode: Image.PreserveAspectCrop | ||
100 | smooth: true | ||
101 | visible: false | ||
102 | asynchronous: true | ||
103 | cache: false | ||
104 | |||
105 | onStatusChanged: { | ||
106 | if (status === Image.Ready) { | ||
107 | background.current = img | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | 57 | ||
112 | MultiEffect { | 58 | onIsIdleChanged: { |
113 | id: imageEffect | 59 | if (idleMonitor.isIdle) |
60 | lock.locked = true; | ||
61 | } | ||
62 | } | ||
114 | 63 | ||
115 | source: imageSource | 64 | Custom.SystemdInhibitor { |
116 | anchors.fill: parent | 65 | enabled: !lock.secure |
117 | blurEnabled: true | ||
118 | blur: 1 | ||
119 | blurMax: 64 | ||
120 | blurMultiplier: 2 | ||
121 | 66 | ||
122 | opacity: 0 | 67 | what: Custom.SystemdInhibitorParams.Sleep |
68 | who: "quickshell" | ||
69 | why: "Lock session" | ||
70 | mode: Custom.SystemdInhibitorParams.Delay | ||
71 | } | ||
123 | 72 | ||
124 | states: State { | 73 | WlSessionLock { |
125 | name: "visible" | 74 | id: lock |
126 | when: background.current === img | ||
127 | 75 | ||
128 | PropertyChanges { | 76 | onLockStateChanged: { |
129 | imageEffect.opacity: 1 | 77 | if (!locked && pam.active) |
130 | } | 78 | pam.abort(); |
131 | StateChangeScript { | ||
132 | name: "unloadOther" | ||
133 | script: { | ||
134 | if (img === one) | ||
135 | two.source = "" | ||
136 | if (img === two) | ||
137 | one.source = "" | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | 79 | ||
142 | transitions: Transition { | 80 | if (locked) { |
143 | SequentialAnimation { | 81 | Custom.KeePassXC.lockAllDatabases(); |
144 | NumberAnimation { | 82 | Array.from(Mpris.players.values).forEach(player => { |
145 | target: imageEffect | 83 | if (player.canPause && player.isPlaying) |
146 | properties: "opacity" | 84 | player.pause(); |
147 | duration: 5000 | 85 | }); |
148 | easing.type: Easing.OutCubic | 86 | // Custom.Systemd.stopUserUnit("gpg-agent.service", "replace"); |
149 | } | 87 | GpgAgent.reloadAgent(); |
150 | ScriptAction { | ||
151 | scriptName: "unloadOther" | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | } | ||
156 | } | ||
157 | } | 88 | } |
89 | } | ||
158 | 90 | ||
159 | Item { | 91 | onSecureStateChanged: Custom.Systemd.lockedHint = lock.secure |
160 | anchors { | ||
161 | top: lockSurface.top | ||
162 | left: lockSurface.left | ||
163 | right: lockSurface.right | ||
164 | } | ||
165 | |||
166 | implicitWidth: lockSurface.width | ||
167 | implicitHeight: 21 | ||
168 | 92 | ||
169 | Rectangle { | 93 | WlSessionLockSurface { |
170 | anchors.fill: parent | 94 | id: lockSurface |
171 | color: Qt.rgba(0, 0, 0, 0.75) | ||
172 | } | ||
173 | 95 | ||
174 | Clock { | 96 | color: "black" |
175 | anchors.centerIn: parent | ||
176 | calendarPopup: false | ||
177 | } | ||
178 | } | ||
179 | 97 | ||
180 | WrapperRectangle { | 98 | LockSurface { |
181 | id: unlockUi | 99 | id: surfaceContent |
182 | 100 | ||
183 | Keys.onPressed: event => { | 101 | onResponse: responseText => pam.respond(responseText) |
184 | if (!pam.active) { | 102 | onAuthRunningChanged: { |
185 | event.accepted = true; | 103 | if (authRunning) |
186 | pam.start(); | 104 | pam.start(); |
187 | } | ||
188 | } | 105 | } |
189 | focus: !passwordBox.visible | 106 | Connections { |
190 | 107 | target: pam | |
191 | visible: pam.active | 108 | function onMessagesChanged() { surfaceContent.messages = pam.messages; } |
192 | 109 | function onResponseRequiredChanged() { surfaceContent.responseRequired = pam.responseRequired; } | |
193 | color: Qt.rgba(0, 0, 0, 0.75) | 110 | function onActiveChanged() { surfaceContent.authRunning = pam.active; } |
194 | margin: 8 | 111 | } |
195 | 112 | onCurrentTextChanged: lockscreen.currentText = currentText | |
196 | anchors.centerIn: parent | 113 | Connections { |
197 | 114 | target: lockscreen | |
198 | ColumnLayout { | 115 | function onCurrentTextChanged() { surfaceContent.currentText = lockscreen.currentText; } |
199 | spacing: 4 | 116 | } |
200 | 117 | Connections { | |
201 | BusyIndicator { | 118 | target: lockSurface |
202 | visible: running | 119 | function onScreenChanged() { surfaceContent.screen = lockSurface.screen; } |
203 | running: !Array.from(pam.messages).length && !pam.responseRequired | ||
204 | } | ||
205 | |||
206 | Repeater { | ||
207 | model: pam.messages | ||
208 | |||
209 | Text { | ||
210 | required property var modelData | ||
211 | |||
212 | font.pointSize: 10 | ||
213 | font.family: "Fira Sans" | ||
214 | color: modelData.error ? "#f28a21" : "#ffffff" | ||
215 | |||
216 | text: modelData.text | ||
217 | |||
218 | Layout.fillWidth: true | ||
219 | horizontalAlignment: Text.AlignHCenter | ||
220 | } | ||
221 | } | ||
222 | |||
223 | TextField { | ||
224 | id: passwordBox | ||
225 | |||
226 | visible: pam.responseRequired | ||
227 | echoMode: pam.responseVisible ? TextInput.Normal : TextInput.Password | ||
228 | inputMethodHints: Qt.ImhSensitiveData | ||
229 | |||
230 | onTextChanged: lockscreen.currentText = passwordBox.text | ||
231 | onAccepted: { | ||
232 | passwordBox.readOnly = true; | ||
233 | pam.respond(lockscreen.currentText); | ||
234 | } | ||
235 | |||
236 | Connections { | ||
237 | target: lockscreen | ||
238 | function onCurrentTextChanged() { | ||
239 | passwordBox.text = lockscreen.currentText | ||
240 | } | ||
241 | } | ||
242 | Connections { | ||
243 | target: pam | ||
244 | function onResponseRequiredChanged() { | ||
245 | if (pam.responseRequired) | ||
246 | passwordBox.readOnly = false; | ||
247 | passwordBox.focus = true; | ||
248 | passwordBox.selectAll(); | ||
249 | } | ||
250 | } | ||
251 | |||
252 | Layout.topMargin: 4 | ||
253 | Layout.fillWidth: true | ||
254 | } | ||
255 | } | 120 | } |
256 | } | 121 | } |
257 | } | 122 | } |
diff --git a/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml b/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml new file mode 100644 index 00000000..155a009e --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml | |||
@@ -0,0 +1,35 @@ | |||
1 | import QtQuick | ||
2 | import QtQuick.Effects | ||
3 | |||
4 | Item { | ||
5 | id: root | ||
6 | |||
7 | required property string icon | ||
8 | property color color: "white" | ||
9 | |||
10 | property real implicitSize: 0 | ||
11 | |||
12 | readonly property real actualSize: Math.min(root.width, root.height) | ||
13 | |||
14 | implicitWidth: root.implicitSize | ||
15 | implicitHeight: root.implicitSize | ||
16 | |||
17 | Image { | ||
18 | id: sourceImage | ||
19 | source: "file://" + @mdi@ + "/svg/" + root.icon + ".svg" | ||
20 | anchors.fill: parent | ||
21 | fillMode: Image.PreserveAspectFit | ||
22 | |||
23 | sourceSize.width: root.actualSize | ||
24 | sourceSize.height: root.actualSize | ||
25 | |||
26 | layer.enabled: true | ||
27 | layer.effect: MultiEffect { | ||
28 | id: effect | ||
29 | |||
30 | brightness: 1 | ||
31 | colorization: 1 | ||
32 | colorizationColor: root.color | ||
33 | } | ||
34 | } | ||
35 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/NiriIdle.qml b/accounts/gkleen@sif/shell/quickshell/NiriIdle.qml new file mode 100644 index 00000000..faa77c3f --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/NiriIdle.qml | |||
@@ -0,0 +1,30 @@ | |||
1 | import QtQml | ||
2 | import Quickshell | ||
3 | import Quickshell.Wayland | ||
4 | import qs.Services | ||
5 | import Custom as Custom | ||
6 | |||
7 | Scope { | ||
8 | IdleMonitor { | ||
9 | id: idleMonitor30 | ||
10 | timeout: 30 | ||
11 | |||
12 | onIsIdleChanged: Custom.Systemd.setIdleHint(idleMonitor30.isIdle) | ||
13 | } | ||
14 | IdleMonitor { | ||
15 | id: idleMonitor540 | ||
16 | timeout: 540 | ||
17 | |||
18 | onIsIdleChanged: { | ||
19 | if (idleMonitor540.isIdle) | ||
20 | NiriService.sendCommand({ "Action": "PowerOffMonitors" }); | ||
21 | } | ||
22 | } | ||
23 | Connections { | ||
24 | target: Custom.Systemd | ||
25 | function onSleep(before: bool) { | ||
26 | if (!before) | ||
27 | NiriService.sendCommand({ "Action": "PowerOnMonitors" }); | ||
28 | } | ||
29 | } | ||
30 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/PipewireWidget.qml b/accounts/gkleen@sif/shell/quickshell/PipewireWidget.qml new file mode 100644 index 00000000..3e0b8fd9 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/PipewireWidget.qml | |||
@@ -0,0 +1,471 @@ | |||
1 | import QtQuick | ||
2 | import QtQuick.Layouts | ||
3 | import QtQuick.Controls.Fusion | ||
4 | import Quickshell | ||
5 | import Quickshell.Services.Pipewire | ||
6 | import Quickshell.Widgets | ||
7 | |||
8 | Item { | ||
9 | height: parent.height | ||
10 | width: volumeIcon.width + 8 | ||
11 | anchors.verticalCenter: parent.verticalCenter | ||
12 | |||
13 | PwObjectTracker { | ||
14 | objects: [Pipewire.defaultAudioSink] | ||
15 | } | ||
16 | |||
17 | WrapperMouseArea { | ||
18 | id: widgetMouseArea | ||
19 | |||
20 | anchors.fill: parent | ||
21 | hoverEnabled: true | ||
22 | cursorShape: Qt.PointingHandCursor | ||
23 | |||
24 | onClicked: { | ||
25 | if (!Pipewire.defaultAudioSink) | ||
26 | return; | ||
27 | Pipewire.defaultAudioSink.audio.muted = !Pipewire.defaultAudioSink.audio.muted; | ||
28 | } | ||
29 | |||
30 | property real sensitivity: (1 / 40) / 120 | ||
31 | onWheel: event => { | ||
32 | if (!Pipewire.defaultAudioSink) | ||
33 | return; | ||
34 | Pipewire.defaultAudioSink.audio.volume += event.angleDelta.y * sensitivity; | ||
35 | } | ||
36 | |||
37 | Rectangle { | ||
38 | id: volumeWidget | ||
39 | |||
40 | anchors.fill: parent | ||
41 | color: { | ||
42 | if (widgetMouseArea.containsMouse) | ||
43 | return "#33808080"; | ||
44 | return "transparent"; | ||
45 | } | ||
46 | |||
47 | Item { | ||
48 | anchors.fill: parent | ||
49 | |||
50 | MaterialDesignIcon { | ||
51 | id: volumeIcon | ||
52 | |||
53 | implicitSize: 14 | ||
54 | anchors.centerIn: parent | ||
55 | |||
56 | icon: { | ||
57 | if (!Pipewire.defaultAudioSink || Pipewire.defaultAudioSink.audio.muted) | ||
58 | return "volume-off"; | ||
59 | if (Pipewire.defaultAudioSink.audio.volume <= 0.33) | ||
60 | return "volume-low"; | ||
61 | if (Pipewire.defaultAudioSink.audio.volume <= 0.67) | ||
62 | return "volume-medium"; | ||
63 | return "volume-high"; | ||
64 | } | ||
65 | color: "#555" | ||
66 | } | ||
67 | } | ||
68 | } | ||
69 | } | ||
70 | |||
71 | Loader { | ||
72 | id: tooltipLoader | ||
73 | |||
74 | active: false | ||
75 | |||
76 | Connections { | ||
77 | target: widgetMouseArea | ||
78 | function onContainsMouseChanged() { | ||
79 | if (widgetMouseArea.containsMouse) | ||
80 | tooltipLoader.active = true; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | PwObjectTracker { | ||
85 | objects: Pipewire.devices | ||
86 | } | ||
87 | PwObjectTracker { | ||
88 | objects: Pipewire.nodes | ||
89 | } | ||
90 | |||
91 | sourceComponent: PopupWindow { | ||
92 | id: tooltip | ||
93 | |||
94 | property bool openPopup: false | ||
95 | property bool nextVisible: widgetMouseArea.containsMouse || tooltipMouseArea.containsMouse || openPopup | ||
96 | |||
97 | anchor { | ||
98 | item: widgetMouseArea | ||
99 | edges: Edges.Bottom | Edges.Left | ||
100 | } | ||
101 | visible: false | ||
102 | |||
103 | onNextVisibleChanged: hangTimer.restart() | ||
104 | |||
105 | Timer { | ||
106 | id: hangTimer | ||
107 | interval: 100 | ||
108 | onTriggered: { | ||
109 | tooltip.visible = tooltip.nextVisible; | ||
110 | if (!tooltip.visible) | ||
111 | tooltipLoader.active = false; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | implicitWidth: tooltipContent.width | ||
116 | implicitHeight: tooltipContent.height | ||
117 | color: "transparent" | ||
118 | |||
119 | Rectangle { | ||
120 | width: tooltip.width | ||
121 | height: tooltipLayout.childrenRect.height + 16 | ||
122 | color: "black" | ||
123 | } | ||
124 | |||
125 | WrapperItem { | ||
126 | id: tooltipContent | ||
127 | |||
128 | bottomMargin: Math.max(0, 200 - tooltipLayout.implicitHeight) | ||
129 | |||
130 | WrapperMouseArea { | ||
131 | id: tooltipMouseArea | ||
132 | |||
133 | hoverEnabled: true | ||
134 | enabled: true | ||
135 | |||
136 | WrapperItem { | ||
137 | margin: 8 | ||
138 | bottomMargin: 8 | ||
139 | |||
140 | GridLayout { | ||
141 | id: tooltipLayout | ||
142 | |||
143 | columns: 4 | ||
144 | |||
145 | Repeater { | ||
146 | model: Array.from(Pipewire.devices.values).filter(dev => dev.type == "Audio/Device") | ||
147 | |||
148 | Item { | ||
149 | id: descItem | ||
150 | |||
151 | required property var modelData | ||
152 | required property int index | ||
153 | |||
154 | Layout.column: 0 | ||
155 | Layout.row: index | ||
156 | |||
157 | implicitWidth: descText.contentWidth | ||
158 | implicitHeight: descText.contentHeight | ||
159 | |||
160 | Text { | ||
161 | id: descText | ||
162 | |||
163 | color: "white" | ||
164 | font.pointSize: 10 | ||
165 | font.family: "Fira Sans" | ||
166 | |||
167 | text: descItem.modelData.description | ||
168 | } | ||
169 | } | ||
170 | } | ||
171 | |||
172 | Repeater { | ||
173 | id: defaultSinkRepeater | ||
174 | |||
175 | model: { | ||
176 | Array.from(Pipewire.devices.values) | ||
177 | .filter(dev => dev.type == "Audio/Device") | ||
178 | .map(device => Array.from(Pipewire.nodes.values).find(node => node.type == PwNodeType.AudioSink && node.device?.id == device.id )); | ||
179 | } | ||
180 | |||
181 | Item { | ||
182 | id: defaultSinkItem | ||
183 | |||
184 | required property var modelData | ||
185 | required property int index | ||
186 | |||
187 | visible: Boolean(modelData) | ||
188 | |||
189 | PwObjectTracker { | ||
190 | objects: [defaultSinkItem.modelData] | ||
191 | } | ||
192 | |||
193 | Layout.column: 1 | ||
194 | Layout.row: index | ||
195 | |||
196 | Layout.fillHeight: true | ||
197 | |||
198 | implicitWidth: 16 + 8 | ||
199 | |||
200 | WrapperMouseArea { | ||
201 | id: defaultSinkMouseArea | ||
202 | |||
203 | anchors.fill: parent | ||
204 | hoverEnabled: true | ||
205 | cursorShape: Qt.PointingHandCursor | ||
206 | |||
207 | onClicked: { | ||
208 | Pipewire.preferredDefaultAudioSink = defaultSinkItem.modelData | ||
209 | } | ||
210 | |||
211 | onWheel: event => scrollVolume(event); | ||
212 | property real sensitivity: (1 / 40) / 120 | ||
213 | function scrollVolume(event) { | ||
214 | defaultSinkItem.modelData.audio.volume += event.angleDelta.y * sensitivity; | ||
215 | } | ||
216 | |||
217 | Rectangle { | ||
218 | id: defaultSinkWidget | ||
219 | |||
220 | anchors.fill: parent | ||
221 | color: { | ||
222 | if (defaultSinkMouseArea.containsMouse) | ||
223 | return "#33808080"; | ||
224 | return "transparent"; | ||
225 | } | ||
226 | |||
227 | MaterialDesignIcon { | ||
228 | width: 16 | ||
229 | height: 16 | ||
230 | anchors.centerIn: parent | ||
231 | |||
232 | icon: { | ||
233 | if (defaultSinkItem.modelData?.id == Pipewire.defaultAudioSink?.id) | ||
234 | return "speaker"; | ||
235 | return "speaker-off"; | ||
236 | } | ||
237 | color: icon == "speaker" ? "white" : "#555" | ||
238 | } | ||
239 | } | ||
240 | } | ||
241 | |||
242 | PopupWindow { | ||
243 | id: volumeTooltip | ||
244 | |||
245 | property bool nextVisible: defaultSinkMouseArea.containsMouse || volumeTooltipMouseArea.containsMouse | ||
246 | |||
247 | anchor { | ||
248 | item: defaultSinkMouseArea | ||
249 | edges: Edges.Bottom | Edges.Left | ||
250 | } | ||
251 | visible: false | ||
252 | |||
253 | onNextVisibleChanged: volumeHangTimer.restart() | ||
254 | |||
255 | onVisibleChanged: tooltip.openPopup = volumeTooltip.visible | ||
256 | |||
257 | Timer { | ||
258 | id: volumeHangTimer | ||
259 | interval: 100 | ||
260 | onTriggered: volumeTooltip.visible = volumeTooltip.nextVisible | ||
261 | } | ||
262 | |||
263 | implicitWidth: volumeTooltipText.contentWidth + 16 | ||
264 | implicitHeight: volumeTooltipText.contentHeight + 16 | ||
265 | color: "black" | ||
266 | |||
267 | WrapperMouseArea { | ||
268 | id: volumeTooltipMouseArea | ||
269 | |||
270 | hoverEnabled: true | ||
271 | enabled: true | ||
272 | |||
273 | onWheel: event => defaultSinkMouseArea.scrollVolume(event); | ||
274 | |||
275 | anchors.centerIn: parent | ||
276 | |||
277 | Text { | ||
278 | id: volumeTooltipText | ||
279 | |||
280 | font.pointSize: 10 | ||
281 | font.family: "Fira Sans" | ||
282 | color: "white" | ||
283 | |||
284 | text: `${Math.round(defaultSinkItem.modelData?.audio?.volume * 100)}%` | ||
285 | } | ||
286 | } | ||
287 | } | ||
288 | } | ||
289 | } | ||
290 | |||
291 | Repeater { | ||
292 | id: defaultSourceRepeater | ||
293 | |||
294 | model: { | ||
295 | Array.from(Pipewire.devices.values) | ||
296 | .filter(dev => dev.type == "Audio/Device") | ||
297 | .map(device => Array.from(Pipewire.nodes.values).find(node => node.type == PwNodeType.AudioSource && node.device?.id == device.id )); | ||
298 | } | ||
299 | |||
300 | Item { | ||
301 | id: defaultSourceItem | ||
302 | |||
303 | required property var modelData | ||
304 | required property int index | ||
305 | |||
306 | visible: Boolean(modelData) | ||
307 | |||
308 | PwObjectTracker { | ||
309 | objects: [defaultSourceItem.modelData] | ||
310 | } | ||
311 | |||
312 | Layout.column: 2 | ||
313 | Layout.row: index | ||
314 | |||
315 | Layout.fillHeight: true | ||
316 | |||
317 | implicitWidth: 16 + 8 | ||
318 | |||
319 | WrapperMouseArea { | ||
320 | id: defaultSourceMouseArea | ||
321 | |||
322 | anchors.fill: parent | ||
323 | hoverEnabled: true | ||
324 | cursorShape: Qt.PointingHandCursor | ||
325 | |||
326 | onClicked: { | ||
327 | Pipewire.preferredDefaultAudioSource = defaultSourceItem.modelData | ||
328 | } | ||
329 | |||
330 | onWheel: event => scrollVolume(event); | ||
331 | property real sensitivity: (1 / 40) / 120 | ||
332 | function scrollVolume(event) { | ||
333 | defaultSourceItem.modelData.audio.volume += event.angleDelta.y * sensitivity; | ||
334 | } | ||
335 | |||
336 | Rectangle { | ||
337 | id: defaultSourceWidget | ||
338 | |||
339 | anchors.fill: parent | ||
340 | color: { | ||
341 | if (defaultSourceMouseArea.containsMouse) | ||
342 | return "#33808080"; | ||
343 | return "transparent"; | ||
344 | } | ||
345 | |||
346 | MaterialDesignIcon { | ||
347 | width: 16 | ||
348 | height: 16 | ||
349 | anchors.centerIn: parent | ||
350 | |||
351 | icon: { | ||
352 | if (defaultSourceItem.modelData?.id == Pipewire.defaultAudioSource?.id) | ||
353 | return "microphone"; | ||
354 | return "microphone-off"; | ||
355 | } | ||
356 | color: icon == "microphone" ? "white" : "#555" | ||
357 | } | ||
358 | } | ||
359 | } | ||
360 | |||
361 | PopupWindow { | ||
362 | id: volumeTooltip | ||
363 | |||
364 | property bool nextVisible: defaultSourceMouseArea.containsMouse || volumeTooltipMouseArea.containsMouse | ||
365 | |||
366 | anchor { | ||
367 | item: defaultSourceMouseArea | ||
368 | edges: Edges.Bottom | Edges.Left | ||
369 | } | ||
370 | visible: false | ||
371 | |||
372 | onNextVisibleChanged: volumeHangTimer.restart() | ||
373 | |||
374 | onVisibleChanged: tooltip.openPopup = volumeTooltip.visible | ||
375 | |||
376 | Timer { | ||
377 | id: volumeHangTimer | ||
378 | interval: 100 | ||
379 | onTriggered: volumeTooltip.visible = volumeTooltip.nextVisible | ||
380 | } | ||
381 | |||
382 | implicitWidth: volumeTooltipText.contentWidth + 16 | ||
383 | implicitHeight: volumeTooltipText.contentHeight + 16 | ||
384 | color: "black" | ||
385 | |||
386 | WrapperMouseArea { | ||
387 | id: volumeTooltipMouseArea | ||
388 | |||
389 | hoverEnabled: true | ||
390 | enabled: true | ||
391 | |||
392 | onWheel: event => defaultSourceMouseArea.scrollVolume(event); | ||
393 | |||
394 | anchors.centerIn: parent | ||
395 | |||
396 | Text { | ||
397 | id: volumeTooltipText | ||
398 | |||
399 | font.pointSize: 10 | ||
400 | font.family: "Fira Sans" | ||
401 | color: "white" | ||
402 | |||
403 | text: `${Math.round(defaultSourceItem.modelData?.audio?.volume * 100)}%` | ||
404 | } | ||
405 | } | ||
406 | } | ||
407 | } | ||
408 | } | ||
409 | |||
410 | Repeater { | ||
411 | id: profileRepeater | ||
412 | |||
413 | model: Array.from(Pipewire.devices.values).filter(dev => dev.type == "Audio/Device") | ||
414 | |||
415 | Item { | ||
416 | id: profileItem | ||
417 | |||
418 | required property var modelData | ||
419 | required property int index | ||
420 | |||
421 | PwObjectTracker { | ||
422 | objects: [profileItem.modelData] | ||
423 | } | ||
424 | |||
425 | Layout.column: 3 | ||
426 | Layout.row: index | ||
427 | |||
428 | Layout.fillWidth: true | ||
429 | |||
430 | implicitWidth: Math.max(profileBox.implicitWidth, 300) | ||
431 | implicitHeight: profileBox.height | ||
432 | |||
433 | ComboBox { | ||
434 | id: profileBox | ||
435 | |||
436 | model: profileItem.modelData.profiles | ||
437 | |||
438 | textRole: "description" | ||
439 | valueRole: "index" | ||
440 | onActivated: profileItem.modelData.setProfile(currentValue) | ||
441 | |||
442 | anchors.fill: parent | ||
443 | |||
444 | implicitContentWidthPolicy: ComboBox.WidestText | ||
445 | |||
446 | Connections { | ||
447 | target: profileItem.modelData | ||
448 | function onCurrentProfileChanged() { | ||
449 | profileBox.currentIndex = Array.from(profileItem.modelData.profiles).findIndex(profile => profile.index == profileItem.modelData.currentProfile); | ||
450 | } | ||
451 | } | ||
452 | Component.onCompleted: { | ||
453 | profileBox.currentIndex = Array.from(profileItem.modelData.profiles).findIndex(profile => profile.index == profileItem.modelData.currentProfile); | ||
454 | } | ||
455 | |||
456 | Connections { | ||
457 | target: profileBox.popup | ||
458 | function onVisibleChanged() { | ||
459 | tooltip.openPopup = profileBox.popup.visible | ||
460 | } | ||
461 | } | ||
462 | } | ||
463 | } | ||
464 | } | ||
465 | } | ||
466 | } | ||
467 | } | ||
468 | } | ||
469 | } | ||
470 | } | ||
471 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/PrivacyWidget.qml b/accounts/gkleen@sif/shell/quickshell/PrivacyWidget.qml new file mode 100644 index 00000000..d7ffadfe --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/PrivacyWidget.qml | |||
@@ -0,0 +1,49 @@ | |||
1 | import QtQuick | ||
2 | import QtQuick.Layouts | ||
3 | import Quickshell | ||
4 | import Quickshell.Widgets | ||
5 | import qs.Services | ||
6 | |||
7 | Item { | ||
8 | height: parent.height | ||
9 | width: layout.childrenRect.width | ||
10 | anchors.verticalCenter: parent.verticalCenter | ||
11 | |||
12 | visible: Array.from(Privacy.activeItems).length > 0 | ||
13 | |||
14 | RowLayout { | ||
15 | id: layout | ||
16 | |||
17 | anchors.fill: parent | ||
18 | |||
19 | spacing: 8 | ||
20 | |||
21 | Repeater { | ||
22 | model: Privacy.activeItems | ||
23 | |||
24 | Item { | ||
25 | id: privacyItem | ||
26 | |||
27 | required property var modelData; | ||
28 | |||
29 | height: parent.height | ||
30 | width: icon.width | ||
31 | |||
32 | MaterialDesignIcon { | ||
33 | id: icon | ||
34 | |||
35 | implicitSize: 14 | ||
36 | anchors.centerIn: parent | ||
37 | |||
38 | icon: { | ||
39 | if (privacyItem.modelData == Privacy.Item.Microphone) | ||
40 | return "microphone"; | ||
41 | if (privacyItem.modelData == Privacy.Item.Screensharing) | ||
42 | return "monitor-share"; | ||
43 | } | ||
44 | color: "#f2201f" | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | } | ||
49 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml new file mode 100644 index 00000000..8318df50 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml | |||
@@ -0,0 +1,75 @@ | |||
1 | pragma Singleton | ||
2 | |||
3 | import QtQml | ||
4 | import Quickshell | ||
5 | import Quickshell.Io | ||
6 | import Custom as Custom | ||
7 | |||
8 | Singleton { | ||
9 | id: root | ||
10 | |||
11 | property string subsystem: "backlight" | ||
12 | property string device: "intel_backlight" | ||
13 | |||
14 | property real currBrightness | ||
15 | property real exponent: 4 | ||
16 | |||
17 | function calcCurrBrightness() { | ||
18 | if (!currFile.loaded || !maxFile.loaded) | ||
19 | return undefined; | ||
20 | const curr = Number(currFile.text()); | ||
21 | const max = Number(maxFile.text()); | ||
22 | const val = Math.pow(curr / max, 1 / root.exponent); | ||
23 | return val; | ||
24 | } | ||
25 | |||
26 | Connections { | ||
27 | target: currFile | ||
28 | function onLoaded() { | ||
29 | const b = root.calcCurrBrightness(); | ||
30 | if (typeof b !== 'undefined') | ||
31 | root.currBrightness = b; | ||
32 | } | ||
33 | } | ||
34 | Connections { | ||
35 | target: maxFile | ||
36 | function onLoaded() { | ||
37 | const b = root.calcCurrBrightness(); | ||
38 | if (typeof b !== 'undefined') | ||
39 | root.currBrightness = b; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | onCurrBrightnessChanged: { | ||
44 | root.currBrightness = Math.max(0, Math.min(1, root.currBrightness)); | ||
45 | |||
46 | const prev = root.calcCurrBrightness(); | ||
47 | if (typeof prev === 'undefined' || Math.abs(root.currBrightness - prev) < 0.01) | ||
48 | return; | ||
49 | |||
50 | const max = Number(maxFile.text()); | ||
51 | const actual = Number(currFile.text()); | ||
52 | let curr = Math.max(0, Math.min(max, Math.pow(root.currBrightness, root.exponent) * max)); | ||
53 | if (Math.round(curr) == actual && curr < actual) | ||
54 | curr = Math.max(0, actual - 1); | ||
55 | else if (Math.round(curr) == actual && curr > actual) | ||
56 | curr = Math.min(max, actual + 1); | ||
57 | // root.currBrightness = Math.pow(curr / max, 1 / root.exponent); | ||
58 | Custom.Systemd.setBrightness(root.subsystem, root.device, Math.round(curr)); | ||
59 | } | ||
60 | |||
61 | FileView { | ||
62 | id: currFile | ||
63 | path: `/sys/class/${root.subsystem}/${root.device}/brightness` | ||
64 | blockAllReads: true | ||
65 | watchChanges: true | ||
66 | onFileChanged: reload() | ||
67 | } | ||
68 | FileView { | ||
69 | id: maxFile | ||
70 | path: `/sys/class/${root.subsystem}/${root.device}/max_brightness` | ||
71 | blockAllReads: true | ||
72 | watchChanges: true | ||
73 | onFileChanged: reload() | ||
74 | } | ||
75 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/GpgAgent.qml b/accounts/gkleen@sif/shell/quickshell/Services/GpgAgent.qml new file mode 100644 index 00000000..3de69535 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/Services/GpgAgent.qml | |||
@@ -0,0 +1,18 @@ | |||
1 | pragma Singleton | ||
2 | |||
3 | import Quickshell | ||
4 | import Quickshell.Io | ||
5 | |||
6 | Singleton { | ||
7 | id: root | ||
8 | |||
9 | Socket { | ||
10 | id: agentSocket | ||
11 | connected: true | ||
12 | path: `${Quickshell.env("XDG_RUNTIME_DIR")}/gnupg/S.gpg-agent` | ||
13 | } | ||
14 | |||
15 | function reloadAgent() { | ||
16 | agentSocket.write("RELOADAGENT\n") | ||
17 | } | ||
18 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml b/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml new file mode 100644 index 00000000..fe48fd7f --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/Services/InhibitorState.qml | |||
@@ -0,0 +1,22 @@ | |||
1 | pragma Singleton | ||
2 | |||
3 | import Quickshell | ||
4 | import Custom as Custom | ||
5 | |||
6 | Singleton { | ||
7 | id: inhibitorState | ||
8 | |||
9 | property bool waylandIdleInhibited: false | ||
10 | property alias lidSwitchInhibited: lidSwitchInhibitor.enabled | ||
11 | |||
12 | Custom.SystemdInhibitor { | ||
13 | id: lidSwitchInhibitor | ||
14 | |||
15 | enabled: false | ||
16 | |||
17 | what: Custom.SystemdInhibitorParams.HandleLidSwitch | ||
18 | who: "quickshell" | ||
19 | why: "User request" | ||
20 | mode: Custom.SystemdInhibitorParams.BlockWeak | ||
21 | } | ||
22 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/Privacy.qml b/accounts/gkleen@sif/shell/quickshell/Services/Privacy.qml new file mode 100644 index 00000000..9c813e49 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/Services/Privacy.qml | |||
@@ -0,0 +1,63 @@ | |||
1 | pragma Singleton | ||
2 | |||
3 | import QtQml | ||
4 | import Quickshell | ||
5 | import Quickshell.Services.Pipewire | ||
6 | |||
7 | Singleton { | ||
8 | id: root | ||
9 | |||
10 | PwObjectTracker { | ||
11 | objects: Pipewire.nodes.values | ||
12 | } | ||
13 | |||
14 | enum Item { | ||
15 | Microphone, | ||
16 | Screensharing | ||
17 | } | ||
18 | |||
19 | readonly property list<var> activeItems: { | ||
20 | var items = []; | ||
21 | if (microphoneActive) | ||
22 | items.push(Privacy.Item.Microphone); | ||
23 | if (screensharingActive) | ||
24 | items.push(Privacy.Item.Screensharing); | ||
25 | return items; | ||
26 | } | ||
27 | |||
28 | readonly property bool microphoneActive: { | ||
29 | if (!Pipewire.ready || !Pipewire.nodes?.values) { | ||
30 | return false | ||
31 | } | ||
32 | |||
33 | for (const node of Pipewire.nodes.values) { | ||
34 | if (!node || (node.type & PwNodeType.AudioInStream) != PwNodeType.AudioInStream) | ||
35 | continue; | ||
36 | |||
37 | if (node.properties?.["stream.monitor"] === "true") | ||
38 | continue; | ||
39 | |||
40 | if (node.audio?.muted) | ||
41 | continue; | ||
42 | |||
43 | return true; | ||
44 | } | ||
45 | |||
46 | return false; | ||
47 | } | ||
48 | |||
49 | readonly property bool screensharingActive: { | ||
50 | if (!Pipewire.ready || !Pipewire.nodes?.values) { | ||
51 | return false | ||
52 | } | ||
53 | |||
54 | for (const node of Pipewire.nodes.values) { | ||
55 | if (!node || (node.type & PwNodeType.VideoInStream) != PwNodeType.VideoInStream) | ||
56 | continue; | ||
57 | |||
58 | return true; | ||
59 | } | ||
60 | |||
61 | return false; | ||
62 | } | ||
63 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml index 55b1690e..6f70be29 100644 --- a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml +++ b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml | |||
@@ -47,7 +47,7 @@ Item { | |||
47 | return "" | 47 | return "" |
48 | } | 48 | } |
49 | 49 | ||
50 | width: 16 | 50 | width: icon.width + 6 |
51 | height: parent.height | 51 | height: parent.height |
52 | anchors.verticalCenter: parent.verticalCenter | 52 | anchors.verticalCenter: parent.verticalCenter |
53 | 53 | ||
@@ -83,14 +83,24 @@ Item { | |||
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | IconImage { | 86 | Rectangle { |
87 | anchors.centerIn: parent | 87 | anchors.fill: parent |
88 | width: parent.width | 88 | color: { |
89 | height: parent.width | 89 | if (trayItemArea.containsMouse) |
90 | source: trayItemWrapper.iconSource | 90 | return "#33808080"; |
91 | asynchronous: true | 91 | return "transparent"; |
92 | smooth: true | 92 | } |
93 | mipmap: true | 93 | |
94 | IconImage { | ||
95 | id: icon | ||
96 | |||
97 | anchors.centerIn: parent | ||
98 | implicitSize: 16 | ||
99 | source: trayItemWrapper.iconSource | ||
100 | asynchronous: true | ||
101 | smooth: true | ||
102 | mipmap: true | ||
103 | } | ||
94 | } | 104 | } |
95 | } | 105 | } |
96 | 106 | ||
@@ -116,7 +126,7 @@ Item { | |||
116 | color: "black" | 126 | color: "black" |
117 | 127 | ||
118 | implicitWidth: Math.max(tooltipTitle.contentWidth, tooltipDescription.contentWidth) + 16 | 128 | implicitWidth: Math.max(tooltipTitle.contentWidth, tooltipDescription.contentWidth) + 16 |
119 | implicitHeight: tooltipTitle.contentHeight + tooltipDescription.contentHeight + 16 | 129 | implicitHeight: (trayItem.tooltipTitle ? tooltipTitle.contentHeight : 0) + (trayItem.tooltipDescription ? tooltipDescription.contentHeight : 0) + 16 |
120 | 130 | ||
121 | WrapperMouseArea { | 131 | WrapperMouseArea { |
122 | id: tooltipMouseArea | 132 | id: tooltipMouseArea |
@@ -130,6 +140,8 @@ Item { | |||
130 | Text { | 140 | Text { |
131 | id: tooltipTitle | 141 | id: tooltipTitle |
132 | 142 | ||
143 | enabled: trayItem.tooltipTitle | ||
144 | |||
133 | font.pointSize: 10 | 145 | font.pointSize: 10 |
134 | font.family: "Fira Sans" | 146 | font.family: "Fira Sans" |
135 | font.bold: true | 147 | font.bold: true |
@@ -141,6 +153,8 @@ Item { | |||
141 | Text { | 153 | Text { |
142 | id: tooltipDescription | 154 | id: tooltipDescription |
143 | 155 | ||
156 | enabled: trayItem.tooltipDescription | ||
157 | |||
144 | font.pointSize: 10 | 158 | font.pointSize: 10 |
145 | font.family: "Fira Sans" | 159 | font.family: "Fira Sans" |
146 | color: "white" | 160 | color: "white" |
diff --git a/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml b/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml new file mode 100644 index 00000000..742ef4f5 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/UnixIPC.qml | |||
@@ -0,0 +1,59 @@ | |||
1 | import Quickshell | ||
2 | import Quickshell.Io | ||
3 | import Quickshell.Services.Pipewire | ||
4 | import qs.Services | ||
5 | |||
6 | Scope { | ||
7 | id: root | ||
8 | |||
9 | SocketServer { | ||
10 | active: true | ||
11 | path: `${Quickshell.env("XDG_RUNTIME_DIR")}/shell.sock` | ||
12 | handler: Socket { | ||
13 | parser: SplitParser { | ||
14 | onRead: line => { | ||
15 | try { | ||
16 | const command = JSON.parse(line); | ||
17 | |||
18 | if (command.Volume) | ||
19 | root.onCommandVolume(command.Volume); | ||
20 | else if (command.Brightness) | ||
21 | root.onCommandBrightness(command.Brightness); | ||
22 | else | ||
23 | console.warn("UnixIPC: Command not handled:", JSON.stringify(command)); | ||
24 | } catch (e) { | ||
25 | console.warn("UnixIPC: Failed to parse command:", line, e); | ||
26 | } | ||
27 | } | ||
28 | } | ||
29 | |||
30 | onError: e => { | ||
31 | if (e == 1) | ||
32 | return; | ||
33 | console.warn("QLocalSocket::LocalSocketError", e); | ||
34 | } | ||
35 | } | ||
36 | } | ||
37 | |||
38 | PwObjectTracker { | ||
39 | objects: [ Pipewire.defaultAudioSink, Pipewire.defaultAudioSource ] | ||
40 | } | ||
41 | function onCommandVolume(command) { | ||
42 | if (command.muted === "toggle") | ||
43 | Pipewire.defaultAudioSink.audio.muted = !Pipewire.defaultAudioSink.audio.muted; | ||
44 | if (command.volume === "up") | ||
45 | Pipewire.defaultAudioSink.audio.volume += 0.02; | ||
46 | if (command.volume === "down") | ||
47 | Pipewire.defaultAudioSink.audio.volume -= 0.02; | ||
48 | |||
49 | if (command["mic-muted"] === "toggle") | ||
50 | Pipewire.defaultAudioSource.audio.muted = !Pipewire.defaultAudioSource.audio.muted; | ||
51 | } | ||
52 | |||
53 | function onCommandBrightness(command) { | ||
54 | if (command === "up") | ||
55 | Brightness.currBrightness += 0.02 | ||
56 | if (command === "down") | ||
57 | Brightness.currBrightness -= 0.02 | ||
58 | } | ||
59 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml b/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml new file mode 100644 index 00000000..653f4763 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/VolumeOSD.qml | |||
@@ -0,0 +1,163 @@ | |||
1 | import QtQuick | ||
2 | import QtQuick.Layouts | ||
3 | import Quickshell | ||
4 | import Quickshell.Services.Pipewire | ||
5 | import Quickshell.Widgets | ||
6 | |||
7 | Scope { | ||
8 | id: root | ||
9 | |||
10 | property string show: "" | ||
11 | property bool inhibited: true | ||
12 | |||
13 | PwObjectTracker { | ||
14 | objects: [ Pipewire.defaultAudioSink, Pipewire.defaultAudioSource ] | ||
15 | } | ||
16 | |||
17 | Connections { | ||
18 | enabled: Pipewire.defaultAudioSink | ||
19 | target: Pipewire.defaultAudioSink?.audio | ||
20 | |||
21 | function onVolumeChanged() { | ||
22 | root.show = "sink"; | ||
23 | hideTimer.restart(); | ||
24 | } | ||
25 | function onMutedChanged() { | ||
26 | root.show = "sink"; | ||
27 | hideTimer.restart(); | ||
28 | } | ||
29 | } | ||
30 | |||
31 | Connections { | ||
32 | enabled: Pipewire.defaultAudioSource | ||
33 | target: Pipewire.defaultAudioSource?.audio | ||
34 | |||
35 | function onVolumeChanged() { | ||
36 | root.show = "source"; | ||
37 | hideTimer.restart(); | ||
38 | } | ||
39 | function onMutedChanged() { | ||
40 | root.show = "source"; | ||
41 | hideTimer.restart(); | ||
42 | } | ||
43 | } | ||
44 | |||
45 | onShowChanged: { | ||
46 | if (show) | ||
47 | hideTimer.restart(); | ||
48 | } | ||
49 | |||
50 | Timer { | ||
51 | id: hideTimer | ||
52 | interval: 1000 | ||
53 | onTriggered: root.show = "" | ||
54 | } | ||
55 | |||
56 | Timer { | ||
57 | id: startInhibit | ||
58 | interval: 100 | ||
59 | running: true | ||
60 | onTriggered: { | ||
61 | root.show = ""; | ||
62 | root.inhibited = false; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | LazyLoader { | ||
67 | active: root.show && !root.inhibited | ||
68 | |||
69 | Variants { | ||
70 | model: Quickshell.screens | ||
71 | |||
72 | delegate: Scope { | ||
73 | id: screenScope | ||
74 | |||
75 | required property var modelData | ||
76 | |||
77 | PanelWindow { | ||
78 | id: window | ||
79 | |||
80 | screen: screenScope.modelData | ||
81 | |||
82 | anchors.top: true | ||
83 | margins.top: screen.height / 2 - 50 + 3.5 | ||
84 | exclusiveZone: 0 | ||
85 | exclusionMode: ExclusionMode.Ignore | ||
86 | |||
87 | implicitWidth: 400 | ||
88 | implicitHeight: 50 | ||
89 | |||
90 | mask: Region {} | ||
91 | |||
92 | color: "transparent" | ||
93 | |||
94 | Rectangle { | ||
95 | anchors.fill: parent | ||
96 | color: Qt.rgba(0, 0, 0, 0.75) | ||
97 | } | ||
98 | |||
99 | RowLayout { | ||
100 | id: layout | ||
101 | |||
102 | anchors.centerIn: parent | ||
103 | |||
104 | height: 50 - 8*2 | ||
105 | width: 400 - 8*2 | ||
106 | |||
107 | MaterialDesignIcon { | ||
108 | id: volumeIcon | ||
109 | |||
110 | implicitWidth: parent.height | ||
111 | implicitHeight: parent.height | ||
112 | |||
113 | icon: { | ||
114 | if (root.show == "sink") { | ||
115 | if (!Pipewire.defaultAudioSink || Pipewire.defaultAudioSink.audio.muted) | ||
116 | return "volume-off"; | ||
117 | if (Pipewire.defaultAudioSink.audio.volume <= 0.33) | ||
118 | return "volume-low"; | ||
119 | if (Pipewire.defaultAudioSink.audio.volume <= 0.67) | ||
120 | return "volume-medium"; | ||
121 | return "volume-high"; | ||
122 | } else if (root.show == "source") { | ||
123 | if (!Pipewire.defaultAudioSource || Pipewire.defaultAudioSource.audio.muted) | ||
124 | return "microphone-off"; | ||
125 | if (Pipewire.defaultAudioSource.audio.volume > 1) | ||
126 | return "microphone-plus"; | ||
127 | return "microphone"; | ||
128 | } | ||
129 | return "volume-high"; | ||
130 | } | ||
131 | } | ||
132 | |||
133 | Rectangle { | ||
134 | Layout.fillWidth: true | ||
135 | |||
136 | implicitHeight: 10 | ||
137 | |||
138 | color: "#50ffffff" | ||
139 | |||
140 | Rectangle { | ||
141 | anchors { | ||
142 | left: parent.left | ||
143 | top: parent.top | ||
144 | bottom: parent.bottom | ||
145 | } | ||
146 | |||
147 | color: Pipewire.defaultAudioSink?.audio.muted ? "#70ffffff" : "white" | ||
148 | |||
149 | implicitWidth: { | ||
150 | if (root.show == "sink") | ||
151 | return parent.width * (Pipewire.defaultAudioSink?.audio.volume ?? 0); | ||
152 | else if (root.show == "source") | ||
153 | return parent.width * Math.min(1, (Pipewire.defaultAudioSource?.audio.volume ?? 0)); | ||
154 | return 0; | ||
155 | } | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | } | ||
162 | } | ||
163 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml b/accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml new file mode 100644 index 00000000..0633f350 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/WaylandInhibitorWidget.qml | |||
@@ -0,0 +1,55 @@ | |||
1 | import Quickshell | ||
2 | import QtQuick | ||
3 | import Quickshell.Widgets | ||
4 | import Quickshell.Wayland | ||
5 | import qs.Services | ||
6 | |||
7 | Item { | ||
8 | id: root | ||
9 | |||
10 | required property var window | ||
11 | |||
12 | width: icon.width + 8 | ||
13 | height: parent.height | ||
14 | anchors.verticalCenter: parent.verticalCenter | ||
15 | |||
16 | IdleInhibitor { | ||
17 | id: inhibitor | ||
18 | enabled: InhibitorState.waylandIdleInhibited | ||
19 | window: root.window | ||
20 | } | ||
21 | |||
22 | WrapperMouseArea { | ||
23 | id: widgetMouseArea | ||
24 | |||
25 | anchors.fill: parent | ||
26 | |||
27 | hoverEnabled: true | ||
28 | |||
29 | onClicked: InhibitorState.waylandIdleInhibited = !InhibitorState.waylandIdleInhibited | ||
30 | |||
31 | Rectangle { | ||
32 | anchors.fill: parent | ||
33 | color: { | ||
34 | if (widgetMouseArea.containsMouse) { | ||
35 | return "#33808080"; | ||
36 | } | ||
37 | return "transparent"; | ||
38 | } | ||
39 | |||
40 | Item { | ||
41 | anchors.fill: parent | ||
42 | |||
43 | MaterialDesignIcon { | ||
44 | id: icon | ||
45 | |||
46 | implicitSize: 14 | ||
47 | anchors.centerIn: parent | ||
48 | |||
49 | icon: inhibitor.enabled ? "eye" : "eye-off" | ||
50 | color: inhibitor.enabled ? "white" : "#555" | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml b/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml index c8c017c3..4cbebcc9 100644 --- a/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml +++ b/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml | |||
@@ -48,7 +48,7 @@ Row { | |||
48 | cursorShape: Qt.PointingHandCursor | 48 | cursorShape: Qt.PointingHandCursor |
49 | enabled: true | 49 | enabled: true |
50 | onClicked: { | 50 | onClicked: { |
51 | NiriService.sendCommand({ "Action": { "FocusWorkspace": { "reference": { "Id": workspaceData.id } } } }, _ => {}) | 51 | NiriService.sendCommand({ "Action": { "FocusWorkspace": { "reference": { "Id": workspaceData.id } } } }, _ => {}); |
52 | } | 52 | } |
53 | 53 | ||
54 | Rectangle { | 54 | Rectangle { |
diff --git a/accounts/gkleen@sif/shell/quickshell/displaymanager.qml b/accounts/gkleen@sif/shell/quickshell/displaymanager.qml new file mode 100644 index 00000000..b452c03d --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/displaymanager.qml | |||
@@ -0,0 +1,115 @@ | |||
1 | //@ pragma UseQApplication | ||
2 | |||
3 | import Quickshell | ||
4 | import Quickshell.Wayland | ||
5 | import Quickshell.Io | ||
6 | import Quickshell.Services.Greetd | ||
7 | import QtQml | ||
8 | |||
9 | |||
10 | ShellRoot { | ||
11 | id: displaymanager | ||
12 | |||
13 | settings.watchFiles: false | ||
14 | |||
15 | property string currentText: "" | ||
16 | property string username: @username@ | ||
17 | property list<string> command: @niri_session@ | ||
18 | property list<var> messages: [] | ||
19 | property bool responseRequired: false | ||
20 | property bool responseVisible: false | ||
21 | |||
22 | signal startAuth() | ||
23 | |||
24 | onStartAuth: { | ||
25 | if (Greetd.state !== GreetdState.Inactive) | ||
26 | Greetd.cancelSession(); | ||
27 | displaymanager.messages = []; | ||
28 | Greetd.createSession(displaymanager.username); | ||
29 | } | ||
30 | |||
31 | Connections { | ||
32 | target: Greetd | ||
33 | function onStateChanged() { | ||
34 | console.log("greetd state: ", GreetdState.toString(Greetd.state)); | ||
35 | if (Greetd.state === GreetdState.ReadyToLaunch) | ||
36 | Greetd.launch(displaymanager.command); | ||
37 | } | ||
38 | function onAuthMessage(message: string, error: bool, responseRequired: bool, echoResponse: bool) { | ||
39 | displaymanager.responseVisible = echoResponse; | ||
40 | displaymanager.responseRequired = responseRequired; | ||
41 | displaymanager.messages = Array.from(displaymanager.messages).concat([{ "text": message, "error": error }]); | ||
42 | } | ||
43 | function onAuthFailure(message: string) { | ||
44 | displaymanager.responseRequired = false; | ||
45 | displaymanager.messages = Array.from(displaymanager.messages).concat([{ "text": message, "error": true }]); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | Component.onCompleted: { | ||
50 | if (Greetd.state !== GreetdState.Inactive) | ||
51 | Greetd.cancelSession(); | ||
52 | } | ||
53 | |||
54 | Variants { | ||
55 | model: Quickshell.screens | ||
56 | |||
57 | delegate: Scope { | ||
58 | id: screenScope | ||
59 | |||
60 | required property var modelData | ||
61 | |||
62 | PanelWindow { | ||
63 | color: "black" | ||
64 | |||
65 | screen: screenScope.modelData | ||
66 | |||
67 | WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive | ||
68 | |||
69 | anchors.top: true | ||
70 | anchors.bottom: true | ||
71 | anchors.left: true | ||
72 | anchors.right: true | ||
73 | |||
74 | LockSurface { | ||
75 | id: surfaceContent | ||
76 | |||
77 | screen: screenScope.modelData | ||
78 | |||
79 | onCurrentTextChanged: displaymanager.currentText = currentText | ||
80 | Connections { | ||
81 | target: displaymanager | ||
82 | function onCurrentTextChanged() { surfaceContent.currentText = displaymanager.currentText; } | ||
83 | function onMessagesChanged() { surfaceContent.messages = Array.from(displaymanager.messages); } | ||
84 | function onResponseRequiredChanged() { surfaceContent.responseRequired = displaymanager.responseRequired; } | ||
85 | function onResponseVisibleChanged() { surfaceContent.responseVisible = displaymanager.responseVisible; } | ||
86 | } | ||
87 | |||
88 | onResponse: responseText => Greetd.respond(responseText); | ||
89 | Connections { | ||
90 | target: Greetd | ||
91 | function onStateChanged() { | ||
92 | if (Greetd.state === GreetdState.Authenticating) { | ||
93 | surfaceContent.authRunning = true; | ||
94 | } else { | ||
95 | surfaceContent.authRunning = false; | ||
96 | } | ||
97 | } | ||
98 | } | ||
99 | |||
100 | onAuthRunningChanged: { | ||
101 | if (surfaceContent.authRunning && Greetd.state !== GreetdState.Authenticating) | ||
102 | displaymanager.startAuth(); | ||
103 | } | ||
104 | Component.onCompleted: { | ||
105 | surfaceContent.authRunning = Greetd.state === GreetdState.Authenticating | ||
106 | surfaceContent.messages = Array.from(displaymanager.messages); | ||
107 | surfaceContent.responseVisible = displaymanager.responseVisible; | ||
108 | surfaceContent.responseRequired = displaymanager.responseRequired; | ||
109 | surfaceContent.currentText = displaymanager.currentText; | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | } | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/shell.qml b/accounts/gkleen@sif/shell/quickshell/shell.qml index 1da9457d..693d741f 100644 --- a/accounts/gkleen@sif/shell/quickshell/shell.qml +++ b/accounts/gkleen@sif/shell/quickshell/shell.qml | |||
@@ -41,4 +41,10 @@ ShellRoot { | |||
41 | } | 41 | } |
42 | 42 | ||
43 | Lockscreen {} | 43 | Lockscreen {} |
44 | NiriIdle {} | ||
45 | |||
46 | VolumeOSD {} | ||
47 | BrightnessOSD {} | ||
48 | |||
49 | UnixIPC {} | ||
44 | } | 50 | } |
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index 1539126c..e601b49c 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix | |||
@@ -205,11 +205,6 @@ in { | |||
205 | StartLimitBurst = 7; | 205 | StartLimitBurst = 7; |
206 | }; | 206 | }; |
207 | }; | 207 | }; |
208 | swayidle = { | ||
209 | Service = { | ||
210 | RuntimeDirectory = "swayidle"; | ||
211 | }; | ||
212 | }; | ||
213 | psi-notify = { | 208 | psi-notify = { |
214 | Install = { | 209 | Install = { |
215 | WantedBy = ["graphical-session.target"]; | 210 | WantedBy = ["graphical-session.target"]; |
@@ -351,8 +346,6 @@ in { | |||
351 | xembed-sni-proxy = { | 346 | xembed-sni-proxy = { |
352 | Unit = { | 347 | Unit = { |
353 | PartOf = lib.mkForce ["tray.target"]; | 348 | PartOf = lib.mkForce ["tray.target"]; |
354 | BindsTo = ["xwayland-satellite.service"]; | ||
355 | After = ["xwayland-satellite.service"]; | ||
356 | }; | 349 | }; |
357 | }; | 350 | }; |
358 | poweralertd = { | 351 | poweralertd = { |