From aa010ea4ad9a92fe04a25639afa8f90fa2c5ec44 Mon Sep 17 00:00:00 2001 From: weiss Date: Sun, 15 Sep 2024 18:19:29 +0200 Subject: [PATCH] update env; apply to ultrawide screen --- .github/workflows/CI.yaml | 45 +- README.md | 6 +- app/Main.hs | 4 + devshell.toml | 7 - flake.lock | 656 +++++++++++++++++++++++- flake.nix | 119 +++-- fourmolu.yaml | 3 +- hie.yaml | 10 +- src/Config.hs | 4 + src/TreeActions.hs | 12 +- src/Treeselect.hs | 12 + src/Utils.hs | 23 +- src/Utils/WindowOps.hs | 1 + src/WeissScratchpad.hs | 55 +- src/WeissWindowOperations.hs | 108 +--- src/WeissXMonad.hs | 22 +- WeissXmonad.cabal => weiss-xmonad.cabal | 52 +- 17 files changed, 912 insertions(+), 227 deletions(-) create mode 100644 app/Main.hs delete mode 100644 devshell.toml create mode 100644 src/Treeselect.hs create mode 100644 src/Utils/WindowOps.hs rename WeissXmonad.cabal => weiss-xmonad.cabal (74%) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index bcdc3d7..a397a76 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -17,4 +17,47 @@ jobs: - name: Build weiss-xmonad run: nix build -L - name: Build weiss-xmonad shell - run: nix build -L '.#devShells.x86_64-linux.default' + run: nix build -L '.#devShells.x86_64-linux.default' + + stack-build: + name: Stack ${{ matrix.resolver }} on ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + resolver: [ nightly, lts-19, lts-18, lts-17, lts-16, lts-15, lts-14 ] + os: [ macos-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + with: + enable-stack: true + ## For some reason, stack caching seems to be very brittle, and cause a lot of build failures. + ## I haven't investigated very thoroughly what to best do about this, but for now, I'm just not caching stack builds. + - run: stack init --resolver ${{ matrix.resolver }} + - run: stack build --resolver ${{ matrix.resolver }} --only-dependencies + - run: stack build --resolver ${{ matrix.resolver }} + - run: stack build --resolver ${{ matrix.resolver }} --haddock --test --bench --no-run-benchmarks + + cabal-build: + name: Cabal with GHC ${{ matrix.ghc }} on ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + ghc: [ '8.6.5', '8.8.3', '8.10.7', '9.0.2', '9.2.2' ] + os: [ ubuntu-latest, macos-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.ghc }} + - uses: actions/cache@v2 + with: + path: | + ~/.cabal + dist-newstyle + key: cabal-cache-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }} + - run: cabal new-build --only-dependencies + - run: cabal new-build + - run: cabal new-test --test-show-details=direct diff --git a/README.md b/README.md index 8e1126f..9092146 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# WeissXmonad -[![WeissXmonad on hackage](https://img.shields.io/hackage/v/WeissXmonad)](http://hackage.haskell.org/package/WeissXmonad) -[![WeissXmonad on Stackage Nightly](https://stackage.org/package/WeissXmonad/badge/nightly)](https://stackage.org/nightly/package/WeissXmonad) +# weiss-xmonad +[![weiss-xmonad on hackage](https://img.shields.io/hackage/v/weiss-xmonad)](http://hackage.haskell.org/package/weiss-xmonad) +[![weiss-xmonad on Stackage Nightly](https://stackage.org/package/weiss-xmonad/badge/nightly)](https://stackage.org/nightly/package/weiss-xmonad) Generated with [template-haskell](https://github.com/jonascarpay/template-haskell) diff --git a/app/Main.hs b/app/Main.hs new file mode 100644 index 0000000..5b2a3ee --- /dev/null +++ b/app/Main.hs @@ -0,0 +1,4 @@ +import WeissXMonad + +main :: IO () +main = WeissXMonad.runXmonad "/home/weiss/.config/xmobar" diff --git a/devshell.toml b/devshell.toml deleted file mode 100644 index 8bd2903..0000000 --- a/devshell.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[commands]] -name = "doc" -command = ''' -echo http://127.0.0.1:9898 -hoogle serve -p 9898 --local - ''' -help = "run hoogle server locally for documentation" diff --git a/flake.lock b/flake.lock index 41601c4..8fe574e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,88 @@ { "nodes": { + "HTTP": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "cabal-32": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", + "owner": "haskell", + "repo": "cabal", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34": { + "flake": false, + "locked": { + "lastModified": 1645834128, + "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", + "owner": "haskell", + "repo": "cabal", + "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36": { + "flake": false, + "locked": { + "lastModified": 1669081697, + "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", + "owner": "haskell", + "repo": "cabal", + "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cardano-shell": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, "devshell": { "inputs": { "nixpkgs": "nixpkgs" @@ -18,6 +101,23 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1672831974, + "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "hkm/gitlab-fix", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -36,6 +136,355 @@ "type": "github" } }, + "ghc-8.6.5-iohk": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "hackage": { + "flake": false, + "locked": { + "lastModified": 1726360493, + "narHash": "sha256-QFHHejY9SrxsnfRI6XpBDLNFef+7lG3Kxhl1pmABvAQ=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "5a72c0e91aa59973bb5964be77cb8ad59fb53b7b", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "haskellNix": { + "inputs": { + "HTTP": "HTTP", + "cabal-32": "cabal-32", + "cabal-34": "cabal-34", + "cabal-36": "cabal-36", + "cardano-shell": "cardano-shell", + "flake-compat": "flake-compat", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", + "hackage": "hackage", + "hls-1.10": "hls-1.10", + "hls-2.0": "hls-2.0", + "hls-2.2": "hls-2.2", + "hls-2.3": "hls-2.3", + "hls-2.4": "hls-2.4", + "hls-2.5": "hls-2.5", + "hls-2.6": "hls-2.6", + "hls-2.7": "hls-2.7", + "hls-2.8": "hls-2.8", + "hls-2.9": "hls-2.9", + "hpc-coveralls": "hpc-coveralls", + "hydra": "hydra", + "iserv-proxy": "iserv-proxy", + "nixpkgs": [ + "haskellNix", + "nixpkgs-unstable" + ], + "nixpkgs-2003": "nixpkgs-2003", + "nixpkgs-2105": "nixpkgs-2105", + "nixpkgs-2111": "nixpkgs-2111", + "nixpkgs-2205": "nixpkgs-2205", + "nixpkgs-2211": "nixpkgs-2211", + "nixpkgs-2305": "nixpkgs-2305", + "nixpkgs-2311": "nixpkgs-2311", + "nixpkgs-2405": "nixpkgs-2405", + "nixpkgs-unstable": "nixpkgs-unstable", + "old-ghc-nix": "old-ghc-nix", + "stackage": "stackage" + }, + "locked": { + "lastModified": 1726361454, + "narHash": "sha256-KwwtTura35vENgiNtoSl0usLZWNGWCIRIFyuKoqrcVU=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "d98f2ffd05f9bf26bf3c601373ac758acadbab29", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "hls-1.10": { + "flake": false, + "locked": { + "lastModified": 1680000865, + "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.0": { + "flake": false, + "locked": { + "lastModified": 1687698105, + "narHash": "sha256-OHXlgRzs/kuJH8q7Sxh507H+0Rb8b7VOiPAjcY9sM1k=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "783905f211ac63edf982dd1889c671653327e441", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.0.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.2": { + "flake": false, + "locked": { + "lastModified": 1693064058, + "narHash": "sha256-8DGIyz5GjuCFmohY6Fa79hHA/p1iIqubfJUTGQElbNk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b30f4b6cf5822f3112c35d14a0cba51f3fe23b85", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.2.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.3": { + "flake": false, + "locked": { + "lastModified": 1695910642, + "narHash": "sha256-tR58doOs3DncFehHwCLczJgntyG/zlsSd7DgDgMPOkI=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "458ccdb55c9ea22cd5d13ec3051aaefb295321be", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.3.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.4": { + "flake": false, + "locked": { + "lastModified": 1699862708, + "narHash": "sha256-YHXSkdz53zd0fYGIYOgLt6HrA0eaRJi9mXVqDgmvrjk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "54507ef7e85fa8e9d0eb9a669832a3287ffccd57", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.4.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.5": { + "flake": false, + "locked": { + "lastModified": 1701080174, + "narHash": "sha256-fyiR9TaHGJIIR0UmcCb73Xv9TJq3ht2ioxQ2mT7kVdc=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "27f8c3d3892e38edaef5bea3870161815c4d014c", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.5.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.6": { + "flake": false, + "locked": { + "lastModified": 1705325287, + "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.6.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.7": { + "flake": false, + "locked": { + "lastModified": 1708965829, + "narHash": "sha256-LfJ+TBcBFq/XKoiNI7pc4VoHg4WmuzsFxYJ3Fu+Jf+M=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "50322b0a4aefb27adc5ec42f5055aaa8f8e38001", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.7.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.8": { + "flake": false, + "locked": { + "lastModified": 1715153580, + "narHash": "sha256-Vi/iUt2pWyUJlo9VrYgTcbRviWE0cFO6rmGi9rmALw0=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "dd1be1beb16700de59e0d6801957290bcf956a0a", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.8.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.9": { + "flake": false, + "locked": { + "lastModified": 1718469202, + "narHash": "sha256-THXSz+iwB1yQQsr/PY151+2GvtoJnTIB2pIQ4OzfjD4=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "40891bccb235ebacce020b598b083eab9dda80f1", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.9.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hpc-coveralls": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hydra": { + "inputs": { + "nix": "nix", + "nixpkgs": [ + "haskellNix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", + "owner": "NixOS", + "repo": "hydra", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", + "type": "github" + }, + "original": { + "id": "hydra", + "type": "indirect" + } + }, + "iserv-proxy": { + "flake": false, + "locked": { + "lastModified": 1717479972, + "narHash": "sha256-7vE3RQycHI1YT9LHJ1/fUaeln2vIpYm6Mmn8FTpYeVo=", + "owner": "stable-haskell", + "repo": "iserv-proxy", + "rev": "2ed34002247213fc435d0062350b91bab920626e", + "type": "github" + }, + "original": { + "owner": "stable-haskell", + "ref": "iserv-syms", + "repo": "iserv-proxy", + "type": "github" + } + }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": "nixpkgs_2", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1661606874, + "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", + "owner": "NixOS", + "repo": "nix", + "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.11.0", + "repo": "nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1722073938, @@ -52,27 +501,224 @@ "type": "github" } }, + "nixpkgs-2003": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105": { + "locked": { + "lastModified": 1659914493, + "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2205": { + "locked": { + "lastModified": 1685573264, + "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2211": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2305": { + "locked": { + "lastModified": 1705033721, + "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2311": { + "locked": { + "lastModified": 1719957072, + "narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7144d6241f02d171d25fba3edeaf15e0f2592105", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2405": { + "locked": { + "lastModified": 1720122915, + "narHash": "sha256-Nby8WWxj0elBu1xuRaUcRjPi/rU3xVbkAt2kj4QwX2U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "835cf2d3f37989c5db6585a28de967a667a75fb1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-24.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1720181791, + "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1720535198, - "narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=", + "lastModified": 1657693803, + "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5", + "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.11", + "ref": "nixos-22.05-small", "repo": "nixpkgs", "type": "github" } }, + "old-ghc-nix": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, "root": { "inputs": { "devshell": "devshell", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2" + "haskellNix": "haskellNix", + "nixpkgs": [ + "haskellNix", + "nixpkgs-unstable" + ] + } + }, + "stackage": { + "flake": false, + "locked": { + "lastModified": 1726359270, + "narHash": "sha256-7YoWo302ri5PP1olWNUXdcqNxXr1hOmY2Xqd71l6GIQ=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "fc1a8b94eb40ba1d391c06b4986fccb44bd1a262", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index d8681ca..3cc7bc4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,65 +1,80 @@ { - description = "WeissXmonad"; + description = "weiss-xmonad"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; + haskellNix.url = "github:input-output-hk/haskell.nix"; + nixpkgs.follows = "haskellNix/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; devshell.url = "github:numtide/devshell"; }; - outputs = { self, flake-utils, devshell, nixpkgs, ... }: - let - overlay = final: prev: { - haskell = prev.haskell // { - packageOverrides = hfinal: hprev: - prev.haskell.packageOverrides hfinal hprev // { - WeissXmonad = hfinal.callCabal2nix "WeissXmonad" ./. { }; - }; - }; - # WeissXmonad = final.haskell.lib.compose.justStaticExecutables - # final.haskellPackages.WeissXmonad; - WeissXmonad = final.haskellPackages.WeissXmonad; - }; - perSystem = system: + nixConfig = { + extra-substituters = [ "https://cache.iog.io" ]; + extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; + }; + + outputs = + inputs@{ + self, + flake-utils, + haskellNix, + devshell, + nixpkgs, + ... + }: + flake-utils.lib.eachSystem + [ + "x86_64-linux" + "x86_64-darwin" + ] + ( + system: let + overlays = [ + haskellNix.overlay + (final: prev: { + xmonad = final.xmonad_0_18_0; + weiss-xmonad = final.haskell-nix.project' { + src = ./.; + compiler-nix-name = "ghc966"; + }; + }) + devshell.overlays.default + ]; pkgs = import nixpkgs { - inherit system; - overlays = [ overlay devshell.overlays.default ]; + inherit system overlays; + inherit (haskellNix) config; }; - ghcVersion = "ghc948"; - hspkgs = pkgs.haskell.packages.${ghcVersion}; - devShells.shellFor = hspkgs.shellFor { - packages = p: [ p.WeissXmonad ]; - withHoogle = true; - }; - in { - devShells.default = pkgs.devshell.mkShell { - name = "WeissXmonad"; - imports = [ (pkgs.devshell.importTOML ./devshell.toml) ]; - # packages = [ pkgs.hpack ]; - packagesFrom = [ devShells.shellFor ]; - commands = [ - (let cabal = pkgs.cabal-install; - in { - name = cabal.pname; - help = cabal.meta.description; - package = cabal; - category = "tools"; - }) - (let hls = hspkgs.haskell-language-server; - in { - name = hls.pname; - help = hls.meta.description; - package = hls; - category = "tools"; - }) - ]; - packages = [ hspkgs.hlint hspkgs.fourmolu hspkgs.cabal-fmt ]; + flake = pkgs.weiss-xmonad.flake { }; + shellWithToml = + tomls: + pkgs.weiss-xmonad.shellFor { + exactDeps = false; + withHoogle = true; + inputsFrom = [ + (pkgs.devshell.mkShell { + name = "weiss-xmonad"; + packages = with pkgs; [ ]; + }) + ]; + tools = { + cabal = "latest"; + fourmolu = "latest"; + hlint = "latest"; + cabal-fmt = "latest"; + haskell-language-server = "latest"; + }; + }; + in + flake + // { + packages = { + default = flake.packages."weiss-xmonad:exe:weiss-xmonad-exe"; }; - packages = rec { - default = WeissXmonad; - WeissXmonad = pkgs.WeissXmonad; + devShells = { + default = shellWithToml [ ]; }; - }; - in { inherit overlay; } // flake-utils.lib.eachDefaultSystem perSystem; + } + ); + } diff --git a/fourmolu.yaml b/fourmolu.yaml index 9406ae4..3bbb701 100755 --- a/fourmolu.yaml +++ b/fourmolu.yaml @@ -5,5 +5,4 @@ indent-wheres: true diff-friendly-import-export: true respectful: true haddock-style: multi-line -newlines-between-decls: 1 -column-limit: 84 +newlines-between-decls: 1 diff --git a/hie.yaml b/hie.yaml index 6a40a18..4c415ce 100644 --- a/hie.yaml +++ b/hie.yaml @@ -4,5 +4,13 @@ cradle: # config: {cradle: {none: }} - path: "src" - config: {cradle: {cabal: {component: "lib:WeissXmonad"}}} + config: {cradle: {cabal: {component: "lib:weiss-xmonad"}}} + - path: "app" + config: {cradle: {cabal: {component: "weiss-xmonad:weiss-xmonad-exe"}}} + + - path: "test" + config: {cradle: {cabal: {component: "weiss-xmonad:weiss-xmonad-test"}}} + + - path: "bench" + config: {cradle: {cabal: {component: "weiss-xmonad:weiss-xmonad-bench"}}} diff --git a/src/Config.hs b/src/Config.hs index 6f62a65..53043ea 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -20,3 +20,7 @@ myFocusColor = "#46d9ff" -- Border color of focused windows myModMask :: KeyMask myModMask = mod4Mask + +isScreenVertical :: ScreenId -> Bool +isScreenVertical 1 = True +isScreenVertical _ = False diff --git a/src/TreeActions.hs b/src/TreeActions.hs index b78c85c..f4cad8f 100644 --- a/src/TreeActions.hs +++ b/src/TreeActions.hs @@ -3,9 +3,8 @@ module TreeActions where import Data.Map qualified as Map import Data.Tree (Tree (..)) import WeissScratchpad (myScratchPads, switchNSP) -import XMonad (def, spawn) +import XMonad import XMonad.Actions.TreeSelect -import XMonad.Config.Prime import XMonad.Prelude ((<&>)) import XMonad.Util.NamedScratchpad (NamedScratchpad (NS)) @@ -48,9 +47,9 @@ weissTreeActions = myTreeConf $ [ Node (TSNode "System" "System operations" (return ())) - [ Node (TSNode "Shutdown" "Poweroff the system" (spawn "shutdown")) [] - , Node (TSNode "Reboot" "Reboot the system" (spawn "shutdown")) [] - , Node (TSNode "Suspend" "Suspend the system" (spawn "shutdown")) [] + [ Node (TSNode "Shutdown" "Poweroff the system" (spawn " sudo shutdown now")) [] + , Node (TSNode "Reboot" "Reboot the system" (spawn "sudo reboot")) [] + , Node (TSNode "Suspend" "Suspend the system" (spawn "sudo suspend")) [] ] ] <> scratchpadActions @@ -58,6 +57,5 @@ weissTreeActions = scratchpadActions = myScratchPads <&> \(NS name _ _ _) -> Node - ( TSNode name ("Activate scratchpad " <> name) (switchNSP name) - ) + (TSNode name ("Activate scratchpad " <> name) (switchNSP name)) [] diff --git a/src/Treeselect.hs b/src/Treeselect.hs new file mode 100644 index 0000000..3da3b6f --- /dev/null +++ b/src/Treeselect.hs @@ -0,0 +1,12 @@ +module Treeselect where + +import MyPrelude + +weissTreeActions = + treeselectAction + def + [ Node (TSNode "Hello" "displays hello" (spawn "xmessage hello!")) [] + , Node (TSNode "Shutdown" "Poweroff the system" (spawn "shutdown")) [] + ] + where + scratchpadActions = myScratchPads <&> error "TODO" diff --git a/src/Utils.hs b/src/Utils.hs index ca206e7..8369d3e 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -3,6 +3,7 @@ module Utils where import Config import Control.Monad (liftM) import Control.Monad.Trans.Maybe +import Data.Functor ((<&>)) import Data.List qualified as L import Data.List.Unique (allUnique) import Data.Map qualified as Map @@ -13,6 +14,12 @@ import XMonad.Prelude (Endo (..)) import XMonad.StackSet qualified as W import XMonad.Util.Loggers import XMonad.Util.NamedWindows +import XMonad.Util.PureX (curScreenId) + +onWindowsCount :: (Int -> X ()) -> X () +onWindowsCount f = do + winCount <- length . W.index . windowset <$> get + f winCount liftMaybeT :: (Monad m) => m a -> MaybeT m a liftMaybeT act = MaybeT $ Just `liftM` act @@ -75,12 +82,24 @@ logWindowCount = withWindowSet ct W.current ss logMaster :: X Bool -logMaster = withWindowSet isMaster +logMaster = withWindowSet isM where - isMaster ss = return $ case W.stack . W.workspace . W.current $ ss of + isM ss = return $ case W.stack . W.workspace . W.current $ ss of Just (W.Stack _ [] _) -> True _ -> False +withFocusedG :: (Window -> X a) -> X (Maybe a) +withFocusedG f = withWindowSet $ mapM f . W.peek + +logFocusedScreenRect :: X Rectangle +logFocusedScreenRect = withWindowSet $ return . screenRect . W.screenDetail . W.current + +logWinCount :: X Int +logWinCount = length . W.index . windowset <$> get + +logIsVerticalScreen :: X Bool +logIsVerticalScreen = curScreenId <&> isScreenVertical + trimPrefixWithList :: [String] -> Maybe String -> Maybe String trimPrefixWithList _ Nothing = Nothing trimPrefixWithList xs (Just s) = case mapMaybe (`L.stripPrefix` s) xs of diff --git a/src/Utils/WindowOps.hs b/src/Utils/WindowOps.hs new file mode 100644 index 0000000..df7f192 --- /dev/null +++ b/src/Utils/WindowOps.hs @@ -0,0 +1 @@ +module Utils.WindowOps where diff --git a/src/WeissScratchpad.hs b/src/WeissScratchpad.hs index 3d474bd..c88d94f 100644 --- a/src/WeissScratchpad.hs +++ b/src/WeissScratchpad.hs @@ -6,6 +6,7 @@ import Control.Monad.Extra (andM, firstJustM, unlessM, whenJustM, whenM) import Control.Monad.Trans.Maybe import Data.Foldable.Extra (findM) import Data.Functor (void) +import Data.List (isInfixOf) import Data.Maybe (isJust, isNothing) import Data.Tree (Tree (Node)) import Utils @@ -15,6 +16,7 @@ import XMonad.Actions.ShowText (flashText) import XMonad.Actions.TreeSelect (TSNode (..), treeselectAction) import XMonad.Actions.WithAll (withAll) import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.RefocusLast (refocusLastLogHook) import XMonad.Prelude (Endo (..), catMaybes, (<&>)) import XMonad.StackSet qualified as W import XMonad.Util.ExtensibleState qualified as XS @@ -24,7 +26,7 @@ import XMonad.Util.NamedScratchpad termNSP, timeNSP, pavuNSP :: NamedScratchpad termNSP = NS - "term" + "wezterm" (myTerminal <> " --config-file $XDG_CONFIG_HOME/wezterm/scratch.lua") (title ^=? "[Scratchpad]" <&&> (className =? "org.wezfurlong.wezterm")) niceFloating @@ -42,27 +44,38 @@ myScratchPads = [termNSP, timeNSP, pavuNSP] myScratchpadNames :: [String] myScratchpadNames = name <$> myScratchPads +scratchpadLogHook :: X () +scratchpadLogHook = refocusLastLogHook >> nsSingleScratchpadPerWorkspace myScratchPads + myScratchPadsManageHook :: ManageHook myScratchPadsManageHook = namedScratchpadManageHook myScratchPads floatTimeTracking :: ManageHook -floatTimeTracking = floatOnScreen f - where - f 0 = W.RationalRect (20 / 50) (5 / 50) (25 / 50) (40 / 50) - f _ = W.RationalRect (3 / 50) (5 / 50) (45 / 50) (35 / 50) +floatTimeTracking = do + isV <- liftX logIsVerticalScreen + doRectFloat $ + if isV + then W.RationalRect (3 / 50) (5 / 50) (45 / 50) (35 / 50) + else W.RationalRect (20 / 50) (5 / 50) (25 / 50) (40 / 50) -- try to float window in a way that do not overlap the currently focused window niceFloating :: ManageHook niceFloating = do - m <- liftX logMaster - l <- liftX logLayout let r = W.RationalRect - doRectFloat $ case (m, trimLayoutModifiers l) of - (_, Just "StackTile") -> r (1 / 50) (26 / 50) (45 / 50) (20 / 50) - (True, Just "Mirror Tall") -> r (1 / 50) (26 / 50) (45 / 50) (20 / 50) - (False, Just "Mirror Tall") -> r (1 / 50) (5 / 50) (45 / 50) (20 / 50) - (True, _) -> r (26 / 50) (6 / 50) (23 / 50) (20 / 50) - (False, _) -> r (1 / 50) (6 / 50) (23 / 50) (20 / 50) + isV <- liftX logIsVerticalScreen + isM <- liftX logMaster + layout <- liftX logLayout <&> trimLayoutModifiers + c <- liftX logWinCount + doRectFloat $ case (isV, isM, layout) of + (False, False, Just l) + | c == 3 && "ThreeCol" `isInfixOf` l -> + r (1 / 100) (6 / 50) (30 / 100) (25 / 50) + (False, _, _) -> r (66 / 100) (6 / 50) (33 / 100) (25 / 50) + -- (_, Just "StackTile") -> r (1 / 50) (26 / 50) (45 / 50) (20 / 50) + -- (True, Just "Mirror Tall") -> r (1 / 50) (26 / 50) (45 / 50) (20 / 50) + -- (False, Just "Mirror Tall") -> r (1 / 50) (5 / 50) (45 / 50) (20 / 50) + (True, True, _) -> r (1 / 50) (26 / 50) (46 / 50) (20 / 50) + (True, False, _) -> r (1 / 50) (3 / 50) (46 / 50) (20 / 50) newtype CurrentScratchpadName = CurrentScratchpadName String instance ExtensionClass CurrentScratchpadName where @@ -86,16 +99,14 @@ repositionNSP = withFocused $ \w -> void $ runMaybeT $ do NS {..} <- MaybeT (findNSP w) liftMaybeT $ runManageHook hook w -curNSP_ :: X () -curNSP_ = do - CurrentScratchpadName cur <- XS.get - namedScratchpadAction myScratchPads cur +scratchpadsExclusives :: X () +scratchpadsExclusives = addExclusives [myScratchPads <&> name] curNSP :: X () -curNSP = withFocused $ \w -> do - curNSP_ - unlessM (isNSP w) $ - withFocused (\newW -> unlessM (isNSP newW) curNSP_) +curNSP = do + CurrentScratchpadName cur <- XS.get + namedScratchpadAction myScratchPads cur + resetFocusedNSP initialNSP :: X () initialNSP = do @@ -119,6 +130,6 @@ prevNSP = do switchNSP :: String -> X () switchNSP name = do - hideAllNSP namedScratchpadAction myScratchPads name XS.put (CurrentScratchpadName name) + resetFocusedNSP diff --git a/src/WeissWindowOperations.hs b/src/WeissWindowOperations.hs index a113d9c..d72e09d 100644 --- a/src/WeissWindowOperations.hs +++ b/src/WeissWindowOperations.hs @@ -1,6 +1,6 @@ {-# LANGUAGE LambdaCase #-} -module WeissWindowOperations (weissFocusDown, weissFocusUp, weissSwapMaster, easySwap, weissSwitchFocus) where +module WeissWindowOperations (weissSwap, weissSwitchFocus) where import Data.List qualified as L import Data.List.Unique @@ -20,99 +20,10 @@ import XMonad.Actions.EasyMotion ( textSize, ) import XMonad.Actions.FocusNth (swapNth) +import XMonad.StackSet (focusWindow) import XMonad.StackSet qualified as W import XMonad.Util.Loggers -onWindowsCount :: (Int -> X ()) -> X () -onWindowsCount f = do - winCount <- length . W.index . windowset <$> get - f winCount - -handleOp :: X () -> X () -> X () -handleOp handleNSP handleNormal = withFocused $ \w -> - ifM - (isNSP w) - (curNSP_ >> handleNSP >> repositionNSP) - (ifM (isFloating w) (return ()) handleNormal) - -weissFocusDown :: X () -weissFocusDown = handleOp weissTreeActions weissFocusDown_ - -weissFocusDown_ :: X () -weissFocusDown_ = do - l <- logLayout - let run f = windows $ \s -> skipFloating s f - case trimLayoutModifiers l of - Just "TwoPane" -> run focusDownTwoPane - Just "Mirror Tall" -> run $ skipMaster W.focusUp - Just "Tall" -> run $ skipMaster W.focusDown - _ -> run W.focusDown - where - focusDownTwoPane :: W.StackSet i l a s sd -> W.StackSet i l a s sd - focusDownTwoPane = W.modify' $ \stack -> case stack of - W.Stack r1 (l : up) (r2 : down) -> W.Stack r2 [l] (r1 : up <> down) - W.Stack l [] (r1 : r2 : down) -> W.Stack r1 [l] (r2 : down) - _ -> W.focusDown' stack - skipMaster :: - (W.StackSet i l a s sd -> W.StackSet i l a s sd) -> - W.StackSet i l a s sd -> - W.StackSet i l a s sd - skipMaster f x = - if isMaster x - then f x - else - let newS = f x - in if isMaster newS then f newS else newS - -weissFocusUp :: X () -weissFocusUp = handleOp prevNSP weissFocusUp_ - -weissFocusUp_ :: X () -weissFocusUp_ = do - l <- logLayout - let run f = windows $ \s -> skipFloating s f - case trimLayoutModifiers l of - Just "TwoPane" -> run focusUpTwoPane - Just "Mirror Tall" -> run $ backToMaster W.focusDown - Just "Tall" -> run $ backToMaster W.focusUp - _ -> run W.focusUp - where - focusUpTwoPane :: W.StackSet i l a s sd -> W.StackSet i l a s sd - focusUpTwoPane = W.modify' $ \stack -> case stack of - -- W.Stack r2 (l : r1 : up) down -> W.Stack l [] (r2 : r1 : down) - W.Stack r1 (l : _) (r2 : down) -> W.Stack l [] (r1 : r2 : down) - W.Stack l [] (r1 : r2 : down) -> W.Stack r2 [l] (r1 : down) - _ -> W.focusUp' stack - backToMaster :: - (W.StackSet i l a s sd -> W.StackSet i l a s sd) -> - W.StackSet i l a s sd -> - W.StackSet i l a s sd - backToMaster f x = if isMaster x then f x else W.focusMaster x - -weissSwapMaster :: X () -weissSwapMaster = handleOp initialNSP weissSwapMaster_ - -weissSwapMaster_ :: X () -weissSwapMaster_ = do - l <- logLayout - case trimLayoutModifiers l of - Just "TwoPane" -> windows swapMasterTwoPane - _ -> windows $ W.modify' swapBetweenMasterAndSlave - where - swapBetweenMasterAndSlave :: W.Stack a -> W.Stack a - swapBetweenMasterAndSlave stack = case stack of - W.Stack f [] [] -> stack - W.Stack f [] ds -> W.Stack (last ds) [] (f : init ds) - W.Stack t ls rs -> W.Stack t [] (xs <> (x : rs)) - where - (x : xs) = reverse ls - swapMasterTwoPane :: W.StackSet i l a s sd -> W.StackSet i l a s sd - swapMasterTwoPane = W.modify' $ \stack -> case stack of - W.Stack r2 (l : r1 : up) down -> W.Stack r1 [r2] (l : down) - W.Stack r1 (l : up) (r2 : down) -> W.Stack r2 [r1] (l : down) - W.Stack l [] (r1 : r2 : down) -> W.Stack l [] (r2 : r1 : down) - _ -> swapBetweenMasterAndSlave stack - easyMotionConf :: EasyMotionConfig easyMotionConf = def @@ -127,12 +38,15 @@ easyMotionConf = ) } -easySwap :: X () -easySwap = do - win <- selectWindow easyMotionConf - stack <- gets $ W.index . windowset - let match = L.find ((win ==) . Just . fst) $ zip stack [0 ..] - whenJust match $ swapNth . snd +weissSwap :: X () +weissSwap = onWindowsCount $ \c -> + if c <= 2 + then windows W.swapDown + else withFocused $ \focused -> do + win <- selectWindow easyMotionConf + stack <- gets $ W.index . windowset + let match = L.find ((win ==) . Just . fst) $ zip stack [0 ..] + whenJust match $ \(_, idx) -> swapNth idx >> focus focused weissSwitchFocus :: X () weissSwitchFocus = onWindowsCount $ \c -> diff --git a/src/WeissXMonad.hs b/src/WeissXMonad.hs index e3db173..d963e4f 100644 --- a/src/WeissXMonad.hs +++ b/src/WeissXMonad.hs @@ -1,7 +1,7 @@ {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} {-# HLINT ignore "Redundant return" #-} -module WeissXMonad (runXmonad) where +module WeissXMonad (runXmonad, module XMonad) where import Config import Data.List @@ -25,9 +25,11 @@ import XMonad.Hooks.DynamicProperty import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.RefocusLast (refocusLastLogHook) import XMonad.Hooks.StatusBar import XMonad.Layout.Accordion import XMonad.Layout.LayoutModifier +import XMonad.Layout.MouseResizableTile (MouseResizableTile (..), mouseResizableTile) import XMonad.Layout.MultiColumns import XMonad.Layout.NoBorders import XMonad.Layout.NoFrillsDecoration @@ -35,6 +37,7 @@ import XMonad.Layout.PerScreen (ifWider) import XMonad.Layout.ResizableThreeColumns (ResizableThreeCol (..)) import XMonad.Layout.Spacing import XMonad.Layout.StackTile +import XMonad.Layout.ThreeColumns (ThreeCol (..)) import XMonad.Layout.TwoPane import XMonad.Layout.WindowArranger import XMonad.Layout.WindowNavigation @@ -95,10 +98,10 @@ myLayout = windowArrange $ ifWider 1500 - (myMulCol ||| myTall ||| Full) - (Mirror myTall ||| myStackTile ||| Full) + (threeCol ||| Full) + (mouseResizableTile {isMirrored = True, masterFrac = 0.7} ||| Full) where - threeCol = ResizableThreeCol 1 (3 / 100) (1 / 3) [] + threeCol = ResizableThreeColMid 1 (3 / 100) (1 / 3) [] myMulCol = multiCol [1, 1] 0 0.01 (-0.5) twoPane = TwoPane delta ratio myTall = Tall nmaster delta ratio @@ -120,7 +123,7 @@ myKeys = , ("", weissSwitchFocus) , ("M-", kill) , ("M-1", weissTreeActions) - , ("M-2", easySwap) + , ("M-2", weissSwap) , ("M-", sendMessage Shrink) , ("M-", sendMessage Expand) , ("M-k", spawn myTerminal) @@ -193,14 +196,15 @@ myConfig = def { modMask = myModMask , terminal = myTerminal - , -- , startupHook = myStartupHook - manageHook = myManageHook + , manageHook = myManageHook , workspaces = myWorkspaces - , borderWidth = myBorderWidth + , -- , logHook = scratchpadLogHook + borderWidth = myBorderWidth , layoutHook = myLayout , normalBorderColor = myNormColor , focusedBorderColor = myFocusColor - , startupHook = return () >> checkKeymap myConfig myKeys -- return () to avoid infinite mutual recursion + , -- return () to avoid infinite mutual recursion + startupHook = return () >> checkKeymap myConfig myKeys >> scratchpadsExclusives , handleEventHook = handleEventHook def <> handleTimerEvent } -- `removeKeysP` ["M-4"] diff --git a/WeissXmonad.cabal b/weiss-xmonad.cabal similarity index 74% rename from WeissXmonad.cabal rename to weiss-xmonad.cabal index 8571136..9178ec5 100644 --- a/WeissXmonad.cabal +++ b/weiss-xmonad.cabal @@ -1,5 +1,5 @@ -cabal-version: 2.4 -name: WeissXmonad +cabal-version: 3.8 +name: weiss-xmonad version: 0 license: BSD-3-Clause build-type: Simple @@ -7,7 +7,7 @@ license-file: LICENSE author: weiss maintainer: weiss copyright: 2024 weiss -tested-with: GHC ==8.6.5 || ==8.8.3 || ==8.10.7 || ==9.0.2 || ==9.2.2 +tested-with: GHC ==9.6.6 extra-doc-files: CHANGELOG.md README.md @@ -15,10 +15,10 @@ extra-doc-files: -- category: -- description: description -- synopsis: one-line synopsis --- homepage: https://github.com/FIXME/WeissXmonad#readme +-- homepage: https://github.com/FIXME/weiss-xmonad#readme -- source-repository head -- type: git --- location: git://github.com/FIXME/WeissXmonad.git +-- location: git://github.com/FIXME/weiss-xmonad.git common common-options build-depends: base >=4.9 && <5 @@ -26,8 +26,11 @@ common common-options default-extensions: ApplicativeDo BangPatterns + BlockArguments ConstraintKinds DataKinds + DefaultSignatures + DeriveAnyClass DeriveDataTypeable DeriveFoldable DeriveFunctor @@ -36,6 +39,8 @@ common common-options DeriveTraversable DerivingStrategies DerivingVia + DisambiguateRecordFields + DuplicateRecordFields EmptyCase EmptyDataDecls EmptyDataDeriving @@ -43,11 +48,13 @@ common common-options ExplicitForAll FlexibleContexts FlexibleInstances + FunctionalDependencies GADTSyntax GeneralisedNewtypeDeriving ImportQualifiedPost KindSignatures LambdaCase + MonadComprehensions MultiParamTypeClasses MultiWayIf NoStarIsType @@ -71,22 +78,11 @@ common common-options ghc-options: -Wall -Wcompat -Widentities -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints - -fhide-source-paths -Wpartial-fields -Wno-missing-signatures + -fhide-source-paths -Wpartial-fields library import: common-options hs-source-dirs: src - exposed-modules: - Config - Utils - WeissPromptPass - WeissScratchpad - WeissWindowOperations - WeissXmobar - WeissXMonad - WorkspaceFamily - TreeActions - build-depends: , base , containers @@ -100,5 +96,23 @@ library , Unique , unix , unordered-containers - , xmonad - , xmonad-contrib >= 0.18.1 + , xmonad >=0.18 + , xmonad-contrib >=0.18 + + exposed-modules: + Config + TreeActions + Utils + WeissPromptPass + WeissScratchpad + WeissWindowOperations + WeissXmobar + WeissXMonad + WorkspaceFamily + +executable weiss-xmonad-exe + import: common-options + hs-source-dirs: app + main-is: Main.hs + build-depends: weiss-xmonad + ghc-options: -threaded -rtsopts -with-rtsopts=-N