Skip to content

Sending commands from shell script to Pinnacle #217

Answered by Ottatop
justinesmithies asked this question in Q&A
Discussion options

You must be logged in to vote

Is it possible to send commands ran from a bash script as you can using say swaymsg with Pinnacle ?

Yes, but you'll need to use the Lua API and either

  1. Pipe Lua code into lua:
    echo "<your Lua here>" | lua
    or
  2. Run Lua files from bash:
    lua <your Lua file>

If you're not limited to bash you can also run executable Lua files directly.

For the specifics, you can run the run function (not setup, this will block):

require("pinnacle").run(function(Pinnacle)
    -- Anything you can run in a normal Lua config you can use here
end)

Just note the following caveats:

  • Setting a keybind will overwrite any current keybinds set, and because run returns you'll lose those keybinds. This may be changed in …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by justinesmithies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants