Compare commits
No commits in common. "67135990652ad8d5905e273d7351081ec8b1de7b" and "edac0da023a66419755fab55f8f522d24ace5212" have entirely different histories.
6713599065
...
edac0da023
@ -35,11 +35,9 @@ in
|
|||||||
{
|
{
|
||||||
cat = lib.mkDefault "bat --paging=never";
|
cat = lib.mkDefault "bat --paging=never";
|
||||||
nixfix = lib.mkDefault "nix fmt ./**/*.nix";
|
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";
|
aws-export-credentials = lib.mkDefault "aws configure export-credentials --format env --profile";
|
||||||
# use curl-aws --aws-sigv4 "aws:amz:region:service"
|
# 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\"";
|
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
|
if isDarwin then
|
||||||
|
|||||||
@ -10,6 +10,7 @@ end)
|
|||||||
|
|
||||||
local wm = {
|
local wm = {
|
||||||
sizes = { 1 / 2, 2 / 3, 1 / 3 },
|
sizes = { 1 / 2, 2 / 3, 1 / 3 },
|
||||||
|
fullScreenSizes = { 1, 3 / 4, 1 / 2 },
|
||||||
}
|
}
|
||||||
|
|
||||||
function wm:_nextStep(dim, offs, cb)
|
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 oppDim = dim == "w" and "h" or "w"
|
||||||
local oppAxis = dim == "w" and "y" or "x"
|
local oppAxis = dim == "w" and "y" or "x"
|
||||||
local win = hs.window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
|
local id = win:id()
|
||||||
local screen = win:screen()
|
local screen = win:screen()
|
||||||
|
|
||||||
local cell = hs.grid.get(win, screen)
|
local cell = hs.grid.get(win, screen)
|
||||||
@ -43,17 +45,31 @@ function wm:_nextStep(dim, offs, cb)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:_fullscreen()
|
function wm:_nextFullScreenStep()
|
||||||
if hs.window.focusedWindow() then
|
if hs.window.focusedWindow() then
|
||||||
local win = hs.window.frontmostWindow()
|
local win = hs.window.frontmostWindow()
|
||||||
|
local id = win:id()
|
||||||
local screen = win:screen()
|
local screen = win:screen()
|
||||||
|
|
||||||
local cell = hs.grid.get(win, screen)
|
local cell = hs.grid.get(win, screen)
|
||||||
|
|
||||||
cell.x = 0
|
local nextSize = self.fullScreenSizes[1]
|
||||||
cell.y = 0
|
for i = 1, #self.fullScreenSizes do
|
||||||
cell.w = self.GRID.w
|
if
|
||||||
cell.h = self.GRID.h
|
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)
|
hs.grid.set(win, cell, screen)
|
||||||
end
|
end
|
||||||
@ -147,7 +163,7 @@ function wm:init()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
hs.hotkey.bind(hyper, "m", function()
|
hs.hotkey.bind(hyper, "m", function()
|
||||||
self:_fullscreen()
|
self:_nextFullScreenStep()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -65,10 +65,10 @@ in
|
|||||||
keybind = super+k=new_split:down
|
keybind = super+k=new_split:down
|
||||||
keybind = super+l=new_split:right
|
keybind = super+l=new_split:right
|
||||||
|
|
||||||
keybind = super+ctrl+j=goto_split:top
|
keybind = super+alt+j=goto_split:top
|
||||||
keybind = super+ctrl+k=goto_split:bottom
|
keybind = super+alt+k=goto_split:bottom
|
||||||
keybind = super+ctrl+h=goto_split:left
|
keybind = super+alt+h=goto_split:left
|
||||||
keybind = super+ctrl+l=goto_split:right
|
keybind = super+alt+l=goto_split:right
|
||||||
|
|
||||||
keybind = super+shift+j=resize_split:up,10
|
keybind = super+shift+j=resize_split:up,10
|
||||||
keybind = super+shift+k=resize_split:down,10
|
keybind = super+shift+k=resize_split:down,10
|
||||||
@ -128,7 +128,6 @@ in
|
|||||||
ui = {
|
ui = {
|
||||||
logoless = true;
|
logoless = true;
|
||||||
headless = true;
|
headless = true;
|
||||||
skin = "darkerbg";
|
|
||||||
};
|
};
|
||||||
logger = {
|
logger = {
|
||||||
tail = 1000;
|
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 = {
|
programs.lsd = {
|
||||||
|
|||||||
@ -1,12 +1,26 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
nix-prepare = ''
|
git-nix-clone = ''
|
||||||
|
# Input is a git repository such as git@github.com:group/project-name.git
|
||||||
run() {
|
run() {
|
||||||
local dir
|
local repo="$1"
|
||||||
echo "Preparing nix environment in $dir"
|
local projectName=$(echo "$repo" | sed 's/.*\///' | sed 's/\.git//')
|
||||||
|
|
||||||
mkdir -p $dir
|
if [ "$repo" = "" ]; then
|
||||||
cd $dir
|
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
|
git init
|
||||||
|
|
||||||
@ -27,25 +41,8 @@ let
|
|||||||
|
|
||||||
git add flake.lock
|
git add flake.lock
|
||||||
git commit -m "Lock flakes"
|
git commit -m "Lock flakes"
|
||||||
}
|
|
||||||
|
|
||||||
run "$@"
|
git clone "$repo"
|
||||||
'';
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run "$@"
|
run "$@"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user