LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Manjaro (https://www.linuxquestions.org/questions/manjaro-119/)
-   -   Trouble installing bbswitch-monitor [AUR] (https://www.linuxquestions.org/questions/manjaro-119/trouble-installing-bbswitch-monitor-%5Baur%5D-4175701407/)

Leviathan42 10-03-2021 05:59 AM

Trouble installing bbswitch-monitor [AUR]
 
I've installed bbswitch-monitor from AUR and as the github page says, you need to activate it using
Code:

systemctl --user enable bbswitch-monitor
but when running this command, i get
Code:

Unit /etc/xdg/systemd/user/bbswitch-monitor.service is added as a dependency to a non-existent unit graphical.target.
and it wont run after boot. Can anyone help me?

mrmazda 10-03-2021 06:17 AM

Do you have any display manager installed and enabled?

Leviathan42 10-03-2021 06:50 AM

Quote:

Originally Posted by mrmazda (Post 6288621)
Do you have any display manager installed and enabled?

I use KDE/SDDM

mrmazda 10-03-2021 11:33 PM

You might try reinstalling SDDM. If it doesn't work, try switching to LightDM or XDM. Graphical.target is systemd standard equipment. Have you disabled or masked it?

Leviathan42 10-04-2021 03:01 AM

Quote:

Originally Posted by mrmazda (Post 6288861)
You might try reinstalling SDDM. If it doesn't work, try switching to LightDM or XDM. Graphical.target is systemd standard equipment. Have you disabled or masked it?

No, havent done anything but switching themes and stuff. Reinstalling didnt help. Still the same error.

Leviathan42 10-04-2021 10:54 AM

Now it gets weird:

systemctl list-units --type=target returns
Code:

UNIT                LOAD  ACTIVE SUB    DESCRIPTION                           
  basic.target        loaded active active Basic System
  bluetooth.target    loaded active active Bluetooth Support
  cryptsetup.target  loaded active active Local Encrypted Volumes
  getty.target        loaded active active Login Prompts
  graphical.target    loaded active active Graphical Interface
  local-fs-pre.target loaded active active Preparation for Local File Systems
  local-fs.target    loaded active active Local File Systems
  multi-user.target  loaded active active Multi-User System
  network.target      loaded active active Network
  nss-lookup.target  loaded active active Host and Network Name Lookups
  paths.target        loaded active active Path Units
  remote-fs.target    loaded active active Remote File Systems
  slices.target      loaded active active Slice Units
  sockets.target      loaded active active Socket Units
  sound.target        loaded active active Sound Card
  swap.target        loaded active active Swaps
  sysinit.target      loaded active active System Initialization
  time-set.target    loaded active active System Time Set
  timers.target      loaded active active Timer Units
  veritysetup.target  loaded active active Local Verity Integrity Protected Volumes

LOAD  = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
20 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

So graphical.target is there and active but i still get this error. WTF!!!!!

mrmazda 10-04-2021 11:29 AM

I'd find the maintainer's email address in the changelog and report to him about this.

Leviathan42 10-04-2021 11:43 AM

The AUR repo has gone and the Github link returns 404. It has been up and working less than 48 hours ago. :O

ondoho 10-04-2021 11:53 PM

Indeed it is.

If you still want to get to the bottom of this:
  • I can see that "systemctl --user list-units --type=target" gives fewer results. Maybe has something to do with it.
  • If you didn't remove it yet, you could show us the offending .service file, the PKGBUILD and any additional installation instructions.

That said, bbswitch-monitor described itself thusly:
Quote:

This is a simple applet built with Qt to monitor external GPU status, whether it's ON or OFF by querying /proc/acpi/bbswitch
That means you could probably recreate its functionality fairly easily with a quick'n'dirty shell script "daemon".

Leviathan42 10-05-2021 02:27 AM

Quote:

Originally Posted by ondoho (Post 6289174)
If you still want to get to the bottom of this:
  • I can see that "systemctl --user list-units --type=target" gives fewer results.

systemctl --user list unity --type=target gives me
Code:

  UNIT          LOAD  ACTIVE SUB    DESCRIPTION   
  basic.target  loaded active active Basic System
  default.target loaded active active Main User Target
  paths.target  loaded active active Paths
  sockets.target loaded active active Sockets
  timers.target  loaded active active Timers

LOAD  = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
5 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

now graphical.target is not listed
Quote:

Originally Posted by ondoho (Post 6289174)
If you didn't remove it yet

It is still there
Quote:

Originally Posted by ondoho (Post 6289174)
you could show us the offending .service file

Code:

[Unit]
Description=System tray icon to monitor external GPU on/off status with Bumblebee

[Service]
Type=simple

ExecStart=bbswitch-monitor
Restart=always

[Install]
WantedBy=graphical.target

Quote:

Originally Posted by ondoho (Post 6289174)
the PKGBUILD and any additional installation instructions.

there is no PKGBUILD but only a "desc", "files" and "mtree" archive with "mtree.uncompressed" inside

desc:
Code:

%NAME%
bbswitch-monitor

%VERSION%
0.1.2-1

%BASE%
bbswitch-monitor

%DESC%
System tray icon to monitor external GPU on/off status with Bumblebee

%URL%
https://github.com/MicroDroid/bbswitch-monitor

%ARCH%
x86_64

%BUILDDATE%
1633258598

%INSTALLDATE%
1633258605

%PACKAGER%
Unknown Packager

%SIZE%
35007

%LICENSE%
MIT

%VALIDATION%
none

%DEPENDS%
bbswitch

%PROVIDES%
bbswitch-monitor

files:
Code:

%FILES%
etc/
etc/systemd/
etc/systemd/user/
etc/systemd/user/bbswitch-monitor.service
usr/
usr/local/
usr/local/bin/
usr/local/bin/bbswitch-monitor

and mtree.uncompressed
Code:

#mtree
/set type=file uid=0 gid=0 mode=644
./.BUILDINFO time=1633258598.0 size=40907 md5digest=b3054c637b07bf4e37a6ed85886f4e80 sha256digest=73f463674a8441c8f2cc139a21d534ca36ecdce3cb9a305097b5e74f2204d7bf
./.PKGINFO time=1633258598.0 size=441 md5digest=354915ae8da223306644e34b092a99f1 sha256digest=020385c963093a0f380942cb5b327ebb8d323da284d3aafd447776e4308e0f12
./etc time=1633258598.0 mode=755 type=dir
./etc/systemd time=1633258598.0 mode=755 type=dir
./etc/systemd/user time=1633258598.0 mode=755 type=dir
./etc/systemd/user/bbswitch-monitor.service time=1633258598.0 size=191 md5digest=ee8aa178e6197f6d6e27fcf5637b213b sha256digest=b51a9ca528b41852f16e2e471d41300b401cf6834fa853453ce0887272556c4a
./usr time=1633258598.0 mode=755 type=dir
./usr/local time=1633258598.0 mode=755 type=dir
./usr/local/bin time=1633258598.0 mode=755 type=dir
./usr/local/bin/bbswitch-monitor time=1633258598.0 mode=755 size=34816 md5digest=9c7e9b62d689f32fba282ef421bd832d sha256digest=90192117a91f76307aec24212a677c4e7cb7bac8109c1046933dce5a4e849b9e

i hope this is some useful information

Leviathan42 10-05-2021 08:15 AM

Found the PKGBUILD:
Code:

# Maintainer: Yousef Sultan <yousef.su.2000@gmail.com>

pkgname=bbswitch-monitor
pkgver=0.1.2
pkgrel=1
pkgdesc="System tray icon to monitor external GPU on/off status with Bumblebee"
arch=('x86_64')
url='https://github.com/MicroDroid/bbswitch-monitor'
provides=('bbswitch-monitor')
license=('MIT')
depends=('bbswitch')
makedepends=('make' 'qt5-base')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/MicroDroid/bbswitch-monitor/archive/v${pkgver}.tar.gz")
sha512sums=('ebee8b42526f038581f25be0d71d94b30c6744b147a93858e3a1f08bd8d25ebc19e9d5a32b31eb19806616ef8a9c513d7d461fa0727548963db4333d8c5be567')

build() {
  mkdir -p "$srcdir/$pkgname-$pkgver/build/"
  cd "$srcdir/$pkgname-$pkgver/build/"
  qmake ../bbswitch-monitor.pro PREFIX=/usr/local
  make VERSION=$pkgver DESTDIR="$pkgdir" PREFIX=/usr/local
}

package() {
  cd "$srcdir/$pkgname-$pkgver/build"

  INSTALL_ROOT="$pkgdir" make VERSION=$pkgver DESTDIR="$pkgdir" PREFIX=/usr/local install

  mkdir -p "$pkgdir/usr/local/bin"
  mkdir -p "$pkgdir/etc/systemd/user"

  echo "${pkgdir}"

  mv "$pkgdir/opt/bbswitch-monitor/bin/bbswitch-monitor" "$pkgdir/usr/local/bin"
  cp "$srcdir/$pkgname-$pkgver/bbswitch-monitor.service" "$pkgdir/etc/systemd/user"

  rm -r "$pkgdir/opt"

  printf "\033[1;33m--- NOTE: Don't forget to run: systemctl --user enable bbswitch-monitor\n"
}


ondoho 10-06-2021 02:23 PM

Quote:

Originally Posted by Leviathan42 (Post 6289199)
now graphical.target is not listed

Yep.

But looking at this:
Code:

[Unit]
Description=System tray icon to monitor external GPU on/off status with Bumblebee

[Service]
Type=simple

ExecStart=bbswitch-monitor
Restart=always

[Install]
WantedBy=graphical.target

I think whoever wrote this service file wanted to execute a little graphical tray utility via systemd. That's not how systemd works, it does not cater to desktop environemnts in this particular way.

It was wise of them to remove the repo, I guess.

If you still want to autostart it you should do it via XDG or in some startup script.

Leviathan42 10-07-2021 03:25 AM

Ok, but how can i do that?

ondoho 10-07-2021 11:03 PM

Quote:

Originally Posted by Leviathan42 (Post 6289793)
Ok, but how can i do that?

By clicking on the link I provided, and then further links in that article.
There's many different methods, even one involving systemd, lol.
I guess at least one of them is already implemented on your system, about which you provided no information at all so far.


All times are GMT -5. The time now is 01:29 PM.