first commit

This commit is contained in:
hdvt
2025-11-13 23:48:27 +03:00
commit 981b16aa8d
28 changed files with 1844 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
export STATUS_FILE="$XDG_RUNTIME_DIR/keyboard.status"
enable_keyboard() {
printf "true" >"$STATUS_FILE"
notify-send -u normal "Enabling Keyboard"
hyprctl keyword '$LAPTOP_KB_ENABLED' "true" -r
}
disable_keyboard() {
printf "false" >"$STATUS_FILE"
notify-send -u normal "Disabling Keyboard"
hyprctl keyword '$LAPTOP_KB_ENABLED' "false" -r
}
if ! [ -f "$STATUS_FILE" ]; then
enable_keyboard
else
if [ $(cat "$STATUS_FILE") = "true" ]; then
disable_keyboard
elif [ $(cat "$STATUS_FILE") = "false" ]; then
enable_keyboard
fi
fi

View File

@@ -0,0 +1,8 @@
#!/bin/bash
# Check if HDMI-A-1 is present in hyprctl monitors output
if hyprctl monitors | grep -q "HDMI-A-1"; then
hyprctl keyword monitor eDP-1,disable
else
echo "HDMI-A-1 not detected. No action taken."
fi

7
hypr/scripts/floating.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [ $# -eq 0 ]; then
exit 1
fi
hyprctl dispatch exec "[float; center] $1"

16
hypr/scripts/restart.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "use: $0 <program>"
exit 1
fi
PROGRAM_NAME=$1
if pgrep -x "$PROGRAM_NAME" > /dev/null
then
pkill -x "$PROGRAM_NAME"
sleep 1
fi
$PROGRAM_NAME > /dev/null 2>&1 &

85
hypr/scripts/spotify-menu.sh Executable file
View File

@@ -0,0 +1,85 @@
#!/bin/bash
# --- ИКОНКИ (требуется Nerd Font) ---
# Вы можете заменить их на любые другие символы или эмодзи
ICON_PLAY="" # Play
ICON_PAUSE="" # Pause
ICON_NEXT="" # Next
ICON_PREV="" # Previous
ICON_SHUFFLE="" # Shuffle
ICON_REPEAT="" # Repeat
ICON_ARTIST="" # Artist
ICON_TITLE="" # Title (custom icon, could be  for music)
# Проверяем, запущен ли Spotify
if ! playerctl -p spotify status &> /dev/null; then
wofi --show dmenu -p "Spotify" <<< " Spotify не запущен"
exit 1
fi
# --- Получение текущего состояния плеера ---
STATUS=$(playerctl -p spotify status)
SHUFFLE_STATUS=$(playerctl -p spotify shuffle)
LOOP_STATUS=$(playerctl -p spotify loop)
ARTIST=$(playerctl -p spotify metadata artist)
TITLE=$(playerctl -p spotify metadata title)
# --- Формирование пунктов меню ---
# Строка с информацией о треке
INFO="$ICON_ARTIST $ARTIST\n$ICON_TITLE $TITLE"
# Кнопка Play/Pause
if [ "$STATUS" = "Playing" ]; then
PLAY_PAUSE="$ICON_PAUSE Пауза"
else
PLAY_PAUSE="$ICON_PLAY Воспроизвести"
fi
# Кнопка Shuffle
if [ "$SHUFFLE_STATUS" = "On" ]; then
SHUFFLE="[Вкл] $ICON_SHUFFLE Перемешать"
else
SHUFFLE="[Выкл] $ICON_SHUFFLE Перемешать"
fi
# Кнопка Repeat
if [ "$LOOP_STATUS" = "Track" ]; then
REPEAT="[Трек] $ICON_REPEAT Повтор"
elif [ "$LOOP_STATUS" = "Playlist" ]; then
REPEAT="[Плейлист] $ICON_REPEAT Повтор"
else
REPEAT="[Выкл] $ICON_REPEAT Повтор"
fi
# Остальные кнопки
PREV="$ICON_PREV Пред. трек"
NEXT="$ICON_NEXT След. трек"
# --- Отображение меню Wofi ---
# Собираем все опции в одну переменную, разделяя их новой строкой
options="$PLAY_PAUSE\n$PREV\n$NEXT\n$SHUFFLE\n$REPEAT"
# Вызываем Wofi, передавая ему опции и информацию о треке в качестве заголовка
# Используем кастомные файлы конфигурации и стилей
choice=$(echo -e "$options" | wofi --show dmenu -p "$INFO" --conf ~/.config/wofi/spotify/config --style ~/.config/wofi/spotify/style.css)
# --- Обработка выбора пользователя ---
case "$choice" in
"$PLAY_PAUSE")
playerctl -p spotify play-pause
;;
"$PREV")
playerctl -p spotify previous
;;
"$NEXT")
playerctl -p spotify next
;;
"$SHUFFLE")
playerctl -p spotify shuffle Toggle
;;
"$REPEAT")
playerctl -p spotify loop Playlist
;;
esac