From 478941e330bb229a733299122c0e4a321b82a565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 27 Jun 2021 13:05:29 +0100 Subject: [PATCH] allow normal user to restart i3 from the commandline --- nixos/i3/default.nix | 4 ++++ nixos/i3/grobi.nix | 18 +----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/nixos/i3/default.nix b/nixos/i3/default.nix index ff49a307..ee19e9fa 100644 --- a/nixos/i3/default.nix +++ b/nixos/i3/default.nix @@ -6,6 +6,10 @@ programs.dconf.enable = true; security.sudo.extraRules = [ + { + users = [ "cyryl" ]; + commands = [ { command = "${pkgs.i3}/bin/i3-msg"; options = [ "NOPASSWD" ]; } ]; + } { users = [ "cyryl" ]; commands = [ { command = "${pkgs.intel-gpu-tools}/bin/intel_gpu_top"; options = [ "NOPASSWD" ]; } ]; diff --git a/nixos/i3/grobi.nix b/nixos/i3/grobi.nix index 16c1bbb3..e4aa9e96 100644 --- a/nixos/i3/grobi.nix +++ b/nixos/i3/grobi.nix @@ -6,7 +6,7 @@ enable = true; executeAfter = [ "${pkgs.systemd}/bin/systemctl --user restart picom" - "${pkgs.systemd}/bin/systemctl --user restart kdeconnect-indicator kdeconnect network-manager-applet pasystray udiskie" + "${pkgs.i3}/bin/i3-msg restart" ]; rules = [ { @@ -36,22 +36,6 @@ "${pkgs.xorg.xrandr}/bin/xrandr --output eDP1 --primary" ]; } - { - name = "form3-docked"; - outputs_connected = [ "eDP-1-1" "DP-1-1" ]; - configure_single = "DP-1-1"; - execute_after = [ - "${pkgs.xorg.xrandr}/bin/xrandr --dpi 192" - ]; - } - { - name = "form3"; - outputs_connected = [ "eDP-1-1" ]; - configure_single = "eDP-1-1"; - execute_after = [ - "${pkgs.xorg.xrandr}/bin/xrandr --dpi 256" - ]; - } ]; }; }