Skip to content

Commit

Permalink
added sddm setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
n0noob committed Jan 23, 2025
1 parent f5a7647 commit 05c61a4
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 2 deletions.
66 changes: 66 additions & 0 deletions home-dir/.scripts/jellyfin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# Map of source directories to mount locations
declare -A MOUNT_MAP=(
["/home/aneem/jellyfin-movies"]="jellyfin-movies"
["/home/aneem/.int-certs"]="int"
["/home/aneem/Downloads"]="downloads"
["/run/media/aneem/OMEGA/BACKUPS/NEW-SSD/EndeavourOS2024/HOME/.int-certs/images/"]="int-img"
["/run/media/aneem/OMEGA/BACKUPS/NEW-SSD/EndeavourOS2024/HOME/.int-certs/videos/"]="int-vid"
)

# Root path to be added to each destination path
MOUNT_ROOT_PATH="/media/"

# jellyfin-start function
jellyfin-start() {
echo "Starting Jellyfin service..."
# Start the jellyfin service
sudo systemctl start jellyfin

# Allow TCP traffic to port 8096 for the current session
echo "Configuring firewall to allow TCP traffic on port 8096..."
sudo firewall-cmd --add-port=8096/tcp

# Mount directories based on the map
for SOURCE in "${!MOUNT_MAP[@]}"; do
DESTINATION="${MOUNT_ROOT_PATH}${MOUNT_MAP[$SOURCE]}"
if [[ -d "$SOURCE" && -d "$DESTINATION" ]]; then
echo "Mounting $SOURCE to $DESTINATION..."
sudo mount --bind "$SOURCE" "$DESTINATION"
else
echo "Skipping $SOURCE -> $DESTINATION. Ensure both directories exist."
fi
done
}

# jellyfin-stop function
jellyfin-stop() {
echo "Stopping Jellyfin service..."
# Stop the jellyfin service
sudo systemctl stop jellyfin

# Remove the TCP port allowance from the firewall
echo "Removing firewall rule for TCP traffic on port 8096..."
sudo firewall-cmd --remove-port=8096/tcp

# Unmount directories based on the map
for SOURCE in "${!MOUNT_MAP[@]}"; do
DESTINATION="${MOUNT_ROOT_PATH}${MOUNT_MAP[$SOURCE]}"
if mountpoint -q "$DESTINATION"; then
echo "Unmounting $DESTINATION..."
sudo umount "$DESTINATION"
else
echo "$DESTINATION is not mounted. Skipping..."
fi
done
}

# Help message
if [[ "$1" == "start" ]]; then
jellyfin-start
elif [[ "$1" == "stop" ]]; then
jellyfin-stop
else
echo "Usage: $0 {start|stop}"
fi
5 changes: 5 additions & 0 deletions hypr/.config/hypr/autostart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ if [[ ! `pidof polkit-gnome-authentication-agent-1` ]]; then
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
fi

if [[ ! `pidof hypridle` ]]; then
hypridle >> /var/log/hypridle.log &
fi


# variables
scripts=~/.scripts
wallpapers=~/.wallpapers
Expand Down
5 changes: 5 additions & 0 deletions hypr/.config/hypr/hypridle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
listener {
timeout = 60 # in seconds.
on-timeout = notify-send "You are idle!" # command to run when timeout has passed.
on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}
4 changes: 2 additions & 2 deletions mpv/.config/mpv/input.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Zoom
- add video-zoom -.25
+ add video-zoom .25
KP_SUBTRACT add video-zoom -.25
KP_ADD add video-zoom .25

kp8 add video-pan-y .05
kp6 add video-pan-x -.05
Expand Down
1 change: 1 addition & 0 deletions setup-sddm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sudo sed -i -e 's/Current=/Current=maldives/g' /usr/lib/sddm/sddm.conf.d/default.conf

0 comments on commit 05c61a4

Please sign in to comment.