LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bodhi (https://www.linuxquestions.org/questions/bodhi-92/)
-   -   trying to use photo gadget on moksha desktop (https://www.linuxquestions.org/questions/bodhi-92/trying-to-use-photo-gadget-on-moksha-desktop-4175651270/)

crajor 04-01-2019 07:42 AM

trying to use photo gadget on moksha desktop
 
bodhi 5.0.0 64bit
I am trying use the photo gadget to change wallpapers quickly and often. Tried to install several desktop slideshow utils, all to no avail. Photo gagdet seemed to be a solution, but I am not able to change background with it. Gives an error of "Photo needs e17setroot". It also list an e-utils package where this supposed utility can be found, but I cannot find that package, let alone install it.
I realize that moksha actually creates another type of file to display as a wallpaper.
I believe this e17setroot will create the .edj file so the image will then display as a background. Is it possible that e17setroot exists and I am just not able to find it?
Any help will be greatly appreciated.

BW-userx 04-01-2019 08:05 AM

e17setroot I bet is a program that comes with e17, like
Code:

/usr/bin/Esetroot  /usr/bin/fbsetroot  /usr/bin/xsetroot
/usr/bin/bsetroot  /usr/bin/kEsetroot
 /usr/bin/mh5000 #something I wrote

and a few others that set images on the root desktop, that come with the window manger.

mh5000 is a stand lone, like xsetroot, and hsetroot, and has a multitude of options that go beyond all of the others others shown here(shameless plug), and they are for a window manager, not desktop environment.

the_waiter 04-01-2019 10:17 AM

No, photo module is not for changing the wallpapers. It is a gadget for changing photos in the smaller rectangle on the screen. The module you are looking for is moksha-module-slideshow. Unfortunately I can not see it in our repository. Let me have some time to prepare deb file. Maybe Robert will make it sooner than me if read this post. I am gonna out with kids now...

Enjoy

Stefan

rbtylee 04-01-2019 11:04 AM

Quote:

Originally Posted by the_waiter (Post 5980075)
...Maybe Robert will make it sooner than me if read this post. I am gonna out with kids now...

Enjoy

Stefan

OK in BL5.0 repo now. Wonder why we missed that one?

rbtylee 04-01-2019 11:30 AM

Quote:

Originally Posted by crajor (Post 5980022)
...
I believe this e17setroot will create the .edj file so the image will then display as a background. Is it possible that e17setroot exists and I am just not able to find it?
Any help will be greatly appreciated.

Interesting, ok the photo module is fairly old and I suppose no one tried to use the set as background option it provides and reported this error to us. I never tested that functionality myself.

Regardless tho at some point in the history of e17 this worked. The program e17setroot is found in the legacy/subversion-history.git on the e-git website. Hid deep at OLD/e_utils/src/bin/e17setroot. The OLD part means it is probably broken and may not even compile much less work. I will check that out when I have some free time.

But to the point regardless whether or not e17setroot works as expect and is safe to use on Moksha this module needs fixed to not use that. Moksha/e17 has its own code to set and unset backgrounds that the module should be using. One of us needs to fix this.

Sounds like a good project for Štefan ;)

the_waiter 04-01-2019 12:31 PM

Thanx for making deb Robert

I tried photo module under BL 3 and maybe BL 4 and it worked fine after some time of playing with setup. Need to look again under BL 5. You mentioned some errors. OK the challenge accepted :)

Š

the_waiter 04-01-2019 12:54 PM

Hmm, I realized I have never tried the photo module feature for setting a picture as a wallpaper. But yes, I can see "Photo needs e17setroot" popup as well. Beside this, I can see the photo gadget working flawlessly on my screen.

https://i.imgur.com/5KnUI7l.jpg

EDIT: I can see also "exhibit" as default picture viewer. We should change it to ephoto or xdg-open.

rbtylee 04-01-2019 04:03 PM

Quote:

Originally Posted by crajor (Post 5980022)
Gives an error of "Photo needs e17setroot". It also list an e-utils package where this supposed utility can be found, but I cannot find that package, let alone install it.
I realize that moksha actually creates another type of file to display as a wallpaper.
I believe this e17setroot will create the .edj file so the image will then display as a background. Is it possible that e17setroot exists and I am just not able to find it?
Any help will be greatly appreciated.

OK until we properly fix this module here is a hackish fix. You create a file called e17setroot make it executable and place it in your PATH. The file has to be able to create the edj file and set it as your background. Really not hard to do but even easier to do as it has already been done. The variety wallpaper changer app has such a script. I modified it for this purpose to make it work with the photo module:

Code:

#!/bin/bash
#
# This script is run by Variety when a new wallpaper is set. You can use Bash, Python or whatever suits you best.
# Here you can put custom commands for setting the wallpaper on your specific desktop environment,
# or run commands like notify-send that notify you of the change. You can also add commands to theme your browser,
# login screen or whatever you desire.
#

WP=$2

