-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1bef50
commit 5db7196
Showing
5 changed files
with
56 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
(final: _prev: { | ||
squeekboard = _prev.squeekboard.overrideAttrs (oldAttrs: { | ||
postPatch = oldAttrs.postPatch or "" + '' | ||
${_prev.coreutils}/bin/cp -rf ${./us_wide.yaml} data/keyboards/terminal/us_wide.yaml | ||
''; | ||
(final: prev: let | ||
pkgSrc = prev.fetchFromGitLab { | ||
domain = "gitlab.gnome.org"; | ||
group = "World"; | ||
owner = "Phosh"; | ||
repo = "${prev.squeekboard.pname}"; | ||
rev = "v${prev.squeekboard.version}"; | ||
hash = "sha256-ZVSnLH2wLPcOHkU2pO0BgIdGmULMNiacIYMRmhN+bZ8="; | ||
}; | ||
in { | ||
squeekboard = prev.squeekboard.overrideAttrs (oldAttrs: { | ||
postPatch = | ||
oldAttrs.postPatch | ||
or "" | ||
+ '' | ||
${prev.coreutils}/bin/cp -rf ${./us_wide.yaml} data/keyboards/terminal/us_wide.yaml | ||
${prev.coreutils}/bin/cp -rf ${./fi_wide.yaml} data/keyboards/terminal/fi_wide.yaml | ||
''; | ||
postInstall = '' | ||
mkdir -p $out/share/dbus-1/services | ||
cat <<END > $out/share/dbus-1/services/sm.puri.OSK0.service | ||
[D-BUS Service] | ||
Name=sm.puri.OSK0 | ||
Exec=$out/bin/squeekboard | ||
END | ||
mkdir -p $out/share/dbus-1/services | ||
cat <<END > $out/share/dbus-1/services/sm.puri.OSK0.service | ||
[D-BUS Service] | ||
Name=sm.puri.OSK0 | ||
Exec=$out/bin/squeekboard | ||
END | ||
''; | ||
}); | ||
squeekboard-control = final.callPackage ./squeekboard.nix {pkgs=final;}; | ||
squeekboard-control = final.callPackage ./squeekboard.nix {pkgs = final;}; | ||
}) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{pkgs}: | ||
pkgs.writeShellApplication { | ||
name = "squeekboard-control"; | ||
runtimeInputs = [ | ||
pkgs.systemd | ||
]; | ||
text = '' | ||
function visible { | ||
case "$(busctl --user get-property sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible)" in | ||
*true*) return 0;; | ||
*) return 1;; | ||
esac | ||
} | ||
{ | ||
pkgs, | ||
}: | ||
pkgs.writeScriptBin "squeekboard-control" '' | ||
#${pkgs.bash}/bin/bash | ||
i=$(busctl --user get-property sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible) | ||
echo $i | ||
if [ "$i" == "b true" ] | ||
then | ||
pkill squeekboard | ||
else | ||
busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true | ||
fi | ||
echo "Toggling on-screen keyboard..." | ||
'' | ||
printf "Toggling on-screen keyboard..." | ||
if visible; then | ||
busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false | ||
else | ||
busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true | ||
fi | ||
''; | ||
} |