commit ae8db382b0e6b17c66c9dfd1d54b519b768aecbb
parent 2bb53581eba5e49d8117732e56407d02692ea95f
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 4 Dec 2020 17:29:31 +0100
users/vincent: enable autorandr
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
3 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/systems/modules/profiles/i3.nix b/systems/modules/profiles/i3.nix
@@ -18,6 +18,7 @@ in
};
services = {
blueman.enable = true;
+ autorandr.enable = true;
xserver = {
enable = true;
displayManager = {
diff --git a/users/vincent/desktop/autorandr.nix b/users/vincent/desktop/autorandr.nix
@@ -0,0 +1,33 @@
+{ config, lib, pkgs, ... }:
+let
+ lg_ultrawide_curved = "00ffffffffffff001e6de25a0cd105000a1b0104a55022789eca95a6554ea1260f50542108007140818081c0a9c0b300d1c081000101e77c70a0d0a0295030203a00204f3100001a9d6770a0d0a0225030203a00204f3100001a000000fd00383d1e5a20000a202020202020000000fc004c4720554c545241574944450a017f020316712309060749100403011f13595a12830100009f3d70a0d0a0155030203a00204f3100001a7e4800e0a0381f4040403a00204f31000018011d007251d01e206e285500204f3100001e8c0ad08a20e02d10103e9600204f31000018000000000000000000000000000000000000000000000000000000000000000000aa";
+ thinkpadt480s = "00ffffffffffff000daec91400000000081a0104951f11780228659759548e271e505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843412d4541420a20000000fe00434d4e0a202020202020202020000000fe004e3134304843412d4541420a20003e";
+in
+{
+ programs.autorandr = {
+ enable = true;
+ hooks.postswitch."notify-i3" = "${config.xsession.windowManager.i3.package}/bin/i3-msg restart";
+ hooks.postswitch."reset-background" = "systemctl --user start random-background.service";
+ profiles = {
+ home = {
+ fingerprint = {
+ eDP-1 = thinkpadt480s;
+ DP-1-2 = lg_ultrawide_curved;
+ };
+ config = {
+ eDP-1 = {
+ enable = true;
+ position = "651x1440";
+ mode = "1920x1080";
+ };
+ DP-1-2 = {
+ enable = true;
+ primary = true;
+ mode = "3440x1440";
+ position = "0x0";
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/users/vincent/desktop/i3.nix b/users/vincent/desktop/i3.nix
@@ -18,6 +18,7 @@ let
in
{
imports = [
+ ./autorandr.nix
./dconf.nix
./xsession.nix
];
@@ -333,12 +334,6 @@ in
#assign [class="Firefox" window_role="browser"] → $WS1
#assign [class="Google-chrome" window_role="browser"] → $WS1
- ## quick terminal (tmux)
- exec --no-startup-id alacritty --title metask --class metask --command tmux
- for_window [instance="metask"] floating enable;
- for_window [instance="metask"] move scratchpad; [instance="metask"] scratchpad show; move position center; move scratchpad
- bindcode $mod+49 [instance="metask"] scratchpad show
-
for_window [title="capture"] floating enable;
bindsym XF86MonBrightnessUp exec "xbacklight -inc 10"
@@ -414,6 +409,21 @@ in
}
bindsym $mod+o mode "resize"
+ ## quick terminal (tmux)
+ exec --no-startup-id alacritty --title metask --class metask --command tmux
+ for_window [instance="metask"] floating enable;
+ for_window [instance="metask"] move scratchpad; [instance="metask"] scratchpad show; move position center; move scratchpad
+ bindcode $mod+49 [instance="metask"] scratchpad show
+
+ ## scratchpad
+ set $scratchpad "scratchpad: [$]terminal [p]avucontrol"
+ mode $scratchpad {
+ bindcode 49 [instance="metask"] scratchpad show; mode "default"
+ bindcode 33 [class="(?i)pavucontrol"] scratchpad show; mode "default"
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+ }
+ # bindcode $mod+49 mode $scratchpad
# System menu
set $sysmenu "system: [s]uspend [l]ock [r]estart [b]lank-screen [p]oweroff reload-[c]onf e[x]it"
bindsym $mod+q mode $sysmenu