if [[ "$DESKTOP" == *"Enlightenment"* ]] || [[ "$DESKTOP" == *"Moksha"* ]]; then

    OUTPUT_DIR="$HOME/.e/e/backgrounds"

    TEMPLATE='
    images { image: "@IMAGE@" USER; }
    collections {
      group {
      name: "e/desktop/background";
      data { item: "style" "4"; item: "noanimation" "1"; }
      max: @WIDTH@ @HEIGHT@;
      parts {
        part {
        name: "bg";
        mouse_events: 0;
        description {
          state: "default" 0.0;
          aspect: @ASPECT@ @ASPECT@;
          aspect_preference: NONE;
          image { normal: "@IMAGE@"; scale_hint: STATIC; }
        }
        }
      }
      }
    }
    '

    OFILE="$OUTPUT_DIR/variety_wallpaper_$RANDOM"

    DIMENSION="$(identify -format "%w/%h" "$WP")"

    if [ ! -z "$DIMENSION" ]; then
        WIDTH="$(echo "$DIMENSION" | cut -d/ -f1)"
        HEIGHT="$(echo "$DIMENSION" | cut -d/ -f2)"
        IMAGE="$(echo "$WP" | sed 's/[^[:alnum:]_-]/\\&/g')"

        if [ -z "$HEIGHT" ] || [ "$HEIGHT" = "0" ]; then
            ASPECT="0.0"
        else
            ASPECT="$(echo "scale=9; $DIMENSION" | bc)"
        fi
    fi

    printf "%s" "$TEMPLATE" | \
    sed "s/@ASPECT@/$ASPECT/g; s/@WIDTH@/$WIDTH/g; s/@HEIGHT@/$HEIGHT/g; s|@IMAGE@|$IMAGE|g" > "$OFILE.edc"
    edje_cc "$OFILE.edc" "$OFILE.edj" 2>/dev/null
    rm "$OFILE.edc"

    ## Get the current number of virtual desktops
    desk_x_count=$(enlightenment_remote -desktops-get | awk '{print $1}')
    desk_y_count=$(enlightenment_remote -desktops-get | awk '{print $2}')

    ## Get the current number of screens
    screen_count=1
    # If xrandr is available use it to get screen desk_x_count
    if command -v xrandr >/dev/null 2>&1; then
        screen_count=$(xrandr -q | grep -c ' connected')
    fi

    ## Set the wallpaper for each virtual desktop
    for ((x=0; x<desk_x_count; x++)); do
        for ((y=0; y<desk_y_count; y++)); do
            for ((z=0; z<screen_count; z++)); do
                # -desktop-bg-add OPT1 OPT2 OPT3 OPT4 OPT5 Add a desktop bg definition.
                # OPT1 = ContainerNo OPT2 = ZoneNo OPT3 = Desk_x. OPT4 = Desk_y. OPT5 = bg file path
                enlightenment_remote -desktop-bg-add 0 "$z" "$x" "$y" "$OFILE.edj"&
            done
        done
    done
fi

For the record variety is a really nice app and supports moksha. Someone ask about it on our old forum and i fixed it to support moksha and then latter contacted one the devs working on it and the moksha patch got added.

EDIT: Forgot to mention probably imagemagick needs to be installed:

Code:

sudo apt-get update
sudo apt-get install imagemagick


the_waiter 04-01-2019 04:18 PM

Unbelievable scope of knowledge

the_waiter 04-02-2019 11:10 AM

I tried Ylee's hack successfully but maybe need to tell where to place the script

Type $PATH in your terminal emulator to see the right dirs
I placed it to ~/.local/bin

Stefan

rbtylee 04-02-2019 05:47 PM

Quote:

Originally Posted by the_waiter (Post 5980432)
I tried Ylee's hack successfully but maybe need to tell where to place the script...

I said place it in your PATH. Yeah I left some details out. But anyways ... One important detail I left out is you need to have the dbus module loaded.

Despite this hack working it is after all a hack and the module should work on its own without users applying some hack they found online. lol. This has lead to me taking a closer look at it. I fixed some minor issues I found and then spent way too long adding support for changing the background from an image without relying upon the above hack or any other exterior program. Along the way I had to learn alot of detail about how Moksha and enlightenment actually set and change the background. As usual for such projects this involved looking at alot of Moksha source code closely, adding debug statements to print the values of various variables in Moksha functions and whatnot. Meanwhile Štefan added a few minor improvements including a border around the image in the module gadget.

While I hinted at above making implementing this background change Štefan's project, I released that would be rather difficult for him and take alot of time. And in the process I would end up having to answer quite a few questions from him. So may as well do it myself. And I confess it was a little harder than I expected and as usual took longer than I hoped.

Regardless, I am uncertain whether to package this as it is now or to wait until we finish modernizing the module and fixing whatever issues I know about or find in the process. This round of changes was focused entirely on the background change functionality from image files displayed in the gadget. Focused entirely on one file in the modules source code.I really didn't look over any of the other files or functions.

Any opinions on packaging now or waiting some undetermined amount of time?

crajor 04-02-2019 08:02 PM

repo did work for me
 
Just to let you all know, I downloaded the Moksha-module-slideshow from the repo and used gdebi to install.
Had to load the module and THEN had to activate the gadget. Working fine with the default backgrounds folder
where .edj files are stored - /home/bodhi/.e/e/backgrounds.

HOORAY! My background is changing as I wish. Thanks to all who helped with this.

Is the slideshow module a replacement for the photos gadget? Seems the case, but that is a guess.
It seems from the discussion in this thread that I opened a can of worms that may cause some work. If this is any help,
moksha-module-slideshow gives me what I was looking for - a wallpaper changer. I find myself wondering if photos gadget
is now needed at all?

Again, thanks to all Craig :)

the_waiter 04-03-2019 03:18 PM

As you can see, Robert's work is awesome and instant. Sometimes I really wonder where this old man takes energy, time and knowledge for this project. Without him the Bodhi Linux would not be at the level it is now. I am so proud to be his student. My full respect...

If you share my respect, you may consider some donations for him

https://www.paypal.me/rbtylee

Stefan


All times are GMT -5. The time now is 10:44 PM.