.desktop scripts for Vnstat not working while the commands work in terminal.

Forum Forums New users New Users and General Questions .desktop scripts for Vnstat not working while the commands work in terminal.

  • This topic has 1 reply, 1 voice, and was last updated Jul 28-8:46 am by anilkagi.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39507
    Member
    anilkagi

      Hello there,

      I have installed vnstat. And I can run the commands in terminal, namely;

      vnstat -l -i wlan0
      vnstat -h -i wlan0
      vnstat -d -i wlan0
      vnstat -m -i wlan0

      All these commands work in the terminal.

      However I thought of creating desktop scripts to run those commands for other users, instead of typing those commands in the terminal. Not everybody can do that.

      I created these executable files with the names, ‘Internet Traffic Live.desktop’, ‘Internet Traffic Hourly.desktop’, ‘Internet Traffic Daily.desktop’ and ‘Internet Traffic Monthly.desktop’.

      The script I added to these files are as below;

      [Desktop Entry]
      Name=vnstat
      Exec=vnstat -l -i wlan0
      Terminal=true
      Type=Application
      Name[en_IN]=Internet Traffic Live
      
      [Desktop Entry]
      Name=vnstat
      Exec=vnstat -h -i wlan0
      Terminal=true
      Type=Application
      Name[en_IN]=Internet Traffic Hourly
      
      [Desktop Entry]
      Name=vnstat
      Exec=vnstat -d -i wlan0
      Terminal=true
      Type=Application
      Name[en_IN]=Internet Traffic Daily
      
      [Desktop Entry]
      Name=vnstat
      Exec=vnstat -m -i wlan0
      Terminal=true
      Type=Application
      Name[en_IN]=Internet Traffic Monthly

      Here, among all these scripts only the ‘Internet Traffic Live.desktop’ works. But the hourly, daily and monthly scripts don’t work. The terminal flashes for a fraction a second and goes.

      What am I doing wrong in this?

      Thanks

      • This topic was modified 2 years, 9 months ago by anilkagi.
      #39517
      Member
      anilkagi
        Helpful
        Up
        0
        ::

        Hello there,

        It’s solved.

        I added;

        bash -c

        and

        $SHELL

        It’s working now

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.