fixes 4 NORTH + yazi openers1

This commit is contained in:
nx2
2024-04-09 10:58:24 +02:00
parent b79ec3015a
commit cb121e283c
5 changed files with 232 additions and 66 deletions

View File

@@ -42,13 +42,13 @@
inecure-packages = [
"electron-25.9.0"
];
];
};
secrets = import ./secrets/passwords-and-certificates.nix;
rice = {
transparency = "0.9";
transparency = "0.8";
colors = rec {
main-fg = "#ffffff";
main-bg = "#000000";
@@ -56,7 +56,7 @@
bubble-bg = "#222222";
bubble-border = "#bbbbbb";
secondary-fg = main-fg;
secondary-bg = "#222255";
secondary-bg = "#111133";
lines = "#bbbbbb";
accent = "#ff00ff";
};
@@ -91,10 +91,15 @@
};
homeConfigurations = {
nx2 = home-manager.lib.homeManagerConfiguration {
NxXPS = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = { inherit system user allowed secrets pkgs-unstable rice nvidia; };
extraSpecialArgs = let host = "NxXPS"; in { inherit system user host allowed secrets pkgs-unstable rice nvidia; };
};
NxNORTH = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = let host = "NxNORTH"; in { inherit system user host allowed secrets pkgs-unstable rice nvidia; };
};
};

View File

