Add monitor/setup/setup_hide_panel.sh
This commit is contained in:
parent
457fcb0613
commit
2b97596893
48
monitor/setup/setup_hide_panel.sh
Normal file
48
monitor/setup/setup_hide_panel.sh
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/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."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user