start refactoring

This commit is contained in:
Noa Aarts 2024-04-03 20:30:38 +02:00
parent 3262489146
commit b406b8bbfa
12 changed files with 296 additions and 303 deletions

View file

@ -1,8 +0,0 @@
{ config, pkgs, inputs, ... }:
{
services.hypridle = {
enable = true;
# TODO: find commands to turn on/off monitors
};
}

View file

@ -1,115 +0,0 @@
{ config, pkgs, inputs, ... }:
{
# these are necessary for the config to function correctly
imports = [
./kitty.nix
./waybar-vnc.nix
./wofi.nix
];
home.packages = with pkgs; [
hyprland
# I always want these with hyprland anyways
dunst
wl-clipboard
slurp
grim
];
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = [
"DP-3,2560x1440@144,0x0,1"
"DP-2,disable"
];
windowrulev2 = [
"opacity 0.8 0.8,class:^(kitty)$"
"stayfocused,class:^(wofi)$"
];
env = [
"WLR_NO_HARDWARE_CURSORS,1"
];
exec-once = [
"waybar"
"wayvnc --output=DP-3 0.0.0.0 5909"
"dunst"
"hyprctl dispatcher focusmonitor 1"
];
general = {
sensitivity = "1.2";
gaps_in = "2";
gaps_out = "3";
border_size = "3";
"col.active_border"="0xff950fad";
"col.inactive_border"="0xff26052e";
};
decoration = {
rounding = "6";
active_opacity = "1";
inactive_opacity = "1";
};
workspace = [
"HEADLESS-2,1"
];
animations = {
enabled = "1";
animation = [
"windows,1,2,default"
"border,1,10,default"
"fade,0,5,default"
"workspaces,1,4,default"
];
};
"$mod" = "SUPER";
bind = [
"$mod,Return,exec,kitty"
"$mod,tab,cyclenext"
"SUPERSHIFT,Q,killactive"
"$mod,SPACE,exec,wofi-launch"
"$mod,P,exec,wofi-power"
"SUPERSHIFT,m,exit"
"$mod,H,movefocus,l"
"$mod,J,movefocus,u"
"$mod,K,movefocus,d"
"$mod,L,movefocus,r"
"SUPERSHIFT,H,movewindow,l"
"SUPERSHIFT,J,movewindow,u"
"SUPERSHIFT,K,movewindow,d"
"SUPERSHIFT,L,movewindow,r"
"$mod,F,togglefloating"
"$mod,X,togglespecialworkspace"
"SUPERSHIFT,X,movetoworkspace,special"
"$mod,Print,exec,grim - | wl-copy && notify-send 'Screenshot Copied to Clipboard'"
"SUPERSHIFT,S,exec,slurp | grim -g - /tmp/photo && wl-copy < /tmp/photo && notify-send 'Screenshot Copied to Clipboard'"
"$mod,f11,fullscreen,0"
",XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_SINK@ 1%-"
",XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_SINK@ 1%+"
",XF86AudioMute,exec,wpctl set-mute @DEFAULT_SINK@ toggle"
",XF86AudioPlay,exec,playerctl play-pause"
",XF86AudioPrev,exec,playerctl previous"
",XF86AudioNext,exec,playerctl next"
]
++ (
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x+1);
in
builtins.toString (x);
in [
"$mod,${ws},workspace,${ws}"
"ALT,${ws},movetoworkspace,${ws}"
]
)
10)
);
bindm = [
"$mod,mouse:272,movewindow"
"$mod,mouse:273,resizewindow"
];
};
};
}

View file

@ -1,18 +1,16 @@
{ config, pkgs, inputs, ... }:
let
hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland;
in
{
# these are necessary for the config to function correctly
imports = [
./kitty.nix
./waybar.nix
./wofi.nix
# ./hypridle.nix # TODO: find out why these bitches not work
# ./hyprlock.nix
./dunst.nix
];
home.packages = with pkgs; [
hyprland
# I always want these with hyprland anyways
libnotify # to enable the notify-send command
wl-clipboard
@ -24,9 +22,13 @@
playerctl
];
xdg.portal.configPackages = [ hyprland ];
services.playerctld.enable = true;
wayland.windowManager.hyprland = {
enable = true;
package = hyprland;
settings = {
monitor = [
"DP-3,2560x1440@360,2560x0,1"
@ -122,5 +124,4 @@
];
};
};
}

View file

@ -1,8 +0,0 @@
{ config, pkgs, inputs, ... }:
{
programs.hyprlock = {
enable = true;
# TODO: find commands to turn on/off monitors
};
}

View file

@ -1,88 +0,0 @@
{ config, pkgs, inputs, ... }:
{
home.packages = with pkgs; [
waybar
font-awesome
];
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 28;
output = [
"HEADLESS-2"
];
modules-left = [ "hyprland/workspaces" "tray" "custom/pronouns" "custom/spotify" ];
modules-center = [ "hyprland/window" "clock" ];
modules-right = [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "temperature" "custom/poweroff" ];
"clock" = {
tooltip-format = "<big>{:%Y %B}</big>\n\n<small>{calendar}</small>";
interval = 1;
format = "{:%H:%M:%S}";
format-alt = ":%Y-%m-%d %H:%M:%S}";
on-click-middle = "gnome-clocks";
calendar = {
weeks-pos = "left";
format = {
today = "<span color='#FF6666'><u>{}</u></span>";
weeks = "<span color='#707A8C'>{}</span>";
};
};
};
"tray".spacing = 10;
"cpu" = {
format = "cpu: {usage}%";
tooltip = false;
};
"memory" = {
format = "mem: {}%";
};
"wireplumber" = {
format = "{volume}%";
};
"custom/vpn" = {
format = "VPN";
exec = "echo '{\"class\": \"connected\"}'";
exec-if = "test -d /proc/sys/net/ipv4/conf/tun0";
return-type = "json";
interval = 5;
};
"temperature" = {
thermal-zone = 2;
hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" ""];
};
"custom/poweroff" = {
format = "";
on-click = "wofi-power";
on-click-right = "swaylock";
};
"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}";
};
"custom/pronouns" = {
format = "{}";
exec = "${config.xdg.configHome}/waybar/pronouns";
interval = 5;
};
"hyprland/workspaces" = {
format = "{name}";
on-click = "activate";
sort-by = "id";
};
};
};
style = ../styles/waybar.css;
};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, inputs, ... }:
{ config, pkgs, lib, ... }:
{
home.packages = with pkgs; [
@ -6,7 +6,7 @@
font-awesome
];
programs.waybar = {
enable = true;
enable = lib.mkDefault true;
settings = {
mainBar = {
layer = "top";

View file

@ -10,21 +10,16 @@
'')
(writeShellScriptBin "wofi-power" ''
lock="Lock"
logout="Logout"
poweroff="Poweroff"
reboot="Reboot"
sleep="Suspend"
selected_option=$(echo -e "$lock\n$logout\n$sleep\n$reboot\n$poweroff" | wofi --dmenu -i -p "Powermenu")
selected_option=$(echo -e "$lock\n$sleep\n$reboot\n$poweroff" | wofi --dmenu -i -p "Powermenu")
if [ "$selected_option" == "$lock" ]
then
echo "lock"
swaylock
elif [ "$selected_option" == "$logout" ]
then
echo "logout"
loginctl terminate-user `whoami`
elif [ "$selected_option" == "$poweroff" ]
then
echo "poweroff"