Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 24 Jun 2019, 11:57
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
detect all installed packages that require X
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2685
Location: UK

PostPosted: Sat 01 Dec 2018, 13:50    Post subject:  detect all installed packages that require X
Subject description: (the starting point of building a no-X puppy)
 

How do I detect all installed packages that require X?
_________________
Pkg, mdsh, Woofy, Akita Linux, VLC-GTK
Back to top
View user's profile Send private message 
nosystemdthanks


Joined: 03 May 2018
Posts: 632

PostPosted: Sat 01 Dec 2018, 16:34    Post subject: Re: detect all installed packages that require X
Subject description: (the starting point of building a no-X puppy)
 

a sloppy way would be to drop to the command line, try to run each program with & and note the ones that dont start. you could try this with the gui running too, and compare the two lists to avoid false positives. (or false negatives, depending how you phrase the problem.)

i havent tried it yet, but perhaps you could 2> log and look for something telling you it couldnt run without it.

some programs wont run backgrounded with & (ive had trouble with mplayer running an mp3 this way) and some wont run without proper options. you could also try running grep on the binary for the note that tells you it needs the gui to run. libraries are trickier perhaps.

_________________
communities (sometimes) care what youre going through as a user. big for-profit corporations never do.
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 917

PostPosted: Sat 01 Dec 2018, 17:27    Post subject:  

Reminded me of this post: http://www.murga-linux.com/puppy/viewtopic.php?p=656475#656475

Modified approach: delete/rename libX11 and search for executebles that misses it.
After that you have to identify from which package the executable came...
Back to top
View user's profile Send private message Visit poster's website 
nosystemdthanks


Joined: 03 May 2018
Posts: 632

PostPosted: Sat 01 Dec 2018, 17:35    Post subject:  

goingnuts wrote:
delete/rename libX11 and search for executebles that misses it.


nice. by the way, leafpad > log says "Cannot open display:" in the log, but renaming libX11 is even better.

i figured it would be 2> log that did that, but it is on plain stdout.

_________________
communities (sometimes) care what youre going through as a user. big for-profit corporations never do.
Back to top
View user's profile Send private message Visit poster's website 
rufwoof


Joined: 24 Feb 2014
Posts: 3181

PostPosted: Sat 01 Dec 2018, 21:43    Post subject:  

Quote:
Subject description: (the starting point of building a no-X puppy)

... why not attack it from the other angle. Boot a basic busybox pup, and then add in the non-X things you prefer

mpv and/or cmus (music)
mc (file manager and text editor)
tmux
calcurse diary/calendar/todo
alpine (mail)
irssi (irc)
rtv (reddit)
htop
... etc.

tmux terminal multiplexer along with some sensible keybindings works really well. I've set F12 to step between windows (tabs), F11 to add a new tab ... as that sits well with mc's use of F1 to F10. Add in some console menus using tput/ansi/ascii art etc and my personal preference is to use one full screen terminal/tab for individual programs. cmus for instance is a great music player and I nearly always have that running in one tab. Prefer maximised windows over that of using tmux panes myself (division of a single window into separate programs/windows). You can zoom/unzoom panes so that everything is visible from a single terminal window and you maximise/restore whichever window you want to focus upon - but I tend to only use panes for when I'm comparing things side by side (vertical/central split). Another nice feature with tmux is that you can detach and later re-attach again, even from different locations/devices and everything is immediately back to how you left it.

