Compare commits

..

No commits in common. "67135990652ad8d5905e273d7351081ec8b1de7b" and "edac0da023a66419755fab55f8f522d24ace5212" have entirely different histories.

4 changed files with 47 additions and 64 deletions

View File

@ -35,11 +35,9 @@ in
{
cat = lib.mkDefault "bat --paging=never";
nixfix = lib.mkDefault "nix fmt ./**/*.nix";
# use eval $(aws-export-credentials) to expose them to environment
aws-export-credentials = lib.mkDefault "aws configure export-credentials --format env --profile";
# use curl-aws --aws-sigv4 "aws:amz:region:service"
curl-aws = lib.mkDefault "curl -H \"X-Amz-Security-Token: $AWS_SESSION_TOKEN\" --user \"$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY\"";
git-sync-remote = lib.mkDefault "git remote update origin --prune";
}
// (
if isDarwin then

View File

@ -10,6 +10,7 @@ end)
local wm = {
sizes = { 1 / 2, 2 / 3, 1 / 3 },
fullScreenSizes = { 1, 3 / 4, 1 / 2 },
}
function wm:_nextStep(dim, offs, cb)
@ -18,6 +19,7 @@ function wm:_nextStep(dim, offs, cb)
local oppDim = dim == "w" and "h" or "w"
local oppAxis = dim == "w" and "y" or "x"
local win = hs.window.frontmostWindow()
local id = win:id()
local screen = win:screen()
local cell = hs.grid.get(win, screen)
@ -43,17 +45,31 @@ function wm:_nextStep(dim, offs, cb)
end
end
function wm:_fullscreen()
function wm:_nextFullScreenStep()
if hs.window.focusedWindow() then
local win = hs.window.frontmostWindow()
local id = win:id()
local screen = win:screen()
local cell = hs.grid.get(win, screen)
cell.x = 0
cell.y = 0
cell.w = self.GRID.w
cell.h = self.GRID.h
local nextSize = self.fullScreenSizes[1]
for i = 1, #self.fullScreenSizes do
if
cell.w == self.GRID.w * self.fullScreenSizes[i]
and cell.h == self.GRID.h * self.fullScreenSizes[i]
and cell.x == (self.GRID.w - self.GRID.w * self.fullScreenSizes[i]) / 2
and cell.y == (self.GRID.h - self.GRID.h * self.fullScreenSizes[i]) / 2
then
nextSize = self.fullScreenSizes[(i % #self.fullScreenSizes) + 1]
break
end
end
cell.w = self.GRID.w * nextSize
cell.h = self.GRID.h * nextSize
cell.x = (self.GRID.w - self.GRID.w * nextSize) / 2
cell.y = (self.GRID.h - self.GRID.h * nextSize) / 2
hs.grid.set(win, cell, screen)
end
@ -147,8 +163,8 @@ function wm:init()
end)
hs.hotkey.bind(hyper, "m", function()
self:_fullscreen()
end)
self:_nextFullScreenStep()
end)
end
wm:init()

View File

@ -65,10 +65,10 @@ in
keybind = super+k=new_split:down
keybind = super+l=new_split:right
keybind = super+ctrl+j=goto_split:top
keybind = super+ctrl+k=goto_split:bottom
keybind = super+ctrl+h=goto_split:left
keybind = super+ctrl+l=goto_split:right
keybind = super+alt+j=goto_split:top
keybind = super+alt+k=goto_split:bottom
keybind = super+alt+h=goto_split:left
keybind = super+alt+l=goto_split:right
keybind = super+shift+j=resize_split:up,10
keybind = super+shift+k=resize_split:down,10
@ -128,7 +128,6 @@ in
ui = {
logoless = true;
headless = true;
skin = "darkerbg";
};
logger = {
tail = 1000;
@ -138,33 +137,6 @@ in
};
};
};
skins = {
darkerbg = {
k9s = {
body = {
bgColor = "#333";
};
frame = {
title = {
bgColor = "#333";
};
};
views = {
table = {
bgColor = "#333";
header = {
bgColor = "#333";
};
};
logs = {
bgColor = "#333";
};
};
};
};
};
};
programs.lsd = {

View File

@ -1,12 +1,26 @@
{ lib, pkgs, ... }:
let
nix-prepare = ''
git-nix-clone = ''
# Input is a git repository such as git@github.com:group/project-name.git
run() {
local dir
echo "Preparing nix environment in $dir"
local repo="$1"
local projectName=$(echo "$repo" | sed 's/.*\///' | sed 's/\.git//')
mkdir -p $dir
cd $dir
if [ "$repo" = "" ]; then
echo "Usage: git-nix-clone <repo>"
exit 1
fi
echo "Clone $repo into ''${projectName}-nix/''${projectName}?"
read -p "continue?" answer
if [ "$answer" != "" ]; then
echo "Aborting"
exit 1
fi
mkdir -p "$projectName"-nix
cd "$projectName"-nix
git init
@ -27,25 +41,8 @@ let
git add flake.lock
git commit -m "Lock flakes"
}
run "$@"
'';
git-nix-clone = ''
# Input is a git repository such as git@github.com:group/project-name.git
run() {
local repo="$1"
local projectName=$(echo "$repo" | sed 's/.*\///' | sed 's/\.git//')
if [ "$repo" = "" ]; then
echo "Usage: git-nix-clone <repo>"
exit 1
fi
nix-prepare "$projectName"-nix
git clone "$repo" "$projectName"-nix"/$projectName"
git clone "$repo"
}
run "$@"