NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.19k stars 14.2k forks source link

Opensnitch starts maximized in Hyprland #354990

Closed guttermonk closed 1 week ago

guttermonk commented 1 week ago

Opensnitch starts maximized in Hyprland on startup even with the --background flag set. My Hyprland config file has the following:

exec-once = [
  "QT_STYLE_OVERRIDE=kvantum opensnitch-ui --background"
];

If I kill opensnitch and reopen it in the CLI using the above command, it starts minimized (as expected) with the following output in terminal:

     ~ OpenSnitch GUI - 1.6.5.1 ~
    protobuf: 4.24.4 - grpc: 1.62.2
--------------------------------------------------

gRPC Max Message Length: 8MiB
                  Bytes: 8388608
is new file, or IN MEMORY, setting initial schema version
setting schema version to: 3
setting schema version to: 3
Setting journal_mode:  OFF
Setting DB memory optimizations
schema version: 3
db schema is up to date
Loading translations: /nix/store/xbqhchpqcr7lvhc6z0a0jpfhzkshwq3d-opensnitch-ui-1.6.5.1/lib/python3.11/site-packages/opensnitch/utils/../i18n locale: en_US
using IPASN DB: /nix/store/znpyq3gj64pn9hsjq57p2ksbm31cmypb-python3.11-pyasn-1.6.2/lib/python3.11/site-packages/pyasn/data/ipasn_20140513_v12.dat.gz
Using server address: unix:///tmp/osui.sock auth type: simple

Other things I've tried - I tried adding sleep 30; before QT_STYLE_OVERRIDE=kvantum opensnitch-ui --background and then added the following to my hyprland config and tried rebooting again:

exec-once = [
        "sudo systemctl enable --now opensnitch"
        "sudo systemctl start opensnitch"
];

Also tried changing that to opensnitchd as suggested in the wiki.

Notify maintainers

@onny @stuebinm

Metadata


Add a :+1: reaction to issues you find important.

guttermonk commented 1 week ago

The solution is to set services.opensnitch.enable = true; in configuration.nix, which will launch the program on it's own during startup. There's no need to include it in the hyprland config.

My issue was that I had the service enabled and, apparently, launching opensnitch-ui from the hyprland config causes it to open maximized.