Init comfortable hyprland configuration

This commit is contained in:
Joey Hafner 2024-10-14 14:14:31 -07:00
parent 84dfd599a4
commit a00ce7d81a
6 changed files with 1011 additions and 0 deletions

View File

@ -0,0 +1,122 @@
{ pkgs, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
plugins = [];
settings = {
monitor = ",1920x1080@60,0x0,1";
"$terminal" = "kitty";
"$fileManager" = "dolphin";
"$bar" = "killall .waybar-wrapped; waybar --style ~/.config/waybar/waybar.css";
"$menu" = "wofi --show drun";
"$notifd" = "mako";
"$wallpaperd" = "swww-daemon";
exec-once = [
"$terminal"
"$bar"
"$notifd"
"$wallpaperd"
];
env = [
"XCURSOR_SIZE,24"
"HYPRCURSOR_SIZE,24"
];
general = {
gaps_in = "5";
gaps_out = "20";
border_size = "2";
allow_tearing = false;
resize_on_border = false;
layout = "dwindle";
};
decoration = {
rounding = "10";
active_opacity = "1.0";
inactive_opacity = "0.9";
drop_shadow = true;
shadow_range = "4";
shadow_render_power = "3";
blur = {
enabled = true;
size = "3";
passes = "1";
vibrancy = "0.1696";
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
master = {
new_status = "master";
};
misc = {
force_default_wallpaper = "0";
disable_hyprland_logo = true;
};
input = {
kb_layout = "us";
follow_mouse = "1";
sensitivity = "0";
touchpad = {
natural_scroll = false;
};
};
gestures = {
workspace_swipe = false;
};
device = {
name = "epic-mouse-v1";
sensitivity = "-0.5";
};
"$mainMod" = "SUPER";
bind = [
"$mainMod, T, exec, $terminal"
"$mainMod, Q, killactive,"
"$mainMod, M, exit,"
"$mainMod, E, exec, $fileManager"
"$mainMod, V, togglefloating,"
"$mainMod, R, exec, $menu"
"$mainMod, P, pseudo,"
"$mainMod, J, togglesplit,"
"$mainMod, left, movefocus, l"
"$mainMod, right, movefocus, r"
"$mainMod, up, movefocus, u"
"$mainMod, down, movefocus, d"
"$mainMod CTRL, right, workspace, +1"
"$mainMod CTRL, left, workspace, -1"
"$mainMod CTRL SHIFT, right, movetoworkspace, +1"
"$mainMod CTRL SHIFT, left, movetoworkspace, -1"
"$mainMod CTRL, B, exec, $bar"
];
windowrulev2 = "suppressevent maximize, class:.*";
};
};
}

View File

@ -0,0 +1,355 @@
/*
* __ __ _ ____ _ _
* \ \ / /_ _ _ _| |__ __ _ _ __ / ___|| |_ _ _| | ___
* \ \ /\ / / _` | | | | '_ \ / _` | '__| \___ \| __| | | | |/ _ \
* \ V V / (_| | |_| | |_) | (_| | | ___) | |_| |_| | | __/
* \_/\_/ \__,_|\__, |_.__/ \__,_|_| |____/ \__|\__, |_|\___|
* |___/ |___/
*
* by Stephan Raabe (2024)
* -----------------------------------------------------
*/
@define-color backgroundlight #FFFFFF;
@define-color backgrounddark #FFFFFF;
@define-color workspacesbackground1 #FFFFFF;
@define-color workspacesbackground2 #CCCCCC;
@define-color bordercolor #FFFFFF;
@define-color textcolor1 #000000;
@define-color textcolor2 #000000;
@define-color textcolor3 #FFFFFF;
@define-color iconcolor #FFFFFF;
/* -----------------------------------------------------
* General
* ----------------------------------------------------- */
* {
font-family: "Fira Sans Semibold", FontAwesome, Roboto, Helvetica, Arial, sans-serif;
border: none;
border-radius: 0px;
}
window#waybar {
background-color: rgba(0,0,0,0.2);
border-bottom: 0px solid #ffffff;
/* color: #FFFFFF; */
transition-property: background-color;
transition-duration: .5s;
}
/* -----------------------------------------------------
* Workspaces
* ----------------------------------------------------- */
#workspaces {
margin: 5px 1px 6px 1px;
padding: 0px 1px;
border-radius: 15px;
border: 0px;
font-weight: bold;
font-style: normal;
font-size: 16px;
color: @textcolor1;
}
#workspaces button {
padding: 0px 5px;
margin: 4px 3px;
border-radius: 15px;
border: 0px;
color: @textcolor3;
transition: all 0.3s ease-in-out;
}
#workspaces button.active {
color: @textcolor1;
background: @workspacesbackground2;
border-radius: 15px;
min-width: 40px;
transition: all 0.3s ease-in-out;
}
#workspaces button:hover {
color: @textcolor1;
background: @workspacesbackground2;
border-radius: 15px;
}
/* -----------------------------------------------------
* Tooltips
* ----------------------------------------------------- */
tooltip {
border-radius: 10px;
background-color: @backgroundlight;
opacity:0.8;
padding:20px;
margin:0px;
}
tooltip label {
color: @textcolor2;
}
/* -----------------------------------------------------
* Window
* ----------------------------------------------------- */
#window {
background: @backgroundlight;
margin: 10px 15px 10px 0px;
padding: 2px 10px 0px 10px;
border-radius: 12px;
color:@textcolor2;
font-size:16px;
font-weight:normal;
}
window#waybar.empty #window {
background-color:transparent;
}
/* -----------------------------------------------------
* Taskbar
* ----------------------------------------------------- */
#taskbar {
background: @backgroundlight;
margin: 6px 15px 6px 0px;
padding:0px;
border-radius: 15px;
font-weight: normal;
font-style: normal;
border: 3px solid @backgroundlight;
}
#taskbar button {
margin:0;
border-radius: 15px;
padding: 0px 5px 0px 5px;
}
/* -----------------------------------------------------
* Modules
* ----------------------------------------------------- */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
/* -----------------------------------------------------
* Custom Quicklinks
* ----------------------------------------------------- */
#custom-browser,
#custom-filemanager,
#network,
#pulseaudio,
#battery,
#custom-appmenu,
#clock {
margin-right: 20px;
font-size: 20px;
font-weight: bold;
color: @iconcolor;
padding: 4px 10px 2px 10px;
font-size: 16px;
}
#custom-quicklink1,
#custom-quicklink2,
#custom-quicklink3,
#custom-quicklink4,
#custom-quicklink5,
#custom-quicklink6,
#custom-quicklink7,
#custom-quicklink8,
#custom-quicklink9,
#custom-quicklink10 {
padding:0px;
margin-right: 7px;
font-size:20px;
color: @iconcolor;
}
/* -----------------------------------------------------
* Custom Modules
* ----------------------------------------------------- */
#custom-appmenu {
background-color: @backgrounddark;
color: @textcolor1;
border-radius: 15px;
margin: 10px 10px 10px 10px;
}
/* -----------------------------------------------------
* Custom Exit
* ----------------------------------------------------- */
#custom-exit {
margin: 2px 20px 0px 0px;
padding:0px;
font-size:20px;
color: @iconcolor;
}
/* -----------------------------------------------------
* Hardware Group
* ----------------------------------------------------- */
#disk,#memory,#cpu,#language {
margin:0px;
padding:0px;
font-size:16px;
color:@iconcolor;
}
#language {
margin-right:10px;
}
/* -----------------------------------------------------
* Clock
* ----------------------------------------------------- */
#clock {
background-color: @backgrounddark;
font-size: 16px;
color: @textcolor1;
border-radius: 15px;
margin: 10px 7px 10px 0px;
}
/* -----------------------------------------------------
* Pulseaudio
* ----------------------------------------------------- */
#pulseaudio {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
margin: 10px 10px 10px 0px;
}
#pulseaudio.muted {
background-color: @backgrounddark;
color: @textcolor1;
}
/* -----------------------------------------------------
* Network
* ----------------------------------------------------- */
#network {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
margin: 10px 10px 10px 0px;
}
#network.ethernet {
background-color: @backgroundlight;
color: @textcolor2;
}
#network.wifi {
background-color: @backgroundlight;
color: @textcolor2;
}
/* -----------------------------------------------------
* Bluetooth
* ----------------------------------------------------- */
#bluetooth, #bluetooth.on, #bluetooth.connected {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
margin: 10px 15px 10px 0px;
}
#bluetooth.off {
background-color: transparent;
padding: 0px;
margin: 0px;
}
/* -----------------------------------------------------
* Battery
* ----------------------------------------------------- */
#battery {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
margin: 10px 15px 10px 0px;
}
#battery.charging, #battery.plugged {
color: @textcolor2;
background-color: @backgroundlight;
}
@keyframes blink {
to {
background-color: @backgroundlight;
color: @textcolor2;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: @textcolor3;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
/* -----------------------------------------------------
* Tray
* ----------------------------------------------------- */
#tray {
margin:0px 10px 0px 0px;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
/* -----------------------------------------------------
* Other
* ----------------------------------------------------- */
label:focus {
background-color: #000000;
}
#backlight {
background-color: #90b1b1;
}
#network {
background-color: #2980b9;
}
#network.disconnected {
background-color: #f53c3c;
}

