Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to run QT APP when power button pressed in Ubuntu 20.04

How to run QT APP when power button pressed in Ubuntu 20.04

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 289 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Service IT
    wrote on last edited by Service IT
    #1

    Hello dear,
    I Want to run my PowerOff Qt app when I press the power button, I have tried this solution:
    https://superuser.com/questions/1523918/run-script-when-power-button-pressed

    my power.sh in /etc/acpi/
    contain :
    ./home/serviceit/PowerOff
    any Solution Please

    JonBJ 1 Reply Last reply
    0
    • S Service IT

      Hello dear,
      I Want to run my PowerOff Qt app when I press the power button, I have tried this solution:
      https://superuser.com/questions/1523918/run-script-when-power-button-pressed

      my power.sh in /etc/acpi/
      contain :
      ./home/serviceit/PowerOff
      any Solution Please

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Service-IT
      And what is your question? Have you even verified your script is executed?

      ./home/serviceit/PowerOff

      I have no idea what you think the current working directory is when this is executed, nor where PowerOff is actually located.

      JonBJ 1 Reply Last reply
      1
      • S Offline
        S Offline
        Service IT
        wrote on last edited by
        #3

        @JonB said in How to run QT APP when power button pressed in Ubuntu 20.04:

        ./home/serviceit/PowerOff

        ./home/serviceit/PowerOff

        this command works fine if i execute in command line or execute power.sh in the command line, but not working if the power button of the device is pressed

        1 Reply Last reply
        0
        • JonBJ JonB

          @Service-IT
          And what is your question? Have you even verified your script is executed?

          ./home/serviceit/PowerOff

          I have no idea what you think the current working directory is when this is executed, nor where PowerOff is actually located.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Service-IT

          @JonB said in How to run QT APP when power button pressed in Ubuntu 20.04:

          Have you even verified your script is executed?

          What did you do about this?

          @JonB said in How to run QT APP when power button pressed in Ubuntu 20.04:

          I have no idea what you think the current working directory is when this is executed, nor where PowerOff is actually located.

          Already said the above. Why in the world would you use a relative path??

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved