feat: hyprland init

This commit is contained in:
Julien Malka 2023-04-01 18:40:54 +02:00
parent 91fa5f57d2
commit a55a8ee9a4
Signed by: Luj
GPG key ID: 6FC74C847011FD83
8 changed files with 400 additions and 5 deletions

View file

@ -80,7 +80,7 @@
})
(builtins.attrNames (builtins.readDir ./modules)));
nixosConfigurations = builtins.mapAttrs (name: value: (lib.mkMachine { host = name; host-config = value; modules = self.nixosModules; nixpkgs = inputs.${lib.luj.machines.${name}.nixpkgs_version}; system = lib.luj.machines.${name}.arch; })) (lib.importConfig ./machines);
nixosConfigurations = builtins.mapAttrs (name: value: (lib.mkMachine { host = name; host-config = value; modules = self.nixosModules; nixpkgs = inputs.nixos-apple-silicon.inputs.nixpkgs; system = lib.luj.machines.${name}.arch; })) (lib.importConfig ./machines);
deploy.nodes.lambda = {
hostname = "lambda.julienmalka.me";

View file

@ -0,0 +1,232 @@
{ config, pkgs, lib, inputs, ... }:
let
cfg = config.luj.programs.hyprland;
terminal = "${pkgs.kitty}/bin/kitty";
menu = "${pkgs.rofi-wayland}/bin/rofi -no-lazy-grab -show";
in
with lib;
{
options.luj.programs.hyprland = {
enable = mkEnableOption "Enable HyprLand";
};
config = mkIf cfg.enable
{
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
};
xdg.configFile."hypr/hyprland.conf".text = ''
exec-once=${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && systemctl --user start hyprland-session.target
exec-once = waybar
# Monitors
monitor = eDP-1, preferred, auto, auto
# Input
input {
kb_layout = fr
kb_variant = mac
follow_mouse = 1
touchpad {
disable_while_typing = false
natural_scroll = true
tap-to-click = true
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
# General
general {
gaps_in = 7.5
gaps_out = 15
border_size = 2
col.active_border = rgb(11111b)
col.inactive_border = rgb(11111b)
cursor_inactive_timeout = 1
layout = master
}
# Misc
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
}
# Decorations
decoration {
# Opacity
active_opacity = 1.0
inactive_opacity = 1.0
# Blur
blur = false
blur_size = 10
blur_passes = 4
blur_new_optimizations = true
# Shadow
drop_shadow = true
shadow_ignore_window = true
shadow_offset = 2 2
shadow_range = 4
shadow_render_power = 2
col.shadow = 0x66000000
}
# Blurring layerSurfaces
blurls = gtk-layer-shell
blurls = lockscreen
# Animations
animations {
enabled = true
# bezier curve
bezier = overshot, 0.05, 0.9, 0.1, 1.05
bezier = smoothOut, 0.36, 0, 0.66, -0.56
bezier = smoothIn, 0.25, 1, 0.5, 1
# animation list
animation = windows, 1, 5, overshot, slide
animation = windowsOut, 1, 4, smoothOut, slide
animation = windowsMove, 1, 4, default
animation = border, 1, 10, default
animation = fade, 1, 10, smoothIn
animation = fadeDim, 1, 10, smoothIn
animation = workspaces, 1, 6, overshot, slidevert
}
# Gestures
gestures {
workspace_swipe = true
workspace_swipe_fingers = 3
}
# Layouts
dwindle {
no_gaps_when_only = true
pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # you probably want this
}
# Window rules
windowrule = float, file_progress
windowrule = float, confirm
windowrule = float, dialog
windowrule = float, download
windowrule = float, notification
windowrule = float, error
windowrule = float, splash
windowrule = float, confirmreset
windowrule = float, title:Open File
windowrule = float, title:branchdialog
windowrule = float, zoom
windowrule = float, vlc
windowrule = float, Lxappearance
windowrule = float, ncmpcpp
windowrule = float, Rofi
windowrule = animation none, Rofi
windowrule = float, viewnior
windowrule = float, pavucontrol-qt
windowrule = float, gucharmap
windowrule = float, gnome-font
windowrule = float, org.gnome.Settings
windowrule = float, file-roller
windowrule = float, nautilus
windowrule = float, nemo
windowrule = float, thunar
windowrule = float, wdisplays
windowrule = fullscreen, wlogout
windowrule = float, title:wlogout
windowrule = fullscreen, title:wlogout
windowrule = float, pavucontrol-qt
windowrule = float, keepassxc
windowrule = idleinhibit focus, mpv
windowrule = idleinhibit fullscreen, firefox
windowrule = float, title:^(Media viewer)$
windowrule = float, title:^(Transmission)$
windowrule = float, title:^(Volume Control)$
windowrule = float, title:^(Picture-in-Picture)$
windowrule = float, title:^(Firefox Sharing Indicator)$
windowrule = move 0 0, title:^(Firefox Sharing Indicator)$
windowrule = size 800 600, title:^(Volume Control)$
windowrule = move 75 44%, title:^(Volume Control)$
# Variables
$term = ${terminal}
$browser = firefox
$editor = nvim
$files = nemo
$launcher = ${menu}
# Apps
bind = SUPER, RETURN, exec, $term
bind = SUPER SHIFT, E, exec, $editor
bind = SUPER SHIFT, F, exec, $files
bind = SUPER SHIFT, B, exec, $browser
bind = SUPER, SPACE, exec, $launcher
bind = SUPER, E, exec, $emoji
bind = SUPER, X, exec, power-menu
# Function keys
bind = ,XF86MonBrightnessUp, exec, brightnessctl s +10
bind = ,XF86MonBrightnessDown, exec, brightnessctl s 10-
# Screenshots
bind = , Print, exec, $screenshotarea
bind = CTRL, Print, exec, grimblast --notify --cursor copysave output
bind = SUPER SHIFT CTRL, R, exec, grimblast --notify --cursor copysave output
bind = ALT, Print, exec, grimblast --notify --cursor copysave screen
bind = SUPER SHIFT ALT, R, exec, grimblast --notify --cursor copysave screen
# Misc
bind = CTRL ALT, L, exec, swaylock
# Window management
bind = SUPER, Q, killactive,
bind = SUPER, M, exit,
bind = SUPER, F, fullscreen,
bind = SUPER, Space, togglefloating,
bind = SUPER, P, pseudo, # dwindle
bind = SUPER, J, togglesplit, # dwindle
# Focus
bind = SUPER, left, movefocus, l
bind = SUPER, right, movefocus, r
bind = SUPER, up, movefocus, u
bind = SUPER, down, movefocus, d
# Move
bind = SUPER SHIFT, left, movewindow, l
bind = SUPER SHIFT, right, movewindow, r
bind = SUPER SHIFT, up, movewindow, u
bind = SUPER SHIFT, down, movewindow, d
# Resize
bind = SUPER CTRL, left, resizeactive, -20 0
bind = SUPER CTRL, right, resizeactive, 20 0
bind = SUPER CTRL, up, resizeactive, 0 -20
bind = SUPER CTRL, down, resizeactive, 0 20
# Tabbed
bind= SUPER, g, togglegroup
bind= SUPER, tab, changegroupactive
# Special workspace
bind = SUPER, grave, togglespecialworkspace
bind = SUPERSHIFT, grave, movetoworkspace, special
# Switch workspaces
bind = SUPER, ampersand, workspace, 1
bind = SUPER, eacute, workspace, 2
bind = SUPER, quotedbl, workspace,
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
bind = SUPER, mouse_down, workspace, e+1
bind = SUPER, mouse_up, workspace, e-1
'';
};
}

View file

@ -0,0 +1,153 @@
{ config, pkgs, lib, ... }:
let
cfg = config.luj.programs.waybar;
in
with lib;
{
options.luj.programs.waybar = {
enable = mkEnableOption "Enable waybar";
};
config = mkIf cfg.enable {
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
modules-left = [ "custom/arch" "wlr/workspaces" ];
modules-center = [ "clock" ];
modules-right = [ "backlight" "pulseaudio" "network" "battery" ];
"custom/arch" = {
format = " ";
tooltip = false;
on-click = "sh $HOME/.config/rofi/bin/powermenu";
};
"wlr/workspaces" = {
format = "{name}";
tooltip = false;
all-outputs = true;
};
"clock" = { };
"backlight" = {
device = "intel_backlight";
format = "<span color='#cba6f7'>{icon}</span> {percent}%";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
"pulseaudio" = {
format = "<span color='#cba6f7'>{icon}</span> {volume}%";
format-muted = "";
tooltip = false;
format-icons = {
headphone = "";
default = [ "" "" "󰕾" "󰕾" "󰕾" "" "" "" ];
};
scroll-step = 1;
};
"bluetooth" = {
format = "<span color='#cba6f7'></span> {status}";
format-disabled = "";
format-connected = "<span color='#cba6f7'></span> {num_connections}";
tooltip-format = "{device_enumerate}";
tooltip-format-enumerate-connected = "{device_alias} {device_address}";
};
"network" = {
interface = "wlp1s0f0";
format = "{ifname}";
format-wifi = "<span color='#cba6f7'> </span>{essid}";
format-ethernet = "{ipaddr}/{cidr} ";
format-disconnected = "<span color='#cba6f7'>󰖪 </span>No Network";
tooltip = false;
};
"battery" = {
format = "<span color='#cba6f7'>{icon}</span> {capacity}%";
format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
format-charging = "<span color='#cba6f7'></span> {capacity}%";
tooltip = false;
};
};
};
style = ''
* {
border: none;
font-family: 'Fira Code', 'Symbols Nerd Font Mono';
font-size: 12px;
font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"';
min-height: 12px;
}
window#waybar {
background: transparent;
}
#custom-arch, #workspaces {
border-radius: 10px;
background-color: #11111b;
color: #cba6f7;
margin-top: 15px;
margin-right: 15px;
padding-top: 1px;
padding-left: 10px;
padding-right: 10px;
}
#custom-arch {
font-size: 20px;
margin-left: 15px;
}
#workspaces button {
background: #11111b;
color: #cdd6f4;
}
#workspaces button.active {
color: #cba6f7;
}
#clock, #backlight, #pulseaudio, #bluetooth, #network, #battery{
border-radius: 10px;
background-color: #11111b;
color: #cdd6f4;
margin-top: 15px;
padding-left: 10px;
padding-right: 10px;
margin-right: 15px;
}
#backlight, #bluetooth {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
padding-right: 5px;
margin-right: 0
}
#pulseaudio, #network {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
padding-left: 5px;
}
#clock {
margin-right: 0;
}
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
#battery.warning:not(.charging) {
background: #f38ba8;
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
'';
};
};
}

