Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ install-packages:
gifsicle \
git \
git-delta \
gtk-layer-shell \
hexyl \
htop \
iftop \
Expand All @@ -60,6 +61,7 @@ install-packages:
ttyd \
unzip \
unrar \
wtype \
wl-clipboard \
yt-dlp \
-y -q
Expand Down
33 changes: 33 additions & 0 deletions handy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name := handy
# Discovery: https://github.com/cjpais/Handy/releases/latest
version := 0.8.2
release := 1
package_url := https://github.com/cjpais/Handy/releases/download/v$(version)/Handy-$(version)-$(release).x86_64.rpm
data_dir := $(HOME)/.local/share/odsod/machine/data/$(name)

.PHONY: install
install: \
install-dependencies \
install-package \
~/.local/bin/handy-toggle

.PHONY: install-dependencies
install-dependencies:
$(info [$(name)] Installing dependencies...)
@sudo dnf install -y gtk-layer-shell wtype

.PHONY: install-package
install-package: $(data_dir)/$(version)/package.rpm
$(info [$(name)] Installing package...)
@sudo dnf install -y $<

.PHONY: ~/.local/bin/handy-toggle
~/.local/bin/handy-toggle: handy-toggle
$(info [$(name)] Symlinking $@...)
@mkdir -p $(dir $@)
@ln -fsT $(abspath $<) $@

$(data_dir)/$(version)/package.rpm:
$(info [$(name)] Downloading package...)
@curl -L $(package_url) --create-dirs -o $@
@touch $@
20 changes: 20 additions & 0 deletions handy/handy-toggle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail

if ! command -v handy >/dev/null 2>&1; then
echo "handy is not installed" >&2
exit 1
fi

if ! pgrep -x handy >/dev/null 2>&1; then
setsid handy --start-hidden >/dev/null 2>&1 < /dev/null &
fi

for _ in $(seq 1 30); do
if handy --toggle-transcription >/dev/null 2>&1; then
exit 0
fi
sleep 0.1
done

pkill -USR2 -n handy
7 changes: 7 additions & 0 deletions kwin/contents/code/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ const shortcuts = [
resourceClass: "systemsettings",
},

{
actionId: ["kwin", "[odsod] handy", "KWin", ""],
key: "Meta+N",
kind: "command",
command: ["handy-toggle"],
},

{
actionId: ["kwin", "[odsod] zed", "KWin", ""],
key: "Meta+Z",
Expand Down