Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See the PR to the upstream repository: Homebrew/homebrew-cask#128508
- Loading branch information
1 parent
d52870e
commit 16d1e13
Showing
1 changed file
with
23 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,32 @@ | ||
class QwertyFr < Formula | ||
desc "Qwerty keyboard layout with French accents" | ||
homepage "https://qwerty-fr.org" | ||
url "https://github.com/qwerty-fr/qwerty-fr/releases/download/v0.7/qwerty-fr_0.7_mac.zip" | ||
cask "qwerty-fr" do | ||
version "0.7" | ||
sha256 "34bc8c8f764798ed7e48a3f2404319e09a6d8bfcbef350b25df32387a3199bfa" | ||
license "MIT" | ||
|
||
def install | ||
# Homebrew automatically extracts the folder inside the archive to the cur directory (not configurable) | ||
# so we need to rebundle it | ||
mkdir "qwerty-fr.bundle" | ||
mv "Contents", "qwerty-fr.bundle/" | ||
prefix.install "qwerty-fr.bundle" | ||
end | ||
|
||
def caveats | ||
<<~EOS | ||
1) Finishing the installation | ||
To globally install the layout, you need to manually link the layout bundle (only once): | ||
sudo ln -sf '#{prefix}/qwerty-fr.bundle' '/Library/Keyboard Layouts/' | ||
url "https://github.com/qwerty-fr/qwerty-fr/releases/download/v#{version}/qwerty-fr_#{version}_mac.zip", | ||
verified: "github.com/qwerty-fr/qwerty-fr/" | ||
name "qwerty-fr keyboard layout" | ||
desc "QWERTY-based layout. Type EU languages, greek, math, currencies, & more!" | ||
homepage "https://qwerty-fr.org/" | ||
|
||
If you only want to only install the layout for the current user, do the following instead: | ||
ln -sf '#{prefix}/qwerty-fr.bundle' '~/Library/Keyboard Layouts/' | ||
depends_on macos: ">= :sierra" | ||
|
||
artifact "qwerty-fr.bundle", target: "/Library/Keyboard Layouts/qwerty-fr.bundle" | ||
|
||
2) Restart your system (dead keys don't work properly before restarting). | ||
3) You can then enable the qwerty-fr layout by doing the following: | ||
a) Open "System Preferences" → "Keyboard" → "Input Source". | ||
b) Click on "+" → Search for "qwerty-fr" → Click on "Add". | ||
c) Click on the layout selection icon in the menu bar of macOS and choose "qwerty-fr" | ||
EOS | ||
postflight do | ||
# clear the layout cache before new layouts are recognized | ||
system_command "/bin/rm", | ||
args: ["-f", "--", "/System/Library/Caches/com.apple.IntlDataCache.le*"], | ||
sudo: true | ||
end | ||
|
||
test do | ||
system "false" | ||
uninstall delete: [ | ||
"/Library/Keyboard Layouts/qwerty-fr.bundle/", | ||
"/Library/Caches/com.apple.IntlDataCache*", | ||
"/System/Library/Caches/com.apple.IntlDataCache.le*", | ||
"/private/var/folders/*/*/-Caches-/com.apple.IntlDataCache.le*", | ||
] | ||
|
||
caveats do | ||
reboot | ||
end | ||
end |