Regenerated
This commit is contained in:
+360
-290
File diff suppressed because it is too large
Load Diff
+61
-2
@@ -401,7 +401,6 @@ This is a list of additional apps to install
|
|||||||
#packages
|
#packages
|
||||||
bluez
|
bluez
|
||||||
blueman
|
blueman
|
||||||
pavucontrol
|
|
||||||
usbutils
|
usbutils
|
||||||
todoist
|
todoist
|
||||||
brave
|
brave
|
||||||
@@ -2340,10 +2339,21 @@ in
|
|||||||
description = "Dynamic wallpapers per workspace for Hyprland";
|
description = "Dynamic wallpapers per workspace for Hyprland";
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wants = [ "graphical-session.target" ];
|
wants = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
ExecStart = "${homeDir}/Wallpapers/scripts/workspace-wallpapers.sh";
|
ExecStart = "${homeDir}/Wallpapers/scripts/workspace-wallpapers.sh";
|
||||||
Restart = "always";
|
Restart = "on-failure";
|
||||||
|
RestartSec = 5;
|
||||||
|
WorkingDirectory = homeDir;
|
||||||
|
Environment = [
|
||||||
|
"XDG_RUNTIME_DIR=${config.xdg.runtimeDir}"
|
||||||
|
"HYPRLAND_INSTANCE_SIGNATURE=${builtins.getEnv "HYPRLAND_INSTANCE_SIGNATURE"}"
|
||||||
|
"WAYLAND_DISPLAY=wayland-1"
|
||||||
|
"PATH=/run/current-system/sw/bin:/usr/bin:/bin"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -3179,6 +3189,34 @@ in
|
|||||||
|
|
||||||
* generated/modules/traveldroid/system
|
* generated/modules/traveldroid/system
|
||||||
|
|
||||||
|
** =generated/modules/traveldroid/system/audio.nix=
|
||||||
|
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/system/audio.nix :noweb yes :mkdirp yes :eval never
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
############################
|
||||||
|
# Audio system
|
||||||
|
############################
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
pulseaudio # PulseAudio daemon
|
||||||
|
pavucontrol # GUI mixer
|
||||||
|
pamixer # CLI mixer
|
||||||
|
];
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Enable PulseAudio system-wide
|
||||||
|
############################
|
||||||
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Optional: enable ALSA support
|
||||||
|
############################
|
||||||
|
hardware.pulseaudio.support32Bit = true; # for 32-bit apps
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
** =generated/modules/traveldroid/system/bluetooth.nix=
|
** =generated/modules/traveldroid/system/bluetooth.nix=
|
||||||
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/system/bluetooth.nix :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/system/bluetooth.nix :noweb yes :mkdirp yes :eval never
|
||||||
{ lib, config, pkgs, home-manager, ... }:
|
{ lib, config, pkgs, home-manager, ... }:
|
||||||
@@ -3343,6 +3381,27 @@ This sets the networking.
|
|||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** =generated/modules/traveldroid/system/printing.nix=
|
||||||
|
This sets the dbus implementation
|
||||||
|
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/system/printing.nix :noweb yes :mkdirp yes :eval never
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
############################
|
||||||
|
# Printing system
|
||||||
|
############################
|
||||||
|
services.printing.enable = true; # enable CUPS printing service
|
||||||
|
services.printing.drivers = [ "all" ]; # include all drivers (optional)
|
||||||
|
|
||||||
|
############################
|
||||||
|
# System packages for GUI management
|
||||||
|
############################
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
system-config-printer # GUI to manage printers
|
||||||
|
];
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
* generated/users
|
* generated/users
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,83 @@
|
|||||||
#!/run/current-system/sw/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
currentpath=/run/current-system/sw/bin
|
# -------------------------------
|
||||||
PICTURES_DIR="$HOME/Wallpapers/pictures"
|
# Config
|
||||||
|
# -------------------------------
|
||||||
|
HOME_DIR="$HOME"
|
||||||
|
PICTURES_DIR="$HOME_DIR/Wallpapers/pictures"
|
||||||
|
STATE_DIR="$HOME_DIR/.cache/hypr-wallpapers"
|
||||||
NAMESPACE="main"
|
NAMESPACE="main"
|
||||||
|
|
||||||
|
CURRENTPATH=/run/current-system/sw/bin
|
||||||
|
|
||||||
|
# Required environment variables
|
||||||
: "${XDG_RUNTIME_DIR:?XDG_RUNTIME_DIR is not set}"
|
: "${XDG_RUNTIME_DIR:?XDG_RUNTIME_DIR is not set}"
|
||||||
: "${HYPRLAND_INSTANCE_SIGNATURE:?HYPRLAND_INSTANCE_SIGNATURE is not set}"
|
: "${HYPRLAND_INSTANCE_SIGNATURE:?HYPRLAND_INSTANCE_SIGNATURE is not set}"
|
||||||
|
: "${WAYLAND_DISPLAY:?WAYLAND_DISPLAY is not set}"
|
||||||
|
|
||||||
IPC_SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
IPC_SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
||||||
|
|
||||||
while [ ! -S "$IPC_SOCKET" ]; do sleep 1; done
|
# -------------------------------
|
||||||
|
# Wait for Hyprland IPC socket
|
||||||
|
# -------------------------------
|
||||||
|
until [ -S "$IPC_SOCKET" ]; do
|
||||||
|
echo "Waiting for Hyprland IPC socket..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
echo $IPC_SOCKET
|
# -------------------------------
|
||||||
|
# Start swww-daemon if not already running
|
||||||
|
# -------------------------------
|
||||||
|
SWWW_SOCKET="$XDG_RUNTIME_DIR/swww/$NAMESPACE.sock"
|
||||||
|
|
||||||
# Start swww-daemon only if not already running for this namespace
|
if [ ! -S "$SWWW_SOCKET" ]; then
|
||||||
if [ ! -S "$XDG_RUNTIME_DIR/swww/$NAMESPACE.sock" ]; then
|
if ! pgrep -f "swww-daemon.*--namespace $NAMESPACE" >/dev/null; then
|
||||||
"$currentpath/swww-daemon" --namespace "$NAMESPACE" &
|
echo "Starting swww-daemon for namespace $NAMESPACE..."
|
||||||
sleep 0.5
|
"$CURRENTPATH/swww-daemon" --namespace "$NAMESPACE" &
|
||||||
|
sleep 0.5
|
||||||
|
else
|
||||||
|
echo "swww-daemon already running for namespace $NAMESPACE"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# -------------------------------
|
||||||
# Load wallpapers
|
# Load wallpapers
|
||||||
|
# -------------------------------
|
||||||
mapfile -t IMAGES < <(find "$PICTURES_DIR" -type f \( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' \))
|
mapfile -t IMAGES < <(find "$PICTURES_DIR" -type f \( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' \))
|
||||||
[ "${#IMAGES[@]}" -eq 0 ] && exit 1
|
[ "${#IMAGES[@]}" -eq 0 ] && { echo "No wallpapers found in $PICTURES_DIR"; exit 1; }
|
||||||
|
|
||||||
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
|
get_wallpaper() {
|
||||||
|
local ws="$1"
|
||||||
|
local mon="$2"
|
||||||
|
local key="$STATE_DIR/ws${ws}_mon${mon}.txt"
|
||||||
|
|
||||||
|
if [ -f "$key" ]; then
|
||||||
|
cat "$key"
|
||||||
|
else
|
||||||
|
local image="${IMAGES[RANDOM % ${#IMAGES[@]}]}"
|
||||||
|
echo "$image" > "$key"
|
||||||
|
echo "$image"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# -------------------------------
|
||||||
# Subscribe to workspace events
|
# Subscribe to workspace events
|
||||||
|
# -------------------------------
|
||||||
{
|
{
|
||||||
echo '{"subscribe":["workspace"]}'
|
echo '{"subscribe":["workspace"]}'
|
||||||
"$currentpath/socat" - UNIX-CONNECT:"$IPC_SOCKET"
|
"$CURRENTPATH/socat" - UNIX-CONNECT:"$IPC_SOCKET"
|
||||||
} | while read -r line; do
|
} | while read -r line; do
|
||||||
# Only parse lines starting with '{' (JSON)
|
[[ "$line" =~ ^\{ ]] || continue
|
||||||
if [[ "$line" =~ ^\{ ]]; then
|
|
||||||
WS_NUM=$(echo "$line" | "$currentpath/jq" -e -r 'select(.type=="workspace" and .active==true) | .workspace' 2>/dev/null || true)
|
WS_NUM=$("$CURRENTPATH/jq" -r 'select(.type=="workspace" and .active==true) | .workspace' <<< "$line" 2>/dev/null || true)
|
||||||
if [ -n "$WS_NUM" ]; then
|
MONITOR=$("$CURRENTPATH/jq" -r '.monitor' <<< "$line" 2>/dev/null || true)
|
||||||
RAND_IMAGE="${IMAGES[RANDOM % ${#IMAGES[@]}]}"
|
|
||||||
MONITOR=$(echo "$line" | "$currentpath/jq" -r '.monitor')
|
if [ -n "$WS_NUM" ] && [ -n "$MONITOR" ]; then
|
||||||
"$currentpath/swww" img "$RAND_IMAGE" --resize stretch --transition-type random --namespace "$WS_NUM"
|
WALLPAPER=$(get_wallpaper "$WS_NUM" "$MONITOR")
|
||||||
fi
|
echo "Setting wallpaper for workspace $WS_NUM on monitor $MONITOR: $WALLPAPER"
|
||||||
|
"$CURRENTPATH/swww" img "$WALLPAPER" --resize stretch --namespace "$WS_NUM"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#packages
|
#packages
|
||||||
bluez
|
bluez
|
||||||
blueman
|
blueman
|
||||||
pavucontrol
|
|
||||||
usbutils
|
usbutils
|
||||||
todoist
|
todoist
|
||||||
brave
|
brave
|
||||||
|
|||||||
@@ -71,10 +71,21 @@ in
|
|||||||
description = "Dynamic wallpapers per workspace for Hyprland";
|
description = "Dynamic wallpapers per workspace for Hyprland";
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wants = [ "graphical-session.target" ];
|
wants = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
ExecStart = "${homeDir}/Wallpapers/scripts/workspace-wallpapers.sh";
|
ExecStart = "${homeDir}/Wallpapers/scripts/workspace-wallpapers.sh";
|
||||||
Restart = "always";
|
Restart = "on-failure";
|
||||||
|
RestartSec = 5;
|
||||||
|
WorkingDirectory = homeDir;
|
||||||
|
Environment = [
|
||||||
|
"XDG_RUNTIME_DIR=${config.xdg.runtimeDir}"
|
||||||
|
"HYPRLAND_INSTANCE_SIGNATURE=${builtins.getEnv "HYPRLAND_INSTANCE_SIGNATURE"}"
|
||||||
|
"WAYLAND_DISPLAY=wayland-1"
|
||||||
|
"PATH=/run/current-system/sw/bin:/usr/bin:/bin"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
############################
|
||||||
|
# Audio system
|
||||||
|
############################
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
pulseaudio # PulseAudio daemon
|
||||||
|
pavucontrol # GUI mixer
|
||||||
|
pamixer # CLI mixer
|
||||||
|
];
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Enable PulseAudio system-wide
|
||||||
|
############################
|
||||||
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Optional: enable ALSA support
|
||||||
|
############################
|
||||||
|
hardware.pulseaudio.support32Bit = true; # for 32-bit apps
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
############################
|
||||||
|
# Printing system
|
||||||
|
############################
|
||||||
|
services.printing.enable = true; # enable CUPS printing service
|
||||||
|
services.printing.drivers = [ "all" ]; # include all drivers (optional)
|
||||||
|
|
||||||
|
############################
|
||||||
|
# System packages for GUI management
|
||||||
|
############################
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
system-config-printer # GUI to manage printers
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user