Posts: 148
figosdev
Joined: 29 Jun 2017
#1
wget
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://distro.ibiblio.org/refracta/files/extra_packages/fig29-31_1.0.deb"
linktext was:"http://distro.ibiblio.org/refracta/file ... 31_1.0.deb"
====================================
# should conflict with 0 anti-x packages
sudo dpkg -i fig29-31_1.0.deb
sudo apt-get update
sudo apt-get install python-pygame aterm

Code: Select all

#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
function rgbcolour r g b c
python
    figcgapal[c] = (r, g, b)
    fig
    fig
v 1
c 400
w 3.14159 divby 2
function radians a
    x a times 3.141592653589793 divby 180 return x
    fig
for r 490 110 -.50    
    e w minus 0.00413367105263 swap e w # 3.14159 / 4 / (490 - 300)
    for p 1 360 .5
        e w cos times 380 divby 1 int
        rc r divby 2 int
        rd 256 minus rc rgbcolour rc 0 rc 11
        x p radians x times 2 cos times e plus c int
        y p radians y times 2 sin times e plus r minus 50  int
        m 6.28 plus 1.57 divby 108.503 divby 2
        now v plus m swap now v
        rc r #divby 4 int mod 2
        iftrue rc
            now v times 2 int mod 2 times 11 pset x y now
            y2 y minus 1 pset x y2 now
            fig
        next
    now display
    next
now display lineinput
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#2
red 256, green 0, blue 11...

your script is painting animated spirals onto the root window?
Posts: 148
figosdev
Joined: 29 Jun 2017
#3
no, its drawing it (i wouldnt call it animation, even though it does take a moment) onto an 800x600 sdl window. then i use mtpaint to get a screencap (i usually do) and stretch it to 1024x768 and save it as a .png, which i load onto the root window in the very good antix cpanel.

now the question is, could i make it a larger resolution? yes, there are two ways i could do that, one does not require editing the compiler (which is still a single 60k python script.) but if you find a library for drawing to the root window i want to know the name.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#4
When I chased that white rabbit a year or so ago, I learned that writing to the true"root window"
probably isn't a desirable goal because, when the app is used in a"desktop environment"

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://en.wikipedia.org/wiki/Root_window#Virtual_root_window"
linktext was:"https://en.wikipedia.org/wiki/Root_wind ... oot_window"
====================================
it winds up covered/hidden by
the DE's virtual root window aka"desktop" (or"pinboard" in Rox-speak).

For python apps, the only drawing library I've ever attempted using was PyCairo.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://zetcode.com/gfx/pycairo/root/"
linktext was:"http://zetcode.com/gfx/pycairo/root/"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://pycairo.readthedocs.io/en/latest/examples.html"
linktext was:"https://pycairo.readthedocs.io/en/latest/examples.html"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.tortall.net/mu/wiki/PyGTKCairoTutorial"
linktext was:"http://www.tortall.net/mu/wiki/PyGTKCairoTutorial"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://www.cairographics.org/documentation/pycairo/2/reference/context.html"
linktext was:"https://www.cairographics.org/documenta ... ntext.html"
====================================

The best in-the-wild example using PyCairo I can point to is:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/Zulko/gizeh"
linktext was:"https://github.com/Zulko/gizeh"
====================================

I discovered that it's too slow (and its antialiasing is too crude) for the raster drawing applications I had in mind.


If I had a few more dog years, I'd probably investigate the
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/kivy/kivy"
linktext was:"Kivy"
====================================
OpenGL ES 2 framework
Posts: 148
figosdev
Joined: 29 Jun 2017
#5
When I chased that white rabbit a year or so ago, I learned that writing to the true"root window"
probably isn't a desirable goal because, when the app is used in a"desktop environment"

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://en.wikipedia.org/wiki/Root_window#Virtual_root_window"
linktext was:"https://en.wikipedia.org/wiki/Root_wind ... oot_window"
====================================
it winds up covered/hidden by
the DE's virtual root window aka"desktop" (or"pinboard" in Rox-speak).
oh yeah, what you really want is a transparent layer above the root window and"below" the"normal" window layer. you can manually set a window to that level with icewm and it stands to reason that its possible with a call to *something.* one of the fun things about conky is you can hack its ini/rc with pretty much whatever you want, and reload it (if it doesnt do it automatically through say, an env variable changing everying x seconds...) and it will do the"low-level" work for you. hooray for conky.

that might even be what youre getting at with pycairo, and if so, cool. as for kivy and kano, i think those are two things we are both at least academically interested in. as a package its a bit much in terms of size or bloat, as a concept im interested in almost everything like that. unless google makes it-- if google makes it they will usually kill it off soon, and not make it 100% free, meaning its always really"googles." chrome and android are examples, and therefore probably"chrome music lab" too.
Posts: 119
wildstar84
Joined: 31 May 2014
#6
aterm -geometry +66+12 -fade 66 --cutchars"\`\'\"&()*,;:<=>?[]{|}" -tr -sr -st -sl 2000 -bg black -fg green -fn"-xos4-terminus-medium-r-normal--22-*-100-100-*-*-iso8859-1" +sb

Image:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://flic.kr/p/DmmEyJ"
linktext was:"https://flic.kr/p/DmmEyJ"
====================================
Posts: 148
figosdev
Joined: 29 Jun 2017
#7
considerably nicer font settings.

here is antix 17.x modified with mkfigos running a"root pinboard" -- you can set the black background to match the metro wallpaper-- ive probably stood on that platform.