@@ -1,20 +1,44 @@
{ config, pkgs, pkgs-unstable, rice, lib, ... }:
{ config, pkgs, pkgs-unstable, host, nvidia, rice, lib, ... }:
let
animation-speed = "2";
transparency = rice.transparency;
gap-size = 10;
gap-size = 20;
rounding = 10;
border-width = 2;
monitors = {
main = {
name = "eDP-1";
resolution = "1920x1200";
position = "0x0";
scale = "1.0";
xps = {
main = {
name = "eDP-1";
resolution = "1920x1200";
position = "0x0";
scale = "1.0";
};
second = {
name = "DP-1";
resolution = "1920x1080";
position = "1920x0";
scale = "1.0";
};
};
second = {
name = "DP-1";
resolution = "1920x1080";
position = "1920x0";
scale = "1.0";
north = {
main = {
name = "DP-4";
resolution = "2560x1440";
position = "1920x0";
scale = "1.0";
};
left = {
name = "HDME-A-3";
resolution = "1920x1080";
position = "0x180";
scale = "1.0";
};
right = {
name = "HDMI-A-3";
resolution = "1920x1080";
position = "4480x80";
scale = "1.0";
};
};
};
in
@@ -73,50 +97,74 @@ in
settings = {
# source = /home/nx2/.config/hypr/hyprland-nosync.conf;
monitor = [
"${monitors.main.name}, ${monitors.main.resolution}, ${monitors.main.position}, ${monitors.main.scale}"
];
monitor =
if host == "NxXPS" then [
"${monitors.xps.main.name}, ${monitors.xps.main.resolution}, ${monitors.xps.main.position}, ${monitors.xps.main.scale}"
"${monitors.xps.second.name}, ${monitors.xps.second.resolution}, ${monitors.xps.second.position}, ${monitors.xps.second.scale}"
] else [
"${monitors.north.main.name}, ${monitors.north.main.resolution}, ${monitors.north.main.position}, ${monitors.north.main.scale}"
"${monitors.north.left.name}, ${monitors.north.left.resolution}, ${monitors.north.left.position}, ${monitors.north.left.scale}"
"${monitors.north.right.name}, ${monitors.north.right.resolution}, ${monitors.north.right.position}, ${monitors.north.right.scale}"
];
workspace = [
"${monitors.main.name}, 11"
"${monitors.main.name}, 12"
"${monitors.main.name}, 13"
"${monitors.main.name}, 14"
"${monitors.main.name}, 15"
"${monitors.main.name}, 16"
"${monitors.main.name}, 17"
"${monitors.main.name}, 18"
"${monitors.main.name}, 19"
"${monitors.main.name}, 10,gapsin:0,gapsout:0"
"${monitors.main.name}, 100"
"${monitors.second.name}, 21,gapsin:0,gapsout:0"
"${monitors.second.name}, 21"
"${monitors.second.name}, 22"
"${monitors.second.name}, 23"
"${monitors.second.name}, 24"
"${monitors.second.name}, 25"
"${monitors.second.name}, 26"
"${monitors.second.name}, 27"
"${monitors.second.name}, 28"
"${monitors.second.name}, 29"
"${monitors.second.name}, 20"
];
workspace =
let
d1 = if host == "NxXPS" then monitors.xps.main.name else monitors.north.main.name;
d3 = if host == "NxXPS" then monitors.xps.second.name else monitors.north.left.name;
d2 = if host == "NxXPS" then monitors.xps.main.name else monitors.north.right.name;
compact = ",gapsin:0,gapsout:0,rounding:0,bordersize:0";
in
[
"${d1}, 11"
"${d1}, 12"
"${d1}, 13"
"${d1}, 14"
"${d1}, 15"
"${d1}, 16"
"${d1}, 17"
"${d1}, 18"
"${d1}, 19"
"${d1}, 10${compact}"
"${d1}, 100${compact}"
"${d2}, 21${compact}"
"${d2}, 22"
"${d2}, 23"
"${d2}, 24"
"${d2}, 25"
"${d2}, 26"
"${d2}, 27"
"${d2}, 28"
"${d2}, 29"
"${d2}, 20"
"${d3}, 31"
"${d3}, 32"
"${d3}, 33"
"${d3}, 34"
"${d3}, 35"
"${d3}, 36"
"${d3}, 37"
"${d3}, 38"
"${d3}, 39"
"${d3}, 30"
];
"device:logitech-wireless-mouse-mx-master-1" = {
sensitivity = -0.2;
};
# env = XCURSOR_SIZE,18
# env = GTK_IM_MODULE,ibus
# env = QT_IM_MODULE,ibus
# env = XMODIFIERS,@im=ibus
env = if nvidia.enable == true then [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
] else [];
input = {
sensitivity = 0.1;
kb_layout = "de";
follow_mouse = "2";
follow_mouse = "1";
touchpad = {
natural_scroll = true;
scroll_factor = "0.9";
@@ -126,7 +174,7 @@ in
general = {
gaps_in = builtins.div gap-size 2;
gaps_out = gap-size;
border_size = "1";
border_size = border-width;
"col.active_border" = "rgba(888888ff)";
"col.inactive_border" = "rgba(000000ff)";
@@ -136,9 +184,7 @@ in
};
decoration = {
rounding = "0";
rounding = rounding;
drop_shadow = false;
shadow_range = "20";
shadow_offset = "0 0";
@@ -162,7 +208,6 @@ in
};
};
animations = {
enabled = true;
# bezier = "myBezier, 0.01, 0.9, 0.1, 1.0"; #o
@@ -379,12 +424,13 @@ in
# "SUPER, <,"
"SUPER, Y, execr, waybar_mode set '󰹑 '"
"SUPER, Y, submap, scrR"
"SUPER, X, exec, pkill wlogout || wlogout --protocol layer-shell -b 5 -T 450 -B 450"
"SUPER, C, exec, /home/nx2/scripts/quickconfig/quickconfig.sh "
"SUPER, X, exec, pkill wlogout || wlogout --protocol layer-shell -b 3"
# "SUPER, C, exec, /home/nx2/scripts/quickconfig/quickconfig.sh "
"SUPER, C, exec, codium,"
"SUPER, V, togglefloating, "
"SUPER, B, exec, bitwarden-desktop"
"SUPER, N, togglesplit"
"SUPER, M, exec, /home/nx2/scripts/meme-full-screen/meme-full-screen.sh "
# "SUPER, M, exec, /home/nx2/scripts/meme-full-screen/meme-full-screen.sh "
# "SUPER, comma, exec, /home/nx2/scripts/change-language.sh"
"SUPER, ., exec, echo key x:Prior | dotool"
"SUPER, -, exec, echo key x:Next | dotool"
@@ -442,9 +488,14 @@ in
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
bindl = [
# ",switch:on:Lid Switch, exec, hyprlock &"
];
};
# .d8888. db db d8888b. 88b d88 d8b d88888b. .d8888.
# 88' YP 88 88 88 '8D 88YbdP88 dP'Yb 88' '8b 88' YP
# '8bo. 88 88 88oooY' 88 YP 88 d8. .8b 88. .8P '8bo.
@@ -736,11 +787,14 @@ in
'';
};
home.file = {
".config/hypr/hyprlock.conf".text = ''
home.file =
let
m = if host == "NxXPS" then monitors.xps.main.name else monitors.north.main.name;
in
{
".config/hypr/hyprlock.conf".text = ''
background {
monitor = ${monitors.main.name}
monitor = ${m}
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
path = /home/nx2/Pictures/nix-wall.png
@@ -808,7 +862,7 @@ in
valign = bottom
}
'';
};
};
}

View File

@@ -28,7 +28,7 @@
{ exec = ''sudo nano "$@"''; desc = "sudo nano"; block = true;}
];
play = [
{ exec = ''mpv "$@"''; }
{ exec = ''mpv "$@"''; }
{ exec = ''mediainfo "$1"; echo "Press enter to exit"; read''; block = true; desc = "Show mediainfo";}
];
archive = [
@@ -37,6 +37,7 @@
image = [
{ exec = ''imv "$@"''; desc = "imv";}
{ exec = ''gimp "$@"''; desc = "gimp";}
{ exec = ''swww img "$@"''; desc = "swww wallpaper";}
];
font = [
{ exec = ''fontpreview "$@"''; desc = "fontpreview"; }
@@ -46,6 +47,10 @@
{ exec = ''firefox "$@"''; desc = "firefox"; }
];
};
open.rules = [
{ mime = "text/*"; use = "edit"; }
{ mime = "image/*"; use = "image"; }
];
};
};
}

