WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] how to find active X11 session's user and display?  (Read 5544 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10295
Re: [Solved] how to find active X11 session's user and display?
« Reply #30 on: November 28, 2020, 06:35:18 AM »
Hi GNUser
It's possible only the commands used in the Tinycore scripts were included.

Offline GNUser

  • Hero Member
  • *****
  • Posts: 894
Re: [Solved] how to find active X11 session's user and display?
« Reply #31 on: November 28, 2020, 07:42:44 AM »
If all compiled busybox applets are included in the aliases file, then the file will be larger but more generally useful. This code snippet generates a complete aliases file:

Code: [Select]
#!/bin/sh

for applet in $(busybox --list); do echo "$applet() {
    busybox $applet \"\$@\"
}
" >> busybox-aliases; done

for applet in $(busybox.suid --list); do echo "$applet() {
    busybox.suid $applet \"\$@\"
}
" >> busybox-aliases; done

We just have to delete the first two aliases because  [  and  [[  are not valid function names.

I'll submit a pull request on GitHub.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10295
Re: [Solved] how to find active X11 session's user and display?
« Reply #32 on: November 28, 2020, 07:48:49 AM »
Hi GNUser
You might want to wait for Juanito and curaga to weigh in on this. There may be a reason some aliases were left out
that I'm not aware of.

Offline GNUser

  • Hero Member
  • *****
  • Posts: 894
Re: [Solved] how to find active X11 session's user and display?
« Reply #33 on: November 28, 2020, 09:05:57 AM »
From curaga: "It's not about using busybox everywhere, only where the commands may differ."

So I guess the plan going forward is to update the aliases file only when we find commands like  ps  that need to be included.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 645
Re: [Solved] how to find active X11 session's user and display?
« Reply #34 on: November 28, 2020, 12:04:29 PM »
Hi, GNUser!

What's Your guess, is aliasing of all the busybox applets equivalent to PATH reordering? Not proposing, just asking.

Offline GNUser

  • Hero Member
  • *****
  • Posts: 894
Re: [Solved] how to find active X11 session's user and display?
« Reply #35 on: November 28, 2020, 03:08:09 PM »
Hi, jazzbiker. That's a great point. Yes, I think that would be a nice way of achieving the same result. Something like this would work:
Code: [Select]
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"The four prioritized directories would appear twice in the PATH but that wouldn't cause any problems.