!XQQVyIbcAcHFvzmcTl:nixos.org

NixOS GNOME

413 Members
A room for maintainers of GNOME & GNOME-Related desktop environments (xfce, cinnamon, pantheon...)91 Servers

Load older messages


SenderMessageTime
4 May 2023
@uep:matrix.orguep(which you can, of course, set declaratively via nix if you want)23:59:29
5 May 2023
@elvishjerricco:matrix.orgElvishJerriccowell, after some patching because the code isn't quite right, the list is too long and it doesn't scroll so it's useless anyway :P00:05:59
@elvishjerricco:matrix.orgElvishJerricco
diff --git a/systemdBoot.js b/systemdBoot.js
index 22c2054..9599b0f 100644
--- a/systemdBoot.js
+++ b/systemdBoot.js
@@ -49,7 +49,7 @@ async function getBootOptions() {
         Utils._log(`bootctl list: ${status}\n${stdout}\n${stderr}`);
         let lines = String(stdout).split('\n');
         let titleRx = /(?<=title:\s+).+/;
-        let idRx = /(?<=id:\s+).+/;
+	let idRx = /(?<=id:\s+)(?<!machine-id:\s+).+/;
         let defaultRx = /\(default\)/;
         let titles = [];
         let ids = []
@@ -99,7 +99,7 @@ async function getBootOptions() {
 async function setBootOption(id) {
     try {
         let [status, stdout, stderr] = await Utils.execCommand(
-            ['/usr/bin/pkexec', '/usr/sbin/bootctl', 'set-oneshot', id],
+            ['/run/wrappers/bin/pkexec', '/run/current-system/sw/bin/bootctl', 'set-oneshot', id],
         );
         if (status !== 0)
             throw new String(`Failed to set boot option to ${id}:\nExitCode: ${status}\nstdout: ${stdout}\nstderr: ${stderr}`);
@@ -109,4 +109,4 @@ async function setBootOption(id) {
         Utils._logWarning(e);
         return false;
     }
-}
\ No newline at end of file
+}
diff --git a/utils.js b/utils.js
index d39baec..7d44513 100644
--- a/utils.js
+++ b/utils.js
@@ -48,7 +48,7 @@ const BootLoaderClass = {
  * Returns the path of the bootctl binary or an empty string if not found
  */
 function getBootctlPath() {
-    let paths = ["/usr/sbin/bootctl", "/usr/bin/bootctl"];
+    let paths = ["/run/current-system/sw/bin/bootctl"];
 
     let file;
 
@@ -191,4 +191,4 @@ function _log(msg) {
 function _logWarning(msg) {
     if(DEBUG)
         log(`CustomReboot WARN: ${msg}`);
-}
\ No newline at end of file
+}

Here's the patches I used. If anyone knows how to make the menu scroll, maybe I'll use it :P

00:06:49
@elvishjerricco:matrix.orgElvishJerriccooh, guess I indented bad00:07:00
@jtojnar:matrix.orgJan Tojnar
In reply to @elvishjerricco:matrix.org
well, after some patching because the code isn't quite right, the list is too long and it doesn't scroll so it's useless anyway :P

It looks like the only scrollable element is PopupSubMenu, if you do not want to muck with the actor tree too much:

--- a/extension.js
+++ b/extension.js
@@ -47,7 +47,9 @@ class RebootQuickMenu extends QuickSettings.QuickMenuToggle {
         // Set Menu Header
         this.menu.setHeader('system-reboot-symbolic', 'Boot Options',
             'Reboot into the selected entry');
-        
+
+        this.menu.actor.style = `max-height: 500px;`;
+
         // Add boot options to menu
         this.createBootMenu();
     }
@@ -62,10 +64,10 @@ class RebootQuickMenu extends QuickSettings.QuickMenuToggle {
         // Get boot options
         const bootloader = Utils.getCurrentBootloader().getBootOptions().then(([bootOps, defaultOpt]) => {
             if (bootOps !== undefined) {
-                this._itemsSection = new PopupMenu.PopupMenuSection();
+                this._itemsSection = new PopupMenu.PopupSubMenuMenuItem('Reboot into…');
                 let x = 0;
                 bootOps.forEach((title, id) => {
-                    this._itemsSection.addAction(String(title), () => {
+                    this._itemsSection.menu.addAction(String(title), () => {
                         // Get bootloader and set reboot option
                         Utils.getCurrentBootloader().setBootOption(String(id)).then(result => {
                             if (result) {
13:29:23
@jtojnar:matrix.orgJan Tojnaralso relevant https://gjs.guide/extensions/upgrading/gnome-shell-44.html13:30:04
6 May 2023
@vector1dev:vector1.dev@vector1dev:vector1.dev joined the room.10:17:01
@vector1dev:vector1.dev@vector1dev:vector1.devHello! Is it possible to somehow configure monitors through home-manager?10:18:00
@jtojnar:matrix.orgJan Tojnar vector1dev: you can use home.file.".config/monitors.xml" 16:14:13
7 May 2023
@dre:imad.nyc@dre:imad.nyc Hey, does anyone know how to edit portions of your config depending on the dark mode? I know that the dconf for it is /org/gnome/desktop/interface/color-scheme, but I want to be able to do things depending on if its "prefer-dark" or "default". Specifically, change the programs.helix.theme = "theme1"; between two values depending on dark mode or not. 05:46:13
@uep:matrix.orguepDo you mean in nix (at derivation / build time) or at runtime so it adapts if the user toggles dark mode?06:05:35
@uep:matrix.orguepThe latter: no idea06:05:52
@dre:imad.nyc@dre:imad.nycYea, the latter06:06:34
@uep:matrix.orguepyou might need a small extension or a program to watch dbus things and send relevant changes06:06:37
@dre:imad.nyc@dre:imad.nycYea, I saw a blog post about a systemd service that checks if the value changes, and it would change the config file, but nix doesn't let you just edit the .config file, and I'm not sure how to have a conditional that checks the dconf value06:07:51
@dre:imad.nyc@dre:imad.nycA workaround that could be done is make a shell script that has 2 different config files only with the theme line changed, and the shell script itself checks if GNOME is in a dark mode or not, but this seems messy and I would rather try and do it within my nix configuration06:10:51
@uep:matrix.orguepNothing in nix is likely to do it, but whatever you end up with that does do it (even such a shell script) can of course be wrapped up into your nix config06:12:03
@uep:matrix.orguep * Nothing in nix is likely to do it, but whatever you end up with that does do it (even such a shell script) can of course be wrapped up into your nix config to be installed and hooked into the right places (as a systemd service or gnome extension or whatever it ends up needing)06:12:49
@dre:imad.nyc@dre:imad.nyc
In reply to@uep:matrix.org
Nothing in nix is likely to do it, but whatever you end up with that does do it (even such a shell script) can of course be wrapped up into your nix config
I'll try and do this, but I had another thought. Is it possible to have nix create 2 separate derivations, say in this case light and dark, and have, for example, shell script, that would check the dconf value and switch between those? So if I called the program it would call different packages in the nix store depending on if it's dark mode or not? I'm not sure if this would be trivial to do within home manager.
06:15:45
@uep:matrix.orguepThere's not a great benefit in adding that overhead, vs something that runs and makes the relevant settings based on the current value. It's just more framework and stuff to change as a way of pushing the same settings.06:17:25
@uep:matrix.orguepIf this is only about helix, rather than a more general issue, you could ask for an enhancement there, or write a wrapper that checks on startup06:19:15
@uep:matrix.orguep(I don't know if you have long-running instances or start it frequently)06:19:58
@dre:imad.nyc@dre:imad.nyc
In reply to@uep:matrix.org
If this is only about helix, rather than a more general issue, you could ask for an enhancement there, or write a wrapper that checks on startup
I think this is more of a nix & gnome issue, since the solution for it exists outside of nix via just editing the file in ~/.confg. You're right about the overhead, and I know that putting in the shell script (or whatever) in my configuration itself is the same as making 2 derivations it feels more imperative than creating the 2 declarations. I'm not sure I can explain why though. I guess I'll look into it more but won't put too much effort.
06:21:22
@dre:imad.nyc@dre:imad.nyc
In reply to@uep:matrix.org
If this is only about helix, rather than a more general issue, you could ask for an enhancement there, or write a wrapper that checks on startup
* I think this is more of a nix & gnome issue, since the solution for it exists outside of nix via just editing the file in ~/.config. You're right about the overhead, and I know that putting in the shell script (or whatever) in my configuration itself is the same as making 2 derivations it feels more imperative than creating the 2 declarations. I'm not sure I can explain why though. I guess I'll look into it more but won't put too much effort.
06:21:32
@dre:imad.nyc@dre:imad.nyc * I think this is more of a nix & gnome issue, since the solution for it exists outside of nix via just editing the file in ~/.config. You're right about the overhead, and I know that putting in the shell script (or whatever) in my configuration itself is the same as making 2 derivations it feels more imperative than creating the 2 derivations. I'm not sure I can explain why though. I guess I'll look into it more but won't put too much effort. 06:22:22
@dre:imad.nyc@dre:imad.nyc * I think this is more of a nix & gnome issue, since the solution for it exists outside of nix via just editing the file in ~/.config. You're right about the overhead, and I know that putting in the shell script (or whatever) in my configuration itself is the same as making 2 derivations but it feels more imperative than creating the 2 derivations. I'm not sure I can explain why though. I guess I'll look into it more but won't put too much effort. 06:23:17
@uep:matrix.orguepGetting nix involved at the time of switching seems way to heavy-weight, there's otherwise no reason it would be invoked. It can deploy both sets of configs, however you package them, in advance - but the thing that gets invoked by toggling dark mode should be much smaller, and just send a few dbus config changes, or swap config files / a symlink06:25:10
@uep:matrix.orguepI think you want to change something in a helic config file, right?06:26:03
@uep:matrix.orguep * I think you want to change something in a helix config file, right?06:26:12
@dre:imad.nyc@dre:imad.nyc
In reply to@uep:matrix.org
I think you want to change something in a helic config file, right?
Yes, and right now it's controlled by home-manager
06:27:15

Show newer messages


Back to Room ListRoom Version: 6