Results 1 to 6 of 6

Thread: Making spotify.desktop work with alias for scaling?

  1. #1
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    288
    Distro
    Ubuntu 20.04 Focal Fossa

    Question Making spotify.desktop work with alias for scaling?

    I have installed Spotify on Ubuntu 20.04.01 with apt from the Spotify repo as that is my preferred method of install. Unfortunately on my 3200 x 1800 the user interface is very small.

    In ~./bash_aliases I have added the following line:

    Code:
    alias spotify='/usr/bin/spotify --force-device-scale-factor=2.0'
    and in terminal I input:

    Code:
    . .bash.rc
    For good measure, I have also rebooted.

    If I enter the command spotify in terminal it is now scaled properly but when I open Spotify using the Gnome icon it is the same as before.

    /usr/share/applications/spotify.desktop has a line
    Code:
    Exec=spotify %U
    and if I run this from terminal scaling is also fixed.

    How can I make it so the .desktop launch option uses the scaling I have set please?

  2. #2
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,430
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Making spotify.desktop work with alias for scaling?

    Have you tried just sticking that additional configuration flag into your desktop file?

    Code:
    Exec=spotify --force-device-scale-factor=2.0 %U

  3. #3
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    288
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Making spotify.desktop work with alias for scaling?

    Quote Originally Posted by CatKiller View Post
    Have you tried just sticking that additional configuration flag into your desktop file?

    Code:
    Exec=spotify --force-device-scale-factor=2.0 %U
    I should have explained, I plan to sync my .bashrc and config files across systems so I am trying to keep any custom settings contained within. As such I have purposely not just edited the Exec line.

    Is there a workaround?

  4. #4
    Join Date
    Dec 2014
    Beans
    2,558

    Re: Making spotify.desktop work with alias for scaling?

    Not really. Aliases are substituted by the shell (bash, probably). There's no shell involved when calling programs through a .desktop file. You could put the changed .desktop file for spotify in $HOME/.local/share/applications - the directory for user-specific .desktop files - and add that directory to the ones you keep in sync.

    Holger

  5. #5
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    288
    Distro
    Ubuntu 20.04 Focal Fossa

    Question Re: Making spotify.desktop work with alias for scaling?

    Quote Originally Posted by Holger_Gehrke View Post
    Not really. Aliases are substituted by the shell (bash, probably). There's no shell involved when calling programs through a .desktop file. You could put the changed .desktop file for spotify in $HOME/.local/share/applications - the directory for user-specific .desktop files - and add that directory to the ones you keep in sync.

    Holger
    Sounds good.

    After moving the spotify.desktop file I can see in Nautilus there is a lock on the icon but I have edited the exec line from spotify %U to:

    Code:
    Exec=/usr/bin/spotify --force-device-scale-factor=2.0 %U
    Is it correct for the URL parameter to come at the very end there or should it be directly after /usr/bin/spotify?

    I am looking at a permissions cheatsheet here but I am unsure if I should duplicate the permissions for jetbrains or for telegram?

    Code:
    user@host:~/.local/share/applications$ lltotal 20
    drwx------ 1 user user 224 Sep 12 20:12 ./
    drwxr-xr-x 1 user user 452 Sep 12 20:14 ../
    -rwxrw-r-- 1 user user 353 Sep 12 12:42 jetbrains-idea.desktop*
    -rwxrw-r-- 1 user user 440 Sep 12 12:40 jetbrains-toolbox.desktop*
    -rw-rw-r-- 1 user user   0 Sep 11 18:58 mimeapps.list
    -rw-rw-r-- 1 user user  58 Sep 12 11:28 mimeinfo.cache
    -rw-r--r-- 1 root  root  238 Sep 12 09:47 spotify.desktop
    -rw-rw-r-- 1 user user 411 Sep 12 11:28 telegramdesktop.desktop

  6. #6
    Join Date
    Dec 2014
    Beans
    2,558

    Re: Making spotify.desktop work with alias for scaling?

    The lock-icon in Nautilus is there because the file is owned by root. You could change ownership of the file - you really should not have files owned by root in your home directory - by running 'sudo chown user:user ~/.local/share/applications/spotify.desktop'.
    The normal order is options first then parameters, but that's mostly convention. What order the 'spotify' program expects I can't tell you, but there might be some documentation. Try 'man spotify'.
    The permissions on the file are the minimum that will work. Having the executable bit for the owner set would allow you to start the program from Nautilus with a double-click on the file. Making it writeable for the group does not make sense under the circumstances. I'd leave it as it is.

    Holger

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •