Skip to content

Commit faabb5f

Browse files
committed
Remove release names due to limited horizontal space
1 parent 015ba33 commit faabb5f

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

boot-switcher/switch-boot-target.sh

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,37 +87,20 @@ if [ -f "$TARGET_FILE" ]; then # Sailfish OS
8787
rm "$TARGET_FILE"
8888

8989
TARGET="sfos"
90-
SFOS_REL=`cat /data/.stowaways/sailfishos/etc/os-release | grep VERSION= | cut -d'=' -f2 | cut -d'"' -f2` # e.g. '3.0.3.10 (Hossa)'
91-
TARGET_PRETTY="SailfishOS $SFOS_REL" # e.g. "SailfishOS 3.0.3.10 (Hossa)"
90+
SFOS_REL=`cat /data/.stowaways/sailfishos/etc/os-release | grep VERSION_ID= | cut -d'=' -f2 | cut -d'"' -f2` # e.g. '3.0.3.10'
91+
TARGET_PRETTY="SailfishOS $SFOS_REL" # e.g. "SailfishOS 3.0.3.10"
9292
else # LineageOS
9393
touch "$TARGET_FILE"
9494

95-
DROID_VER=`cat /system/build.prop | grep ro.build.version.release | cut -d'=' -f2 | cut -d'.' -f1` # e.g. "8"
96-
DROID_REL="" # e.g. "Oreo"
97-
98-
if [ "$DROID_VER" = "9" ]; then
99-
DROID_REL="Pie"
100-
elif [ "$DROID_VER" = "8" ]; then
101-
DROID_REL="Oreo"
102-
elif [ "$DROID_VER" = "7" ]; then
103-
DROID_REL="Nougat"
104-
elif [ "$DROID_VER" = "6" ]; then
105-
DROID_REL="Marshmellow"
106-
elif [ "$DROID_VER" = "5" ]; then
107-
DROID_REL="Lollipop"
108-
elif [ "$DROID_VER" = "4" ]; then
109-
DROID_REL="KitKat"
110-
fi
111-
112-
[ ! -z $DROID_REL ] && DROID_REL=" ($DROID_REL)" # e.g. " (Oreo)"
95+
DROID_VER=`cat /system/build.prop | grep ro.build.version.release | cut -d'=' -f2 | sed -r 's/^.0+|.0+$//g'` # e.g. "8.1"
11396

11497
LOS_VER=`cat /system/build.prop | grep ro.lineage.build.version= | cut -d'=' -f'2'` # e.g. "15.1"
115-
TARGET_PRETTY="Android $DROID_VER$DROID_REL" # e.g. "Android 7.1.1 (Nougat)"
116-
[ ! -z $LOS_VER ] && TARGET_PRETTY="LineageOS $LOS_VER$DROID_REL" || TARGET_DROID_LOS="0" # e.g. "LineageOS 15.1 (Oreo)"
98+
TARGET_PRETTY="Android $DROID_VER" # e.g. "Android 7.1.1"
99+
[ ! -z $LOS_VER ] && TARGET_PRETTY="LineageOS $LOS_VER ($DROID_VER)" || TARGET_DROID_LOS="0" # e.g. "LineageOS 15.1 (8.1)"
117100
fi
118101

119102
# Calculate centering offset indent on left
120-
target_len=`echo -n $TARGET_PRETTY | wc -m` # e.g. 21 for "LineageOS 15.1 (Oreo)"
103+
target_len=`echo -n $TARGET_PRETTY | wc -m` # e.g. 21 for "LineageOS 15.1 (8.1)"
121104
start=`expr 52 - 25 - $target_len` # e.g. 7
122105
start=`expr $start / 2` # e.g. 3
123106
log "indent offset is $start for '$TARGET_PRETTY'"

screenshots/los.png

-472 Bytes
Loading

screenshots/sfos.png

-758 Bytes
Loading

0 commit comments

Comments
 (0)