Choose style:

Author Topic: Nemo Custom Action Not Working [Solved]  (Read 1692 times)

0 Members and 1 Guest are viewing this topic.

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Nemo Custom Action Not Working [Solved]
« on: August 05, 2015, 09:30:23 pm »
I can't seem to get this action working. I created a file called install_fonts.nemo_action in ~/.local/share/nemo/actions with the following contents:
Code: [Select]
[Nemo Action]
Name=Install Fonts
Comment=Copies font files to ~/.fonts
Exec=sakura -x sh -c 'mv %F ~/.fonts'
Icon-Name=font-x-generic
Selection=notnone
Extensions=ttf;otf;
When I right click on a font file I can see the action and icon just fine in the context menu, however when running it, the verbose action output shows
Code: [Select]
Cannot parse integer value 'mv /home/mike/Downloads/lato/Lato-Black.ttf ~/.fonts' for -c
I feel like the error is probably obvious but I'm not sure.
« Last Edit: August 08, 2015, 04:40:11 pm by configX »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26468
  • Karma: 2869
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Nemo Custom Action Not Working
« Reply #1 on: August 07, 2015, 06:01:40 am »
Not sure if you can use relative paths (~/.fonts) in an action script (and a bit too busy to check ATM)

maybe try a full path:
Code: [Select]
Exec=sakura -x sh -c 'mv %F /home/mike/.fonts'
or even better (so other user accounts don't copy to your .fonts directory)
Code: [Select]
Exec=sakura -x sh -c 'mv %F $HOME/.fonts'
« Last Edit: August 07, 2015, 06:05:26 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26468
  • Karma: 2869
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Nemo Custom Action Not Working
« Reply #2 on: August 07, 2015, 05:02:56 pm »
come to think of it, do you need the "sakura -x" at all (unless you're asking sakura to actually open) ?
(and you really should add a forward slash to the end of the path, ot if the .fonts directory doesn't exist the file will just get renamed to .fonts)

how about just
Code: [Select]
Exec=bash -c "mv %F $HOME/.fonts/"



Also you are aware that just simply copying the .ttf file to the .fonts directory isn't enough for the system to recognise the font ?

maybe:
Code: [Select]
Exec=bash -c "mv %F $HOME/.fonts/ && fc-cache -f"
« Last Edit: August 07, 2015, 05:17:05 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: Nemo Custom Action Not Working
« Reply #3 on: August 07, 2015, 08:49:21 pm »
come to think of it, do you need the "sakura -x" at all (unless you're asking sakura to actually open) ?

Yeah, I'm a dummy. It worked without calling sakura. Thanks!
Code: [Select]
Exec=bash -c 'mv %F ~/.fonts/'

Quote
Also you are aware that just simply copying the .ttf file to the .fonts directory isn't enough for the system to recognise the font ?
maybe:
Code: [Select]
Exec=bash -c "mv %F $HOME/.fonts/ && fc-cache -f"

That's strange...I've never had to rebuild the font cache before as they usually just show up. Good to know though! Thanks again.
« Last Edit: August 07, 2015, 08:51:27 pm by configX »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26468
  • Karma: 2869
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Nemo Custom Action Not Working
« Reply #4 on: August 08, 2015, 03:57:44 pm »
No problem :)

Can you remember to mark the topic solved please .. you can do this by editing the FIRST posting in the topic and changing:-

Subject: Nemo Custom Action Not Working (SOLVED)

Thanks in advance ;)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec