From 7cd1f9c93a0bb80171541ce5f0c953ca0f645139 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 22 Dec 2024 18:53:27 +0530 Subject: Add command to build appimage --- .gitignore | 1 + README.md | 2 +- TODO.norg | 4 ++-- flake.nix | 2 ++ justfile | 3 +++ src/Chelleport.hs | 2 +- src/Chelleport/Context.hs | 2 +- 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a04c30d..aefeff9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ result dist-newstyle/ +*.AppImage diff --git a/README.md b/README.md index 2fc1a49..6cb9778 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Chelleport Control your mouse pointer with your keyboard -> Note: Only supports Linux running X11 display server currently because that's what I use. Might support more if there's interest. +> Note: So far it only supports Linux running X11 display server with a compositor, because that's what I use. Might support more if there's interest. https://github.com/user-attachments/assets/93ddc1ff-6cbe-4be4-9507-d68de880212a diff --git a/TODO.norg b/TODO.norg index 7e3ce15..c4556ec 100644 --- a/TODO.norg +++ b/TODO.norg @@ -2,9 +2,9 @@ - ( ) Middle click * Later - - ( ) Look into making controls cross-platform (remove x11?) + - ( ) Look into making controls cross-platform - ( ) Switch to [test-fixture]{https://hackage.haskell.org/package/test-fixture} * Maybe - ( ) Scroll - - ( ) Process mode? Run in bg and handle key binding to toggle + - ( ) Process mode? Run in bg with root key binding to toggle diff --git a/flake.nix b/flake.nix index 32fdf3c..e0c4579 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,8 @@ buildInputs = with pkgs; [ xorg.libXtst xorg.libX11 + SDL2 + SDL2_ttf ]; in { haskellProjects.default = { diff --git a/justfile b/justfile index 6d634b1..8fc38cd 100644 --- a/justfile +++ b/justfile @@ -13,3 +13,6 @@ testw *args: build: nix build + +appimage: + nix bundle --bundler github:ralismark/nix-appimage diff --git a/src/Chelleport.hs b/src/Chelleport.hs index fe58259..fa21c28 100644 --- a/src/Chelleport.hs +++ b/src/Chelleport.hs @@ -35,7 +35,7 @@ run = do Chelleport.View.render where runAppWithCtx :: (MonadIO m) => DrawContext -> AppM m x -> m x - runAppWithCtx ctx action = runReaderT (runAppM action) ctx + runAppWithCtx ctx = (`runReaderT` ctx) . runAppM initialState :: (Monad m) => m State initialState = do diff --git a/src/Chelleport/Context.hs b/src/Chelleport/Context.hs index 6452e86..b23c1c2 100644 --- a/src/Chelleport/Context.hs +++ b/src/Chelleport/Context.hs @@ -50,7 +50,7 @@ loadFont = do initializeRenderer :: SDL.Window -> IO SDL.Renderer initializeRenderer window = do - renderer <- SDL.createRenderer window (-1) SDL.defaultRenderer + renderer <- SDL.createRenderer window (-1) SDL.defaultRenderer -- No hw acc: {SDL.rendererType = SDL.SoftwareRenderer} SDL.windowOpacity window $= windowOpacity SDL.rendererDrawBlendMode renderer $= SDL.BlendAlphaBlend pure renderer -- cgit v1.3.1