View File

@ -0,0 +1,355 @@
@import "style.css";
waybar#window {
background-color: @base0B;
}
@define-color base00 #111349;
@define-color base01 #332330;
@define-color base02 #156eb2;
@define-color base03 #66a3da;
@define-color base04 #95bede;
@define-color base05 #e2e1ef;
@define-color base06 #e0e3f4;
@define-color base07 #cce8f6;
@define-color base08 #5196d1;
@define-color base09 #5196cf;
@define-color base0A #5796cc;
@define-color base0B #5595d3;
@define-color base0C #5896c9;
@define-color base0D #5795d0;
@define-color base0E #4f96d8;
@define-color base0F #5894d3;
* {
font-family: "DejaVu Sans";
font-size: 12pt;
}
window#waybar, tooltip {
background: alpha(@base00, 1.000000);
color: @base05;
}
tooltip {
border-color: @base0D;
}
#wireplumber,
#pulseaudio,
#sndio {
padding: 0 5px;
}
#wireplumber.muted,
#pulseaudio.muted,
#sndio.muted {
padding: 0 5px;
}
#upower,
#battery {
padding: 0 5px;
}
#upower.charging,
#battery.Charging {
padding: 0 5px;
}
#network {
padding: 0 5px;
}
#network.disconnected {
padding: 0 5px;
}
#user {
padding: 0 5px;
}
#clock {
padding: 0 5px;
}
#backlight {
padding: 0 5px;
}
#cpu {
padding: 0 5px;
}
#disk {
padding: 0 5px;
}
#idle_inhibitor {
padding: 0 5px;
}
#temperature {
padding: 0 5px;
}
#mpd {
padding: 0 5px;
}
#language {
padding: 0 5px;
}
#keyboard-state {
padding: 0 5px;
}
#memory {
padding: 0 5px;
}
#window {
padding: 0 5px;
}
window .modules-left #workspaces button {
background-color: @base07;
color: @base00;
}
.modules-left #wireplumber,
.modules-left #pulseaudio,
.modules-left #sndio {
background-color: @base09;
color: @base00;
}
.modules-left #workspaces button.focused,
.modules-left #workspaces button.active {
background: @base03;
}
.modules-left #workspaces button.urgent {
background-color: @base08;
}
.modules-left #wireplumber.muted,
.modules-left #pulseaudio.muted,
.modules-left #sndio.muted {
background-color: @base0C;
}
.modules-left #upower,
.modules-left #battery {
background-color: @base0D;
color: @base00;
}
.modules-left #upower.charging,
.modules-left #battery.Charging {
background-color: @base0E;
}
.modules-left #network {
background-color: @base0B;
color: @base00;
}
.modules-left #network.disconnected {
background-color: @base0C;
}
.modules-left #user {
background-color: @base0F;
color: @base00;
}
.modules-left #clock {
background-color: @base03;
color: @base00;
}
.modules-left #backlight {
background-color: @base0E;
color: @base00;
}
.modules-left #cpu {
background-color: @base0B;
color: @base00;
}
.modules-left #disk {
background-color: @base02;
color: @base00;
}
.modules-left #idle_inhibitor {
background-color: @base06;
color: @base00;
}
.modules-left #temperature {
background-color: @base07;
color: @base00;
}
.modules-left #mpd {
background-color: @base02;
color: @base00;
}
.modules-left #language {
background-color: @base02;
color: @base00;
}
.modules-left #keyboard-state {
background-color: @base03;
color: @base00;
}
.modules-left #memory {
background-color: @base09;
color: @base00;
}
.modules-left #window {
background-color: @base0C;
color: @base00;
}
window .modules-center #workspaces button {
background-color: @base07;
color: @base00;
}
.modules-center #wireplumber,
.modules-center #pulseaudio,
.modules-center #sndio {
background-color: @base09;
color: @base00;
}
.modules-center #workspaces button.focused,
.modules-center #workspaces button.active {
background: @base03;
}
.modules-center #workspaces button.urgent {
background-color: @base08;
}
.modules-center #wireplumber.muted,
.modules-center #pulseaudio.muted,
.modules-center #sndio.muted {
background-color: @base0C;
}
.modules-center #upower,
.modules-center #battery {
background-color: @base0D;
color: @base00;
}
.modules-center #upower.charging,
.modules-center #battery.Charging {
background-color: @base0E;
}
.modules-center #network {
background-color: @base0B;
color: @base00;
}
.modules-center #network.disconnected {
background-color: @base0C;
}
.modules-center #user {
background-color: @base0F;
color: @base00;
}
.modules-center #clock {
background-color: @base03;
color: @base00;
}
.modules-center #backlight {
background-color: @base0E;
color: @base00;
}
.modules-center #cpu {
background-color: @base0B;
color: @base00;
}
.modules-center #disk {
background-color: @base02;
color: @base00;
}
.modules-center #idle_inhibitor {
background-color: @base06;
color: @base00;
}
.modules-center #temperature {
background-color: @base07;
color: @base00;
}
.modules-center #mpd {
background-color: @base02;
color: @base00;
}
.modules-center #language {
background-color: @base02;
color: @base00;
}
.modules-center #keyboard-state {
background-color: @base03;
color: @base00;
}
.modules-center #memory {
background-color: @base09;
color: @base00;
}
.modules-center #window {
background-color: @base0C;
color: @base00;
}
window .modules-right #workspaces button {
background-color: @base07;
color: @base00;
}
.modules-right #wireplumber,
.modules-right #pulseaudio,
.modules-right #sndio {
background-color: @base09;
color: @base00;
}
.modules-right #workspaces button.focused,
.modules-right #workspaces button.active {
background: @base03;
}
.modules-right #workspaces button.urgent {
background-color: @base08;
}
.modules-right #wireplumber.muted,
.modules-right #pulseaudio.muted,
.modules-right #sndio.muted {
background-color: @base0C;
}
.modules-right #upower,
.modules-right #battery {
background-color: @base0D;
color: @base00;
}
.modules-right #upower.charging,
.modules-right #battery.Charging {
background-color: @base0E;
}
.modules-right #network {
background-color: @base0B;
color: @base00;
}
.modules-right #network.disconnected {
background-color: @base0C;
}
.modules-right #user {
background-color: @base0F;
color: @base00;
}
.modules-right #clock {
background-color: @base03;
color: @base00;
}
.modules-right #backlight {
background-color: @base0E;
color: @base00;
}
.modules-right #cpu {
background-color: @base0B;
color: @base00;
}
.modules-right #disk {
background-color: @base02;
color: @base00;
}
.modules-right #idle_inhibitor {
background-color: @base06;
color: @base00;
}
.modules-right #temperature {
background-color: @base07;
color: @base00;
}
.modules-right #mpd {
background-color: @base02;
color: @base00;
}
.modules-right #language {
background-color: @base02;
color: @base00;
}
.modules-right #keyboard-state {
background-color: @base03;
color: @base00;
}
.modules-right #memory {
background-color: @base09;
color: @base00;
}
.modules-right #window {
background-color: @base0C;
color: @base00;
}