the usual antix pinboard is underneath (this isnt reconfigured by mkfigos yet.)

the graphical environment (including x and the wm) is running as demo (user)

the pinboard (pcmanfm... spacefm is also installed) is running automatically as root, so when you open the console youre already root. (if you super-t for the term you are running as user.) this hybrid user/root desktop is inspired by puppy, but built on antix 17.x. it takes 10-20 minutes to modify the antix iso and put it back together with stuff like this.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#8
wondering:
What launchstring do you use for the pinboard? sudo? sudo su -p? gksu?
What $ENV vars are set when"Console" is launched?

I don't use desktop icons, but I imagine a sudo-permissioned, autohiding roxpanel might serve as a handy widget.
Posts: 148
figosdev
Joined: 29 Jun 2017
#9
i call this script with & from rc.local -- you can simplify as you wish, i havent tried to add more than it seemed to require though my own bash-fu has its good and bad days. you can thwart it by creating a folder without a working .Xauthority in /home (not intended, but probably obvious.) and i had to take out the shbang because this forum is bizarre. oh heck i will just post it as an image.

edit: fixed it! forum wont take"ps au_x" without the _ in it, lol...

Code: Select all

#!/bin/bash
while [[ 1 ]] 
do p=$(psNOFILTER="ps" ; $psNOFILTER aux | grep pcmanfm | grep desk | wc -l)
if ["$p" -lt"1" ]  
then export XAUTHORITY=$(find /home | grep"\.Xauthority" | tail -1) pcmanfm
export DISPLAY=:0
cd /root 
pcmanfm --desktop 2>  /dev/null & 
export XAUTHORITY= 
fi
sleep 2
done
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#10
Ah, so you're using pcmanfm to manage the desktop. Still leaves me wondering:
When"root-permissioned Console" is launched, what $ENV vars are set?
Posts: 148
figosdev
Joined: 29 Jun 2017
#11
well literally: $HOME/.Xauthority

XAUTHORITY=$HOME/.Xauthority pcmanfm
DISPLAY=:0

where $HOME isnt /root but whatever home folder the default user is using. for example when you boot live, thats /home/user/.Xauthority ...if you install and choose the user skidoo than its /home/skidoo/.Xauthority (until grep does something undesired, then you have no root desktop and probably have to tweak /root/desktops and run it again to get it back.)
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#12
What I was getting at, is this:
Upon launching"lxterminal" and checking env vars, I see that these vars
XDG_DATA_HOME
DESKTOP_SESSION_WM
are set, but when launching"sudo lxterminal" or"gksu lxterminal" those same vars are not set.
So, my expectation for a"root terminal" is that not all the typical vars will be set unless you go out of your way to set/preserve 'em.
Posts: 148
figosdev
Joined: 29 Jun 2017
#13
i got mixed results trying your examples, though you are correct. LS_COLORS is set in some instances, (its a very noticeable entry) and not in others. i figure some of these can be explained by .bashrc -- all of them?

any environment is at least locally effected by .bashrc similar to variables in python functions. if you run su, export a variable and env | grep for it, then ctrl-d and then use su, you will find the variable you just set isnt there. let me know if you find an exception to this.

to answer your question, doing this my way doesnt seem to yield different or more interesting results than sudo xterm or gksu xterm would.
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#14
@figosdev, why aterm? For most things urxvt is better and more powerful even if the interface to it can seem arcane.

To make urxvt easier to customize we added a program called urxvt-style. The two examples from the bottom of the usage should get your started:

Code: Select all

Examples:
    urxvt-style reset sorbet blur5 tabbed size15
    urxvt-style large zenburn transbg size12
The blur option can be slow on some machines depending on the graphics acceleration.

We tried to make it easy to play with (antiX = antics). You can play around with the different options until you find a configuration you like and then use the"save" option to save your configuration and make it the new default.
Posts: 148
figosdev
Joined: 29 Jun 2017
#15
first your bigger question, then why aterm: here are the reasons i roll my own remaster script, instead of using one of the many (and far nicer) alternatives:

* i want it to remain fully automated-- ive no interest in"tweaking and saving" my setup"by hand." refracta snapshot would surely do what i need otherwise, speaking generally.

* i dont want a distro-specific solution. rolling my own tends to work wherever python does. mostly.

* a lot of the time i dont trust anything i can do myself to be handled the way i like by someone else. if i could"make my own refracta" i would! but for now i can only *modify* my own refracta. if i went upstream and started with devuan instead of refracta, id probably hate it-- having used devuan, but not wanting to remaster it.

its not that my way is better, its just theres no commitment to tradition anymore-- if you want a tradition, youll pretty much have to start one. or make it easier for others and hope they decide to.

in short, if someone else does it, they might change the way its done in ways i would find intolerable. i never thought id make a remaster script (too much trouble) but ive managed to, to a degree.


why aterm: i am as surprised as you are to find that the term i rely on the most is: xterm. it defies belief, doesnt it? lxde has the nicest"full" term windows; for everything else i like xterm.

xterm would block too much of the background, and aterm is the simplest (pseudo)transparent term im FAMILIAR with. im surprised that ive never had much luck with rxvt or urxvt, and i actually didnt know the latter would do transparency or pseudo-transparency. thats good to know.

i dont normally use aterm. it was a quick way to have a lightweight term in the screencap that showed the background behind it, thats the only reason for it.