Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spoonify Spacehammer #183

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
518bcc1
Update functional library
jaidetree Oct 16, 2023
fff7288
Initial spoonify
jaidetree Oct 17, 2023
81cd4a5
Update imports
jaidetree Oct 17, 2023
fd6ee92
Make hyper binding optional if not present in config
jaidetree Dec 9, 2023
d43db39
Fix example config path
ambirdsall Dec 11, 2023
99210e6
Fix path to activate modal fn in example config
ambirdsall Dec 12, 2023
51f0ec0
Make hs.ipc.cliInstall work on M1 & co.
ambirdsall Dec 12, 2023
e8dd456
Merge pull request #2 from ambirdsall/spoonify
jaidetree Dec 12, 2023
28b37bf
Try to get tests running
Grazfather Dec 14, 2023
531d6a8
cleanup
Grazfather Dec 14, 2023
5cc9a11
cleanup more
Grazfather Dec 14, 2023
c36aa5d
cleanx
Grazfather Dec 14, 2023
374481a
more
Grazfather Dec 14, 2023
fdded94
Merge pull request #3 from Grazfather/fix_tests
jaidetree Dec 14, 2023
21ecae6
Remove -c flag from test.lua
jaidetree Dec 14, 2023
1d75ea1
Fix argument order of string.find
ambirdsall Dec 14, 2023
8417c03
Update testing docs with updated paths
jaidetree Dec 14, 2023
8d9f141
Extract file helper functions to lib directory
ambirdsall Dec 14, 2023
cb8cfa6
Move most other globals to lib/globals.fnl
ambirdsall Dec 14, 2023
7a8574e
Create init.example.fnl, extract console keybind
ambirdsall Dec 14, 2023
1ff7743
Remove obsolete comments
ambirdsall Dec 14, 2023
61f52a1
Merge pull request #4 from ambirdsall/fix-cliInstall-conditional
jaidetree Dec 14, 2023
8d2a05a
Update file helper docstrings for consistency
ambirdsall Dec 14, 2023
a7de87a
Merge pull request #5 from ambirdsall/extract-helpers-from-core-and-a…
jaidetree Dec 14, 2023
5a0a156
Support custom paths from tools like nix
jaidetree Apr 7, 2024
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
3 changes: 0 additions & 3 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

238 changes: 0 additions & 238 deletions core.fnl

This file was deleted.

4 changes: 2 additions & 2 deletions docs/testing.org
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ running scripts against the hammerspoon CLI =hs=.
Run tests by invoking the following shell command within the =~/.hammerspoon= directory:

#+begin_src bash :dir ..
./run-test test/*.fnl
./run-test spacehammer/test/*.fnl
#+end_src

Which will output something like the following:
Expand Down Expand Up @@ -275,4 +275,4 @@ Run the following command, will only work if Node is installed:
#+begin_src bash
npm install nodemon
#+end_src

test
27 changes: 27 additions & 0 deletions flake.lock

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

23 changes: 23 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { nixpkgs, ... }:
let
supportedSystems = [ "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = [
pkgs.lua5_4_compat
pkgs.lua54Packages.fennel
];
};
});
};
}
31 changes: 22 additions & 9 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
hs.alert.show("Spacehammer config loaded")
local Spacehammer = {
name = "Spacehammer",
version = "3.0.0",
author = "Ag Ibragimov",
license = "MIT",
homepage = "https://github.com/agzam/spacehammer"
}

-- Support upcoming 5.4 release and also use luarocks' local path
package.path = package.path .. ";" .. os.getenv("HOME") .. "/.luarocks/share/lua/5.4/?.lua;" .. os.getenv("HOME") .. "/.luarocks/share/lua/5.4/?/init.lua"
package.cpath = package.cpath .. ";" .. os.getenv("HOME") .. "/.luarocks/lib/lua/5.4/?.so"
package.path = package.path .. ";" .. os.getenv("HOME") .. "/.luarocks/share/lua/5.3/?.lua;" .. os.getenv("HOME") .. "/.luarocks/share/lua/5.3/?/init.lua"
package.cpath = package.cpath .. ";" .. os.getenv("HOME") .. "/.luarocks/lib/lua/5.3/?.so"
Spacehammer.paths = {}

fennel = require("fennel")
table.insert(package.loaders or package.searchers, fennel.searcher)
function Spacehammer:init()
local fennelPath = hs.spoons.resourcePath("vendor/fennel.lua")
Spacehammer.paths.fennel = fennelPath
end

require "core"
function Spacehammer:start()
local envPath = hs.spoons.resourcePath("spacehammer/env.lua")
local env = dofile(envPath)

_G['fennel-installed'] = nil
require('spacehammer.core')
hs.alert.show("Spacehammer config loaded")
end

return Spacehammer
15 changes: 0 additions & 15 deletions lib/globals.fnl

This file was deleted.

18 changes: 0 additions & 18 deletions lib/testing/test.lua

This file was deleted.

2 changes: 1 addition & 1 deletion run-test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

exec hs ./lib/testing/test.lua "$(pwd)" "$@"
exec hs ./spacehammer/lib/testing/test.lua "$(pwd)" "$@"
1 change: 1 addition & 0 deletions spacehammer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/paths.lua
File renamed without changes.
2 changes: 1 addition & 1 deletion apps.fnl → spacehammer/apps.fnl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(local {: global-filter} (require :lib.utils))
(local {: global-filter} (require :spacehammer.lib.utils))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; App switcher
Expand Down
Loading