98
home-modules/wlogout.nix Normal file
View File

@@ -0,0 +1,98 @@
{ config, pkgs, rice,... }:
{
home.packages = with pkgs; [
wlogout
];
home.file.".config/wlogout/style.css".text = ''
* { all: unset; }
window {
font-family: ${rice.font.code.name}, monospace;
font-size: 12pt;
color: ${rice.colors.main-fg};
background-color: rgba(0, 0, 0, ${rice.transparency});
}
button {
transition: box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
text-shadow: none;
border: none;
color: ${rice.colors.main-fg};
background-color: ${rice.colors.secondary-bg};
margin: 5px;
}
button:hover {
color: ${rice.colors.accent} ;
}
button:focus {
color: ${rice.colors.accent} ;
}
'';
home.file.".config/wlogout/layout".text = ''
{
"label": "lock",
"action": "hyprlock",
"text": "[L]ock",
"height": 0,
"width": 0,
"keybind": "l"
}
{
"label": "reboot",
"action": "systemctl reboot",
"text": "[R]eboot",
"height": 0,
"width": 0,
"keybind": "r"
}
{
"label": "shutdown",
"action": "systemctl poweroff",
"text": "[S]hutdown",
"height": 0,
"width": 0,
"keybind": "s"
}
{
"label": "logout",
"action": "hyprctl dispatch exit 0",
"text": "Lo[g]out",
"height": 0,
"width": 0,
"keybind": "g"
}
{
"label": "suspend",
"action": "systemctl suspend",
"text": "S[u]spend",
"height": 0,
"width": 0,
"keybind": "u"
}
{
"label": "hibernate",
"action": "systemctl hibernate",
"text": "[H]ibernate",
"height": 0,
"width": 0,
"keybind": "h"
}
'';
# lock { background-image: image(url("./lock.png")); }
# lock:focus { background-image: image(url("./lock-hover.png")); }
# logout { background-image: image(url("./logout.png")); }
# logout:focus { background-image: image(url("./logout-hover.png")); }
# suspend { background-image: image(url("./suspend.png")); }
# suspend:focus { background-image: image(url("./suspend-hover.png")); }
# shutdown { background-image: image(url("./power.png")); }
# shutdown:focus { background-image: image(url("./power-hover.png")); }
# reboot { background-image: image(url("./restart.png")); }
# reboot:focus { background-image: image(url("./restart-hover.png")); }
# hibernate { background-image: image(url("./hibernate.png")); }
# hibernate:hover { background-image: image(url("./hibernate-hover.png"));}
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, user, allowed, secrets, ... }:
{ config, pkgs, lib, system, host, user, allowed, secrets, ... }:
{
imports = [
./home-modules/vscode.nix
@@ -14,6 +14,7 @@
./home-modules/hyprland/hyprland.nix
./home-modules/hyprland/hyprland-autoname-workspaces.nix
./home-modules/hyprland/waybar.nix
./home-modules/wlogout.nix
./home-modules/kitty.nix
./home-modules/shell/fish.nix
@@ -49,7 +50,7 @@
spotify spicetify-cli
obs-studio bitwarden
waybar swww rofi wlogout
waybar swww rofi
imv mpv mediainfo exiftool ffmpeg
pavucontrol fontpreview gtk2fontsel
@@ -90,6 +91,9 @@
"x-scheme-handler/about" = [ "firefox.desktop" ];
"x-scheme-handler/unknown" = [ "firefox.desktop" ];
"image/png" = "imv.desktop";
"image/jpg" = "imv.desktop";
"image/jpeg" = "imv.desktop";
"image/webp" = "imv.desktop";
"image/gif" = "imv.desktop";
};
};