-
I'm writing shell script and I don't know how to make conditional block for ubuntu desktop or ubuntu touch, repositories are added for desktop and they are not working on ubtouch.
-
@GermanAizek said in How to detect Ubuntu Touch using system variables in shell script?:
I'm writing shell script and I don't know how to make conditional block for ubuntu desktop or ubuntu touch, repositories are added for desktop and they are not working on ubtouch.
Maybe just by en vars ?
e.g DESKTOP_SESSION , XDG_SESSION_DESKTOP -
phablet@ubuntu-phablet:/tmp$ debian@gdeb:~/GIT$ sudo adb shell [sudo] password for debian: phablet@ubuntu-phablet:~$ echo $DESKTOP_SESSION phablet@ubuntu-phablet:~$ echo $XDG_SESSION_DESKTOP phablet@ubuntu-phablet:~$ echo "$DESKTOP_SESSION" phablet@ubuntu-phablet:~$ echo "$XDG_SESSION_DESKTOP" phablet@ubuntu-phablet:~$ echo "${XDG_SESSION_DESKTOP}" phablet@ubuntu-phablet:~$ echo "${DESKTOP_SESSION}" phablet@ubuntu-phablet:~$ sudo echo "${DESKTOP_SESSION}" [sudo] password for phablet:
They're empty.
-
@GermanAizek they wouldn't be empty run from the Terminal app. You might think it obvious you wanted to use
adb shell
but you didn't tell us.How about checking
${USER}
for "phablet"? -
How about checking
${USER}
for "phablet"?@alan_g, it's a good solution, but it's unreliable, no one knows when will add ability in ubuntu touch to change user name during fresh installation.
-
@GermanAizek said in How to detect Ubuntu Touch using system variables in shell script?:
no one knows when will add ability in ubuntu touch to change user name during fresh installation.
You are right, no one knows. But it has been this way for the past 5+ years at least.
I doubt any such change will happen anytime soon. In any case it is not now very high on the list of priorities. -
@GermanAizek while the title specifies 'using system variables', the text does not explicitly mention. Hence I dare to suggest, if alternatively it might be an option, to e.g. check for a certain directory/file existence, or read/write access. Any suggestions, what might be distinctive and permanent for touch vs. desktop?
-
@mschmids said in How to detect Ubuntu Touch using system variables in shell script?:
e.g. check for a certain directory/file existence, or read/write access.
indeed, I can still check write/read permissions for Ubuntu Touch /image, but this is not ideal. As a developer, I made image not temporary, write persistent.
-