From dc09318a40e02f95ad0a10c072d683e7e5402e4e Mon Sep 17 00:00:00 2001 From: FURK4NGG <105324908+FURK4NGG@users.noreply.github.com> Date: Mon, 19 Jan 2026 00:35:40 +0300 Subject: [PATCH] Add files via upload --- generate-waybar-configs.sh | 29 +++++++++++++++++++++++++++++ start-waybars.sh | 14 ++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 generate-waybar-configs.sh create mode 100644 start-waybars.sh diff --git a/generate-waybar-configs.sh b/generate-waybar-configs.sh new file mode 100644 index 0000000..ebc177e --- /dev/null +++ b/generate-waybar-configs.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -e + +WAYBAR_DIR="$HOME/.config/waybar" +BASE_CONFIG="$WAYBAR_DIR/config" + +if [ ! -f "$BASE_CONFIG" ]; then + echo "[error] base config not found" + exit 1 +fi + +command -v hyprctl >/dev/null || { + echo "[error] hyprctl not found" + exit 1 +} + +MONITORS=$(hyprctl -j monitors | jq -r '.[].name') + +for MONITOR in $MONITORS; do + TARGET="$WAYBAR_DIR/config-$MONITOR" + + { + echo '{' + echo " \"output\": [\"$MONITOR\"]," + sed '1s/^{//' "$BASE_CONFIG" + } > "$TARGET" + + echo "[ok] generated $TARGET for $MONITOR" +done diff --git a/start-waybars.sh b/start-waybars.sh new file mode 100644 index 0000000..010596b --- /dev/null +++ b/start-waybars.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Ortam değişkenleri +export XDG_RUNTIME_DIR="/run/user/$(id -u)" +export WAYLAND_DISPLAY="wayland-1" + +WAYBAR_BIN="/usr/bin/waybar" +CONFIG_DIR="$HOME/.config/waybar" + +# Tüm config-* dosyalarını al +for CONFIG in "$CONFIG_DIR"/config-*; do + echo "[waybar] starting with $CONFIG" + "$WAYBAR_BIN" -c "$CONFIG" & +done