Formatting + update
This commit is contained in:
parent
93de64c64e
commit
9c895e9cc0
61 changed files with 2350 additions and 2100 deletions
|
|
@ -1,83 +1,89 @@
|
|||
{pkgs, hwconfig, ...}:
|
||||
let
|
||||
battery-path = "/sys/class/power_supply/${if hwconfig.hostname == "kylekrein-mac" then "macsmc-battery" else "BAT0"}";
|
||||
get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" ''
|
||||
cat ${battery-path}/capacity 2>/dev/null || echo "N/A"
|
||||
''}/bin/get-battery-level";
|
||||
get-status = "${pkgs.writeShellScriptBin "get-status" ''
|
||||
cat ${battery-path}/status 2>/dev/null || echo "Unknown"
|
||||
''}/bin/get-status";
|
||||
get-icon = "${pkgs.writeShellScriptBin "get-icon" ''
|
||||
BATTERY_LEVEL=$(${get-battery-level})
|
||||
STATUS=$(${get-status})
|
||||
if [[ "$BATTERY_LEVEL" == "N/A" ]]; then
|
||||
ICON=" "
|
||||
elif [[ "$STATUS" == "Charging" ]]; then
|
||||
if [[ $BATTERY_LEVEL -ge 90 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 80 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 60 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 40 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 20 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
|
||||
ICON=" "
|
||||
else
|
||||
ICON=" "
|
||||
fi
|
||||
else
|
||||
if [[ $BATTERY_LEVEL -ge 90 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
|
||||
ICON=" "
|
||||
else
|
||||
ICON=" "
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$ICON"
|
||||
''}/bin/get-icon";
|
||||
get-remaining-time = "${pkgs.writeShellScriptBin "get-remaining-time" ''
|
||||
REMAINING_ENERGY=$(cat ${battery-path}/energy_now)
|
||||
POWER_USAGE=$(cat ${battery-path}/power_now)
|
||||
if [[ -n "$REMAINING_ENERGY" && -n "$POWER_USAGE" && "$POWER_USAGE" -ne 0 ]]; then
|
||||
TIME_LEFT=$((0 - (REMAINING_ENERGY / POWER_USAGE)))
|
||||
MINUTES_LEFT=$(((0 - ( (REMAINING_ENERGY * 60) / POWER_USAGE )) - (TIME_LEFT * 60)))
|
||||
echo "$TIME_LEFT h $MINUTES_LEFT min"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
''}/bin/get-remaining-time";
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
hwconfig,
|
||||
...
|
||||
}: let
|
||||
battery-path = "/sys/class/power_supply/${
|
||||
if hwconfig.hostname == "kylekrein-mac"
|
||||
then "macsmc-battery"
|
||||
else "BAT0"
|
||||
}";
|
||||
get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" ''
|
||||
cat ${battery-path}/capacity 2>/dev/null || echo "N/A"
|
||||
''}/bin/get-battery-level";
|
||||
get-status = "${pkgs.writeShellScriptBin "get-status" ''
|
||||
cat ${battery-path}/status 2>/dev/null || echo "Unknown"
|
||||
''}/bin/get-status";
|
||||
get-icon = "${pkgs.writeShellScriptBin "get-icon" ''
|
||||
BATTERY_LEVEL=$(${get-battery-level})
|
||||
STATUS=$(${get-status})
|
||||
if [[ "$BATTERY_LEVEL" == "N/A" ]]; then
|
||||
ICON=" "
|
||||
elif [[ "$STATUS" == "Charging" ]]; then
|
||||
if [[ $BATTERY_LEVEL -ge 90 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 80 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 60 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 40 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 20 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
|
||||
ICON=" "
|
||||
else
|
||||
ICON=" "
|
||||
fi
|
||||
else
|
||||
if [[ $BATTERY_LEVEL -ge 90 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
|
||||
ICON=" "
|
||||
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
|
||||
ICON=" "
|
||||
else
|
||||
ICON=" "
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$ICON"
|
||||
''}/bin/get-icon";
|
||||
get-remaining-time = "${pkgs.writeShellScriptBin "get-remaining-time" ''
|
||||
REMAINING_ENERGY=$(cat ${battery-path}/energy_now)
|
||||
POWER_USAGE=$(cat ${battery-path}/power_now)
|
||||
if [[ -n "$REMAINING_ENERGY" && -n "$POWER_USAGE" && "$POWER_USAGE" -ne 0 ]]; then
|
||||
TIME_LEFT=$((0 - (REMAINING_ENERGY / POWER_USAGE)))
|
||||
MINUTES_LEFT=$(((0 - ( (REMAINING_ENERGY * 60) / POWER_USAGE )) - (TIME_LEFT * 60)))
|
||||
echo "$TIME_LEFT h $MINUTES_LEFT min"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
''}/bin/get-remaining-time";
|
||||
in {
|
||||
available = hwconfig.isLaptop;
|
||||
icon = get-icon;
|
||||
status = get-status;
|
||||
time = get-remaining-time;
|
||||
level = get-battery-level;
|
||||
labelAdaptive = "${pkgs.writeShellScriptBin "labelAdaptive" ''
|
||||
if [[ "$(${get-status})" == "Charging" ]]; then
|
||||
echo "$(${get-battery-level})% $(${get-icon})"
|
||||
else
|
||||
echo "$(${get-remaining-time}) $(${get-icon})"
|
||||
fi
|
||||
if [[ "$(${get-status})" == "Charging" ]]; then
|
||||
echo "$(${get-battery-level})% $(${get-icon})"
|
||||
else
|
||||
echo "$(${get-remaining-time}) $(${get-icon})"
|
||||
fi
|
||||
''}/bin/labelAdaptive";
|
||||
labelPercent = "${pkgs.writeShellScriptBin "labelPercent" ''
|
||||
echo "$(${get-battery-level})% $(${get-icon})"
|
||||
echo "$(${get-battery-level})% $(${get-icon})"
|
||||
''}/bin/labelPercent";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,134 +1,137 @@
|
|||
{ pkgs, inputs, hwconfig, unstable-pkgs, ... }:
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
hwconfig,
|
||||
unstable-pkgs,
|
||||
...
|
||||
}: {
|
||||
stylix = {
|
||||
enable = true;
|
||||
image = "${./wallpaper.jpg}";
|
||||
autoEnable = true;
|
||||
opacity = {
|
||||
desktop = 0.0;#0.5;
|
||||
};
|
||||
targets = {
|
||||
gtk.enable = true;
|
||||
plymouth = {
|
||||
enable = false;
|
||||
#logo = ./fastfetch/nixos.png;
|
||||
logoAnimated = false;
|
||||
};
|
||||
};
|
||||
fonts = {
|
||||
sizes = {
|
||||
applications = 14;
|
||||
desktop = 12;
|
||||
popups = 12;
|
||||
terminal = 16;
|
||||
};
|
||||
};
|
||||
polarity = "dark";
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
|
||||
enable = true;
|
||||
image = "${./wallpaper.jpg}";
|
||||
autoEnable = true;
|
||||
opacity = {
|
||||
desktop = 0.0; #0.5;
|
||||
};
|
||||
targets = {
|
||||
gtk.enable = true;
|
||||
plymouth = {
|
||||
enable = false;
|
||||
#logo = ./fastfetch/nixos.png;
|
||||
logoAnimated = false;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
#kando
|
||||
};
|
||||
fonts = {
|
||||
sizes = {
|
||||
applications = 14;
|
||||
desktop = 12;
|
||||
popups = 12;
|
||||
terminal = 16;
|
||||
};
|
||||
};
|
||||
polarity = "dark";
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
#kando
|
||||
|
||||
kdePackages.qtwayland
|
||||
#libsForQt5.qt5.qtwayland
|
||||
#libsForQt5.qt5.qtsvg
|
||||
kdePackages.qtsvg
|
||||
#kio-fuse #to mount remote filesystems via FUSE
|
||||
#libsForQt5.kio-extras #extra protocols support (sftp, fish and more)
|
||||
kdePackages.kio-fuse #to mount remote filesystems via FUSE
|
||||
kdePackages.kio-extras #extra protocols support (sftp, fish and more)
|
||||
kdePackages.kio-admin
|
||||
waybar
|
||||
swaynotificationcenter
|
||||
libnotify
|
||||
swww
|
||||
hyprpicker
|
||||
networkmanagerapplet
|
||||
hyprlock
|
||||
wlogout
|
||||
hypridle
|
||||
qpwgraph
|
||||
pwvucontrol
|
||||
brightnessctl
|
||||
unstable-pkgs.satty #fixes crash in 0.18.0
|
||||
grim
|
||||
slurp
|
||||
clipse
|
||||
libheif #https://github.com/NixOS/nixpkgs/issues/164021
|
||||
libheif.out
|
||||
|
||||
#kde
|
||||
kdePackages.breeze-icons
|
||||
kdePackages.breeze
|
||||
kdePackages.polkit-kde-agent-1
|
||||
kdePackages.kdesdk-thumbnailers
|
||||
kdePackages.kdegraphics-thumbnailers
|
||||
kdePackages.kservice
|
||||
kdePackages.kdbusaddons
|
||||
kdePackages.kfilemetadata
|
||||
kdePackages.kconfig
|
||||
kdePackages.kcoreaddons
|
||||
kdePackages.kcrash
|
||||
kdePackages.kguiaddons
|
||||
kdePackages.ki18n
|
||||
kdePackages.kitemviews
|
||||
kdePackages.kwidgetsaddons
|
||||
kdePackages.kwindowsystem
|
||||
shared-mime-info
|
||||
#kdePackages.plasma-workspace
|
||||
kdePackages.qtwayland
|
||||
#libsForQt5.qt5.qtwayland
|
||||
#libsForQt5.qt5.qtsvg
|
||||
kdePackages.qtsvg
|
||||
#kio-fuse #to mount remote filesystems via FUSE
|
||||
#libsForQt5.kio-extras #extra protocols support (sftp, fish and more)
|
||||
kdePackages.kio-fuse #to mount remote filesystems via FUSE
|
||||
kdePackages.kio-extras #extra protocols support (sftp, fish and more)
|
||||
kdePackages.kio-admin
|
||||
waybar
|
||||
swaynotificationcenter
|
||||
libnotify
|
||||
swww
|
||||
hyprpicker
|
||||
networkmanagerapplet
|
||||
hyprlock
|
||||
wlogout
|
||||
hypridle
|
||||
qpwgraph
|
||||
pwvucontrol
|
||||
brightnessctl
|
||||
unstable-pkgs.satty #fixes crash in 0.18.0
|
||||
grim
|
||||
slurp
|
||||
clipse
|
||||
libheif #https://github.com/NixOS/nixpkgs/issues/164021
|
||||
libheif.out
|
||||
|
||||
#kde support tools
|
||||
libsForQt5.qt5ct
|
||||
qt6ct
|
||||
kdePackages.kimageformats
|
||||
kdePackages.dolphin
|
||||
kdePackages.dolphin-plugins
|
||||
#kde
|
||||
kdePackages.breeze-icons
|
||||
kdePackages.breeze
|
||||
kdePackages.polkit-kde-agent-1
|
||||
kdePackages.kdesdk-thumbnailers
|
||||
kdePackages.kdegraphics-thumbnailers
|
||||
kdePackages.kservice
|
||||
kdePackages.kdbusaddons
|
||||
kdePackages.kfilemetadata
|
||||
kdePackages.kconfig
|
||||
kdePackages.kcoreaddons
|
||||
kdePackages.kcrash
|
||||
kdePackages.kguiaddons
|
||||
kdePackages.ki18n
|
||||
kdePackages.kitemviews
|
||||
kdePackages.kwidgetsaddons
|
||||
kdePackages.kwindowsystem
|
||||
shared-mime-info
|
||||
#kdePackages.plasma-workspace
|
||||
|
||||
#kde support tools
|
||||
libsForQt5.qt5ct
|
||||
qt6ct
|
||||
kdePackages.kimageformats
|
||||
kdePackages.dolphin
|
||||
kdePackages.dolphin-plugins
|
||||
];
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
programs.kdeconnect.package = pkgs.kdePackages.kdeconnect-kde;
|
||||
programs.hyprlock.enable = true;
|
||||
|
||||
xdg = {
|
||||
menus.enable = true;
|
||||
mime.enable = true;
|
||||
};
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
config = {
|
||||
hyprland = {
|
||||
default = [
|
||||
"hyprland"
|
||||
"kde"
|
||||
];
|
||||
};
|
||||
};
|
||||
configPackages = with pkgs; [
|
||||
xdg-desktop-portal-hyprland
|
||||
kdePackages.xdg-desktop-portal-kde
|
||||
];
|
||||
};
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
programs.kdeconnect.package = pkgs.kdePackages.kdeconnect-kde;
|
||||
programs.hyprlock.enable = true;
|
||||
|
||||
xdg = {
|
||||
menus.enable = true;
|
||||
mime.enable = true;
|
||||
};
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
config = {
|
||||
hyprland = {
|
||||
default = [
|
||||
"hyprland"
|
||||
"kde"
|
||||
];
|
||||
};
|
||||
};
|
||||
configPackages = with pkgs; [
|
||||
xdg-desktop-portal-hyprland
|
||||
kdePackages.xdg-desktop-portal-kde
|
||||
];
|
||||
};
|
||||
|
||||
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
|
||||
# This fixes the unpopulated MIME menus
|
||||
environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||
environment.etc."/xdg/menus/applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||
#environment.pathsToLink = [
|
||||
# "share/thumbnailers"
|
||||
#];
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
systemd.setPath.enable = true;
|
||||
};
|
||||
services.hypridle.enable = true;
|
||||
|
||||
# qt = {
|
||||
#enable = true;
|
||||
#platformTheme = "qt5ct";
|
||||
#style = "kvantum";
|
||||
# };
|
||||
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
|
||||
# This fixes the unpopulated MIME menus
|
||||
environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||
environment.etc."/xdg/menus/applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||
#environment.pathsToLink = [
|
||||
# "share/thumbnailers"
|
||||
#];
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
systemd.setPath.enable = true;
|
||||
};
|
||||
services.hypridle.enable = true;
|
||||
|
||||
# qt = {
|
||||
#enable = true;
|
||||
#platformTheme = "qt5ct";
|
||||
#style = "kvantum";
|
||||
# };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
lib,
|
||||
hwconfig,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
imports = [
|
||||
(import ./hyprland.nix {
|
||||
inherit pkgs;
|
||||
|
|
|
|||
|
|
@ -1,65 +1,66 @@
|
|||
{ pkgs, lib, hwconfig, ... }:
|
||||
let
|
||||
suspendScript = pkgs.writeShellScript "suspend-script" ''
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
hwconfig,
|
||||
...
|
||||
}: let
|
||||
suspendScript = pkgs.writeShellScript "suspend-script" ''
|
||||
# check if any player has status "Playing"
|
||||
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
|
||||
# only suspend if nothing is playing
|
||||
if [ $? == 1 ]; then
|
||||
${if hwconfig.isLaptop then "${pkgs.systemd}/bin/systemctl suspend" else "loginctl lock-session"}
|
||||
${
|
||||
if hwconfig.isLaptop
|
||||
then "${pkgs.systemd}/bin/systemctl suspend"
|
||||
else "loginctl lock-session"
|
||||
}
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
||||
general = {
|
||||
lock_cmd="pidof hyprlock || hyprlock";
|
||||
before_sleep_cmd = "pidof hyprlock || loginctl lock-session"; # lock before suspend.
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
|
||||
ignore_dbus_inhibit = false;
|
||||
};
|
||||
|
||||
listener = [
|
||||
|
||||
#{
|
||||
# on-resume="brightnessctl -r"; # monitor backlight restore.
|
||||
# on-timeout="brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
||||
# timeout=240;
|
||||
#}
|
||||
#{
|
||||
# on-resume="brightnessctl -rd rgb:kbd_backlight";
|
||||
# on-timeout="brightnessctl -sd rgb:kbd_backlight set 0";
|
||||
# timeout=300;
|
||||
#}
|
||||
{
|
||||
on-timeout="notify-send \"You're idle. Locking in 30 seconds.\"";
|
||||
timeout=830;
|
||||
}
|
||||
{
|
||||
on-timeout = "pidof hyprlock && systemctl suspend";
|
||||
timeout = 120;
|
||||
}
|
||||
#{
|
||||
# on-timeout="loginctl lock-session";
|
||||
# timeout=360;
|
||||
#}
|
||||
{
|
||||
on-resume = "hyprctl dispatch dpms on";
|
||||
on-timeout = suspendScript.outPath;
|
||||
timeout = 900;
|
||||
}
|
||||
#{
|
||||
# on-resume="hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
|
||||
# on-timeout="hyprctl dispatch dpms off"; # screen off when timeout has passed
|
||||
# timeout=420;
|
||||
#}
|
||||
];
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
in {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "pidof hyprlock || hyprlock";
|
||||
before_sleep_cmd = "pidof hyprlock || loginctl lock-session"; # lock before suspend.
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
|
||||
ignore_dbus_inhibit = false;
|
||||
};
|
||||
|
||||
listener = [
|
||||
#{
|
||||
# on-resume="brightnessctl -r"; # monitor backlight restore.
|
||||
# on-timeout="brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
||||
# timeout=240;
|
||||
#}
|
||||
#{
|
||||
# on-resume="brightnessctl -rd rgb:kbd_backlight";
|
||||
# on-timeout="brightnessctl -sd rgb:kbd_backlight set 0";
|
||||
# timeout=300;
|
||||
#}
|
||||
{
|
||||
on-timeout = "notify-send \"You're idle. Locking in 30 seconds.\"";
|
||||
timeout = 830;
|
||||
}
|
||||
{
|
||||
on-timeout = "pidof hyprlock && systemctl suspend";
|
||||
timeout = 120;
|
||||
}
|
||||
#{
|
||||
# on-timeout="loginctl lock-session";
|
||||
# timeout=360;
|
||||
#}
|
||||
{
|
||||
on-resume = "hyprctl dispatch dpms on";
|
||||
on-timeout = suspendScript.outPath;
|
||||
timeout = 900;
|
||||
}
|
||||
#{
|
||||
# on-resume="hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
|
||||
# on-timeout="hyprctl dispatch dpms off"; # screen off when timeout has passed
|
||||
# timeout=420;
|
||||
#}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ in {
|
|||
"$mainMod ALT, L, exec, ${pkgs.hyprlock}/bin/hyprlock"
|
||||
|
||||
''$mainMod, E, exec, $emacs''
|
||||
#''$mainMod SHIFT, E, exec, emacsclient -e "(emacs-everywhere)"''
|
||||
#''$mainMod SHIFT, E, exec, emacsclient -e "(emacs-everywhere)"''
|
||||
];
|
||||
|
||||
bindm = [
|
||||
|
|
@ -126,17 +126,23 @@ in {
|
|||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
misc = {
|
||||
vfr = true; #lowers the amount of frames when nothing happens
|
||||
allow_session_lock_restore = true; # hope that it fixes the crash of hyprlock
|
||||
disable_hyprland_logo = true;# disables the random Hyprland logo / anime girl background. :(
|
||||
vfr = true; #lowers the amount of frames when nothing happens
|
||||
allow_session_lock_restore = true; # hope that it fixes the crash of hyprlock
|
||||
disable_hyprland_logo = true; # disables the random Hyprland logo / anime girl background. :(
|
||||
};
|
||||
input = {
|
||||
kb_layout = "us, ru";
|
||||
kb_options = "grp:lctrl_toggle, ctrl:nocaps" + (if hwconfig.hostname == "kylekrein-mac" then ", altwin:swap_alt_win" else ""); # "ctrl:nocaps, grp:toggle"
|
||||
kb_options =
|
||||
"grp:lctrl_toggle, ctrl:nocaps"
|
||||
+ (
|
||||
if hwconfig.hostname == "kylekrein-mac"
|
||||
then ", altwin:swap_alt_win"
|
||||
else ""
|
||||
); # "ctrl:nocaps, grp:toggle"
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
disable_while_typing = false; #for games
|
||||
disable_while_typing = false; #for games
|
||||
};
|
||||
};
|
||||
env = [
|
||||
|
|
@ -159,7 +165,7 @@ in {
|
|||
|
||||
cursor = {
|
||||
no_hardware_cursors = true;
|
||||
inactive_timeout = 10;
|
||||
inactive_timeout = 10;
|
||||
};
|
||||
|
||||
general = {
|
||||
|
|
@ -173,8 +179,9 @@ in {
|
|||
allow_tearing = false;
|
||||
layout = "dwindle";
|
||||
};
|
||||
render = lib.mkIf (hwconfig.system == "aarch64-linux") { # Explicit sync breaks asahi driver https://github.com/hyprwm/Hyprland/issues/8158
|
||||
explicit_sync = 0;
|
||||
render = lib.mkIf (hwconfig.system == "aarch64-linux") {
|
||||
# Explicit sync breaks asahi driver https://github.com/hyprwm/Hyprland/issues/8158
|
||||
explicit_sync = 0;
|
||||
};
|
||||
|
||||
windowrule = [
|
||||
|
|
@ -212,9 +219,9 @@ in {
|
|||
#emacs run launcher
|
||||
"float, title:emacs-run-launcher"
|
||||
"pin, title:emacs-run-launcher"
|
||||
|
||||
#emacs
|
||||
"opaque, class:emacs"
|
||||
|
||||
#emacs
|
||||
"opaque, class:emacs"
|
||||
];
|
||||
|
||||
decoration = {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,25 @@
|
|||
{ pkgs, lib, hwconfig, ... }:
|
||||
let
|
||||
profile-image = ./profile-image.png;
|
||||
battery-level = (import ./battery-status.nix {inherit pkgs; inherit hwconfig;}).labelPercent;
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
hwconfig,
|
||||
...
|
||||
}: let
|
||||
profile-image = ./profile-image.png;
|
||||
battery-level =
|
||||
(import ./battery-status.nix {
|
||||
inherit pkgs;
|
||||
inherit hwconfig;
|
||||
}).labelPercent;
|
||||
in {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
#enable_fingerprint = true;
|
||||
disable_loading_bar = true;
|
||||
hide_cursor = true;
|
||||
no_fade_in = false;
|
||||
grace = 10;
|
||||
disable_loading_bar = true;
|
||||
hide_cursor = true;
|
||||
no_fade_in = false;
|
||||
grace = 10;
|
||||
};
|
||||
background = {
|
||||
blur_passes = 1;
|
||||
|
|
@ -24,14 +31,14 @@ in
|
|||
vibrancy_darkness = 0.0;
|
||||
};
|
||||
image = {
|
||||
path = "${profile-image}";
|
||||
size = 150;
|
||||
border_size = 4;
|
||||
#border_color = "rgb(0C96F9)";
|
||||
rounding = -1; # Negative means circle
|
||||
position = "0, 220";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
path = "${profile-image}";
|
||||
size = 150;
|
||||
border_size = 4;
|
||||
#border_color = "rgb(0C96F9)";
|
||||
rounding = -1; # Negative means circle
|
||||
position = "0, 220";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
};
|
||||
input-field = {
|
||||
size = "600, 100";
|
||||
|
|
@ -51,41 +58,41 @@ in
|
|||
halign = "center";
|
||||
valign = "center";
|
||||
};
|
||||
label = [
|
||||
{
|
||||
text = "$USER";
|
||||
font_family = "Fira Code";
|
||||
font_size = 56;
|
||||
position = "0, 100";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
text = "$TIME";
|
||||
font_family = "Roboto";
|
||||
font_size = 72;
|
||||
position = "-40, -40";
|
||||
halign = "right";
|
||||
valign = "top";
|
||||
}
|
||||
{
|
||||
text = "$LAYOUT";
|
||||
font_family = "JetBrains Mono";
|
||||
font_size = 28;
|
||||
position = "-20, 20";
|
||||
halign = "right";
|
||||
valign = "bottom";
|
||||
}
|
||||
] ++ lib.optional (hwconfig.isLaptop) (
|
||||
{
|
||||
label =
|
||||
[
|
||||
{
|
||||
text = "$USER";
|
||||
font_family = "Fira Code";
|
||||
font_size = 56;
|
||||
position = "0, 100";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
text = "$TIME";
|
||||
font_family = "Roboto";
|
||||
font_size = 72;
|
||||
position = "-40, -40";
|
||||
halign = "right";
|
||||
valign = "top";
|
||||
}
|
||||
{
|
||||
text = "$LAYOUT";
|
||||
font_family = "JetBrains Mono";
|
||||
font_size = 28;
|
||||
position = "-20, 20";
|
||||
halign = "right";
|
||||
valign = "bottom";
|
||||
}
|
||||
]
|
||||
++ lib.optional (hwconfig.isLaptop) {
|
||||
text = ''cmd[update:10000] ${battery-level}'';
|
||||
font_family = "JetBrains Mono";
|
||||
font_size = 28;
|
||||
position = "20, 20";
|
||||
halign = "left";
|
||||
valign = "bottom";
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,70 +1,79 @@
|
|||
{ pkgs, lib, hwconfig, ... }:
|
||||
let
|
||||
battery = (import ./battery-status.nix {inherit pkgs; inherit hwconfig;});
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
hwconfig,
|
||||
...
|
||||
}: let
|
||||
battery = import ./battery-status.nix {
|
||||
inherit pkgs;
|
||||
inherit hwconfig;
|
||||
};
|
||||
in {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
#systemd.enable = true;
|
||||
|
||||
#window#waybar {
|
||||
# background: transparent;
|
||||
#border-bottom: none;
|
||||
#}
|
||||
#${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"}
|
||||
style = ''
|
||||
${builtins.readFile ./waybarstyle.css}
|
||||
|
||||
* {
|
||||
font-size: 15px;
|
||||
}
|
||||
'';
|
||||
settings = [{
|
||||
# background: transparent;
|
||||
#border-bottom: none;
|
||||
#}
|
||||
#${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"}
|
||||
style = ''
|
||||
${builtins.readFile ./waybarstyle.css}
|
||||
|
||||
* {
|
||||
font-size: 15px;
|
||||
}
|
||||
'';
|
||||
settings = [
|
||||
{
|
||||
height = 36;
|
||||
layer = "top";
|
||||
position = "top";
|
||||
tray = { spacing = 3; };
|
||||
modules-center = [
|
||||
#"hyprland/window"
|
||||
"clock"
|
||||
];
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
# "hyprland/window"
|
||||
tray = {spacing = 3;};
|
||||
modules-center = [
|
||||
#"hyprland/window"
|
||||
"clock"
|
||||
];
|
||||
modules-right = lib.optional hwconfig.isLaptop "backlight"
|
||||
++ [
|
||||
"pulseaudio"
|
||||
#"network"
|
||||
#"cpu"
|
||||
"memory"
|
||||
#"temperature"
|
||||
"hyprland/language"
|
||||
] ++ lib.optional battery.available "custom/battery"
|
||||
++ [
|
||||
"tray"
|
||||
"custom/notification"
|
||||
#"custom/disablehypridle"
|
||||
"custom/power"
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
# "hyprland/window"
|
||||
];
|
||||
modules-right =
|
||||
lib.optional hwconfig.isLaptop "backlight"
|
||||
++ [
|
||||
"pulseaudio"
|
||||
#"network"
|
||||
#"cpu"
|
||||
"memory"
|
||||
#"temperature"
|
||||
"hyprland/language"
|
||||
]
|
||||
++ lib.optional battery.available "custom/battery"
|
||||
++ [
|
||||
"tray"
|
||||
"custom/notification"
|
||||
#"custom/disablehypridle"
|
||||
"custom/power"
|
||||
];
|
||||
battery = {
|
||||
format = " {time} {icon} ";
|
||||
format-alt = " {capacity}% {icon} ";
|
||||
format-charging = " {capacity}% ";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
format-icons = ["" "" "" "" ""];
|
||||
format-plugged = " {capacity}% ";
|
||||
states = {
|
||||
critical = 10;
|
||||
warning = 20;
|
||||
};
|
||||
};
|
||||
backlight = {
|
||||
format = "{percent}% ";
|
||||
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s 5%+";
|
||||
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
|
||||
};
|
||||
backlight = {
|
||||
format = "{percent}% ";
|
||||
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s 5%+";
|
||||
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
|
||||
};
|
||||
"custom/battery" = {
|
||||
exec ="${pkgs.writeShellScriptBin "battery-widget" ''
|
||||
exec = "${pkgs.writeShellScriptBin "battery-widget" ''
|
||||
${battery.labelAdaptive}
|
||||
${battery.labelPercent}
|
||||
''}/bin/battery-widget";
|
||||
|
|
@ -80,12 +89,12 @@ in
|
|||
tooltip = false;
|
||||
};
|
||||
"hyprland/language" = {
|
||||
format = " {}";
|
||||
format = " {}";
|
||||
};
|
||||
memory = {
|
||||
interval = 1;
|
||||
format = "{used}/{total}Gb ";
|
||||
};
|
||||
memory = {
|
||||
interval = 1;
|
||||
format = "{used}/{total}Gb ";
|
||||
};
|
||||
network = {
|
||||
interval = 1;
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
|
|
@ -102,7 +111,7 @@ in
|
|||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-icons = {
|
||||
car = "";
|
||||
default = [ "" "" "" ];
|
||||
default = ["" "" ""];
|
||||
handsfree = "";
|
||||
headphones = "";
|
||||
headset = "";
|
||||
|
|
@ -114,57 +123,57 @@ in
|
|||
format-source-muted = "";
|
||||
on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol";
|
||||
};
|
||||
"hyprland/submap" = { format = ''<span style="italic">{}</span>''; };
|
||||
"hyprland/submap" = {format = ''<span style="italic">{}</span>'';};
|
||||
temperature = {
|
||||
critical-threshold = 80;
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [ "" "" "" ];
|
||||
format-icons = ["" "" ""];
|
||||
};
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
warp-on-scroll = true;
|
||||
format = "{name}{icon} ";
|
||||
format-icons = {
|
||||
urgent = "";
|
||||
active = "";
|
||||
default = "";
|
||||
};
|
||||
#persistent-workspaces = {
|
||||
# "*" = 3;
|
||||
#};
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
warp-on-scroll = true;
|
||||
format = "{name}{icon} ";
|
||||
format-icons = {
|
||||
urgent = "";
|
||||
active = "";
|
||||
default = "";
|
||||
};
|
||||
#persistent-workspaces = {
|
||||
# "*" = 3;
|
||||
#};
|
||||
};
|
||||
|
||||
"custom/power" = {
|
||||
format = "⏻ ";
|
||||
tooltip = false;
|
||||
#menu = "on-click";
|
||||
#menu-file = ./power_menu.xml;
|
||||
#menu-actions = {
|
||||
# shutdown = "shutdown -h now";
|
||||
# reboot = "reboot";
|
||||
# suspend = "systemctl suspend";
|
||||
# hibernate = "systemctl hibernate";
|
||||
#};
|
||||
on-click = "wlogout";
|
||||
format = "⏻ ";
|
||||
tooltip = false;
|
||||
#menu = "on-click";
|
||||
#menu-file = ./power_menu.xml;
|
||||
#menu-actions = {
|
||||
# shutdown = "shutdown -h now";
|
||||
# reboot = "reboot";
|
||||
# suspend = "systemctl suspend";
|
||||
# hibernate = "systemctl hibernate";
|
||||
#};
|
||||
on-click = "wlogout";
|
||||
};
|
||||
|
||||
"custom/notification" = {
|
||||
tooltip = false;
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
notification = " <span foreground='red'><small><sup>⬤</sup></small></span>";
|
||||
none = " ";
|
||||
dnd-notification = " <span foreground='red'><small><sup>⬤</sup></small></span>";
|
||||
dnd-none = " ";
|
||||
};
|
||||
return-type = "json";
|
||||
exec-if = "which swaync-client";
|
||||
exec = "swaync-client -swb";
|
||||
on-click = "sleep 0.1 && swaync-client -t -sw";
|
||||
on-click-right = "sleep 0.1 && swaync-client -d -sw";
|
||||
escape = true;
|
||||
tooltip = false;
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
notification = " <span foreground='red'><small><sup>⬤</sup></small></span>";
|
||||
none = " ";
|
||||
dnd-notification = " <span foreground='red'><small><sup>⬤</sup></small></span>";
|
||||
dnd-none = " ";
|
||||
};
|
||||
return-type = "json";
|
||||
exec-if = "which swaync-client";
|
||||
exec = "swaync-client -swb";
|
||||
on-click = "sleep 0.1 && swaync-client -t -sw";
|
||||
on-click-right = "sleep 0.1 && swaync-client -d -sw";
|
||||
escape = true;
|
||||
};
|
||||
|
||||
"custom/disablehypridle" = {
|
||||
|
|
@ -184,6 +193,7 @@ in
|
|||
fi
|
||||
'';
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue