You are not logged in.

#1 2020-10-22 11:00:48

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

[SOLVED] Make albert autostart at login with correct dpi settings

I'm extremely new to linux and after learning some basics on regressions and terminal navigation in mint and ubuntu I jumped to arch. I'm using X1carbon gen 7 4k screen uefi install with grub, lightdm and xfce4. When I first installed albert the application was tiny as I'm assuming it must be based on Qt5 so I added:

Exec=/usr/bin/env QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=2 /usr/bin/albert %u

to the:

/usr/share/applications/albert.desktop

I was very happy that worked, but when I added:

albert &

to my

.xprofile

albert started at login but was tiny again. I'm assuming albert is getting started before the changes in

usr/share/applications/albert.desktop

are applied.

I searched the arch wiki and found a page where it mentions delaying autostart, it said to use this command:

sh -c "sleep 3 && command"

but I'm not sure how to use it.

I've tried adding a program to autostart in the xfce session and startup gui but again it didn't work, I don't think I was adding the application properly. Whilst trying from the session and startup settings I tried by adding the path

/usr/share/applications/albert.desktop

and I tried adding

sh -c "sleep 3 && command"

and I tried adding

albert &

.

So I know how to make albert open with the correct dpi settings but I can't get albert to autostart with those settings.

any help would be much appreciated,

many thanks in advance.

Last edited by Straight-path (2020-10-22 14:40:35)

Offline

#2 2020-10-22 11:34:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,364

Re: [SOLVED] Make albert autostart at login with correct dpi settings

You aren't invoking the .desktop file by starting albert this way (... you are basically in a commandline/script environment  in your .xinitrc)

So if you want to start it like that just do the same thing you did in the desktop file: change the startup command to pass that environment

QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=2 /usr/bin/albert &

You can get rid of the sleeps, this isn't a race condition issue here, you simply never launch the .desktop file and thus your modification does not have an effect in that setting.

FWIW this is very albert centric, if you want these parameters to rather apply to the entire session and be applicable for every Qt5 application you start, you can instead export them at the beginning of the .xinitrc (like mentioned in https://wiki.archlinux.org/index.php/En … nvironment )

Last edited by V1del (2020-10-22 11:38:33)

Offline

#3 2020-10-22 11:53:11

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

Do you mean I can add

QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=2 

to my

.xprofile

file?

So as to make the changes for the whole system. That is what I originally wanted to do but I couldn't work out how to do that and just found the answer to manually change one instance.

Last edited by Straight-path (2020-10-22 11:54:41)

Offline

#4 2020-10-22 12:03:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,706

Re: [SOLVED] Make albert autostart at login with correct dpi settings

If your session imports ~/.xprofile - also you'll have to "export" them.

Offline

#5 2020-10-22 12:13:15

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

Thank you very much for the help and your time. but I don't understand. I don't understand exporting things. I've read the pages on the wiki directed to me v1del but I still don't get it.

I think if I add

QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=2 /usr/bin/albert &

to

/usr/share/applications/albert.desktop

that albert will have the correct dpi settings and will autostart.

If thats the case thats fantastic and I could do that for all applications in the future which I have this issue with. But I would love to be able to set it system wide but I don't get the exporting part. I don't understand how to set environment variables and have read that section many times. thats why I ended up finding the singular solution.

pls elaborate on setting up environment variables and exporting pls.

Offline

#6 2020-10-22 12:19:52

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,706

Re: [SOLVED] Make albert autostart at login with correct dpi settings

What part of https://wiki.archlinux.org/index.php/En … _variables do you not understand?

Whether the above works depends on where and how exactly you add that line to the desktop file and which shell interprets the desktop file.
You can circumvent the latter variable by using env ("man env"), but if you've just a desktop file where "QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=2 /usr/bin/albert &" is literally the only content, that's malformed and will do nothing.

Also such desktop service will not be implicitly autostarted, https://wiki.archlinux.org/index.php/Autostarting

Offline

#7 2020-10-22 12:28:09

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

lol sadly I don't understand the majority of that page. It took me literally two days to be able to install udisk2 set it to mount at media and then install udiskie get it to autostart and mkdir and make a new file so the tray would work.

once I new how I could do it in 10 mins. The problem is I don't understand most of what I'm reading and then I read more things and other pages to understand the first page but still don't understand those pages. I have got far with arch but it's such a struggle for me as there's so much I don't know. I've left and come back many times.

I'm thinking maybe I should use ubuntu and learn there and come back to arch when I've learnt a lot more.

Offline

#8 2020-10-22 12:31:55

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

I know you don't want to spoon people. Honestly though the amount of effort I've put in is ridiculous. I've only had to put that much effort because I'm an absolute beginner. When I first started trying to install arch I didn't even know

cd ..

.

It's been a hell of a ride and I've learnt so much in a short space of time. lol but the pain is immense.

Offline

#9 2020-10-22 12:38:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,364

Re: [SOLVED] Make albert autostart at login with correct dpi settings

Well for this particular problem you really only need to adapt the exact section I linked you to your usecase

You have two environment variables, that much you've identified already. The section I linked you  talks about exporting them in .xprofile so that they are available to everything else that's started after them. so what you have to do is do just that.

export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCALE_FACTOR=2

add those at the start of the .xprofile keep the albert command in there as

/usr/bin/albert &

Last edited by V1del (2020-10-22 12:39:55)

Offline

#10 2020-10-22 12:39:17

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

From the perspective of a new linux user it is so difficult. I have the ability to endure the pain and continue and I will, but I may have to come back to arch when I have more knowledge. Linux is absolutely mind blowing and amazing. Hopefully, eventually I'll get to the level where I can help people new to arch because I'll never forget how much of a struggle it's been for me.

Offline

#11 2020-10-22 12:45:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,706

Re: [SOLVED] Make albert autostart at login with correct dpi settings

If you've absolutely no linux/unix experience whatsoever, you should rather start w/ a pre-configured, guided distro to look around and familiarize yourself w/ the basics while having an actually usuable system.
Using arch to "learn linux" is like trying to learn walking on a high wire.

Offline

#12 2020-10-22 12:45:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,364

Re: [SOLVED] Make albert autostart at login with correct dpi settings

I'd say that is a generally good idea if you feel overwhelmed by the documentation/how Arch should be handled, but these concepts are ultimately applicable and worth to learn on Ubuntu as well.

Offline

#13 2020-10-22 12:47:04

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

Thank you very much V1del, sorry just to confirm. Do I just add

export QT_AUTO_SCREEN_SCALE_FACTOR=0

and

export QT_SCALE_FACTOR=2

and

/usr/bin/albert &

to my .xprofile file?

And yes I will definitely be taking notes on everything I have done like I've been doing from the beginning and will re read many times the appropriate pages to understand what I have done and why it works, because I want to know and I don't want to have to ask.

Many issues I have dealt with myself by struggling for days sometimes weeks to find the solutions.

Offline

#14 2020-10-22 12:49:08

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,364

Re: [SOLVED] Make albert autostart at login with correct dpi settings

That should be the deal, yes.

Offline

#15 2020-10-22 12:57:10

Straight-path
Banned
Registered: 2020-06-28
Posts: 66

Re: [SOLVED] Make albert autostart at login with correct dpi settings

well V1del thank you very much. I will do the reading and I will stay with arch for the time being because man I've put the effort in and I deserve it. I can now install Arch up to the stage i'm at now in about 40 mins. When I work out something I noticed on pacman tips and tricks I think about a list of installed apps I should be able to get my installation time down. lol because I know I will break my system and I need the ability to do it all over quickly.

Thank you again V1del, And don't feel like your not helping me spoon feeding me. If I showed you my notes you wouldn't think that.

Offline

Board footer

Powered by FluxBB