![]() |
|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|
|||
![]()
I had installed openbsd-backgrounds, how to use it? thanks
|
|
|||
![]()
I use xendom, but it's the same as before, there's no wallpaper shown.
|
|
||||
![]()
My mistake, xwallpaper is already is identified as a dependency, and has been since 2019. So xwallpaper should be already installed.
I misremembered my provisioning. I'm sorry. I had manually edited /etc/X11/xenodm/Xsetup_0, which -- by default -- has a call to /usr/local/bin/openbsd-wallpaper commented out. I'd uncommented it. |
|
|||
![]()
I had uncommented lines below # then uncomment in /etc/X11/xenodm/Xsetup_0, and then run command rcctl restart xenodm && exit, but wallpaper didn't show up.
|
|
||||
![]()
Double check your changes. The contents of /etc/X11/xenodm/Xsetup_0 should look like this:
Code:
#!/bin/sh # $OpenBSD: Xsetup_0.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $ prefix="/usr/X11R6" exec_prefix="${prefix}" ${exec_prefix}/bin/xsetroot -fg \#6f6f6f -bg \#bfbfbf -bitmap ${prefix}/include/X11/bitmaps/root_weave ${exec_prefix}/bin/xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail # install package openbsd-backgrounds # then uncomment: # if test -x /usr/local/bin/openbsd-wallpaper then /usr/local/bin/openbsd-wallpaper fi sxpm OpenBSD.xpm & |
|
|||
![]()
it's OK now, very good wallpapers!
|
|
|||
![]()
How to let wallpaper automatically fill my screen? the wallpaper is not fullscreen
|
|
||||
![]()
You could edit /usr/local/bin/openbsd-wallpaper and change line 51 to:
Code:
args="$args --output $display --zoom $pic" The --zoom option is actually the default so you could also just delete "--maximize" from that line. |
|
|||
![]()
why my openbsd-wallpaper file's content differ from your's? my file have more than 100 lines. Shoud I replace it with your code?
my wallpaper has black blank on both sides horizontally. Last edited by unicorn; 22nd January 2024 at 01:37 AM. |
|
||||
![]()
I linked to OpenBSD's GitHub mirror, which shows the contents of the file in -current, the file hasn't been changed in 2 years so I am surprised yours is different.
Do you have a line with "--maximize"? If you share your version of the script I can tell you what to change. Please remember to use [code][/code] tags when posting terminal output. Thanks. |
|
|||
![]()
see my file
Code:
#! /usr/bin/perl # # Copyright (c) 2019 Marc Espie <espie@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # use strict; use warnings; use List::Util; use File::Find; use OpenBSD::Subst; sub farey { my ($x, $N) = @_; my ($a, $b) = (0, 1); my ($c, $d) = (1, 0); while ($b <= $N && $d <= $N) { my $mediant = ($a+$c)/($b+$d); if ($x == $mediant) { if ($b + $d <= $N) { return ($a+$c, $b+$d); } elsif ($d > $b) { return ($c, $d); } else { return ($a, $b); } } elsif ($x > $mediant) { ($a, $b) = ($a+$c, $b+$d); } else { ($c, $d) = ($a+$c, $b+$d); } } if ($b > $N) { return ($c, $d); } else { return ($a, $b); } } sub add_dir { my ($l, $dir) = @_; if (!-d $dir) { $dir = 'pictures'; } find( sub { push @$l, $File::Find::name if -f $_; }, $dir); } my $s = OpenBSD::Subst->new; $s->add('TRUEPREFIX' => '/usr/local'); $s->add('LOCALBASE' => '/usr/local'); my $prefix = $s->do('/usr/local'); my $localbase = $s->do('/usr/local'); if (!-x "$localbase/bin/xwallpaper") { print STDERR "You must pkg_add xwallpaper\n"; exit 1; } my $imagedir = "$prefix/share/openbsd-backgrounds"; if (@ARGV != 0) { $imagedir = shift; } $ENV{PATH} = "${localbase}/bin:/usr/bin:/usr/X11R6/bin"; open(my $pipe, "-|", "xrandr") or die "Can't run xrandr: $!"; my $monitors = {}; while (<$pipe>) { chomp; next unless m/\bconnected\b/; my ($name, undef, @r) = split(/\s+/, $_); my $monitor = $monitors->{$name} = {name => $name}; if ($r[0] eq 'primary') { $monitor->{primary} = 1; shift @r; } my $res = shift @r; if ($res =~ m/(\d+)x(\d+)\+\d+\+\d+/) { ($monitor->{a}, $monitor->{b}) = farey($1/$2, 25); } $monitor->{portrait} = ($r[0] eq 'left' or $r[0] eq 'right'); } close($pipe); chdir($imagedir) or die $!; my @command = (qw(xwallpaper)); # build the command on each monitor for my $m (values %$monitors) { my @l; my $ratio = "$m->{a}:$m->{b}"; my $i = "aspect-$ratio"; # let's cheat a bit if (!-r $i && $ratio eq '5:8') { $i = 'aspect-9:16'; } if (-r $i) { open my $file, "<", $i; while (<$file>) { chomp; if (m/^\+(.*)/) { add_dir(\@l, $1); } push(@l, $_); } } else { my $dir = $m->{a} < $m->{b} ? "portrait" : "landscape"; add_dir(\@l, $dir); } @l = (List::Util::shuffle @l); my @r = split(/\s+/, $l[0]); unshift(@r, '--maximize') if @r == 1; push(@command, '--output', $m->{name}, @r); } print "Running ", join(' ', @command), "\n"; exec {$command[0]} @command; |
|
||||
![]()
From the bottom of the script, 5th line up:
Quote:
Disclaimer: I don't know perl ![]()
__________________
Para todos todo, para nosotros nada |
|
|||
![]()
it works! thanks man
|
|
|||
![]()
my wallpaper can't show fullscreen with OpenBSD 7.7, below is my /etc/X11/xenodm/Xsetup_0 contents, how to edit it, thanks!
Code:
#!/bin/sh # $OpenBSD: Xsetup_0.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $ prefix="/usr/X11R6" exec_prefix="${prefix}" ${exec_prefix}/bin/xsetroot -fg \#6f6f6f -bg \#bfbfbf -bitmap ${prefix}/include/X11/bitmaps/root_weave ${exec_prefix}/bin/xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail # install package openbsd-backgrounds # then uncomment: if test -x /usr/local/bin/openbsd-wallpaper then /usr/local/bin/openbsd-wallpaper fi sxpm OpenBSD.xpm & |
|
|||
![]()
Monitors come in different aspect ratios - you can get the output the resolution of the wallpaper files, file(1) and compare it to the output of xrandr(1).
It would be possible but tedious to match the wallpaper files to your screen size using graphics/ImageMagick, graphics/gimp. Last edited by shep; 2 Days Ago at 03:59 PM. Reason: corrected ImageMagick per @Onauk 's subsequent post |
|
||||
![]() Quote:
https://usage.imagemagick.org/resize/#resize |
![]() |
Thread Tools | |
Display Modes | |
|
|