adapt desktop

adapt config so that it works on desktop too
This commit is contained in:
2026-03-20 23:00:30 +01:00
parent 39a9bad8f4
commit 70497a93d0
10 changed files with 179 additions and 107 deletions

View File

@@ -1,3 +1,13 @@
(defwindow power []
:class "powermenuWindow"
:geometry (geometry
:width "200px"
:height "50px"
:anchor "center center"
:x "0%"
:y "0%")
(powerpopup))
(defwidget powerpopup []
(box
:class "powermenu"
@@ -27,23 +37,3 @@
:class "powermenu-button"
(label
:text ""))))
(defwidget powermenu [shutdown shutdown_icon reboot
reboot_icon logout logout_icon]
(box :class "powermenu" :spacing 5
:vexpand true :hexpand true
:valign "end" :halign "end"
:space-evenly false
(button :onclick shutdown shutdown_icon)
(button :onclick reboot reboot_icon)
(button :onclick logout logout_icon)))
(defwindow power []
:class "powermenuWindow"
:geometry (geometry
:width "200px"
:height "50px"
:anchor "center center"
:x "0%"
:y "0%")
(powerpopup)
)

View File

@@ -1,10 +1,19 @@
WINDOW_NAME="power"
echo "Power button pressed" >>/tmp/acpi_log.txt
WINDOW="power"
DISPLAY=""
# Check if the window is already open
if eww active-windows | grep -q "$WINDOW_NAME"; then
eww close "$WINDOW_NAME"
else
eww open "$WINDOW_NAME" --screen "$(wlr-randr | grep -oP '^\S+' | head -n 1)"
if eww active-windows | grep -q "$WINDOW"; then
eww close "$WINDOW"
exit 0
fi
# Determin screen
if [[ "$(hostname)" == "eliasLaptop" ]]; then
DISPLAY="eDP-1"
elif [[ "$(hostname)" == "eliasDesktop" ]]; then
DISPLAY="DVI-D-1"
fi
echo "$DISPLAY"
eww open "$WINDOW" --screen "$DISPLAY"

View File

@@ -1,10 +1,9 @@
hostname=$(hostname)
HOST_NAME=$(hostname)
if [[ "$hostname" == "eliasLaptop" ]]; then
if [[ "$HOST_NAME" == "eliasLaptop" ]]; then
eww open bar --screen eDP-1
/home/elias/.config/eww/scripts/ristate.sh
elif [[ "$hostname" == "eliasDesktop" ]]; then
echo "This is another PC!"
else
echo "This is an unknown PC."
elif [[ "$HOST_NAME" == "eliasDesktop" ]]; then
eww open bar --screen DVI-D-1
/home/elias/.config/eww/scripts/ristate.sh
fi

View File

@@ -11,7 +11,6 @@
profile.outputs = [ { criteria = "eDP-1"; } ];
profile.exec = [
"systemctl --user start hypridle.service"
"eww reload"
];
}
{
@@ -21,36 +20,59 @@
"eww reload"
];
profile.outputs = [
{
criteria = "eDP-1";
mode = "1920x1080@60Hz";
position = "1920,0";
}
{
criteria = "HDMI-A-1";
mode = "1920x1080@60Hz";
position = "0,0";
}
{
criteria = "eDP-1";
mode = "1920x1080@60Hz";
position = "1920,0";
}
];
}
{
profile.name = "desktop";
profile.exec = [
"systemctl --user stop hypridle.service"
];
profile.outputs = [
{
criteria = "HDMI-A-2";
mode = "1920x1080@60Hz";
position = "0,0";
}
{
criteria = "DVI-D-1";
mode = "1920x1080@60Hz";
position = "1920,0";
}
{
criteria = "DP-2";
mode = "1920x1080@60Hz";
position = "3840,0";
}
];
}
{
profile.name = "desktop-reduced";
profile.exec = [
"systemctl --user stop hypridle.service"
];
profile.outputs = [
{
criteria = "DVI-D-1";
mode = "1920x1080@60Hz";
position = "0,0";
}
{
criteria = "DP-2";
mode = "1920x1080@60Hz";
position = "1920,0";
}
];
}
# {
# profile.name = "desktop";
# profile.exec = [
# "systemctl --user start hypridle.service"
# ];
# profile.outputs = [
# {
# criteria = "eDP-1";
# mode = "1920x1080@60Hz";
# position = "1920,0";
# }
# {
# criteria = "HDMI-A-1";
# mode = "1920x1080@60Hz";
# position = "0,0";
# }
# ];
# }
];
};
}

View File

@@ -10,11 +10,11 @@ in
imports = [
./cursor.nix
./fnott.nix
# ./gtk.nix TODO: check why so weird
./gtk.nix
./hyprlock.nix
./nvim.nix
./taskwarrior.nix
# ./qt.nix TODO: check why so weird
./qt.nix
];
catppuccin = {