wlogout and waybar fix

This commit is contained in:
foglar 2024-11-15 14:24:31 +01:00
parent 26b2fc568b
commit 190c41587c
3 changed files with 103 additions and 43 deletions

View File

@ -1,44 +1,49 @@
{
lib,
config,
pkgs,
...
}: {
options = {
hyprland.enable =
lib.mkEnableOption "enable Hyprland module";
hyprland.enable =
lib.mkEnableOption "enable Hyprland module";
};
imports = [
./packages.nix
./waybar.nix
./rofi.nix
];
./packages.nix
./waybar.nix
./rofi.nix
./wlogout.nix
];
config = lib.mkIf config.hyprland.enable {
waybar.enable = lib.mkDefault true;
rofi.enable = lib.mkDefault true;
wlogout.enable = lib.mkDefault true;
services.network-manager-applet.enable = true;
services.dunst.enable = true;
stylix.targets = {
home.packages = [
pkgs.toybox
];
stylix.targets = {
dunst.enable = true;
waybar = {
enableCenterBackColors = false;
enableLeftBackColors = false;
enableRightBackColors = false;
};
};
};
wayland.windowManager.hyprland = {
enable = true;
#plugins = [
#inputs.hyprland-plugins.packages.${pkgs.system}.hyprbars
#inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
#inputs.hyprland-plugins.packages.${pkgs.system}.hyprbars
#inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
#];
settings = {
@ -50,7 +55,8 @@
input = {
"kb_layout" = "us, cz, ru";
"follow_mouse" = "1";
"kb_options" = "caps:swapecase";
#"kb_options" = "caps:swapecase";
#"kb_options" = "ctrl:nocaps";
touchpad = {
@ -108,8 +114,8 @@
"vesktop --start-minimized"
"ferdium --minimized"
"kdeconnect-indicator"
"swww-daemon --format xrgb"
"swww ../../aurora_borealis.png"
#"swww-daemon --format xrgb"
#"swww ../../aurora_borealis.png"
"hypridle"
"waybar"
"swayosd-server"
@ -156,7 +162,7 @@
};
bindr = [
"ALTSHIFT, Shift_L, exec, keyboardswitch.sh"
"ALTSHIFT, Shift_L, exec, keyboardswitch"
"CAPS,Caps_Lock, exec, swayosd-client --caps-lock"
];
@ -169,7 +175,7 @@
bindl = [
# Audio
",XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
",XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
",XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"
# Media
@ -179,8 +185,8 @@
];
bindel = [
",XF86AudioLowerVolume, exec, swayosd-client --output-volume -5"
",XF86AudioRaiseVolume, exec, swayosd-client --output-volume 5"
",XF86AudioLowerVolume, exec, swayosd-client --output-volume -1"
",XF86AudioRaiseVolume, exec, swayosd-client --output-volume 1"
# Brightness
",XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
",XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
@ -217,7 +223,7 @@
"$mod, F, exec, $browser"
"$mod, E, exec, $file"
"$mod, C, exec, $editor"
#"Ctrl+Shift, Escape, exec, $sysmonlaunch.sh"
"Ctrl+Shift, Escape, exec, btop"
# Rofi
"$mod, A, exec, pkill -x rofi || rofi -show drun"

View File

@ -1,6 +1,7 @@
{
lib,
config,
pkgs,
...
}: {
options = {
@ -8,6 +9,10 @@
};
config = lib.mkIf config.waybar.enable {
home.packages = [
pkgs.waybar
];
programs.waybar = {
enable = true;
@ -70,15 +75,15 @@
"m" = 30; # medium
};
interval = 30;
format = "󰾆 {used}GB";
format = "󰾆 {used}GB";
#rotate = ${r_deg};
format-m = "󰾅 {used}GB";
format-h = "󰓅 {used}GB";
format-c = " {used}GB";
format-alt = "󰾆 {percentage}%";
format-m = "󰾅 {used}GB";
format-h = "󰓅 {used}GB";
format-c = " {used}GB";
format-alt = "󰾆 {percentage}%";
max-length = 10;
tooltip = true;
tooltip-format = "󰾆 {percentage}%\n {used:0.1f}GB/{total:0.1f}GB";
tooltip-format = "󰾆 {percentage}%\n {used:0.1f}GB/{total:0.1f}GB";
};
"bluetooth" = {
@ -189,19 +194,19 @@
format = "{icon} {volume}";
rotate = 0;
format-muted = "";
on-click = "pavucontrol -t 3";
on-click-middle = "volumecontrol.sh -o m";
on-scroll-up = "volumecontrol.sh -o i";
on-scroll-down = "volumecontrol.sh -o d";
on-click = "nvidia-offload pavucontrol -t 3";
on-click-middle = "swayosd-client --output-volume mute-toggle";
on-scroll-up = "swayosd-client --output-volume 5";
on-scroll-down = "swayosd-client --output-volume -5";
tooltip-format = "{icon} {desc} // {volume}%";
scroll-step = 5;
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
headphone = " ";
hands-free = " ";
headset = " ";
phone = " ";
portable = " ";
car = " ";
default = ["" "" ""];
};
};
@ -211,10 +216,10 @@
rotate = 0;
format-source = "";
format-source-muted = "";
on-click = "pavucontrol -t 4";
on-click-middle = "volumecontrol.sh -i m";
on-scroll-up = "volumecontrol.sh -i i";
on-scroll-down = "volumecontrol.sh -i d";
on-click = "nvidia-offload pavucontrol -t 4";
on-click-middle = "swayosd-client --input-volume mute-toggle";
on-scroll-up = "swayosd-client --input-volume 5";
on-scroll-down = "swayosd-client --input-volume -5";
tooltip-format = "{format_source} {source_desc} // {source_volume}%";
scroll-step = 5;
};
@ -234,8 +239,8 @@
format = "{}";
rotate = 0;
exec = "echo ; echo logout";
on-click = "logoutlaunch.sh 2";
on-click-right = "logoutlaunch.sh 1";
on-click = "wlogout";
on-click-right = "wlogout";
interval = 86400; # once every day
tooltip = true;
};

View File

@ -0,0 +1,49 @@
{
lib,
config,
pkgs,
...
}: {
options = {
wlogout.enable = lib.mkEnableOption "enable wlogout module";
};
config = lib.mkIf config.wlogout.enable {
programs.wlogout = {
enable = true;
layout = [
{
"label" = "lock";
"action" = "swaylock";
"text" = "Lock";
"keybind" = "l";
}
{
"label" = "logout";
"action" = "hyprctl dispatch exit 0";
"text" = "Logout";
"keybind" = "e";
}
{
"label" = "shutdown";
"action" = "systemctl poweroff";
"text" = "Shutdown";
"keybind" = "s";
}
{
"label" = "reboot";
"action" = "systemctl reboot";
"text" = "Reboot";
"keybind" = "r";
}
];
};
home.packages = [
pkgs.wlogout
];
};
}