View file

@ -28,6 +28,15 @@ in
(overlay-unstable system)
(final: prev:
{
hyprland = inputs.hyprland.packages.${system}.default.override {
enableXWayland = true;
hidpiXWayland = true;
nvidiaPatches = false;
legacyRenderer = true;
};
waybar = prev.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
tinystatus = prev.pkgs.callPackage ../packages/tinystatus { };
jackett = prev.unstable.jackett;
radarr = prev.unstable.radarr;

View file

@ -34,7 +34,7 @@ lib: with lib; let
};
macintosh = {
arch = "aarch64-linux";
nixpkgs_version = "unstable";
nixpkgs_version = "nixos-apple-silicon.inputs";
};
lambda = {
arch = "aarch64-linux";

View file

@ -29,8 +29,7 @@
programs.hyprland.enable = true;
programs.hyprland.package = pkgs.hyprland;
programs.fish.shellInit = ''
if test -z (pgrep ssh-agent)

View file

@ -25,7 +25,8 @@
luj.programs.git.enable = true;
luj.programs.gtk.enable = true;
luj.programs.alacritty.enable = true;
luj.programs.sway.enable = true;
luj.programs.hyprland.enable = true;
luj.programs.waybar.enable = true;
programs.rofi = {
enable = true;
@ -53,6 +54,7 @@
home.packages = with pkgs;
[
du-dust
kitty
jq
lazygit
fira-code

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 KiB