mabox-tools/bin/mabox-langfiles
2022-12-11 18:26:22 +01:00

29 lines
979 B
Bash
Executable File

#!/bin/bash
# Firstboot script
# Copy i18n files to ~ if available
# Check if Laptop|Notebook, otherwise disable power-manager
# Run only once invoked from openbox autostart
LNG=${LANG:0:2}
FILE="$HOME/.config/mabox/.lang"
if [ ! -f "$FILE" ]; then
if [ -d "/usr/share/mabox/lang/$LNG" ]; then
rsync -a /usr/share/mabox/lang/$LNG/ $HOME/
else
rsync -a /usr/share/mabox/lang/en/ $HOME/
fi
echo "selenized-black" > $HOME/.theme_history
# Power manager and tint2 native battery indicator only needed on Laptop/Netbook
TYPE=$(cat /sys/class/dmi/id/chassis_type)
case "$TYPE" in
8|9|10|14):;;
*)
mb-setvar Hidden=true "$HOME"/.config/autostart/xfce4-power-manager.desktop
# fix tint2 battery indicator bug spawning notifications even if there is no battery
sd "battery_low_cmd =.*$" "battery_low_cmd =" "$HOME"/.config/tint2/*.tint2rc
;;
esac
touch $HOME/.config/mabox/.lang
fi