WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Refresh Background without rebooting  (Read 4603 times)

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
[Solved] Refresh Background without rebooting
« on: January 17, 2022, 01:10:43 PM »
Hi There,
i have wrote a script, that change the backgroud which the user select.

The script just edit the file setbackground and run it.

The Problem i am facing is that, after changing the the Background and run setbackground, the background doesn't get on both Monitors but in the middle of both. But after rebooting it does get on both Monitors.

So my question is, is there any way to get the Background on both Monitors without rebooting ?

Thnx
« Last Edit: January 19, 2022, 01:57:32 PM by Rich »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: Refresh Background without rebooting
« Reply #1 on: January 19, 2022, 06:27:10 AM »
What setting did you use for hsetroot ?
I just compiled the latest version from github.
I gotta say, they behave differently even with the same command.
Code: [Select]
hsetroot -fill myfig.jpgThe old one stretchs the image across my two monitors.
The new one fills the monitors individually.

Makefile:
Code: [Select]
CFLAGS?=-mtune=generic -Os -pipe -flto -fno-exceptions -fuse-linker-plugin
LDFLAGS?=-Wl,-O1

Here's a quick comparison between the versions (Note that the binaries are stripped)
Code: [Select]
tc@box:~$ du /tmp/hsetroot/bin/*
24.0K   /tmp/hsetroot/bin/hsetroot
16.0K   /tmp/hsetroot/bin/hsr-outputs
tc@box:~$ du /tmp/tcloop/Xlibs/usr/local/bin/hs*
16.5K   /tmp/tcloop/Xlibs/usr/local/bin/hsetroot

It appears that there's a new executable added. (hsr-outputs)

The old one:
Code: [Select]
tc@box:~$ hsetroot --help
hsetroot 1.0.2 - yet another wallpaper application

Syntaxis: hsetroot [command1 [arg1..]] [command2 [arg1..]]...
Gradients:
 -add <color>               Add color to range using distance 1
 -addd <color> <distance>   Add color to range using custom distance
 -gradient <angle>          Render gradient using specified angle
 -clear                     Clear the color range

Solid:
 -solid <color>             Render a solid using the specified color

Image files:
 -center <image>            Render an image centered on screen
 -tile <image>              Render an image tiled
 -full <image>              Render an image maximum aspect
 -fill <image>              Render an image strechted

Manipulations:
 -tint <color>               Tint the current image
 -blur <radius>             Blur the current image
 -sharpen <radius>          Sharpen the current image
 -contrast <amount>         Adjust contrast of current image
 -brightness <amount>       Adjust brightness of current image
 -gamma <amount>            Adjust gamma level of current image
 -flipv                     Flip the current image vertically
 -fliph                     Flip the current image horizontally
 -flipd                     Flip the current image diagonally

Misc:
 -alpha <amount>            Adjust alpha level for colors and images
 -write <filename>          Write current image to file

Colors are in the #rrbbgg or #rrggbbaa format.

Send bugreports to: hyriand@thegraveyard.org
The new one:
Code: [Select]
[tc@box:~$ /tmp/hsetroot/bin/hsetroot --help
hsetroot - yet another wallpaper application

Syntax: /tmp/hsetroot/bin/hsetroot [command1 [arg1..]] [command2 [arg1..]]...
Generic Options:
 -root                      Treat multiple displays as one big screen (ignore xrandr outputs)
 -screens <int>             Set a screenmask to use

Gradients:
 -add <color>               Add color to range using distance 1
 -addd <color> <distance>   Add color to range using custom distance
 -gradient <angle>          Render gradient using specified angle
 -clear                     Clear the color range

Solid:
 -solid <color>             Render a solid using the specified color

Image files:
 -center <image>            Render an image centered on screen
 -cover <image>             Render an image centered on screen scaled to fill the screen fully
 -tile <image>              Render an image tiled
 -full <image>              Render an image maximum aspect
 -extend <image>            Render an image max aspect and fill borders
 -fill <image>              Render an image stretched

Manipulations:
 -tint <color>              Tint the current image
 -blur <radius>             Blur the current image
 -sharpen <radius>          Sharpen the current image
 -contrast <amount>         Adjust contrast of current image
 -brightness <amount>       Adjust brightness of current image
 -gamma <amount>            Adjust gamma level of current image
 -flipv                     Flip the current image vertically
 -fliph                     Flip the current image horizontally
 -flipd                     Flip the current image diagonally

Misc:
 -alpha <amount>            Adjust alpha level for colors and images
 -write <filename>          Write current image to file

Colors are in the #rgb, #rrggbb, #rrggbbaa, rgb:1/2/3 formats or a X color name.

Create issues at https://github.com/himdel/hsetroot/issues
/code]
« Last Edit: January 19, 2022, 06:42:25 AM by polikuo »

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: Refresh Background without rebooting
« Reply #2 on: January 19, 2022, 08:50:44 AM »
Hi polikuo,

yes i think this ist what i exactly need.

This is the option i need 
Code: [Select]
-screens <int>             Set a screenmask to use
Code: [Select]
Makefile:
CFLAGS?=-mtune=generic -Os -pipe -flto -fno-exceptions -fuse-linker-plugin
LDFLAGS?=-Wl,-O1

Could you tell me how did you compiled it from https://github.com/himdel/hsetroot ?
Cause there is no ./configure File


Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: Refresh Background without rebooting
« Reply #3 on: January 19, 2022, 09:34:22 AM »
Hi Rabie

Which architecture are you using ?
If you're on x86_64, just edit the Makefile directly then type make.
Skipping the configure process.

Here are some other flags:
Code: [Select]
x86: -march=i486 -mtune=i686
x86_64: -mtune=generic
RPI32: -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp
RPI64: -march=armv8-a+crc -mtune=cortex-a72
Replace the parts according to your need.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: Refresh Background without rebooting
« Reply #4 on: January 19, 2022, 12:48:56 PM »
Hi polikuo,

Quote
If you're on x86_64, just edit the Makefile directly then type make.
yes i have the x86_64 Version

i am getting an error
Code: [Select]
make
cc -g -O2 -Wall -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -I/usr/local/include -I/usr/local/include -I/usr/local/include   -c -o hsetroot.o hsetroot.c
In file included from hsetroot.c:1:
/usr/local/include/X11/Xlib.h:38:10: fatal error: sys/types.h: Datei oder Verzeichnis nicht gefunden
 #include <sys/types.h>
          ^~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: hsetroot.o] Error 1


this is the Makefile: (See Attachments)
what am i missing ?  :-\

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: Refresh Background without rebooting
« Reply #5 on: January 19, 2022, 12:56:35 PM »
Hi Rabie
It looks like you did not install  compiletc.tcz.
The missing file is in  glibc_base-dev.tcz  which is a dependency of  compiletc.tcz.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: Refresh Background without rebooting
« Reply #6 on: January 19, 2022, 01:02:55 PM »
Considering that hsetroot is a part of Xlibs.tcz
Will it be updated ?  :)
The newer version DOES fix some bugs after all.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: Refresh Background without rebooting
« Reply #7 on: January 19, 2022, 01:04:54 PM »
Hi Rabie
It looks like you did not install  compiletc.tcz.
The missing file is in  glibc_base-dev.tcz  which is a dependency of  compiletc.tcz.

Hi Rich,

OMG!
again so dumb!  :P
Thx that did it

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: Refresh Background without rebooting
« Reply #8 on: January 19, 2022, 01:10:46 PM »
Hi Rabie
again so dumb!  :P
That's OK. It makes other people think I might be smart.  ::)

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: Refresh Background without rebooting
« Reply #9 on: January 19, 2022, 01:44:51 PM »
Quote
That's OK. It makes other people think I might be smart.  ::)

you are  ;D

By the Way.

The Topic can be marked as Solved.

Thank you @polikuo for your help
« Last Edit: January 19, 2022, 01:46:36 PM by Rabie »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: [Solved] Refresh Background without rebooting
« Reply #10 on: January 19, 2022, 01:58:41 PM »
Hi Rabie
... The Topic can be marked as Solved. ...
Done.  :)

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: [Solved] Refresh Background without rebooting
« Reply #11 on: January 19, 2022, 03:34:41 PM »
oh just have one more question  ;D

ist there a way to say that i dont want to setbackground at boot ?

Because after compiling the new hsetroot i edited /home/tc/.setbackground like this and it does what i want:

Code: [Select]
/usr/local/bin/hsetroot -screens 3 -gradient 0 -center background.jpg
and after rebooting the Background doesn't look like i set it until i start the command manually.

if you understand what i mean  :-\

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: [Solved] Refresh Background without rebooting
« Reply #12 on: January 20, 2022, 12:04:50 AM »
I think you should put hsetroot in your /home/tc/.local/bin
And undo the change to /home/tc/.setbackground

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14791
Re: Refresh Background without rebooting
« Reply #13 on: January 20, 2022, 01:49:50 AM »
Considering that hsetroot is a part of Xlibs.tcz
Will it be updated ?  :)
The newer version DOES fix some bugs after all.

I'll add it to the queue

Edit: I take it you mean to update hsetroot and not to add hsr-outputs?
« Last Edit: January 20, 2022, 02:27:03 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14791
Re: [Solved] Refresh Background without rebooting
« Reply #14 on: January 21, 2022, 06:27:30 AM »
hsetroot updated in Xlibs