Skip to content

Commit 30d6fa6

Browse files
committedMar 24, 2021
Complete refactor

11 files changed

+607
-965
lines changed
 

‎.github/workflows/build.yml

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
name: Build
22
on: [push]
33
jobs:
4-
windows_build:
5-
name: Windows build
6-
runs-on: windows-latest
4+
build:
5+
name: Ubuntu->Windows Cross Compile
6+
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout repo
99
uses: actions/checkout@v1
10-
- name: Get TCC and WinAPI headers
11-
run: |
12-
Invoke-WebRequest -OutFile tcc.zip https://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win32-bin.zip
13-
Expand-Archive -DestinationPath . tcc.zip
14-
15-
Invoke-WebRequest -OutFile tcc-winapi.zip https://download.savannah.gnu.org/releases/tinycc/winapi-full-for-0.9.27.zip
16-
Expand-Archive tcc-winapi.zip
17-
Copy-Item -Force -Recurse tcc-winapi/*/* tcc/
18-
19-
echo "::add-path::$(Resolve-Path -Path tcc | Select -ExpandProperty Path)"
20-
- name: Patch missing GDI functions into TCC lib
21-
run: |
22-
echo "SetDCPenColor" >> tcc/lib/gdi32.def
23-
echo "SetDCBrushColor" >> tcc/lib/gdi32.def
10+
- name: Set up MinGW
11+
uses: egor-tensin/setup-mingw@v2
12+
with:
13+
platform: x64
2414
- name: Build
25-
run: ./make.bat
15+
run: make
2616
- name: Upload artifact
2717
uses: actions/upload-artifact@master
2818
with:

‎.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
tcc/
2-
*.sublime-workspace
3-
*.exe
1+
*.exe
2+
compile_commands.json
3+
.cache/
4+
test.sh

‎Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
wlines.exe: wlines.c
2+
$(CC) -DWLINES_VERSION='"$(shell git log -1 --date=short "--format=%cd-%h")"' -Wall -Werror -Wextra -std=c99 -pedantic -s -O2 $^ -o $@ -static -lgdi32 -luser32 -lshlwapi
3+
4+
.PHONY: clean
5+
clean:
6+
rm -f wlines.exe
7+

‎README.md

+27-54
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,27 @@
1-
# wlines
2-
3-
Dynamic menu for Windows - inspired by the [suckless](https://suckless.org/) [dmenu](https://tools.suckless.org/dmenu/).
4-
5-
### Download
6-
7-
~~A compiled binary for the latest commit can always be found in [Github Actions](https://github.com/JerwuQu/wlines/actions)~~.
8-
9-
Apparently even Github Actions binaries expire, see the [Releases page](https://github.com/JerwuQu/wlines/releases) instead.
10-
11-
### Usage
12-
13-
Menu entries are passed to wlines through stdin. After the user has made a choice, the result is sent out through stdout.
14-
15-
Running `(echo hello & echo world & echo !) | wlines` would for example bring up a menu like this:
16-
17-
![Showing a menu of three items](images/menu_example.png)
18-
19-
The user can filter by writing in the textbox:
20-
21-
![A user filter said menu](images/filter_example.png)
22-
23-
The menu style and behavior can be customized through command-line arguments. Run `wlines -h` for a list of these.
24-
25-
wlines by itself doesn't do much. The power comes through using scripts that talk to it. suckless has [a list of examples of scripts that can be used with dmenu](https://tools.suckless.org/dmenu/scripts/).
26-
27-
[Dave Davenport's](https://github.com/DaveDavenport) [rofi](https://github.com/DaveDavenport/rofi) (an alternative to dmenu) also has [such a list](https://github.com/DaveDavenport/rofi/wiki/User-scripts).
28-
29-
### System requirements
30-
31-
wlines has been tested and works on unmodified Windows XP (32-bit) and Windows 10 (64-bit). As such, it should work on anything in-between as well.
32-
33-
### Build steps
34-
35-
1. Download the [Tiny C Compiler](http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win32-bin.zip) and add the [WinApi headers](http://download.savannah.gnu.org/releases/tinycc/winapi-full-for-0.9.27.zip).
36-
2. Patch `tcc/lib/gdi32.def` to also include `SetDCPenColor` and `SetDCBrushColor`.
37-
3. Make sure `tcc.exe` is in your PATH.
38-
4. Clone this repo (`git clone https://github.com/JerwuQu/wlines.git`)
39-
5. Run `make.bat`
40-
41-
### Credits
42-
43-
* [tcc](https://bellard.org/tcc/) - by [Fabrice Bellard](https://bellard.org/)
44-
45-
* [stretchy_buffer.h](https://github.com/nothings/stb/blob/master/stretchy_buffer.h) - by [Sean Barrett](https://github.com/nothings)
46-
47-
### Contributing
48-
49-
All issues and PRs related to fixing bugs or other strange behavior are welcome.
50-
51-
### License
52-
53-
This project is licensed under the GNU General Public License v3.0. See LICENSE for more details.
54-
1+
# wlines
2+
3+
Dynamic menu for Windows - inspired by the [suckless](https://suckless.org/) [dmenu](https://tools.suckless.org/dmenu/).
4+
5+
### Download
6+
7+
See the [Releases page](https://github.com/JerwuQu/wlines/releases).
8+
9+
### Usage
10+
11+
Menu entries are passed to wlines through stdin. After the user has made a choice, the result is sent out through stdout.
12+
13+
The menu style and behavior can be customized through command-line arguments. Run `wlines -h` for a list of these.
14+
15+
wlines by itself doesn't do much. The power comes through using scripts that talk to it. suckless has [a list of examples of scripts that can be used with dmenu](https://tools.suckless.org/dmenu/scripts/).
16+
17+
[Dave Davenport's](https://github.com/DaveDavenport) [rofi](https://github.com/DaveDavenport/rofi) (an alternative to dmenu) also has [such a list](https://github.com/DaveDavenport/rofi/wiki/User-scripts).
18+
19+
### Build steps
20+
21+
In a MinGW environment you can simply run `make` (e.g. `x86_64-w64-mingw32-make`).
22+
23+
See [the Github Actions Workflow](https://github.com/JerwuQu/wlines/blob/master/.github/workflows/build.yml) for a complete example.
24+
25+
### License
26+
27+
This project is licensed under the GNU General Public License v3.0. See LICENSE for more details.

‎images/filter_example.png

-1.14 KB
Binary file not shown.

‎images/menu_example.png

-1.72 KB
Binary file not shown.

‎make.bat

-43
This file was deleted.

‎src/stretchy_buffer.h

-266
This file was deleted.

‎src/wlines.c

-571
This file was deleted.

‎test_input.txt

-10
This file was deleted.

‎wlines.c

+561
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.