-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtui_greet.sh
More file actions
executable file
·33 lines (25 loc) · 993 Bytes
/
Copy pathtui_greet.sh
File metadata and controls
executable file
·33 lines (25 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
CONFIG_FILE="/etc/greetd/config.toml"
NEW_COMMAND='command = "tuigreet --cmd start-hyprland --time --remember --asterisks --greeting '\'' Welcome to Hyprland '\'' --theme '\''border=magenta;text=cyan;prompt=green;time=red;action=blue;button=yellow;container=black;input=red'\''"'
# Check if run as root
if [ "$(id -u)" -ne 0 ]; then
echo "Please run this script as root (e.g., with sudo)."
exit 1
fi
# Check if tuigreet is installed
if ! command -v tuigreet &>/dev/null; then
echo "Error: 'tuigreet' is not installed. Please install tuigreet first."
exit 1
fi
# Check if the config file exists
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: Config file not found: $CONFIG_FILE"
exit 1
fi
# Replace the line containing 'command = ' with the new command
sed -i "s|^command = .*|$NEW_COMMAND|" "$CONFIG_FILE"
echo "Updated 'command =' in $CONFIG_FILE"
sudo systemctl enable greetd
echo "Enabled greetd service."
sudo systemctl start greetd
echo "Started greetd service."