Setupbox_cloud/monitor/setup/setup_hide_panel.sh

49 lines
1.3 KiB
Bash

#!/bin/bash
# Tạo file hide_panel.sh
cat << 'EOF' > /root/monitor/setup/hide_panel.sh
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Tự động ẩn panel-1
xfconf-query -c xfce4-panel -p /panels/panel-1/autohide --create -t int -s 1
# Thiết lập chế độ tự ẩn (1 = thông minh, 2 = luôn ẩn)
xfconf-query -c xfce4-panel -p /panels/panel-1/autohide-behavior --create -t int -s 2
# 2. Đặt hình nền là winter.png trong cùng thư mục
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image --create -t string -s "$SCRIPT_DIR/background.png"
# Reload background
xfdesktop --reload
# Khởi động lại panel để áp dụng thay đổi
xfce4-panel -r
EOF
# Cấp quyền thực thi cho script
chmod +x /root/monitor/setup/hide_panel.sh
sudo /root/monitor/setup/hide_panel.sh
# Step 2: Create autostart configuration directory
echo "Configuring autostart..."
mkdir -p ~/.config/autostart
# Step 3: Create autostart configuration file
AUTOSTART_FILE=~/.config/autostart/hide-panel.desktop
cat <<EOL > "$AUTOSTART_FILE"
[Desktop Entry]
Type=Application
Exec=/root/monitor/setup/hide_panel.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Hide XFCE Panel
Comment=Auto hide panel desktop
EOL
echo "Hide panel has been installed and configured successfully."