diff --git a/build/nixpkgs/packages/i3-scratchpad/default.nix b/build/nixpkgs/packages/i3-scratchpad/default.nix new file mode 100644 index 00000000..d8b60fcd --- /dev/null +++ b/build/nixpkgs/packages/i3-scratchpad/default.nix @@ -0,0 +1,67 @@ +{ nix-project-lib +, coreutils +, i3 +, jq +}: + +let + progName = "i3-scratchpad"; + meta.description = "Manage I3 scratchpad"; +in + +nix-project-lib.writeShellCheckedExe progName +{ + inherit meta; + + path = [ + coreutils + i3 + jq + ]; +} +'' +set -eu +set -o pipefail + + +main() +{ + case "''${1:-}" in + move) move ;; + *) cycle ;; + esac +} + +move() +{ + if is_in_scratchpad + then + i3-msg floating toggle + else + i3-msg move scratchpad + i3-msg scratchpad show + fi +} + +cycle() +{ + if is_in_scratchpad + then i3-msg "scratchpad show; scratchpad show" + else i3-msg focus next + fi +} + +is_in_scratchpad() +{ + i3-msg -t get_tree \ + | jq --exit-status ' + .. + | select(.scratchpad_state? != "none") + | .nodes[]? + | select(.focused == true) + | .id' >/dev/null +} + + +main "$@" +'' diff --git a/build/nixpkgs/packages/i3-workspace-name/default.nix b/build/nixpkgs/packages/i3-workspace-name/default.nix index abee0033..20332927 100644 --- a/build/nixpkgs/packages/i3-workspace-name/default.nix +++ b/build/nixpkgs/packages/i3-workspace-name/default.nix @@ -8,6 +8,23 @@ let progName = "i3-workspace-name"; meta.description = "Change I3 workspace name interactively"; + + jqSwapTemplate = cond: op: '' + . + | to_entries as $workspaces + | $workspaces[] + | select(.value.focused==true) as $focused + | if ($focused.key ${cond}) + then + $workspaces[] + | select(.key == ($focused.key ${op} 1)) + | .value.name + else empty + end + ''; + jqSwapPrev = jqSwapTemplate "> 0" "-"; + jqSwapNext = jqSwapTemplate "< ($workspaces | length) - 1" "+"; + in nix-project-lib.writeShellCheckedExe progName @@ -28,13 +45,32 @@ set -o pipefail main() { - local input; input="$(get_input)" + case "''${1:-}" in + prev|next) rename_space "jq_$1" ;; + [0-9]|10) rename_space echo "$1" ;; + *) rename_space get_input ;; + esac +} + +rename_space() +{ + local input; input="$("$@")" local trimmed_input; trimmed_input="$(trim "$input")" if [ -n "$trimmed_input" ] then smart_rename "$trimmed_input" fi } +jq_prev() { + i3-msg -t get_workspaces \ + | jq --raw-output '${jqSwapPrev}'; +} + +jq_next() { + i3-msg -t get_workspaces \ + | jq --raw-output '${jqSwapNext}'; +} + get_input() { rofi -dmenu \ @@ -78,17 +114,17 @@ name_exists() rename() { - orig="$1" - new="$2" + local orig="$1" + local new="$2" i3-msg "rename workspace \"$orig\" to \"$new\"" } trim() { - suffix_trimmed="''${1%%*( )}" + local suffix_trimmed="''${1%%*( )}" echo "''${suffix_trimmed##*( )}" } -main +main "$@" '' diff --git a/config.nix b/config.nix index 67fdb011..e531bcee 100644 --- a/config.nix +++ b/config.nix @@ -24,8 +24,8 @@ ]; # DESIGN: https://github.com/input-output-hk/hackage.nix/blob/master/index-state-hashes.nix hackage.index = { - state = "2024-01-24T00:00:00Z"; - sha256 = "0b03fc43deb5e1d0ac367a9005d9d02923b0d10a0fccf2891287b6edb1f17a5d"; + state = "2024-02-04T00:00:00Z"; + sha256 = "0f703fb20c5d0cbddae0e828614e23e4cfd8de6dc97c1006a640afdd2c4947b4"; }; nixpkgs-pin = "nixpkgs-unstable"; }; diff --git a/flake.lock b/flake.lock index b996969c..a936517e 100644 --- a/flake.lock +++ b/flake.lock @@ -19,14 +19,14 @@ "bluos-controller-packed": { "flake": false, "locked": { - "lastModified": 1701175598, - "narHash": "sha256-WPuEkEJui8Oqp4liXE8OOvAxedNGBUKy5BhBEpbuXXg=", + "lastModified": 1706550342, + "narHash": "sha256-wkvdQEI2Q0cWZejHTQVurC93/tVdFVeLe6hIPkrAE3I=", "type": "tarball", - "url": "https://content-bluesound-com.s3.amazonaws.com/uploads/2023/11/BluOS-Controller-4.2.0-Windows.zip" + "url": "https://content-bluesound-com.s3.amazonaws.com/uploads/2024/01/BluOS-Controller-4.2.1-Windows.zip" }, "original": { "type": "tarball", - "url": "https://content-bluesound-com.s3.amazonaws.com/uploads/2023/11/BluOS-Controller-4.2.0-Windows.zip" + "url": "https://content-bluesound-com.s3.amazonaws.com/uploads/2024/01/BluOS-Controller-4.2.1-Windows.zip" } }, "bluos-nix": { @@ -36,11 +36,11 @@ "nix-project": "nix-project" }, "locked": { - "lastModified": 1706489471, - "narHash": "sha256-OPPrObY5bA2pb1aryfBWeBvHAlgteJL+DOebWwByyRk=", + "lastModified": 1707026645, + "narHash": "sha256-m+f7CuHstwsCl7nhNzowaSRtLC5SgfU+syrOKfbZk0c=", "owner": "shajra", "repo": "bluos-nix", - "rev": "ee32e1cf7932daa30b020ec553bc080c2af5e142", + "rev": "c221fafa8b77c361ae5c2f32cc316f2f0001f45c", "type": "github" }, "original": { @@ -187,11 +187,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1706633564, - "narHash": "sha256-H3x0abQXIsX5xJNtHi+8j+/MA3l78cG3nhg3unDT3bg=", + "lastModified": 1707011451, + "narHash": "sha256-v5R5P7LHBMcOCh2Hu+IhX819qzRdDvckmYrlVtU4m2A=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "630458acbc94c79af0c4eb26dd9ac26532e31d5a", + "rev": "0c9de2665a034fbc19782514e32595412cb6a781", "type": "github" }, "original": { @@ -270,11 +270,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -288,11 +288,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -306,11 +306,11 @@ "nixpkgs-lib": "nixpkgs-lib_3" }, "locked": { - "lastModified": 1706569497, - "narHash": "sha256-oixb0IDb5eZYw6BaVr/R/1pSoMh4rfJHkVnlgeRIeZs=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "60c614008eed1d0383d21daac177a3e036192ed8", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -324,11 +324,11 @@ "nixpkgs-lib": "nixpkgs-lib_4" }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -464,11 +464,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1706574159, - "narHash": "sha256-OcE1NT4zQfV4h8Ybq1ttNT+TkXjTV1O2doiCfJzjCbw=", + "lastModified": 1707006239, + "narHash": "sha256-zHZn6uiSLfg2h6CZg8vdHRW9AGJSSdVXoZEBl82jOS8=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "ccff69cc942afd51dbdd7466192e3f4cfe09cde2", + "rev": "1f359fe967f0a885936124a74801a110aef267bd", "type": "github" }, "original": { @@ -532,11 +532,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1706575804, - "narHash": "sha256-/2oEg1CD3FtXOsF0dQm/5RLGZ5LwILA5Gnuw/FkNm4w=", + "lastModified": 1707007813, + "narHash": "sha256-qO1XJ07Em/ENwm1I46DIsPKmuLLJTVTMPrPSwlCOj0M=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "8bc501003577cf9a1077f04d2dabf58f68b256b6", + "rev": "bdcfbb26af260f598945f72fc0e27fbfeb8a46d3", "type": "github" }, "original": { @@ -685,11 +685,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1706126285, - "narHash": "sha256-RVF65vq4CKLkVZrLA/JOb7VOxX/8BenOh+rIKZWBS50=", + "lastModified": 1707030356, + "narHash": "sha256-vZaUSKA34KTn6unBU6UU0ZLdYNEkiob/8ZbKYTyZLjo=", "owner": "shajra", "repo": "home-manager", - "rev": "64403f9cc19b028e0430bfe873ea62244add7a4b", + "rev": "711d4509d62de3f4d4cd9eca31b3cfde6410fb14", "type": "github" }, "original": { @@ -774,11 +774,11 @@ "kitty-scrollback-nvim": { "flake": false, "locked": { - "lastModified": 1706493612, - "narHash": "sha256-hv3o5k85hBaGk8OBRLP7Rf0O9dxiKot6F7/EQelJHHg=", + "lastModified": 1706891759, + "narHash": "sha256-p7RPqLHO6D5CCTDQzUrEqTu9+jg+V7wtYfGbY4qjE9A=", "owner": "mikesmithgh", "repo": "kitty-scrollback.nvim", - "rev": "bb5332b8ec0763b9e611f8cabf4165ed8c3893f5", + "rev": "12f7687ac049d46a987c39b2b4f657fdf540fa4e", "type": "github" }, "original": { @@ -858,11 +858,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1706581965, - "narHash": "sha256-1H7dRdK9LJ7+2X1XQtbwXr+QMqtVVo/ZF0/LIvkjdK8=", + "lastModified": 1706833576, + "narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "91b9daf672c957ef95a05491a75f62e6a01d5aaf", + "rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7", "type": "github" }, "original": { @@ -882,11 +882,11 @@ "ox-gfm": "ox-gfm" }, "locked": { - "lastModified": 1706481697, - "narHash": "sha256-SD0khCAbD2naNjQ8AcCeGw+3cTl6HUlE2KSRebqk0UM=", + "lastModified": 1707026290, + "narHash": "sha256-eLXFCLZXsFNxrlet/A268LypG5SEHbXHl0JHzqthIBk=", "owner": "shajra", "repo": "nix-project", - "rev": "70cdc1e022ed4bf76def964a700839d30681615d", + "rev": "f7461753eba229b57e699b4dd564136360dbf297", "type": "github" }, "original": { @@ -906,11 +906,11 @@ "ox-gfm": "ox-gfm_2" }, "locked": { - "lastModified": 1706481697, - "narHash": "sha256-SD0khCAbD2naNjQ8AcCeGw+3cTl6HUlE2KSRebqk0UM=", + "lastModified": 1707026290, + "narHash": "sha256-eLXFCLZXsFNxrlet/A268LypG5SEHbXHl0JHzqthIBk=", "owner": "shajra", "repo": "nix-project", - "rev": "70cdc1e022ed4bf76def964a700839d30681615d", + "rev": "f7461753eba229b57e699b4dd564136360dbf297", "type": "github" }, "original": { @@ -938,11 +938,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706371002, - "narHash": "sha256-dwuorKimqSYgyu8Cw6ncKhyQjUDOyuXoxDTVmAXq88s=", + "lastModified": 1706732774, + "narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c002c6aa977ad22c60398daaa9be52f2203d0006", + "rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d", "type": "github" }, "original": { @@ -1067,11 +1067,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -1085,11 +1085,11 @@ "nixpkgs-lib_2": { "locked": { "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -1103,11 +1103,11 @@ "nixpkgs-lib_3": { "locked": { "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -1121,11 +1121,11 @@ "nixpkgs-lib_4": { "locked": { "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -1138,11 +1138,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1706479965, - "narHash": "sha256-SdyKpxU1TOvHUFjzYzfpDajxcia//rkon6rMo3NBfFU=", + "lastModified": 1707016070, + "narHash": "sha256-P1bbrI4hYdCIg/XVS44xiHl1OHM68vlNP6L6YRQsUdM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc279167b20580a12a6fd14e72d837a996f6afb1", + "rev": "e1297790f1c4ef4f607a907ba9ce0c4b3a557609", "type": "github" }, "original": { @@ -1154,11 +1154,11 @@ }, "nixpkgs-master_2": { "locked": { - "lastModified": 1706479965, - "narHash": "sha256-SdyKpxU1TOvHUFjzYzfpDajxcia//rkon6rMo3NBfFU=", + "lastModified": 1707016070, + "narHash": "sha256-P1bbrI4hYdCIg/XVS44xiHl1OHM68vlNP6L6YRQsUdM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc279167b20580a12a6fd14e72d837a996f6afb1", + "rev": "e1297790f1c4ef4f607a907ba9ce0c4b3a557609", "type": "github" }, "original": { @@ -1186,11 +1186,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1706373441, - "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "lastModified": 1706826059, + "narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d", "type": "github" }, "original": { @@ -1202,11 +1202,11 @@ }, "nixpkgs-stable-darwin": { "locked": { - "lastModified": 1706323961, - "narHash": "sha256-cfDeRh8YCX8matISbQl8ZuWJS2bzAruG6kJgdjJ3KhA=", + "lastModified": 1706922953, + "narHash": "sha256-45hHA6vQBIcn5bqxi5rtOO+r5rXKSqfWButJJQLHT1s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9658699e3ab26e6f499c95e2e9093819cac777b3", + "rev": "4f24018c731df5f1d522aefb0b9c958e2a701552", "type": "github" }, "original": { @@ -1218,11 +1218,11 @@ }, "nixpkgs-stable-darwin_2": { "locked": { - "lastModified": 1706323961, - "narHash": "sha256-cfDeRh8YCX8matISbQl8ZuWJS2bzAruG6kJgdjJ3KhA=", + "lastModified": 1706922953, + "narHash": "sha256-45hHA6vQBIcn5bqxi5rtOO+r5rXKSqfWButJJQLHT1s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9658699e3ab26e6f499c95e2e9093819cac777b3", + "rev": "4f24018c731df5f1d522aefb0b9c958e2a701552", "type": "github" }, "original": { @@ -1234,11 +1234,11 @@ }, "nixpkgs-stable-linux": { "locked": { - "lastModified": 1706098335, - "narHash": "sha256-r3dWjT8P9/Ah5m5ul4WqIWD8muj5F+/gbCdjiNVBKmU=", + "lastModified": 1706826059, + "narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a77ab169a83a4175169d78684ddd2e54486ac651", + "rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d", "type": "github" }, "original": { @@ -1250,11 +1250,11 @@ }, "nixpkgs-stable-linux_2": { "locked": { - "lastModified": 1706098335, - "narHash": "sha256-r3dWjT8P9/Ah5m5ul4WqIWD8muj5F+/gbCdjiNVBKmU=", + "lastModified": 1706826059, + "narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a77ab169a83a4175169d78684ddd2e54486ac651", + "rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d", "type": "github" }, "original": { @@ -1266,11 +1266,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1706367331, - "narHash": "sha256-AqgkGHRrI6h/8FWuVbnkfFmXr4Bqsr4fV23aISqj/xg=", + "lastModified": 1706925685, + "narHash": "sha256-hVInjWMmgH4yZgA4ZtbgJM1qEAel72SYhP5nOWX4UIM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "160b762eda6d139ac10ae081f8f78d640dd523eb", + "rev": "79a13f1437e149dc7be2d1290c74d378dad60814", "type": "github" }, "original": { @@ -1298,11 +1298,11 @@ }, "nixpkgs-unstable_3": { "locked": { - "lastModified": 1706367331, - "narHash": "sha256-AqgkGHRrI6h/8FWuVbnkfFmXr4Bqsr4fV23aISqj/xg=", + "lastModified": 1706925685, + "narHash": "sha256-hVInjWMmgH4yZgA4ZtbgJM1qEAel72SYhP5nOWX4UIM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "160b762eda6d139ac10ae081f8f78d640dd523eb", + "rev": "79a13f1437e149dc7be2d1290c74d378dad60814", "type": "github" }, "original": { @@ -1330,11 +1330,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1705677747, - "narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=", + "lastModified": 1706191920, + "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261", + "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", "type": "github" }, "original": { @@ -1389,11 +1389,11 @@ }, "nur": { "locked": { - "lastModified": 1706629776, - "narHash": "sha256-IB1M34bepY6b7UENLFS+5Q5c2ZH42gX6xtrHPmsA27c=", + "lastModified": 1707029134, + "narHash": "sha256-jCsAUiJRJ27xSdlMwqh18SlFMnAEQ97HkPYZImRW0mQ=", "owner": "nix-community", "repo": "NUR", - "rev": "09e9ec2ef914bbcfc547f61242078b9219de0a8e", + "rev": "5c5049bf7c0054ac395bb5e1bc3ec6b105c196ec", "type": "github" }, "original": { @@ -1538,11 +1538,11 @@ "sketchybar-font-src": { "flake": false, "locked": { - "lastModified": 1706449529, - "narHash": "sha256-VgzA93ALcbZm8PSoFTsXYLKVkxjrpe4MdqlOlz1dcYU=", + "lastModified": 1706684812, + "narHash": "sha256-InsjYkjX2fwW+WVRZIeZbvetiC4MmhN3slA+JFKJ5b4=", "owner": "kvndrsslr", "repo": "sketchybar-app-font", - "rev": "9bf2ffd5c841d047ca1d7004c9ff545009f3133a", + "rev": "1926c1e658bdd9d848815eb9ad2629343b7b5a7d", "type": "github" }, "original": { @@ -1554,11 +1554,11 @@ "sketchybar-lua": { "flake": false, "locked": { - "lastModified": 1706563703, - "narHash": "sha256-AeHd6W9u4GFUGT0pZj+/vU7sA3GPtZ4b4dXKIeR6lcs=", + "lastModified": 1706644295, + "narHash": "sha256-VsPdorwYo/W5xWUQyC9nJ4E3Q1vCwo8CNXFyhIsxD2o=", "owner": "FelixKratz", "repo": "SbarLua", - "rev": "c078b9ad4744dda8d119e3513d7521a61a814193", + "rev": "2220739be594965a1ddab6167dbdab77f617749e", "type": "github" }, "original": { @@ -1570,11 +1570,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1706573344, - "narHash": "sha256-nOc8eVWcS//QjV4tdZlJVMWPyGauD71BNdCXjvTRXDs=", + "lastModified": 1707005403, + "narHash": "sha256-hXd8Nu2oj80fPed5rX1c9EWpWLlqTlxjdMehPFy+OL0=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "c911e99f7ab959a8d2b83c038a803c255a6d215a", + "rev": "1ba5401a0e66eccd2b39a900ef4aabed7b843723", "type": "github" }, "original": { @@ -1635,11 +1635,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1706577474, - "narHash": "sha256-wP5vL/lZjQtMTcQ9F0rWd2zxUARtwnXmLFnS4vBiRac=", + "lastModified": 1707009713, + "narHash": "sha256-oDr8YWRKFmwV2+B4H0ih7BbYjKAMi99yBpzVAXdWWo0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "73948c64e9cf186f779208d56cff401dd6e1928e", + "rev": "5a034e1b2dee0df8c8d8a6b25902fbc61c26a139", "type": "github" }, "original": { diff --git a/home/modules/base/gui/darwin/xdg/configFile/skhd/skhdrc.nix b/home/modules/base/gui/darwin/xdg/configFile/skhd/skhdrc.nix index 787e5fae..1956ef30 100644 --- a/home/modules/base/gui/darwin/xdg/configFile/skhd/skhdrc.nix +++ b/home/modules/base/gui/darwin/xdg/configFile/skhd/skhdrc.nix @@ -78,17 +78,17 @@ let in '' # Strategy for keybindings: # -# - 'lalt' is used consistently for all window management. +# - 'lcmd' is used consistently for all window management. # - 'ralt' is unused for keybindings outside of skhd. # - Where possible 'shift' implies moving of a window or space. -# - Where possible 'cmd' indicates the target is a space. +# - Where possible 'alt' indicates the target is a space. # - 'ctrl' indicates stacked windows are involved. # - 'h/j/k/l' is used consistently for west/south/north/east direction. # - ',/.' (think angle brackets) are used for next/prev. # - Digits are used for uniquely identifying spaces/displays. # # NOTE: some keys are mysterious codes. Use "skhd -o" to discover what these -# codes should be. +# codes should be # define modes :: default : \ @@ -99,175 +99,182 @@ in '' :: size @ : borders active_color=${colors.semantic.info} # mode: returning home -size, passthru < lalt + shift - escape ; default -size, passthru < lalt - escape ; default +size, passthru < lcmd + shift - escape ; default +size, passthru < lcmd - escape ; default size < escape ; default size < return ; default # mode: resizing, with toggle back -lalt - s ; size -size < lalt - s ; default +lcmd - s ; size +size < lcmd - s ; default # mode: passthrough, with toggle back -lalt - escape ; passthru -passthru < lalt - escape ; default - -# open terminal -#lalt - return : alacritty # no args -lalt - return : "${kitty}" --single-instance --wait-for-single-instance-window-close --directory ~ +lcmd - escape ; passthru +passthru < lcmd - escape ; default # focus window -lalt - h : yabai -m window --focus west || yabai -m display --focus west -lalt - j : yabai -m window --focus south || yabai -m display --focus south -lalt - k : yabai -m window --focus north || yabai -m display --focus north -lalt - l : yabai -m window --focus east || yabai -m display --focus east +lcmd - h : yabai -m window --focus west || yabai -m display --focus west +lcmd - j : yabai -m window --focus south || yabai -m display --focus south +lcmd - k : yabai -m window --focus north || yabai -m display --focus north +lcmd - l : yabai -m window --focus east || yabai -m display --focus east # swap window, or move if floating -lalt + shift - h : yabai -m window --swap west || yabai -m window --move rel:-20:0 -lalt + shift - j : yabai -m window --swap south || yabai -m window --move rel:0:20 -lalt + shift - k : yabai -m window --swap north || yabai -m window --move rel:0:-20 -lalt + shift - l : yabai -m window --swap east || yabai -m window --move rel:20:0 +lcmd + shift - h : yabai -m window --swap west || yabai -m window --move rel:-20:0 +lcmd + shift - j : yabai -m window --swap south || yabai -m window --move rel:0:20 +lcmd + shift - k : yabai -m window --swap north || yabai -m window --move rel:0:-20 +lcmd + shift - l : yabai -m window --swap east || yabai -m window --move rel:20:0 # warp window or fit to grid if floating -lalt + shift + cmd - h : yabai -m window --warp west || yabai -m window --grid 1:2:0:0:1:1 ; "${window-focus}" -lalt + shift + cmd - j : yabai -m window --warp south ; "${window-focus}" -lalt + shift + cmd - k : yabai -m window --warp north || yabai -m window --grid 1:1:0:0:1:1 ; "${window-focus}" -lalt + shift + cmd - l : yabai -m window --warp east || yabai -m window --grid 1:2:1:0:1:1 ; "${window-focus}" +lcmd + shift + alt - h : yabai -m window --warp west || yabai -m window --grid 1:2:0:0:1:1 ; "${window-focus}" +lcmd + shift + alt - j : yabai -m window --warp south ; "${window-focus}" +lcmd + shift + alt - k : yabai -m window --warp north || yabai -m window --grid 1:1:0:0:1:1 ; "${window-focus}" +lcmd + shift + alt - l : yabai -m window --warp east || yabai -m window --grid 1:2:1:0:1:1 ; "${window-focus}" # stack window -lalt + shift + ctrl - h : yabai -m window west --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" -lalt + shift + ctrl - j : yabai -m window south --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" -lalt + shift + ctrl - k : yabai -m window north --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" -lalt + shift + ctrl - l : yabai -m window east --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" +lcmd + shift + ctrl - h : yabai -m window west --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" +lcmd + shift + ctrl - j : yabai -m window south --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" +lcmd + shift + ctrl - k : yabai -m window north --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" +lcmd + shift + ctrl - l : yabai -m window east --stack $(yabai -m query --windows --window | jq -r '.id') ; "${window-focus}" # set insertion point in focused container -lalt + cmd - i : yabai -m window --insert cancel -lalt + cmd - h : yabai -m window --insert west -lalt + cmd - j : yabai -m window --insert south -lalt + cmd - k : yabai -m window --insert north -lalt + cmd - l : yabai -m window --insert east -lalt + cmd - s : yabai -m window --insert stack +lcmd + alt - i : yabai -m window --insert cancel +lcmd + alt - h : yabai -m window --insert west +lcmd + alt - j : yabai -m window --insert south +lcmd + alt - k : yabai -m window --insert north +lcmd + alt - l : yabai -m window --insert east +lcmd + alt - s : yabai -m window --insert stack # increase window size -size < lalt - h : yabai -m window --resize left:-20:0 -size < lalt - j : yabai -m window --resize bottom:0:20 -size < lalt - k : yabai -m window --resize top:0:-20 -size < lalt - l : yabai -m window --resize right:20:0 +size < lcmd - h : yabai -m window --resize left:-20:0 +size < lcmd - j : yabai -m window --resize bottom:0:20 +size < lcmd - k : yabai -m window --resize top:0:-20 +size < lcmd - l : yabai -m window --resize right:20:0 +size < h : yabai -m window --resize left:-20:0 +size < j : yabai -m window --resize bottom:0:20 +size < k : yabai -m window --resize top:0:-20 +size < l : yabai -m window --resize right:20:0 # decrease window size -size < lalt + shift - h : yabai -m window --resize left:20:0 -size < lalt + shift - j : yabai -m window --resize bottom:0:-20 -size < lalt + shift - k : yabai -m window --resize top:0:20 -size < lalt + shift - l : yabai -m window --resize right:-20:0 +size < lcmd + shift - h : yabai -m window --resize left:20:0 +size < lcmd + shift - j : yabai -m window --resize bottom:0:-20 +size < lcmd + shift - k : yabai -m window --resize top:0:20 +size < lcmd + shift - l : yabai -m window --resize right:-20:0 +size < shift - h : yabai -m window --resize left:20:0 +size < shift - j : yabai -m window --resize bottom:0:-20 +size < shift - k : yabai -m window --resize top:0:20 +size < shift - l : yabai -m window --resize right:-20:0 # focus space -lalt - 0x2C : yabai -m space --focus last ; "${window-focus}" -lalt - 0x2B : yabai -m space --focus prev ; "${window-focus}" -lalt - 0x2F : yabai -m space --focus next ; "${window-focus}" -lalt - 1 : yabai -m space --focus 1 ; "${window-focus}" -lalt - 2 : yabai -m space --focus 2 ; "${window-focus}" -lalt - 3 : yabai -m space --focus 3 ; "${window-focus}" -lalt - 4 : yabai -m space --focus 4 ; "${window-focus}" -lalt - 5 : yabai -m space --focus 5 ; "${window-focus}" -lalt - 6 : yabai -m space --focus 6 ; "${window-focus}" -lalt - 7 : yabai -m space --focus 7 ; "${window-focus}" -lalt - 8 : yabai -m space --focus 8 ; "${window-focus}" -lalt - 9 : yabai -m space --focus 9 ; "${window-focus}" +lcmd - 1 : yabai -m space --focus 1 ; "${window-focus}" +lcmd - 2 : yabai -m space --focus 2 ; "${window-focus}" +lcmd - 3 : yabai -m space --focus 3 ; "${window-focus}" +lcmd - 4 : yabai -m space --focus 4 ; "${window-focus}" +lcmd - 5 : yabai -m space --focus 5 ; "${window-focus}" +lcmd - 6 : yabai -m space --focus 6 ; "${window-focus}" +lcmd - 7 : yabai -m space --focus 7 ; "${window-focus}" +lcmd - 8 : yabai -m space --focus 8 ; "${window-focus}" +lcmd - 9 : yabai -m space --focus 9 ; "${window-focus}" +lcmd - 0x2C : yabai -m space --focus last ; "${window-focus}" +lcmd - 0x2B : yabai -m space --focus prev ; "${window-focus}" +lcmd - 0x2F : yabai -m space --focus next ; "${window-focus}" # move window to space -lalt + shift - 0x2C : yabai -m window --space last -lalt + shift - 0x2B : yabai -m window --space prev -lalt + shift - 0x2F : yabai -m window --space next -lalt + shift - 1 : yabai -m window --space 1 -lalt + shift - 2 : yabai -m window --space 2 -lalt + shift - 3 : yabai -m window --space 3 -lalt + shift - 4 : yabai -m window --space 4 -lalt + shift - 5 : yabai -m window --space 5 -lalt + shift - 6 : yabai -m window --space 6 -lalt + shift - 7 : yabai -m window --space 7 -lalt + shift - 8 : yabai -m window --space 8 -lalt + shift - 9 : yabai -m window --space 9 +lcmd + shift - 1 : yabai -m window --space 1 +lcmd + shift - 2 : yabai -m window --space 2 +lcmd + shift - 3 : yabai -m window --space 3 +lcmd + shift - 4 : yabai -m window --space 4 +lcmd + shift - 5 : yabai -m window --space 5 +lcmd + shift - 6 : yabai -m window --space 6 +lcmd + shift - 7 : yabai -m window --space 7 +lcmd + shift - 8 : yabai -m window --space 8 +lcmd + shift - 9 : yabai -m window --space 9 +lcmd + shift - 0x2C : yabai -m window --space last +lcmd + shift - 0x2B : yabai -m window --space prev +lcmd + shift - 0x2F : yabai -m window --space next # move space -lalt + shift + cmd - 0x2C : "${space-move}" last -lalt + shift + cmd - 0x2B : "${space-move}" prev -lalt + shift + cmd - 0x2F : "${space-move}" next -lalt + shift + cmd - 1 : "${space-move}" 1 -lalt + shift + cmd - 2 : "${space-move}" 2 -lalt + shift + cmd - 3 : "${space-move}" 3 -lalt + shift + cmd - 4 : "${space-move}" 4 -lalt + shift + cmd - 5 : "${space-move}" 5 -lalt + shift + cmd - 6 : "${space-move}" 6 -lalt + shift + cmd - 7 : "${space-move}" 7 -lalt + shift + cmd - 8 : "${space-move}" 8 -lalt + shift + cmd - 9 : "${space-move}" 9 +lcmd + shift + alt - 1 : "${space-move}" 1 +lcmd + shift + alt - 2 : "${space-move}" 2 +lcmd + shift + alt - 3 : "${space-move}" 3 +lcmd + shift + alt - 4 : "${space-move}" 4 +lcmd + shift + alt - 5 : "${space-move}" 5 +lcmd + shift + alt - 6 : "${space-move}" 6 +lcmd + shift + alt - 7 : "${space-move}" 7 +lcmd + shift + alt - 8 : "${space-move}" 8 +lcmd + shift + alt - 9 : "${space-move}" 9 +lcmd + shift + alt - 0x2C : "${space-move}" last +lcmd + shift + alt - 0x2B : "${space-move}" prev +lcmd + shift + alt - 0x2F : "${space-move}" next # focus window within stack -lalt + ctrl - 0x2B : yabai -m window --focus stack.prev -lalt + ctrl - 0x2F : yabai -m window --focus stack.next +lcmd + ctrl - 0x2B : yabai -m window --focus stack.prev +lcmd + ctrl - 0x2F : yabai -m window --focus stack.next # move window within stack -lalt + shift + ctrl - 0x2B : yabai -m window --swap stack.prev && yabai -m window --focus stack.prev -lalt + shift + ctrl - 0x2F : yabai -m window --swap stack.next && yabai -m window --focus stack.next +lcmd + shift + ctrl - 0x2B : yabai -m window --swap stack.prev && yabai -m window --focus stack.prev +lcmd + shift + ctrl - 0x2F : yabai -m window --swap stack.next && yabai -m window --focus stack.next # create spaces -lalt + cmd - 0x2C : "${space-create}" last -lalt + cmd - 0x2B : "${space-create}" prev -lalt + cmd - 0x2F : "${space-create}" next +lcmd + alt - 0x2C : "${space-create}" last +lcmd + alt - 0x2B : "${space-create}" prev +lcmd + alt - 0x2F : "${space-create}" next -# cycle windows -lalt - tab : "${window-cycle}" reverse -lalt + shift - tab : "${window-cycle}" '.' +# open terminal +lcmd - return : "${kitty}" --single-instance --wait-for-single-instance-window-close --directory ~ # close window -lalt - q : yabai -m window --close +lcmd - q : yabai -m window --close # destroy space -lalt + cmd - q : "${space-destroy}" +lcmd + alt - q : "${space-destroy}" + +# cycle windows +lcmd - tab : "${window-cycle}" reverse +lcmd + shift - tab : "${window-cycle}" '.' + +# balance size of windows (0x18 = equals) +lcmd - 0x18 : yabai -m space --balance +size < lcmd - 0x18 : yabai -m space --balance -# balance size of windows -lalt - 0 : yabai -m space --balance -size < lalt - 0 : yabai -m space --balance +# transpose split type +lcmd - t : yabai -m window --toggle split # rotate tree -lalt - r : yabai -m space --rotate 90 -lalt + shift - r : yabai -m space --rotate 270 +lcmd - r : yabai -m space --rotate 90 +lcmd + shift - r : yabai -m space --rotate 270 # mirror tree y-axis -lalt - y : yabai -m space --mirror y-axis +lcmd - y : yabai -m space --mirror y-axis # mirror tree x-axis -lalt - x : yabai -m space --mirror x-axis - -# transpose split type -lalt - t : yabai -m window --toggle split +lcmd - x : yabai -m space --mirror x-axis # toggle window parent zoom -lalt - m : yabai -m window --toggle zoom-parent; "${window-focus}" +lcmd - m : yabai -m window --toggle zoom-parent; "${window-focus}" # toggle window fullscreen zoom -lalt - f : yabai -m window --toggle zoom-fullscreen; "${window-focus}" +lcmd - f : yabai -m window --toggle zoom-fullscreen; "${window-focus}" # toggle window native fullscreen -lalt + shift - f : yabai -m window --toggle native-fullscreen; "${window-focus}" +lcmd + shift - f : yabai -m window --toggle native-fullscreen; "${window-focus}" -# float / unfloat window and center on screen -lalt + shift - space : \ +# float / unfloat window and center on screen (0x1B = minus) +lcmd + shift - 0x1B : \ yabai -m window --toggle float && \ yabai -m window --grid 4:4:1:1:2:2; \ "${window-focus}" # toggle sticky -lalt + shift - s : yabai -m window --toggle sticky +lcmd + shift - s : yabai -m window --toggle sticky -lalt - 0x2A : "${gaps-toggle}" +lcmd - 0x2A : "${gaps-toggle}" # toggle sticky, float and resize to picture-in-picture size -lalt - p : yabai -m window --toggle sticky && \ +lcmd - p : yabai -m window --toggle sticky && \ yabai -m window --grid 5:5:4:0:1:1 \ # toggle mission control (application-level) -lalt - a : yabai -m window --toggle expose +lcmd - a : yabai -m window --toggle expose .blacklist [ "VMware Fusion" diff --git a/home/modules/base/gui/linux/programs/rofi/default.nix b/home/modules/base/gui/linux/programs/rofi/default.nix index ad2ef243..30171cc7 100644 --- a/home/modules/base/gui/linux/programs/rofi/default.nix +++ b/home/modules/base/gui/linux/programs/rofi/default.nix @@ -12,6 +12,19 @@ in { enable = true; + extraConfig = { + # DESIGN: unset bindings with Control+j/k, otherwise a conflict + dpi = 0; + kb-accept-entry = "Control+m,Return,KP_Enter"; + kb-remove-to-eol = ""; + kb-row-down = "Down,Control+j"; + kb-row-up = "Up,Control+k"; + }; + font = "${config.theme.fonts.monospaced.code.name} 12"; + plugins = [ + pkgs.rofi-calc + pkgs.rofi-emoji + ]; theme = import ./theme.nix { inherit (config.lib.formats.rasi) mkLiteral; theme_background = colors.semantic.background; @@ -23,13 +36,4 @@ in theme_highlight = colors.semantic.highlight; theme_urgent = colors.semantic.urgent; }; - font = "${config.theme.fonts.monospaced.code.name} 12"; - extraConfig = { - # DESIGN: unset bindings with Control+j/k, otherwise a conflict - dpi = 0; - kb-accept-entry = "Control+m,Return,KP_Enter"; - kb-remove-to-eol = ""; - kb-row-down = "Down,Control+j"; - kb-row-up = "Up,Control+k"; - }; } diff --git a/home/modules/base/gui/linux/xsession/windowManager/i3/keybindings.nix b/home/modules/base/gui/linux/xsession/windowManager/i3/keybindings.nix index 7fba0978..22600468 100644 --- a/home/modules/base/gui/linux/xsession/windowManager/i3/keybindings.nix +++ b/home/modules/base/gui/linux/xsession/windowManager/i3/keybindings.nix @@ -1,6 +1,7 @@ config: pkgs: mod: modAlt: kitty: let + autorandr = "${pkgs.autorandr}/bin/autorandr"; awk = "${pkgs.gawk}/bin/awk"; browser = "${pkgs.microsoft-edge-beta}/bin/microsoft-edge-beta"; @@ -10,6 +11,7 @@ let fish = "${config.programs.fish.package}/bin/fish"; flameshot = "${config.services.flameshot.package}/bin/flameshot"; i3-workspace-name = "${pkgs.i3-workspace-name}/bin/i3-workspace-name"; + i3-scratchpad = "${pkgs.i3-scratchpad}/bin/i3-scratchpad"; pkill = "${pkgs.procps}/bin/pkill"; rofi = "${config.programs.rofi.package}/bin/rofi"; user = config.home.username; @@ -18,90 +20,51 @@ let exec "${rofi}" -dmenu -p 'clip' "$@" ''; - maim-select = pkgs.writers.writeDash "maim-select" '' - TARGET=~/tmp/screenshots - mkdir --parents "$TARGET" - exec "${pkgs.maim}/bin/maim" --select \ - "$TARGET/screenshot.$(${pkgs.coreutils}/bin/date +%s).png" - ''; - in { - # split in horizontal orientation - "${mod}+bracketright" = "split h"; - - # split in vertical orientation - "${mod}+bracketleft" = "split v"; - - # toggle split - "${mod}+backslash" = "layout toggle all"; - - # fullscreen - "${mod}+f" = "fullscreen"; - - # global fullscreen - "${mod}+Shift+f" = "fullscreen"; - - # tabbed - "${mod}+t" = "layout tabbed"; - - # stacking - "${mod}+Shift+t" = "layout stacking"; - - # default - "${mod}+d" = "layout default"; - - # toggle tiling/floating of the current window - "${mod}+Shift+space" = "floating toggle"; - - # toggle focus between tiling and floating layers - "${mod}+space" = "focus mode_toggle"; - - # Make the currently focused window a scratchpad - "${mod}+Shift+minus" = "move scratchpad"; - - # Show the first scratchpad window - "${mod}+minus" = "scratchpad show"; + # resize mode + "${mod}+s" = "mode \"resize\""; - # Stick toggle - "${mod}+Shift+s" = "sticky toggle"; + # passthrough mode + "${mod}+Escape" = "mode \"passthrough\""; # focus with Vim-style keys or cursor keys - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; - "${mod}+Left" = "focus left"; - "${mod}+Down" = "focus down"; - "${mod}+Up" = "focus up"; + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; "${mod}+Right" = "focus right"; # move with Vim-style keys or cursor keys - "${mod}+Shift+h" = "move left"; - "${mod}+Shift+j" = "move down"; - "${mod}+Shift+k" = "move up"; - "${mod}+Shift+l" = "move right"; - "${mod}+Shift+Left" = "move left"; - "${mod}+Shift+Down" = "move down"; - "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+j" = "move down"; + "${mod}+Shift+k" = "move up"; + "${mod}+Shift+l" = "move right"; + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; "${mod}+Shift+Right" = "move right"; # move workspace with Vim-style keys or cursor keys - "${mod}+Control+h" = "move workspace to output left"; - "${mod}+Control+j" = "move workspace to output down"; - "${mod}+Control+k" = "move workspace to output up"; - "${mod}+Control+l" = "move workspace to output right"; - "${mod}+Control+Left" = "move workspace to output left"; - "${mod}+Control+Down" = "move workspace to output down"; - "${mod}+Control+Up" = "move workspace to output up"; + "${mod}+Control+h" = "move workspace to output left"; + "${mod}+Control+j" = "move workspace to output down"; + "${mod}+Control+k" = "move workspace to output up"; + "${mod}+Control+l" = "move workspace to output right"; + "${mod}+Control+Left" = "move workspace to output left"; + "${mod}+Control+Down" = "move workspace to output down"; + "${mod}+Control+Up" = "move workspace to output up"; "${mod}+Control+Right" = "move workspace to output right"; - # focus on the parent container - "${mod}+a" = "focus parent"; - - # focus on the child container - "${mod}+Shift+a" = "focus child"; + # insertion orientation + "${mod}+${modAlt}+l" = "split v"; + "${mod}+${modAlt}+j" = "split h"; + # REVISIT: Keep these? + "${mod}+bracketright" = "split h"; + "${mod}+bracketleft" = "split v"; # focus workspace "${mod}+1" = "workspace number 1"; @@ -114,29 +77,99 @@ in "${mod}+8" = "workspace number 8"; "${mod}+9" = "workspace number 9"; "${mod}+0" = "workspace number 10"; - - # move to workspace - "${mod}+Shift+1" = "move workspace number 1"; - "${mod}+Shift+2" = "move workspace number 2"; - "${mod}+Shift+3" = "move workspace number 3"; - "${mod}+Shift+4" = "move workspace number 4"; - "${mod}+Shift+5" = "move workspace number 5"; - "${mod}+Shift+6" = "move workspace number 6"; - "${mod}+Shift+7" = "move workspace number 7"; - "${mod}+Shift+8" = "move workspace number 8"; - "${mod}+Shift+9" = "move workspace number 9"; - "${mod}+Shift+0" = "move workspace number 10"; - - # cycle through workspaces - "${mod}+comma" = "workspace prev"; + "${mod}+comma" = "workspace prev"; "--whole-window ${mod}+button8" = "workspace prev"; - "${mod}+period" = "workspace next"; + "${mod}+period" = "workspace next"; "--whole-window ${mod}+button9" = "workspace next"; - "${mod}+slash" = "workspace back_and_forth"; + "${mod}+slash" = "workspace back_and_forth"; + + # move window to workspace + "${mod}+Shift+1" = "move workspace number 1"; + "${mod}+Shift+2" = "move workspace number 2"; + "${mod}+Shift+3" = "move workspace number 3"; + "${mod}+Shift+4" = "move workspace number 4"; + "${mod}+Shift+5" = "move workspace number 5"; + "${mod}+Shift+6" = "move workspace number 6"; + "${mod}+Shift+7" = "move workspace number 7"; + "${mod}+Shift+8" = "move workspace number 8"; + "${mod}+Shift+9" = "move workspace number 9"; + "${mod}+Shift+0" = "move workspace number 10"; + "${mod}+Shift+comma" = "move workspace prev"; + "${mod}+Shift+period" = "move workspace next"; + + # move workspace + "${mod}+${modAlt}+Shift+1" = "exec ${i3-workspace-name} 1"; + "${mod}+${modAlt}+Shift+2" = "exec ${i3-workspace-name} 2"; + "${mod}+${modAlt}+Shift+3" = "exec ${i3-workspace-name} 3"; + "${mod}+${modAlt}+Shift+4" = "exec ${i3-workspace-name} 4"; + "${mod}+${modAlt}+Shift+5" = "exec ${i3-workspace-name} 5"; + "${mod}+${modAlt}+Shift+6" = "exec ${i3-workspace-name} 6"; + "${mod}+${modAlt}+Shift+7" = "exec ${i3-workspace-name} 7"; + "${mod}+${modAlt}+Shift+8" = "exec ${i3-workspace-name} 8"; + "${mod}+${modAlt}+Shift+9" = "exec ${i3-workspace-name} 9"; + "${mod}+${modAlt}+Shift+0" = "exec ${i3-workspace-name} 10"; + "${mod}+${modAlt}+Shift+comma" = "exec ${i3-workspace-name} prev"; + "${mod}+${modAlt}+Shift+period" = "exec ${i3-workspace-name} next"; + + # focus on the parent container (up) + "${mod}+u" = "focus parent"; + + # focus on the child container (shift+up ≈ down) + "${mod}+Shift+u" = "focus child"; + + # open general launcher + "${mod}+space" = ''exec ${rofi}'' + ++ '' -show combi'' + ++ '' -modes combi'' + ++ '' -combi-modes "drun,run,window,ssh,emoji"'' + ++ '' -terminal "${kitty} --single-instance"''; + + # open terminal + "${mod}+Return" = ''exec ${kitty} --single-instance''; + + # kill the current client + "${mod}+q" = "kill"; + + # kill frame with mouse click on titlebar + "button2" = ''--release kill''; + + # toggle tabbed + "${mod}+t" = "layout toggle tabbed split"; + + # cycle through all layouts + "${mod}+Shift+t" = "layout toggle all"; + + # rotate split + "${mod}+r" = "layout toggle split"; + + # fullscreen + "${mod}+f" = "fullscreen"; + + # toggle focus between tiling and floating layers + "${mod}+minus" = "focus mode_toggle"; + + # toggle tiling/floating of the current window + "${mod}+Shift+minus" = "floating toggle"; + + # Show scratchpad + "${mod}+equal" = "scratchpad show"; + + # Make the currently focused window a scratchpad + "${mod}+Shift+equal" = "${i3-scratchpad} move"; + + # Cycle through scratchpad (or all windows) + "${mod}+Tab" = "${i3-scratchpad} cycle"; + + # toggle sticky + "${mod}+Shift+s" = "sticky toggle"; # rename workspace "${mod}+w" = ''exec ${i3-workspace-name}''; + # marks + "${mod}+m" = "mark --toggle *"; + "${mod}+Shift+m" = "move window to mark *; unmark *"; + # notification center "${mod}+n" = '' exec test "$(${dunstctl} is-paused)" = false \ @@ -148,53 +181,13 @@ in && ${dunstctl} history-pop \ && ${pkill} -u ${user} -SIGRTMIN+0 i3status-rs ''; - "${mod}+Control+n" = ''exec ${dunstctl} action''; - "${mod}+Control+Shift+n" = ''exec ${dunstctl} context''; - "${mod}+${modAlt}+n" = ''exec ${dunstctl} set-paused toggle''; - - # start a new terminal - "${mod}+Return" = ''exec ${kitty} --single-instance''; - - # run dmenu run launcher - "${mod}+F2" = ''exec ${rofi} -show window''; - "${mod}+Tab" = ''exec ${rofi} -show window''; - - # run dmenu run launcher - "${mod}+F3" = ''exec ${rofi} -show run''; - "${mod}+r" = ''exec ${rofi} -show run''; - - # run dmenu ssh launcher - "${mod}+F4" = ''exec ${rofi} -show ssh -terminal "${kitty} --single-instance"''; - "${mod}+g" = ''exec ${rofi} -show ssh -terminal "${kitty} --single-instance"''; + "${mod}+${modAlt}+n" = ''exec ${dunstctl} action''; + "${mod}+${modAlt}+Shift+n" = ''exec ${dunstctl} context''; + "${mod}+Control+n" = ''exec ${dunstctl} set-paused toggle''; # clipboard management "${mod}+c" = ''exec CM_LAUNCHER=${rofi-clip} ${clipmenu}''; - # kill the current client - "${mod}+q" = "kill"; - - # quit i3 - "${mod}+Control+Shift+q" = "exit"; - - # reload i3 configuration - "${mod}+Shift+r" = "reload"; - - # reload i3 configuration - "${mod}+Control+r" = ''exec ${autorandr} --change --default home''; - - # restart i3 inplace - "${mod}+Control+Shift+r" = "restart"; - - # resize mode - "${mod}+s" = "mode \"resize\""; - - # passthrough mode - "${mod}+Escape" = "mode \"passthrough\""; - - # marks - "${mod}+Shift+m" = "move window to mark *; unmark *"; - "${mod}+m" = "mark --toggle *"; - # PulseAudio controls "XF86AudioRaiseVolume" = ''exec --no-startup-id ${dunst-osd} volume up''; "XF86AudioLowerVolume" = ''exec --no-startup-id ${dunst-osd} volume down''; @@ -205,16 +198,20 @@ in "XF86MonBrightnessDown" = ''exec --no-startup-id ${dunst-osd} brightness down''; # media - #"XF86AudioNext" = ''exec --no-startup-id ${mpc} next''; - #"XF86AudioPlay" = ''exec --no-startup-id ${mpc} toggle''; - #"XF86AudioPrev" = ''exec --no-startup-id ${mpc} prev''; "XF86Search" = ''exec ${browser}''; # screen capture - # DESIGN; trying out flameshot - #"${mod}+Control+s" = ''exec ${maim-select}''; - "${mod}+Control+s" = ''exec ${flameshot} gui''; + "${mod}+${modAlt}+s" = ''exec ${flameshot} gui''; - # kill frame with mouse click on titlebar - "button2" = ''--release kill''; + # reload i3 configuration + "${mod}+Shift+r" = "reload"; + + # reload i3 configuration via autorand + "${mod}+Control+r" = ''exec ${autorandr} --change --default home''; + + # restart i3 inplace + "${mod}+Control+Shift+r" = "restart"; + + # quit i3 + "${mod}+Control+Shift+q" = "exit"; } diff --git a/home/modules/base/gui/linux/xsession/windowManager/i3/modes.nix b/home/modules/base/gui/linux/xsession/windowManager/i3/modes.nix index 9afe42de..450466bc 100644 --- a/home/modules/base/gui/linux/xsession/windowManager/i3/modes.nix +++ b/home/modules/base/gui/linux/xsession/windowManager/i3/modes.nix @@ -15,10 +15,10 @@ let # DESIGN: Sometimes it's easier to keep the mod-key depressed. bindingsForDirection = key: dir: { - "${key}" = "resize grow ${dir} 1 px or 1 ppt"; - "${mod}+${key}" = "resize grow ${dir} 1 px or 1 ppt"; - "Shift+${key}" = "resize shrink ${dir} 1 px or 1 ppt"; - "${mod}+Shift+${key}" = "resize shrink ${dir} 1 px or 1 ppt"; + "${key}" = "resize grow ${dir} 5 px or 5 ppt"; + "${mod}+${key}" = "resize grow ${dir} 5 px or 5 ppt"; + "Shift+${key}" = "resize shrink ${dir} 5 px or 5 ppt"; + "${mod}+Shift+${key}" = "resize shrink ${dir} 5 px or 5 ppt"; }; directionBindings = @@ -35,7 +35,7 @@ in { "${mod}+Escape" = "mode \"default\""; "${mod}+Shift+Escape" = "mode \"default\""; - "${mod}+r" = "mode \"default\""; + "${mod}+s" = "mode \"default\""; "Escape" = "mode \"default\""; "Return" = "mode \"default\""; }; diff --git a/packages.nix b/packages.nix index 6c2eac23..0fb69af3 100644 --- a/packages.nix +++ b/packages.nix @@ -183,18 +183,18 @@ in { "cabal2nix" "cabal-install" "stack" - "haskell.compiler.ghc963" - "haskell.packages.ghc963.apply-refact" - # "haskell.packages.ghc963.djinn" # REVISIT: 2024-01-24: broken - "haskell.packages.ghc963.fast-tags" - "haskell.packages.ghc963.ghc-events" - "haskell.packages.ghc963.ghcid" - "haskell.packages.ghc963.haskdogs" - "haskell.packages.ghc963.hasktags" - "haskell.packages.ghc963.hoogle" - "haskell.packages.ghc963.hlint" - "haskell.packages.ghc963.hp2pretty" - "haskell.packages.ghc963.stylish-haskell" + "haskell.compiler.ghc964" + "haskell.packages.ghc964.apply-refact" + # "haskell.packages.ghc964.djinn" # REVISIT: 2024-02-04: broken + "haskell.packages.ghc964.fast-tags" + "haskell.packages.ghc964.ghc-events" + "haskell.packages.ghc964.ghcid" + "haskell.packages.ghc964.haskdogs" + "haskell.packages.ghc964.hasktags" + "haskell.packages.ghc964.hoogle" + "haskell.packages.ghc964.hlint" + "haskell.packages.ghc964.hp2pretty" + "haskell.packages.ghc964.stylish-haskell" ]; nixpkgs.prebuilt.programming.java = pickHome [ @@ -234,7 +234,7 @@ in { ]; nixpkgs.build.base.gui.darwin = np.pick { darwin = "home"; } [ - # REVISIT: Nixpkgs seems to have given up on Yabai and Skhd + # REVISIT: Waiting for Nixpkgs to have Mac SDK 14 #"yabai" #"skhd" ]; @@ -296,27 +296,27 @@ in { haskell-nix.prebuilt.programming.haskell = { # DESIGN: don't use enough to want to think about a cache miss - #nix-tools = hn.nixpkgs.haskell-nix.nix-tools.ghc963; + #nix-tools = hn.nixpkgs.haskell-nix.nix-tools.ghc964; }; haskell-nix.build.programming.haskell = when (! isDevBuild) ( {} # DESIGN: Nixpkgs-built binaries above are fine (maybe bloated) - #// (hn.fromHackage "ghc963" "apply-refact") - #// (hn.fromHackage "ghc963" "fast-tags") - #// (hn.fromHackage "ghc963" "ghc-events") - #// (hn.fromHackage "ghc963" "ghcid") - #// (hn.fromHackage "ghc963" "haskdogs") - #// (hn.fromHackage "ghc963" "hasktags") - #// (hn.fromHackage "ghc963" "hlint") - #// (hn.fromHackage "ghc963" "hoogle") - #// (hn.fromHackage "ghc963" "hp2pretty") - #// (hn.fromHackage "ghc963" "threadscope") - #// (hn.fromHackageCustomized "ghc963" "stylish-haskell" { configureArgs = "-f ghc-lib"; }) + #// (hn.fromHackage "ghc964" "apply-refact") + #// (hn.fromHackage "ghc964" "fast-tags") + #// (hn.fromHackage "ghc964" "ghc-events") + #// (hn.fromHackage "ghc964" "ghcid") + #// (hn.fromHackage "ghc964" "haskdogs") + #// (hn.fromHackage "ghc964" "hasktags") + #// (hn.fromHackage "ghc964" "hlint") + #// (hn.fromHackage "ghc964" "hoogle") + #// (hn.fromHackage "ghc964" "hp2pretty") + #// (hn.fromHackage "ghc964" "threadscope") + #// (hn.fromHackageCustomized "ghc964" "stylish-haskell" { configureArgs = "-f ghc-lib"; }) # REVISIT: marked broken in Nixpkgs, doesn't seem to build with # Haskell.nix either (need to look for a modern alternative exists) - #// (hn.fromHackage "ghc963" "ghc-events-analyze") + #// (hn.fromHackage "ghc964" "ghc-events-analyze") ); shajra.prebuilt = {};