Skip to content

Commit

Permalink
Add autostart scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
xaqbr committed Jun 15, 2024
1 parent 2ce5818 commit e996f54
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 2 deletions.
26 changes: 24 additions & 2 deletions userpatches/customize-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ Main() {
# - libjson-glib-dev
# - chromium-browser GPU-enabled Chromium from rockchip-multimedia-config.
# - python3-shortuuid Random ID generator for Hawkbit initial target name.
# - vim Text editor
# - vim Text editor for remote / CLI development.
# - cmake Build tools needed for gnome-monitor-config.
# - libcairo2-dev
# - gettext Build tools needed for Gnome Hide Top Bar extension.
# =========================================================================
export DEBIAN_FRONTEND="noninteractive"
export APT_LISTCHANGES_FRONTEND="none"
add-apt-repository -y ppa:jjriek/panfork-mesa
add-apt-repository -y ppa:liujianfeng1994/rockchip-multimedia
apt-get update -y
apt-get install -y systemd-repart mali-g610-firmware rockchip-multimedia-config rauc-service libubootenv-tool meson libcurl4-openssl-dev libjson-glib-dev chromium-browser python3-shortuuid vim
apt-get install -y systemd-repart mali-g610-firmware rockchip-multimedia-config rauc-service libubootenv-tool meson libcurl4-openssl-dev libjson-glib-dev chromium-browser python3-shortuuid vim cmake libcairo2-dev gettext
apt-get dist-upgrade -y

# =========================================================================
Expand All @@ -66,6 +69,16 @@ Main() {
ninja -C build
cp build/rauc-hawkbit-updater /usr/sbin

# =========================================================================
# Build and install gnome-monitor-config
# =========================================================================
git clone https://github.com/jadahl/gnome-monitor-config /tmp/gnome-monitor-config
cd /tmp/gnome-monitor-config
meson build
cd build
meson compile
cp src/gnome-monitor-config /usr/bin

# =========================================================================
# Setup main user
# =========================================================================
Expand All @@ -85,6 +98,15 @@ Main() {
echo "export LANG=en_US.UTF-8"
echo "export LANGUAGE=en_US"
} >> /home/dmb/.xsessionrc
mkdir -p /home/dmb/.config/autostart && cp /tmp/overlay/autostart/* /home/dmb/.config/autostart

# =========================================================================
# Build and install Gnome hide top bar
# =========================================================================
git clone https://gitlab.gnome.org/tuxor1337/hidetopbar.git /tmp/hidetopbar
cd /tmp/hidetopbar
make
sudo -Hu dmb gnome-extensions install ./hidetopbar.zip

# =========================================================================
# Enable desktop manager auto-login.
Expand Down
11 changes: 11 additions & 0 deletions userpatches/overlay/autostart/dmbp-chromium.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0.0
Type=Application
Name=DMBP Chromium
Comment=Start local browser for displaying web app
Exec=chromium-browser --kiosk --no-first-run --noerrdialogs --disable-infobars --enable-features=OverlayScrollbar http://localhost
OnlyShowIn=GNOME;
StartupNotify=false
Terminal=false
Hidden=false
11 changes: 11 additions & 0 deletions userpatches/overlay/autostart/dmbp-gnome.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0.0
Type=Application
Name=DMBP Gnome
Comment=Patch Gnome settings for DMB Pro
Exec=dmbp-update-gnome
OnlyShowIn=GNOME;
StartupNotify=false
Terminal=false
Hidden=false
11 changes: 11 additions & 0 deletions userpatches/overlay/autostart/dmbp-resolution.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0.0
Type=Application
Name=DMBP Resolution
Comment=Set vertical screen orientation
Exec=dmbp-update-resolution
OnlyShowIn=GNOME;
StartupNotify=false
Terminal=false
Hidden=false
30 changes: 30 additions & 0 deletions userpatches/overlay/rootfs/usr/bin/dmbp-update-gnome
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Credit to https://unix.stackexchange.com/a/771693

# Disable Gnome automatic screen timeout.
gsettings set org.gnome.desktop.session idle-delay 0
gsettings set org.gnome.desktop.screensaver lock-delay 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0

# Disable Gnome wallpaper.
gsettings set org.gnome.desktop.background picture-options 'none'
gsettings set org.gnome.desktop.background primary-color '#000000'

# Disable Gnome Hide Top Bar extension's intellihide mode.
# (Top bar should always be hidden)
gnome-extensions enable hidetopbar@mathieu.bidon.ca
dconf write /org/gnome/shell/extensions/hidetopbar/enable-intellihide false

# Disable Gnome overview at startup
# (The ONLY other way to do this is through an extension and we're not doing that -_-).
# (Thanks Gnome developers!)
MTIME=50
for ((i=0; i<$MTIME; i++)); do
read -r DUMMY DUMMY IS_OVERVIEW <<< "$(dbus-send --print-reply=literal --session --dest=org.gnome.Shell --type=method_call /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:OverviewActive)"
if [[ "$IS_OVERVIEW" = "true" ]] ; then
/usr/bin/dbus-send --session --dest=org.gnome.Shell --type=method_call /org/gnome/Shell org.freedesktop.DBus.Properties.Set string:org.gnome.Shell string:OverviewActive variant:boolean:false
exit
fi
sleep 0.1
done

3 changes: 3 additions & 0 deletions userpatches/overlay/rootfs/usr/bin/dmbp-update-resolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
max_resolution=$(head -1 /sys/class/drm/card0-HDMI-A-1/modes)
gnome-monitor-config set -LpM HDMI-1 -t left -m $max_resolution@60.000
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[Plymouth Theme]
Name=Armbian
Description=Armbian logo
ModuleName=two-step

[two-step]
Font=DejaVu Sans 15
TitleFont=DejaVu Sans Mono Bold 30
ImageDir=/usr/share/plymouth/themes/armbian
DialogHorizontalAlignment=.5
DialogVerticalAlignment=.7
TitleHorizontalAlignment=.5
TitleVerticalAlignment=.382
HorizontalAlignment=.6
VerticalAlignment=.5
WatermarkHorizontalAlignment=.5
WatermarkVerticalAlignment=.5
Transition=none
TransitionDuration=0.0
BackgroundStartColor=0x000000
BackgroundEndColor=0x000000
ProgressBarBackgroundColor=0x606060
ProgressBarForegroundColor=0xffffff
DialogClearsFirmwareBackground=false
MessageBelowAnimation=true

[boot-up]
UseEndAnimation=false
UseFirmwareBackground=false

[shutdown]
UseEndAnimation=false
UseFirmwareBackground=false

[reboot]
UseEndAnimation=false
UseFirmwareBackground=false

[updates]
SuppressMessages=true
ProgressBarShowPercentComplete=true
UseProgressBar=true
Title=Installing Updates...
_Title=Installing Updates...
SubTitle=Do not turn off your computer
_SubTitle=Do not turn off your computer

[system-upgrade]
SuppressMessages=true
ProgressBarShowPercentComplete=true
UseProgressBar=true
Title=Upgrading System...
_Title=Upgrading System...
SubTitle=Do not turn off your computer
_SubTitle=Do not turn off your computer

[firmware-upgrade]
SuppressMessages=true
ProgressBarShowPercentComplete=true
UseProgressBar=true
Title=Upgrading Firmware...
_Title=Upgrading Firmware...
SubTitle=Do not turn off your computer
_SubTitle=Do not turn off your computer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e996f54

Please sign in to comment.