-
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 shellbut 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.
-
C CiberSheep moved this topic from 20.04 Focal Fossa on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register Login