Skip to content

Commit

Permalink
Compile to single binary with nuitka
Browse files Browse the repository at this point in the history
  • Loading branch information
Tej Pochiraju committed Apr 2, 2021
1 parent fb78201 commit 34ae9af
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@ dmypy.json

# Pyre type checker
.pyre/

# nuitka artifacts
*.build
*.dist
*.bin
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ Inspired by:

- Create and activate a [Python3 virtual environment](https://stackoverflow.com/a/19848770/)
- Install dependencies with `pip install -r requirements.txt`
- Run `python ctrlc.py`
- ~~Run `python ctrlc.py`~~
- Compile with `python -m nuitka --onefile --linux-onefile-icon icon.png ctrlc.py`
- Move binary to your bin folder, e.g. `$HOME/bin`
- Run `ctrlc.bin`
- To speed things up, bind this to a keyboard shortcut in your window manager (see screenshot below for XFCE)!
- Paste with `ctrl+v`!

![Keyboard Shortcut](keyboard_shortcut.png)

## Important!
- Needs a clipboard manager. e.g. xsel or xclip on GNU/Linux
- `nuitka` needs `chrpath` to be installed on your system, e.g. `sudo pacman -S chrpath`

## TODO

- [ ] Create flow to trigger via keyboard shortcut.
- [ ] Package to a distributable binary.
- [x] Create flow to trigger via keyboard shortcut.
- [x] Package to a distributable binary.

## References

Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added keyboard_shortcut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
beautifulsoup4
requests
pyperclip
pyperclip
nuitka
scons

0 comments on commit 34ae9af

Please sign in to comment.