Skip to content

Instantly share code, notes, and snippets.

@gabrc52
Last active June 7, 2022 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrc52/ec0ea109322c816e7a81f0f58afabd24 to your computer and use it in GitHub Desktop.
Save gabrc52/ec0ea109322c816e7a81f0f58afabd24 to your computer and use it in GitHub Desktop.
NOTE: THIS GIST IS OUTDATED AS FLUTTER NOW SUPPORTS `flutter run` ON DESKTOP ///////// A simple way of running/reloading a Flutter app on Linux with VS Code using flutter-desktop-embedding (place files in `flutter-desktop-embedding/example/linux`)
#!/bin/bash
project_location=$(pwd)
pushd "$(dirname "$0")" # It expects to be placed in flutter-desktop-embedding/example/linux
mkdir $project_location/.vscode
\cp launch.json $project_location/.vscode/launch.json -f # From https://github.com/google/flutter-desktop-embedding/blob/master/Debugging.md , backslash was added because my distro aliases cp to cp -i
ln -T -s -f $project_location ../flutter_app
pkill flutter
make && \
out/flutter_embedder_example &
popd
sleep 1
xdotool key F5
@gabrc52
Copy link
Author

gabrc52 commented Dec 11, 2018

I added a keybinding to this script with the terminal-command-keys plugin:

//keybindings.json (can be opened with the Command Palette)
[
    {
        "key": "meta+f5",
        "command": "terminalCommandKeys.run",
        "args": {
            "cmd": "/home/gabriel/flutter-desktop-embedding/example/linux/vscoder"
        }
    }
]

@gabrc52
Copy link
Author

gabrc52 commented Dec 11, 2018

Additionally, you can use KWin Application rules to make Flutter be always on top and a certain size and position.

@charafau
Copy link

charafau commented Feb 6, 2019

it would be cool to have full instructions step by step how to compile / link to flutter desktop embedder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment