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
|
||||
bluez
|
||||
blueman
|
||||
pavucontrol
|
||||
usbutils
|
||||
todoist
|
||||
brave
|
||||
@@ -2340,10 +2339,21 @@ in
|
||||
description = "Dynamic wallpapers per workspace for Hyprland";
|
||||
after = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
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" ];
|
||||
};
|
||||
}
|
||||
@@ -3179,6 +3189,34 @@ in
|
||||
|
||||
* 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=
|
||||
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/system/bluetooth.nix :noweb yes :mkdirp yes :eval never
|
||||
{ lib, config, pkgs, home-manager, ... }:
|
||||
@@ -3343,6 +3381,27 @@ This sets the networking.
|
||||
}
|
||||
#+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
|
||||
|
||||
|
||||
@@ -1,41 +1,83 @@
|
||||
#!/run/current-system/sw/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
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"
|
||||
|
||||
CURRENTPATH=/run/current-system/sw/bin
|
||||
|
||||
# Required environment variables
|
||||
: "${XDG_RUNTIME_DIR:?XDG_RUNTIME_DIR 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"
|
||||
|
||||
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 "$XDG_RUNTIME_DIR/swww/$NAMESPACE.sock" ]; then
|
||||
"$currentpath/swww-daemon" --namespace "$NAMESPACE" &
|
||||
sleep 0.5
|
||||
if [ ! -S "$SWWW_SOCKET" ]; then
|
||||
if ! pgrep -f "swww-daemon.*--namespace $NAMESPACE" >/dev/null; then
|
||||
echo "Starting swww-daemon for namespace $NAMESPACE..."
|
||||
"$CURRENTPATH/swww-daemon" --namespace "$NAMESPACE" &
|
||||
sleep 0.5
|
||||
else
|
||||
echo "swww-daemon already running for namespace $NAMESPACE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# -------------------------------
|
||||
# Load wallpapers
|
||||
# -------------------------------
|
||||
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
|
||||
# -------------------------------
|
||||
{
|
||||
echo '{"subscribe":["workspace"]}'
|
||||
"$currentpath/socat" - UNIX-CONNECT:"$IPC_SOCKET"
|
||||
"$CURRENTPATH/socat" - UNIX-CONNECT:"$IPC_SOCKET"
|
||||
} | while read -r line; do
|
||||
# Only parse lines starting with '{' (JSON)
|
||||
if [[ "$line" =~ ^\{ ]]; then
|
||||
WS_NUM=$(echo "$line" | "$currentpath/jq" -e -r 'select(.type=="workspace" and .active==true) | .workspace' 2>/dev/null || true)
|
||||
if [ -n "$WS_NUM" ]; then
|
||||
RAND_IMAGE="${IMAGES[RANDOM % ${#IMAGES[@]}]}"
|
||||
MONITOR=$(echo "$line" | "$currentpath/jq" -r '.monitor')
|
||||
"$currentpath/swww" img "$RAND_IMAGE" --resize stretch --transition-type random --namespace "$WS_NUM"
|
||||
fi
|
||||
[[ "$line" =~ ^\{ ]] || continue
|
||||
|
||||
WS_NUM=$("$CURRENTPATH/jq" -r 'select(.type=="workspace" and .active==true) | .workspace' <<< "$line" 2>/dev/null || true)
|
||||
MONITOR=$("$CURRENTPATH/jq" -r '.monitor' <<< "$line" 2>/dev/null || true)
|
||||
|
||||
if [ -n "$WS_NUM" ] && [ -n "$MONITOR" ]; then
|
||||
WALLPAPER=$(get_wallpaper "$WS_NUM" "$MONITOR")
|
||||
echo "Setting wallpaper for workspace $WS_NUM on monitor $MONITOR: $WALLPAPER"
|
||||
"$CURRENTPATH/swww" img "$WALLPAPER" --resize stretch --namespace "$WS_NUM"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#packages
|
||||
bluez
|
||||
blueman
|
||||
pavucontrol
|
||||
usbutils
|
||||
todoist
|
||||
brave
|
||||
|
||||
@@ -71,10 +71,21 @@ in
|
||||
description = "Dynamic wallpapers per workspace for Hyprland";
|
||||
after = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
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" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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