update laptop configuration

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-07-16 20:14:43 +02:00
parent 72e4be86eb
commit 59ae3d5f9d
50 changed files with 479 additions and 1009 deletions

View File

@@ -1,6 +1,5 @@
# Clipman allows you to save and retrieve clipboard history.
{ pkgs, ... }:
let
{pkgs, ...}: let
clipboard-clear = pkgs.writeShellScriptBin "clipboard-clear" ''
clipman clear --all
'';
@@ -8,10 +7,8 @@ let
clipboard = pkgs.writeShellScriptBin "clipboard" ''
clipman pick --tool=wofi
'';
in {
wayland.windowManager.hyprland.settings.exec-once =
[ "${clipboard-clear}" "wl-paste -t text --watch clipman store" ];
home.packages = with pkgs; [ clipman clipboard clipboard-clear ];
wayland.windowManager.hyprland.settings.exec-once = ["${clipboard-clear}" "wl-paste -t text --watch clipman store"];
home.packages = with pkgs; [clipman clipboard clipboard-clear];
services.clipman.enable = true;
}

View File

@@ -1,9 +1,12 @@
# Hypridle is a daemon that listens for user activity and runs commands when the user is idle.
{ pkgs, lib, ... }: {
{
pkgs,
lib,
...
}: {
services.hypridle = {
enable = true;
settings = {
general = {
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";

View File

@@ -1,19 +1,18 @@
{ config, ... }:
let
{config, ...}: let
animationSpeed = config.theme.animation-speed;
animationDuration = if animationSpeed == "slow" then
"4"
else if animationSpeed == "medium" then
"2.5"
else
"1.5";
borderDuration = if animationSpeed == "slow" then
"10"
else if animationSpeed == "medium" then
"6"
else
"3";
animationDuration =
if animationSpeed == "slow"
then "4"
else if animationSpeed == "medium"
then "2.5"
else "1.5";
borderDuration =
if animationSpeed == "slow"
then "10"
else if animationSpeed == "medium"
then "6"
else "3";
in {
wayland.windowManager.hyprland.settings = {
animations = {

View File

@@ -1,45 +1,48 @@
{ pkgs, ... }: {
{pkgs, ...}: {
wayland.windowManager.hyprland.settings = {
bind = [
"$mod,RETURN, exec, uwsm app -- ${pkgs.kitty}/bin/kitty" # Kitty
"$mod,E, exec, uwsm app -- ${pkgs.xfce.thunar}/bin/thunar" # Thunar
"$mod,B, exec, uwsm app -- zen-beta" # Zen Browser
"$mod,K, exec, uwsm app -- ${pkgs.bitwarden}/bin/bitwarden" # Bitwarden
"$mod,L, exec, uwsm app -- ${pkgs.hyprlock}/bin/hyprlock" # Lock
"$mod,X, exec, powermenu" # Powermenu
"$mod,SPACE, exec, menu" # Launcher
"$mod,C, exec, quickmenu" # Quickmenu
"$shiftMod,SPACE, exec, hyprfocus-toggle" # Toggle HyprFocus
# "$mod,P, exec, uwsm app -- ${pkgs.planify}/bin/io.github.alainm23.planify" # Planify
bind =
[
"$mod,RETURN, exec, uwsm app -- ${pkgs.kitty}/bin/kitty" # Kitty
"$mod,E, exec, uwsm app -- ${pkgs.xfce.thunar}/bin/thunar" # Thunar
"$mod,B, exec, uwsm app -- zen-beta" # Zen Browser
"$mod,K, exec, uwsm app -- ${pkgs.bitwarden}/bin/bitwarden" # Bitwarden
"$mod,L, exec, uwsm app -- ${pkgs.hyprlock}/bin/hyprlock" # Lock
"$mod,X, exec, powermenu" # Powermenu
"$mod,SPACE, exec, menu" # Launcher
"$mod,C, exec, quickmenu" # Quickmenu
"$shiftMod,SPACE, exec, hyprfocus-toggle" # Toggle HyprFocus
# "$mod,P, exec, uwsm app -- ${pkgs.planify}/bin/io.github.alainm23.planify" # Planify
"$mod,Q, killactive," # Close window
"$mod,T, togglefloating," # Toggle Floating
"$mod,F, fullscreen" # Toggle Fullscreen
"$mod,left, movefocus, l" # Move focus left
"$mod,right, movefocus, r" # Move focus Right
"$mod,up, movefocus, u" # Move focus Up
"$mod,down, movefocus, d" # Move focus Down
"$shiftMod,up, focusmonitor, -1" # Focus previous monitor
"$shiftMod,down, focusmonitor, 1" # Focus next monitor
"$shiftMod,left, layoutmsg, addmaster" # Add to master
"$shiftMod,right, layoutmsg, removemaster" # Remove from master
"$mod,Q, killactive," # Close window
"$mod,T, togglefloating," # Toggle Floating
"$mod,F, fullscreen" # Toggle Fullscreen
"$mod,left, movefocus, l" # Move focus left
"$mod,right, movefocus, r" # Move focus Right
"$mod,up, movefocus, u" # Move focus Up
"$mod,down, movefocus, d" # Move focus Down
"$shiftMod,up, focusmonitor, -1" # Focus previous monitor
"$shiftMod,down, focusmonitor, 1" # Focus next monitor
"$shiftMod,left, layoutmsg, addmaster" # Add to master
"$shiftMod,right, layoutmsg, removemaster" # Remove from master
"$mod,PRINT, exec, screenshot region" # Screenshot region
",PRINT, exec, screenshot monitor" # Screenshot monitor
"$shiftMod,PRINT, exec, screenshot window" # Screenshot window
"ALT,PRINT, exec, screenshot region swappy" # Screenshot region then edit
"$mod,PRINT, exec, screenshot region" # Screenshot region
",PRINT, exec, screenshot monitor" # Screenshot monitor
"$shiftMod,PRINT, exec, screenshot window" # Screenshot window
"ALT,PRINT, exec, screenshot region swappy" # Screenshot region then edit
"$shiftMod,T, exec, hyprpanel-toggle" # Toggle hyprpanel
"$shiftMod,C, exec, clipboard" # Clipboard picker with wofi
"$shiftMod,E, exec, ${pkgs.wofi-emoji}/bin/wofi-emoji" # Emoji picker with wofi
"$mod,F2, exec, night-shift" # Toggle night shift
"$mod,F3, exec, night-shift" # Toggle night shift
] ++ (builtins.concatLists (builtins.genList (i:
let ws = i + 1;
in [
"$mod,code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT,code:1${toString i}, movetoworkspace, ${toString ws}"
]) 9));
"$shiftMod,T, exec, hyprpanel-toggle" # Toggle hyprpanel
"$shiftMod,C, exec, clipboard" # Clipboard picker with wofi
"$shiftMod,E, exec, ${pkgs.wofi-emoji}/bin/wofi-emoji" # Emoji picker with wofi
"$mod,F2, exec, night-shift" # Toggle night shift
"$mod,F3, exec, night-shift" # Toggle night shift
]
++ (builtins.concatLists (builtins.genList (i: let
ws = i + 1;
in [
"$mod,code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT,code:1${toString i}, movetoworkspace, ${toString ws}"
])
9));
bindm = [
"$mod,mouse:272, movewindow" # Move Window (mouse)
@@ -60,6 +63,5 @@
",XF86MonBrightnessUp, exec, brightness-up" # Brightness Up
",XF86MonBrightnessDown, exec, brightness-down" # Brightness Down
];
};
}

View File

@@ -1,6 +1,10 @@
# So best window tiling manager
{ pkgs, config, inputs, lib, ... }:
let
# Hyprland is a dynamic tiling Wayland compositor that is highly customizable and performant.
{
pkgs,
config,
lib,
...
}: let
border-size = config.theme.border-size;
gaps-in = config.theme.gaps-in;
gaps-out = config.theme.gaps-out;
@@ -11,12 +15,11 @@ let
keyboardLayout = config.var.keyboardLayout;
background = "rgb(" + config.lib.stylix.colors.base00 + ")";
in {
imports = [
./animations.nix
./bindings.nix
./polkitagent.nix
./keyboard-backlight.nix # CHANGEME: This is for my laptop only
./keyboard-backlight.nix # CHANGEME: This is for omen laptop only
./hyprspace.nix
];
@@ -122,7 +125,10 @@ in {
render_power = 3;
};
blur = {
enabled = if blur then "true" else "false";
enabled =
if blur
then "true"
else "false";
size = 18;
};
};
@@ -133,7 +139,7 @@ in {
mfact = 0.5;
};
gestures = { workspace_swipe = true; };
gestures = {workspace_swipe = true;};
misc = {
vfr = true;
@@ -178,7 +184,7 @@ in {
"size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$"
];
layerrule = [ "noanim, launcher" "noanim, ^ags-.*" ];
layerrule = ["noanim, launcher" "noanim, ^ags-.*"];
input = {
kb_layout = keyboardLayout;
@@ -195,7 +201,6 @@ in {
clickfinger_behavior = true;
};
};
};
};
}

View File

@@ -1,7 +1,11 @@
# Hyprspace is a hyprland plugin that provides a workspaces overview (three-finger swipe up) and a workspace switcher (three-finger down).
{ inputs, pkgs, ... }: {
{
inputs,
pkgs,
...
}: {
wayland.windowManager.hyprland = {
plugins = [ inputs.hyprspace.packages.${pkgs.system}.Hyprspace ];
plugins = [inputs.hyprspace.packages.${pkgs.system}.Hyprspace];
settings = {
plugin = {
overview = {

View File

@@ -1,6 +1,10 @@
# Turn the keyboard red/off when the battery is low
{ pkgs, config, ... }:
let
# Include this one only if you have a omen laptop with RGB keyboard
{
pkgs,
config,
...
}: let
keyboard-backlight = pkgs.writeShellScriptBin "keyboard-backlight" ''
function set_keyboard_backlight {
local color=$1
@@ -31,4 +35,4 @@ let
'';
command = "bash ${keyboard-backlight}/bin/keyboard-backlight &";
in { wayland.windowManager.hyprland.settings.exec-once = [ command ]; }
in {wayland.windowManager.hyprland.settings.exec-once = [command];}

View File

@@ -1,7 +1,6 @@
# HyprPolkitAgent is a simple polkit agent for wayland compositors
{ pkgs, ... }: {
home.packages = with pkgs; [ hyprpolkitagent ];
{pkgs, ...}: {
home.packages = with pkgs; [hyprpolkitagent];
wayland.windowManager.hyprland.settings.exec-once =
[ "systemctl --user start hyprpolkitagent" ];
wayland.windowManager.hyprland.settings.exec-once = ["systemctl --user start hyprpolkitagent"];
}

View File

@@ -1,6 +1,9 @@
# Hyprlock is a lockscreen for Hyprland
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
foreground = "rgba(${config.theme.textColorOnWallpaper}ee)";
font = config.stylix.fonts.serif.name;
in {
@@ -13,7 +16,6 @@ in {
disable_loading_bar = false;
};
# BACKGROUND
background = {
monitor = "";
blur_passes = 0;

View File

@@ -1,5 +1,5 @@
# Hyprpaper is used to set the wallpaper on the system
{ lib, ... }: {
{lib, ...}: {
# The wallpaper is set by stylix
services.hyprpaper = {
enable = true;

View File

@@ -1,22 +1,22 @@
{ pkgs, lib, ... }:
with lib;
let
# Mime type associations for the system.
{lib, ...}:
with lib; let
defaultApps = {
browser = [ "zen-beta.desktop" ];
text = [ "org.gnome.TextEditor.desktop" ];
image = [ "imv-dir.desktop" ];
audio = [ "mpv.desktop" ];
video = [ "mpv.desktop" ];
directory = [ "thunar.desktop" ];
office = [ "libreoffice.desktop" ];
pdf = [ "zathura.desktop" ];
terminal = [ "kitty.desktop" ];
discord = [ "discord.desktop" ];
archive = [ "xarchiver.desktop" ];
browser = ["zen-beta.desktop"];
text = ["org.gnome.TextEditor.desktop"];
image = ["imv-dir.desktop"];
audio = ["mpv.desktop"];
video = ["mpv.desktop"];
directory = ["thunar.desktop"];
office = ["libreoffice.desktop"];
pdf = ["zathura.desktop"];
terminal = ["kitty.desktop"];
discord = ["discord.desktop"];
archive = ["xarchiver.desktop"];
};
mimeMap = {
text = [ "text/plain" ];
text = ["text/plain"];
image = [
"image/bmp"
"image/gif"
@@ -47,7 +47,7 @@ let
"video/x-matroska"
"video/x-msvideo"
];
directory = [ "inode/directory" ];
directory = ["inode/directory"];
browser = [
"text/html"
"x-scheme-handler/about"
@@ -67,15 +67,15 @@ let
"application/vnd.ms-powerpoint"
"application/rtf"
];
pdf = [ "application/pdf" ];
terminal = [ "terminal" ];
pdf = ["application/pdf"];
terminal = ["terminal"];
archive = [
"application/zip"
"application/rar"
"application/7z"
"application/*tar"
];
discord = [ "x-scheme-handler/discord" ];
discord = ["x-scheme-handler/discord"];
};
associations = with lists;

View File

@@ -1,6 +1,10 @@
# Wofi is a launcher for Wayland, inspired by rofi.
{ config, pkgs, lib, ... }:
let
{
config,
pkgs,
lib,
...
}: let
accent = "#${config.lib.stylix.colors.base0D}";
background = "#${config.lib.stylix.colors.base00}";
background-alt = "#${config.lib.stylix.colors.base01}";
@@ -9,8 +13,7 @@ let
rounding = config.theme.rounding;
font-size = config.stylix.fonts.sizes.popups;
in {
home.packages = with pkgs; [ wofi-emoji ];
home.packages = with pkgs; [wofi-emoji];
programs.wofi = {
enable = true;
@@ -42,7 +45,8 @@ in {
key_exit = "Escape";
};
style = lib.mkForce
style =
lib.mkForce
# css
''
* {