Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from hyprland-community/v1.0.2
Browse files Browse the repository at this point in the history
v1.0.2
  • Loading branch information
NotAShelf authored Aug 26, 2023
2 parents 1deb310 + 671e37a commit 019ec8f
Show file tree
Hide file tree
Showing 13 changed files with 851 additions and 241 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,34 @@
name: Lint
on:
workflow_dispatch:
pull_request:
branches: [ main ]
pull_request:
branches: [main]
push:
paths:
- '**.go'
- 'revive.toml'
- '.github/workflows/linter.yml'

- "**.go"
- "revive.toml"
- ".github/workflows/linter.yml"

jobs:
lint:
lint:
name: Revive
runs-on: ubuntu-latest
environment: production

defaults:
run:
shell: bash

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Checkout
uses: actions/checkout@v3

- name: Run Revive Action by pulling pre-built image
uses: docker://morphy/revive-action:v2
with:
formatter: friendly
- name: Checkout
uses: actions/checkout@v3

- name: Run Revive Action by pulling pre-built image
uses: docker://morphy/revive-action:v2
with:
formatter: friendly
8 changes: 4 additions & 4 deletions .github/workflows/pre-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Go Build & Release CI
on:
push:
tags:
- 'v*'
- "v*"

permissions:
contents: write
Expand All @@ -22,12 +22,12 @@ jobs:
- run: git fetch --force --tags

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.19.x'
go-version: "1.21.x"
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
if: success() && startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
Expand Down
695 changes: 674 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

89 changes: 43 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,55 @@
# Hyprkeys
# ⌨️ Hyprkeys

A simple, and relatively fast application that returns your Hyprland keys.

*No, not just keybinds. We now return config sections as well*


> ⚠️ Hyprkeys is currently in early development and is not ready for use. Not like it can
break anything, but you will have wasted your time.

In case you still want to use it, instructions are below:

**(Looking for testers and contributors, Go is not a language I often work with.)**
A simple, fast and scriptable keybind inspection utility for [Hyprland](https://github.com/hyprwm/Hyprland)

## Installation & Usage

### From source

1. Download Go. You can find it [here](https://golang.org/dl/)
1. Download Go. You can obtain it from your distro's package manager. It is named "go" under most distros.
2. Clone this repository with `git clone https://github.com/hyprland-community/hyprkeys`
3. Install the application with `make build` then `sudo make install`
4. You can run the application with `hyprkeys`

### Using nix
### Using the Nix Flake

`nix run github:hyprland-community/Hyprkeys`
```nix
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
hyprkeys = {
url = "github:hyprland-community/hyprkeys";
inputs.nixpkgs.follows = "nixpkgs";
};
};
## Project Roadmap
outputs = { self, nixpkgs, hyprkeys }: let
in {
nixosConfigurations.yourHostName = nixpkgs.lib.nixosSystem {
# ...
system.packages = [ hyprkeys.packages.${system}.hyprkeys ];
# ...
};
};
}
```

- [x] Format keybinds better, maybe with a proper table
- [x] Remove the `+` in the keybinds that don't have modifiers
- [x] Add an extra column to mouse keybinds to match table titles
- [x] Optionally (--variables) parse variables and replace them with their actual value
- [x] Account for bind flags, that may be passed in any random order
- [x] Figure out a regex to match the flags
- [x] Figure out why the regex doesn't work
- [x] Account for line comments in rows
- [x] Break code into multiple files
- [x] move command line parsing to a separate file
- [ ] Command line options
- [ ] Sort output by dispatcher
- [x] Account for multiple arguments being passed at once
- [ ] Somehow account for keybinds can be set dynamically? (I don't know how to do this)
- [ ] Add instructions for a pipe to `hyprkeys` to get the keybinds from
- [ ] Convert i3/sway keybinds to Hyprland keybinds with `--convert`
- [ ] Possibly more wayland compositors, sway is enough for now.
- [x] Get more than just keybinds, try and get all config options seperated by section
- [x] Config sections
- [x] Autostarted applications
- [x] Keywords from inside `hyprland.conf`
- [ ] **Packaging for various Linux distros**
- [ ] Nix (WIP)
- [ ] Flake
- [ ] Legacy nixpkgs package
- [ ] Arch (looking for maintainers)
- [ ] Fedora (looking for maintainers)
### Installing Prebuild Binaries

Prebuilt binaries are distributed for each tagged release. You may find them under [releases](https://github.com/hyprland-community/Hyprkeys/releases)

## Usage

See `hyprkeys -v` for a full list of commands and flags.

## Project Demo

https://user-images.githubusercontent.com/86447830/211897915-778e9b24-061d-4d97-bc5e-444224610566.mp4

Rofi script using hyprctl:
### Rofi script using hyprctl:

![OrCEzxZ - Imgur](https://user-images.githubusercontent.com/86447830/211898056-3bdb2f11-f7f5-4854-871f-4eabaa5b898f.png)

Expand All @@ -69,10 +61,15 @@ Rofi script using hyprctl:

**[RAW](test/out.txt)**

## Project Roadmap

See [TODO](todo.md).

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
This project is licensed under the GPLv3 License. See the [LICENSE](LICENSE) file for more details.

## Contributing

If you want to contribute, feel free to open a pull request. I'll try to review it as soon as possible.
Contributions, in form of Pull Requests and Issues are always welcome. If you wish to make changes, open a pull request and I will
guide you through it.
29 changes: 29 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# TODO

- [x] Format keybinds better, maybe with a proper table
- [x] Remove the `+` in the keybinds that don't have modifiers
- [x] Add an extra column to mouse keybinds to match table titles
- [x] Optionally (--variables) parse variables and replace them with their actual value
- [x] Account for bind flags, that may be passed in any random order
- [x] Figure out a regex to match the flags
- [x] Figure out why the regex doesn't work
- [x] Account for line comments in rows
- [x] Break code into multiple files
- [x] move command line parsing to a separate file
- [ ] Command line options
- [ ] Sort output by dispatcher
- [x] Account for multiple arguments being passed at once
- [ ] Somehow account for keybinds can be set dynamically? (I don't know how to do this)
- [ ] Add instructions for a pipe to `hyprkeys` to get the keybinds from
- [ ] Convert i3/sway keybinds to Hyprland keybinds with `--convert`
- [ ] Possibly more wayland compositors, sway is enough for now.
- [x] Get more than just keybinds, try and get all config options seperated by section
- [x] Config sections
- [x] Autostarted applications
- [x] Keywords from inside `hyprland.conf`
- [ ] **Packaging for various Linux distros**
- [ ] Nix (WIP)
- [x] Flake
- [ ] Legacy nixpkgs package
- [ ] Arch (looking for maintainers)
- [ ] Fedora (looking for maintainers)
41 changes: 41 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
buildGoModule,
nix-filter,
lib,
...
}:
buildGoModule {
pname = "Hyprkeys";
version = "1.0.2";
src = nix-filter.lib {
root = ./.;
exclude = [
./README.md
./out.md
./out.json
./.github
];
};

ldflags = ["-s" "-w"];
vendorHash = "sha256-JFvC9V0xS8SZSdLsOtpyTrFzXjYAOaPQaJHdcnJzK3s=";

doCheck = true;

preFixup = ''
mkdir -p completions
$out/bin/hyprkeys completions zsh > completions/hyprkeys.zsh
$out/bin/hyprkeys completions bash > completions/hyprkeys.bash
$out/bin/hyprkeys completions fish > completions/hyprkeys.fish
installShellCompletion completions/*
'';

meta = with lib; {
description = "A simple, scriptable keybind retrieval utility for Hyprland.";
homepage = "https://github.com/hyprland-community/Hyprkeys";
maintainers = with maintainers; [NotAShelf];
mainProgram = "hyprkeys";
platforms = ["x86_64-linux" "aarch64-linux"];
};
}
74 changes: 11 additions & 63 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 019ec8f

Please sign in to comment.