View File

@ -0,0 +1,150 @@
{ pkgs, ... }: {
home.packages = with pkgs; [ waybar ];
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
spacing = 30;
margin-left = 40;
margin-right = 40;
modules-left = [ "custom/appmenu" "wlr/taskbar" "hyprland/window" "tray" ];
modules-center = [ "hyprland/workspaces" ];
modules-right = [
"pulseaudio"
"network"
"battery"
"clock"
"custom/power"
];
"hyprland/workspaces" = {
active-only = false;
on-click = "activate";
format = "{}";
format-icons = {
urgent = "";
active = "";
default = "";
};
persistent-workspaces = {
"*" = 3;
};
};
"wlr/taskbar" = {
format = "{icon}";
icon-size = 18;
tooltip-format = "{title}";
on-click = "activate";
on-click-middle = "close";
ignore-list = [
"kitty"
];
app_ids-mapping = {};
rewrite = {};
};
"hyprland/window" = {
rewrite = {};
separate-outputs = true;
};
"custom/appmenu" = {
format = " ";
on-click = "wofi --show drun";
};
"custom/exit" = {
format = " ";
on-click = "wlogout";
tooltip-format = "Power Menu";
};
keyboard-state = {
numlock = true;
capslock = true;
format = "{name} {icon}";
format-icons = {
locked = " ";
unlocked = " ";
};
};
tray = {
icon-size = 21;
spacing = 10;
};
clock = {
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = ''{:%Y-%m-%d}'';
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = ''{capacity}% {icon}'';
format-full = ''{capacity}% {icon}'';
format-charging = ''{capacity}% '';
format-plugged = ''{capacity}% '';
format-alt = ''{time} {icon}'';
format-icons = [ " " " " " " " " " " ];
};
power-profiles-daemon = {
format = ''{icon}'';
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
default = '' '';
performance = '' '';
balanced = '' '';
power-saver = '' '';
};
};
network = {
format-wifi = ''{essid} ({signalStrength}%) '';
format-ethernet = ''{ipaddr}/{cidr} '';
tooltip-format = ''{ifname} via {gwaddr} '';
format-linked = ''{ifname} (No IP) '';
format-disconnected = ''Disconnected '';
format-alt = ''{ifname}: {ipaddr}/{cidr}'';
};
pulseaudio = {
format = ''{volume}% {icon} {format_source}'';
format-bluetooth = ''{volume}% {icon} {format_source}'';
format-bluetooth-muted = ''{icon} {format_source}'';
format-muted = '' {format_source}'';
format-source = ''{volume}% '';
format-source-muted = '' '';
format-icons = {
headphone = '' '';
hands-free = '' '';
headset = '' '';
phone = '' '';
portable = '' '';
car = '' '';
default = [ "" " " " " ];
};
on-click = ''pavucontrol'';
};
"custom/power" = {
format = '' '';
tooltip = false;
menu = "on-click";
menu-file = ''$HOME/.config/waybar/power_menu.xml'';
menu-actions = {
shutdown = "shutdown";
reboot = "reboot";
suspend = "systemctl suspend";
hibernate = "systemctl hibernate";
};
};
};
};
};
# We want Stylix to do most of the heavy lifting for our styling,
# but we want to add a few snippets. So we're going to run waybar
# with '-c ~/.config/waybar/waybar.css', which will add our snippets
# and then source the original, default '~/.config/waybar/style.css'
# created by Stylix.
home.file."waybar.css" = {
target = ".config/waybar/waybar.css";
source = ./waybar.css;
};
}

View File

@ -0,0 +1,18 @@
{ pkgs, ... }: {
imports = [
./hyprland.nix
./waybar.nix
./wofi.nix
];
home.packages = with pkgs; [
mako
libnotify
swww
polkit-kde-agent
dolphin
power-profiles-daemon
pavucontrol
grim slurp
];
}

View File

@ -0,0 +1,11 @@
{ pkgs, ... }: {
programs.wofi = {
enable = true;
settings = {
show = "drun";
width = "40%";
height = "20%";
allow_markup = true;
};
};
}