Configure hyprlock, work on waybar

This commit is contained in:
Julian Mutter 2024-06-13 22:08:05 +02:00
parent 49cfa7c50d
commit 60dae66fd1
6 changed files with 378 additions and 42 deletions

View File

@ -80,11 +80,13 @@
zotero
xfce.mousepad
tor-browser
## My scripts
pkgs.frajul.deploy-to-pianopi
pkgs.frajul.edit-config
pkgs.frajul.open-messaging
pkgs.frajul.pulseaudio-popup
]
++ lib.lists.concatMap (packages-list-file: import packages-list-file { inherit pkgs; }) [
./fonts.nix

View File

@ -37,52 +37,86 @@ in
home.packages = with pkgs; [
wofi
xfce.thunar
hyprlock
hyprpicker
# hyprlock
# hyprpicker
hyprcursor
];
programs.hyprlock.enable = true;
programs.hyprlock.settings = {
general = {
disable_loading_bar = true;
hide_cursor = true;
ignore_empty_input = true;
};
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
outline_thickness = 5;
placeholder_text = "Password...";
shadow_passes = 2;
}
];
};
programs.waybar = {
enable = true;
systemd.enable = true;
style = builtins.readFile ./style-dracula.css;
settings = {
mainBar = {
layer = "top";
position = "bottom";
height = 30;
output = [
"eDP-1"
"HDMI-A-1"
];
modules-left = [
"hyprland/workspaces"
"hyprland/submap"
];
modules-center = [ "hyprland/window" ];
modules-right = [
# "mpd"
# "idle_inhibitor"
"pulseaudio"
# "network"
"power-profiles-daemon"
"cpu"
"memory"
# "temperature"
# "backlight"
# "keyboard-state"
"battery"
# "battery#bat2"
"clock"
"tray"
];
style = builtins.readFile ./style.css;
settings.mainBar = builtins.fromJSON (builtins.readFile ./waybar-config.json);
# settings = {
# mainBar = {
# layer = "top";
# position = "bottom";
# height = 30;
# output = [
# "eDP-1"
# "HDMI-A-1"
# ];
# modules-left = [
# "hyprland/workspaces"
# "hyprland/submap"
# ];
# modules-center = [ "hyprland/window" ];
# modules-right = [
# # "mpd"
# # "idle_inhibitor"
# "pulseaudio"
# # "network"
# "power-profiles-daemon"
# "cpu"
# "memory"
# # "temperature"
# # "backlight"
# # "keyboard-state"
# "battery"
# # "battery#bat2"
# "clock"
# "tray"
# ];
# "sway/workspaces" = {
# disable-scroll = true;
# all-outputs = true;
# };
};
};
# # "sway/workspaces" = {
# # disable-scroll = true;
# # all-outputs = true;
# # };
# };
# };
};
programs.wlogout.enable = true; # can be configured
@ -120,8 +154,8 @@ in
# Look and Feel
general = {
# gaps_in = 5
# gaps_out = 20
gaps_in = 5;
gaps_out = 5;
# border_size = 2
@ -215,7 +249,7 @@ in
# other commands
"$mod, Escape, exec, wlogout -p layer-shell"
"$mod, TAB, exec, loginctl lock-session"
"$mod, TAB, exec, hyprlock"
"$mod SHIFT, R, exec, hyprctl reload"
", Print, exec, grimblast --notify copysave area"

View File

@ -0,0 +1,189 @@
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: "Noto Sans CJK KR Regular";
font-size: 16px;
min-height: 0;
}
window#waybar {
background: transparent;
/* background-color: rgba(43, 48, 59, 0.5); */
/* border-bottom: 3px solid rgba(100, 114, 125, 0.5); */
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
#waybar.empty #window {
background-color: transparent;
}
#workspaces {
}
#window {
margin: 2;
padding-left: 8;
padding-right: 8;
background-color: rgba(0,0,0,0.6);
font-size:14px;
font-weight: bold;
}
button {
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
/* Avoid rounded borders under each button name */
border: none;
border-radius: 0;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
border-top: 2px solid #c9545d;
}
#workspaces button {
padding: 0 4px;
/* background-color: rgba(0,0,0,0.6); */
}
#workspaces button:hover {
}
#workspaces button.focused {
background-color: #ecf0f1;
color: #2d3436;
/* box-shadow: inset 0 -2px #c9545d; */
border-top: 2px solid #c9545d;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#mpd {
margin: 2px;
padding-left: 4px;
padding-right: 4px;
background-color: rgba(0,0,0,0.6);
color: #ffffff;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#clock {
font-size:14px;
font-weight: bold;
}
#battery icon {
color: red;
}
#battery.charging, #battery.plugged {
color: #ffffff;
/* background-color: #26A65B; */
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.warning:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#network.disconnected {
background-color: #f53c3c;
}
#temperature.critical {
background-color: #eb4d4b;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
/*
window#waybar.solo {
background-color: #FFFFFF;
}
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
*/

View File

@ -0,0 +1,50 @@
{
"position": "bottom",
"height": 35,
"modules-left": ["hyprland/workspaces"],
"modules-right": ["idle_inhibitor", "cpu", "memory", "pulseaudio", "battery", "clock", "tray"],
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
"spacing": 10
},
"clock": {
"tooltip-format": "{calendar}",
"format": "{:%a %d.%m %H:%M:%S}",
"interval": 1
},
"cpu": {
"format": " {usage}%"
},
"memory": {
"format": " {}%"
},
"battery": {
"states": {
"good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}% ({time})",
"format-charging": " {capacity}% ({time})",
"format-plugged": " {capacity}% ({time})",
"format-full": "{icon}",
"format-icons": ["", "", "", "", ""]
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-muted": " {format_source}",
"format-icons": {
"headphone": "",
"default": ["", "", ""]
},
"scroll-step": 5.0,
"on-click": "pulseaudio-popup"
}
}

View File

@ -0,0 +1,43 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}:
pkgs.writeShellApplication {
name = "pulseaudio-popup";
runtimeInputs = with pkgs; [
pavucontrol
jgmenu
];
text = ''
HDMI_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink"
LAPTOP_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink"
HDMI_ICON=$(pactl info | grep -q $HDMI_SINK && echo "checkbox")
LAPTOP_ICON=$(pactl info | grep -q $LAPTOP_SINK && echo "checkbox")
HDMI_VOLUME=$(pactl get-sink-volume $HDMI_SINK | head -n 1 | awk '{print $5}')
LAPTOP_VOLUME=$(pactl get-sink-volume $LAPTOP_SINK | head -n 1 | awk '{print $5}')
read -r -d "" CONF <<EOF
Open Pavucontrol,pavucontrol,pavucontrol
^sep()
HDMI - $HDMI_VOLUME,pactl set-default-sink $HDMI_SINK,$HDMI_ICON
Laptop - $LAPTOP_VOLUME,pactl set-default-sink $LAPTOP_SINK,$LAPTOP_ICON
EOF
echo "$CONF" | jgmenu --simple
'';
}

View File

@ -105,6 +105,7 @@
# Enable the XFCE Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
security.pam.services.gdm.enableGnomeKeyring = true;
# services.displayManager.sddm.wayland.enable = true;
# services.xserver.desktopManager = {
# xterm.enable = false;
@ -136,6 +137,22 @@
hardware.pulseaudio.enable = false;
security.polkit.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
security.pam.services.hyprlock = { };
# Sound
@ -248,6 +265,7 @@
vim
htop
mc
xorg.xhost
];
virtualisation.docker.enable = true;