Skip to content

Commit 9266a88

Browse files
committed
added obsidian setup script
1 parent cfeeca8 commit 9266a88

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

check_waybar.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Export display environment variables
4+
export XDG_RUNTIME_DIR=/run/user/$(id -u)
5+
export WAYLAND_DISPLAY=$(ls $XDG_RUNTIME_DIR | grep -m1 wayland)
6+
7+
# Check if Waybar is running
8+
if ! pgrep -x "waybar" > /dev/null
9+
then
10+
# If Waybar is not running, start it
11+
waybar &
12+
echo "Waybar restarted at $(date)" >> ~/waybar_restart.log
13+
fi

install.sh

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ aur_packages=(
128128
google-earth-pro
129129
luajit-tiktoken-bin
130130
btop
131+
obsidian
131132
)
132133

133134
# Update the system
@@ -180,6 +181,7 @@ scripts=(
180181
"rofi_theme.sh"
181182
"aliases.sh"
182183
"update_dns.sh"
184+
"obsidian_setup.sh"
183185
# "laptop_setup.sh"
184186
)
185187

obsidian_setup.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Define the path to the Obsidian desktop file
4+
DESKTOP_FILE="/usr/share/applications/obsidian.desktop"
5+
6+
# Check if the file exists
7+
if [ ! -f "$DESKTOP_FILE" ]; then
8+
echo "Error: Obsidian desktop file not found at $DESKTOP_FILE"
9+
exit 1
10+
fi
11+
12+
# Create a backup of the original file
13+
cp "$DESKTOP_FILE" "${DESKTOP_FILE}.bak"
14+
echo "Backup created: ${DESKTOP_FILE}.bak"
15+
16+
# Modify the Exec line to include --disable-gpu
17+
sed -i 's/^Exec=obsidian/Exec=obsidian --disable-gpu/' "$DESKTOP_FILE"
18+
19+
# Check if the modification was successful
20+
if grep -q "Exec=obsidian --disable-gpu" "$DESKTOP_FILE"; then
21+
echo "Successfully modified $DESKTOP_FILE to include --disable-gpu"
22+
else
23+
echo "Error: Failed to modify $DESKTOP_FILE"
24+
exit 1
25+
fi
26+
27+
echo "Obsidian desktop file has been updated. You may need to restart your desktop environment for changes to take effect."

0 commit comments

Comments
 (0)