Skip to content

Commit 68e3245

Browse files
committed
Initial release: caps lock indicator with cross-platform packaging
0 parents  commit 68e3245

File tree

13 files changed

+641
-0
lines changed

13 files changed

+641
-0
lines changed

.github/workflows/release.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-binaries:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install Linux GUI deps
28+
if: runner.os == 'Linux'
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y python3-tk
32+
33+
- name: Build binary package (Linux/macOS)
34+
if: runner.os != 'Windows'
35+
shell: bash
36+
run: |
37+
VERSION="${GITHUB_REF_NAME#v}"
38+
if [[ "$VERSION" == "$GITHUB_REF_NAME" ]]; then VERSION="0.1.0"; fi
39+
chmod +x scripts/build_binary.sh
40+
VERSION="$VERSION" ./scripts/build_binary.sh
41+
42+
- name: Build binary package (Windows)
43+
if: runner.os == 'Windows'
44+
shell: pwsh
45+
run: |
46+
$Version = "${env:GITHUB_REF_NAME}".TrimStart("v")
47+
if ($Version -eq "${env:GITHUB_REF_NAME}") { $Version = "0.1.0" }
48+
python -m pip install --upgrade pip
49+
python -m pip install -r requirements-build.txt
50+
python -m PyInstaller --noconfirm --clean --onefile --name capslock-indicator capslock_indicator.py
51+
New-Item -ItemType Directory -Path dist/release -Force | Out-Null
52+
Compress-Archive -Path dist/capslock-indicator.exe -DestinationPath "dist/release/capslock-indicator-$Version-windows-x86_64.zip" -Force
53+
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: binaries-${{ matrix.os }}
57+
path: dist/release/*
58+
59+
build-deb:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Build .deb
64+
shell: bash
65+
run: |
66+
VERSION="${GITHUB_REF_NAME#v}"
67+
if [[ "$VERSION" == "$GITHUB_REF_NAME" ]]; then VERSION="0.1.0"; fi
68+
chmod +x scripts/build_deb.sh
69+
VERSION="$VERSION" ./scripts/build_deb.sh
70+
- uses: actions/upload-artifact@v4
71+
with:
72+
name: deb
73+
path: dist/*.deb
74+
75+
publish-release:
76+
if: startsWith(github.ref, 'refs/tags/v')
77+
needs: [build-binaries, build-deb]
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/download-artifact@v4
81+
with:
82+
path: artifacts
83+
84+
- name: Collect release files
85+
run: |
86+
mkdir -p release
87+
find artifacts -type f -exec cp {} release/ \;
88+
ls -la release
89+
90+
- name: Publish GitHub Release
91+
uses: softprops/action-gh-release@v2
92+
with:
93+
files: release/*
94+
generate_release_notes: true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__pycache__/
2+
*.py[cod]
3+
*.spec
4+
build/
5+
dist/
6+
.venv/
7+
*.log

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 buiilding
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Caps Lock Indicator
2+
3+
Tiny Caps Lock overlay for Linux, Windows, and macOS.
4+
5+
- Shows a square `CAPS` window when Caps Lock is ON
6+
- Hides immediately when Caps Lock is OFF
7+
- Top-left position on primary display
8+
9+
## Ubuntu/Linux install from source
10+
11+
```bash
12+
chmod +x install.sh
13+
./install.sh
14+
```
15+
16+
This installs:
17+
- Binary: `~/.local/bin/capslock-indicator`
18+
- User service: `~/.config/systemd/user/capslock-indicator.service`
19+
- Autostart desktop file: `~/.config/autostart/capslock-indicator.desktop`
20+
21+
## Linux runtime commands
22+
23+
```bash
24+
systemctl --user status capslock-indicator.service
25+
systemctl --user restart capslock-indicator.service
26+
systemctl --user stop capslock-indicator.service
27+
```
28+
29+
## Build downloadable binaries
30+
31+
```bash
32+
chmod +x scripts/build_binary.sh
33+
VERSION=0.1.0 ./scripts/build_binary.sh
34+
```
35+
36+
Artifacts are emitted to `dist/release/`:
37+
- Linux: `capslock-indicator-<version>-linux-x86_64.tar.gz`
38+
- macOS: `capslock-indicator-<version>-macos.zip`
39+
- Windows: `capslock-indicator-<version>-windows-x86_64.zip`
40+
41+
## Build Debian package (`.deb`)
42+
43+
```bash
44+
chmod +x scripts/build_deb.sh
45+
VERSION=0.1.0 ./scripts/build_deb.sh
46+
```
47+
48+
Output: `dist/capslock-indicator_<version>_all.deb`
49+
50+
Install locally:
51+
52+
```bash
53+
sudo apt install ./dist/capslock-indicator_0.1.0_all.deb
54+
```
55+
56+
## Snap package
57+
58+
Snap config is in `snap/snapcraft.yaml`.
59+
60+
Build locally:
61+
62+
```bash
63+
sudo snap install snapcraft --classic
64+
cd snap
65+
snapcraft
66+
```
67+
68+
## GitHub Releases automation
69+
70+
Tag push `v*` triggers `.github/workflows/release.yml`, which builds:
71+
- Linux binary archive
72+
- macOS binary archive
73+
- Windows binary archive
74+
- Debian `.deb`
75+
76+
All artifacts are attached to the GitHub Release automatically.
77+
78+
## Publish to package managers
79+
80+
`sudo apt install capslock-indicator` from default Ubuntu repos requires official Debian/Ubuntu acceptance (not immediate).
81+
82+
Practical fast path:
83+
1. Publish Snap to Snap Store (`snapcraft upload <snap-file>`) so users can run `snap install capslock-indicator`.
84+
2. Publish `.deb` in a PPA (Launchpad) so users can install with `apt`.
85+
3. Keep GitHub Release assets for one-click direct downloads across Linux/Windows/macOS.

0 commit comments

Comments
 (0)