Avoiding X altogether is a no-no IMO however. Its useful to still be able to X-forward from somewhere via ssh and run gui programs/browsers. Or even install a local browser ... I run chromium and the sole purpose of X being installed is to run that, so I set it up to be like a container/jail (restricted userid, no setuid's, no cron, no passwords entered ...etc.). I've added javascript for a calculator and text editor (local html files) for that and one tab is all my bookmarks - that shows the current date/time in the tab title, and along with google docs for collaboration/word/spreadsheets ..etc. a relatively light base system can still be highly functional if/when the need arises.

Console image attached is a actual picture taken using my phone as I run openbsd - that for security reasons prevents snapping the console via software (possible, but easier to just snap it using a phone).

I do run headless fatdog and a headless sacrificial openbsd server, and connect via vnc (fatdog) or just ssh/X-forward (Xvfb running) for other options to browse the web. Frame rates are ok, watching youtubes for instance are fine at normal size, but do stutter if made full screen. Both of those are local, looking to set yet another up at a remote location (another country) so that ssh'ing into that in effects eliminates nearly all my local end traffic visibility by my ISP. That's also more secure if out and about (pre-installed ssh keys, so eliminates any potential internet cafe man in middle attacks).
s.png
 Description   
 Filesize   83.02 KB
 Viewed   239 Time(s)

s.png

root.jpg
 Description   
 Filesize   34.53 KB
 Viewed   241 Time(s)

root.jpg


_________________
( ͡° ͜ʖ ͡°) :wq
Back to top
View user's profile Send private message 
nosystemdthanks


Joined: 03 May 2018
Posts: 632

PostPosted: Sun 02 Dec 2018, 02:27    Post subject:  

rufwoof wrote:

Avoiding X altogether is a no-no IMO however.


i dont entirely agree with this, but everything else you said about it (minus this conclusion) is a good read.

playing devils advocate here, what about a program that just lets you input a list of files to delete from puppy? that way you could just say:

isodelete xenialnox.iso xenialnoxmod.iso /usr/bin/leafpad /usr/bin/mtpaint /usr/bin/ROX-filer

(i think ROX-filer is in /sbin but whatever)

and it would go about removing that from puppy? then whenever you find a file, its trivial to delete?

just a fun idea. very doable. rather than making it important to get everything "on the first try."

would have far more uses than just removing gui apps.

_________________
communities (sometimes) care what youre going through as a user. big for-profit corporations never do.
Back to top
View user's profile Send private message Visit poster's website 
rufwoof


Joined: 24 Feb 2014
Posts: 3181

PostPosted: Sun 02 Dec 2018, 06:25    Post subject:  

nosystemdthanks wrote:
rufwoof wrote:

Avoiding X altogether is a no-no IMO however.

i dont entirely agree with this, but everything else you said about it (minus this conclusion) is a good read.

Thanks. And fair point. mtp/whatever mount a android phone and that could be used as your gui browser that needs a whole lot else to visit/use common web sites, and just transfer files/stuff between that and the X-less system. Personally for me however I have for instance a usage requirement of where I bash in text using mc -e text editor (focus on the content/words), I then spell check that and then add in some html inserts (top, bottom etc.) to format it as required, adding pictures if appropriate ... and then preview that in a gui browser and save to PDF for sending/sharing. Using my phones viewer/print to pdf isn't anywhere near as nice/comfortable as viewing it in a local gui browser (large screen).

For me X + gui browser pretty much are just a single 'program' that serves a useful purpose. And I treat them as a single thing, contained/restricted in being externally open/insecure. As bloated as that might be (gui browser has a dependency of X).

I'd rather see expansion of the original Unix philosophy ... everything is a (text) file. But the world has opted more for the Windows (bloat) philosophy. Given the abuse however, http pretty much commercial/ad owned/driven, and I suspect that forward time might see some reversion back to the core Unix philosophy and where the likes of talking out a document and a PDF output from that, together with 'ad-free' text type alternatives for vendors to publicise their products/services might become the expected/norm. Or even more direct links, such as (textual) ssh'ing directly into a vendors site. I guess fundamentally anything other than the pwning of http by (commercial) Google (dns, searches ..etc.). I suspect however that something like secure (ssh) gopher for searching followed up by direct ssh between you and vendors would be down trodden as hard as possible both by the likes of Google and governments (due to the greater privacy).

_________________
( ͡° ͜ʖ ͡°) :wq
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3181

PostPosted: Sun 02 Dec 2018, 06:36    Post subject:  

nosystemdthanks wrote:
playing devils advocate here, what about a program that just lets you input a list of files to delete from puppy? that way you could just say:

isodelete xenialnox.iso xenialnoxmod.iso /usr/bin/leafpad /usr/bin/mtpaint /usr/bin/ROX-filer

(i think ROX-filer is in /sbin but whatever)

and it would go about removing that from puppy?

Dependencies hell. ldd to find what libs might also be removed, but then having to recurse scan to ensure they're not being used elsewhere by something that isn't being removed. Many 'nix systems do package manage well for both adding and removing. Puppy however are generally a one way add-only - at least from PPM. There is IIRC a remove app choice already in Puppy, but fundamentally they're not removed just .wh flagged. Remain in the main sfs ... unless remastered to physically be remove (rebuild new sfs).

_________________
( ͡° ͜ʖ ͡°) :wq
Back to top
View user's profile Send private message 
nosystemdthanks


Joined: 03 May 2018
Posts: 632

PostPosted: Sun 02 Dec 2018, 06:43    Post subject:  

rufwoof wrote:
Dependencies hell. ldd to find what libs might also be removed, but then having to recurse scan to ensure they're not being used elsewhere by something that isn't being removed.


thats not so hard. except for where ldd lies. well, it tells you what it knows. so its not lying, but the apps do.

_________________
communities (sometimes) care what youre going through as a user. big for-profit corporations never do.
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2119
Location: Maine, USA

PostPosted: Sun 02 Dec 2018, 07:04    Post subject:  

Save this as /usr/local/bin/findlibs and make it executable.
Code:
#!/bin/bash

ldd $1 | grep -q $2
exit $?



then use
Code:
find /usr/bin -executable -type f -exec findlibs {} libX11 \; -print


This is on Debiandog Jessie

Code:
root@debian:~# find /usr/bin -executable -type f -exec findlibs {} libX11 \; -print
/usr/bin/dillo
/usr/bin/xstdcmap
/usr/bin/galculator
/usr/bin/isomaster
/usr/bin/xcalc
/usr/bin/gkrellm
/usr/bin/gdmap
/usr/bin/xkbprint
/usr/bin/xedit
/usr/bin/hdspmixer
/usr/bin/xkbwatch
/usr/bin/xscanimage
/usr/bin/transmission-gtk
/usr/bin/jwm
/usr/bin/bmtoa
/usr/bin/oclock
/usr/bin/xlsfonts
/usr/bin/xman
/usr/bin/leafpad
/usr/bin/xkbbell
/usr/bin/appres
/usr/bin/transset
/usr/bin/xterm
/usr/bin/mplayer
/usr/bin/remmina
/usr/bin/xkbevd
/usr/bin/icewmbg
/usr/bin/openbox
/usr/bin/xfwrite
/usr/bin/xfe
/usr/bin/xeyes
/usr/bin/gdm-control
/usr/bin/ico
/usr/bin/pinentry-gtk-2
/usr/bin/roxterm-config
/usr/bin/mtpaint
/usr/bin/intel-virtual-output
/usr/bin/xcutsel
/usr/bin/pax11publish
/usr/bin/vmwarectrl
/usr/bin/icewmhint
/usr/bin/xrandr
/usr/bin/xfontsel
/usr/bin/xsane
/usr/bin/icehelp
/usr/bin/xsetpointer
/usr/bin/xfview
/usr/bin/parcellite
/usr/bin/pacmd
/usr/bin/xcmsdb
/usr/bin/xauth
/usr/bin/xvidtune
/usr/bin/roxterm
/usr/bin/xset
/usr/bin/gksu
/usr/bin/xcam
/usr/bin/pactl
/usr/bin/pasuspender
/usr/bin/viewres
/usr/bin/xinit
/usr/bin/xprop
/usr/bin/rmedigicontrol
/usr/bin/scrot
/usr/bin/gtkdialog3
/usr/bin/smtube
/usr/bin/pdftocairo
/usr/bin/guayadeque
/usr/bin/xvinfo
/usr/bin/xfimage
/usr/bin/xclipboard
/usr/bin/xditview
/usr/bin/xrefresh
/usr/bin/gftp-gtk
/usr/bin/pavucontrol
/usr/bin/gxine
/usr/bin/xcursorgen
/usr/bin/xsetmode
/usr/bin/xhost
/usr/bin/xmag
/usr/bin/Xdialog
/usr/bin/xkbcomp
/usr/bin/setxkbmap
/usr/bin/smplayer
/usr/bin/xmodmap
/usr/bin/xmessage
/usr/bin/icewmtray
/usr/bin/yad
/usr/bin/xfpack
/usr/bin/claws-mail
/usr/bin/xconsole
/usr/bin/xrdb
/usr/bin/envy24control
/usr/bin/syndaemon
/usr/bin/echomixer
/usr/bin/clementine
/usr/bin/rendercheck
/usr/bin/xxkb
/usr/bin/gbemol
/usr/bin/icesound
/usr/bin/pulseaudio
/usr/bin/xkbvleds
/usr/bin/rox
/usr/bin/gksu-properties
/usr/bin/xclock
/usr/bin/obxprop
/usr/bin/xmore
/usr/bin/gpicview
/usr/bin/xkill
/usr/bin/xgc
/usr/bin/xload
/usr/bin/hdajackretask
/usr/bin/xdpyinfo
/usr/bin/xwd
/usr/bin/xwud
/usr/bin/xgamma
/usr/bin/x11perf
/usr/bin/sakura
/usr/bin/bitmap
/usr/bin/xfd
/usr/bin/editres
/usr/bin/searchmonkey
/usr/bin/xlogo
/usr/bin/gtk-launch
/usr/bin/xdriinfo
/usr/bin/xarchiver
/usr/bin/epdfview
/usr/bin/dbus-launch
/usr/bin/xdm
/usr/bin/synclient
/usr/bin/volumeicon
/usr/bin/links2
/usr/bin/hdspconf
/usr/bin/xsetroot
/usr/bin/xev
/usr/bin/xinput
/usr/bin/pacat
/usr/bin/icesh
/usr/bin/xbiff
/usr/bin/broadwayd
/usr/bin/listres
/usr/bin/icewm
/usr/bin/gtkdialog
root@debian:~#

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Back to top
View user's profile Send private message Visit poster's website 
nosystemdthanks


Joined: 03 May 2018
Posts: 632

PostPosted: Sun 02 Dec 2018, 08:40    Post subject:  

trapster wrote:
Save this as /usr/local/bin/findlibs and make it executable.
Code:
#!/bin/bash

ldd $1 | grep -q $2
exit $?


Code:
find /usr/bin -executable -type f -exec findlibs {} libX11 \; -print


elegant.

_________________
communities (sometimes) care what youre going through as a user. big for-profit corporations never do.
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2119
Location: Maine, USA

PostPosted: Sun 02 Dec 2018, 20:04    Post subject:  

Reverse LDD also works a treat
_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2685
Location: UK

PostPosted: Tue 15 Jan 2019, 18:31    Post subject:  

Using trapsters nice little snippet (the findlibs script):

Code:
libname="libX11.so.6.3.0"
PATHS="$(echo $PATH | sed "s/:/\n/g")"

echo "$PATHS" | while read path
do
  [ -d "$path" ] && find "$path" -executable -type f -exec findlibs {} "${libname//.*/}" \; -print | pkg w - | grep -v ^File | sort -u | uniq
done


.. uses the `pkg which` command to get the name of the package that the given file comes from .. prints the following (on Dpup Stretch RC3):

Code:
abiword_3.0.2-2+deb9u2_i386
compton-0.1_stretch
dbus
dunst-1.1.0
easytag_2.4.3-1+deb9u1_i386
evince
evince-2.32.0-i686
feh_2.18-2_i386
ffmpeg
ffmpeg-3.2.9
ffmpegthumbnailer_2.1.1-0.1+b3_i386
flashplayer-32.0.0.101-i686
flsynclient-0.6-i486
fpm2-0.75-i686_stretch
freememapplet
galculator-2.1.5-i686-gtk2-stretch
gdmap_0.8.1-3+b1
geany_1.29-1
gexec-0.4
gftp-gtk_2.0.19-5
gifsicle
glade_3.20.0-2+deb9u1
gmeasures-0.7-i686_stretch
gmrun_0.9.2-2.2
gnome-alsamixer
gnome-mplayer-1.1w-i686_stretch
gnumeric
gnumeric-1.10.17
gphoto2_2.5.11-1
gpicview_0.2.5-2+b1
gtk+
gtkam_0.2.0-2+b2
gtk-chtheme_0.3.1-5+b3
gtklp
gtklp_1.3.1-0.1+b1
gxmessage-2.12.4-i686_stretch
hardinfo-0.6-alpha
hexchat_2.12.4-3
inkscapelite-0.36
isomaster_1.3.13-1+b1
joy2key_1.6.3-1_i386
joystick_1.6.0-1_i386.files
jstest-gtk_0.1.1~git20160825-2_i386
jwm_2.3.7-1
leafpad_0.8.18.1-5
librsvg
links2_2.14-2+b1_i386
lxde_apps
lxrandr_0.3.1-1
lxtask_0.1.8-1
lxterminal_0.3.0-2
mhwaveedit_1.4.23-1+b1
mlterm_3.5.0-1+b2_i386
mplayer_1.3.0-6
mpv_0.23.0-2+deb9u2
mtpaint-3.49.12-i686_s700
mtr_0.87-1
netmon_wce-3.3-i686_stretch
notecase-1.9.8
numlockx-1.2-i686_stretch
pcmanfm_1.2.5-3
pnmixer-0.7.2
poppler
powerapplet_tray-2.6.2
PupControl
redshift_1.11-1_i386
rofi_1.3.1-2_i386
sylpheed-3.5.1-i686_s700
transmission-gtk_2.92-2+deb9u1
uget
unclutter_8-20+b1
urxvt-9.22
vainfo_1.7.3-2
wmctrl_1.07-7+b1
wv
xarchive-0.2.8-6-i18n-i686_stretch
xboxdrv_0.8.8-1_i386
xclip_0.12+svn84-4+b1
xcur2png-0.7.0-i686_stretch
xdg_puppy
Xdialog-2015.08-i686_stretch
xdotool_3.20160805.1-3
xfdiff-cut
xinit_1.3.4-3+b1
xinput_1.6.2-1+b1
xlockmore
xorg_base_new
xorg_dri
xsane-0.999-i686_stretch
xsel_1.2.0-2+b1_i386
xserver_xorg
yad-0.40.0-i686-dpup-stretch
zarfy-0.1.0-i686-dpup-stretch
zz_w_apps
gadmin-rsync_0.1.7-1+b2
gparted
gtkdialog4-0.8.4
peasyscale
ssh_gui
gxmessage
rubix-1.03
scrox-0.8.17
freeciv-client-gtk_2.5.6-2_i386.files
gplanarity
mame_0.182-1_i386
mednafen_0.9.41+dfsg-2+b1_i386
xsoldier_1.8-4


Still not perfect... Cos sometimes Pkg reports the short version of the package name, sometime not... :/

But close enough.. Cleaning this list up and passing it to `pkg contents -` should list all the files in the packages Smile

Thanks everyone.

_________________
Pkg, mdsh, Woofy, Akita Linux, VLC-GTK

Last edited by sc0ttman on Tue 29 Jan 2019, 12:22; edited 1 time in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2685
Location: UK

PostPosted: Tue 15 Jan 2019, 18:44    Post subject:  

The reason I'm doin this is I think it would be nice to have an Xdrive.sfs file,
containing only the stuff that needs X, and the X11 libs, that if not loaded,
leaves you with a working no-X pup..

But if the Xdrive.sfs is loaded at boot, you get the normal full X, desktop Puppy...

Or is that silly?

_________________
Pkg, mdsh, Woofy, Akita Linux, VLC-GTK
Back to top
View user's profile Send private message 
foxpup


Joined: 29 Jul 2016
Posts: 855
Location: europa near northsea

PostPosted: Wed 16 Jan 2019, 05:54    Post subject:  

sc0ttman wrote:
The reason I'm doin this is I think it would be nice to have an Xdrive.sfs file,
containing only the stuff that needs X, and the X11 libs, that if not loaded,
leaves you with a working no-X pup..

But if the Xdrive.sfs is loaded at boot, you get the normal full X, desktop Puppy...

Or is that silly?
Not at all!
That is something I've been wondering about. Does it even (still) exist, a distro without X? And then on top, the choice to have a desktop anyway.
I love it!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0553s ][ Queries: 12 (0.0052s) ][ GZIP on ]