Compare commits
5 Commits
edac0da023
...
6713599065
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6713599065 | ||
|
|
ac857e73d1 | ||
|
|
c48e7e3165 | ||
|
|
bcf2d6355f | ||
|
|
9fd1171c2c |
@ -35,9 +35,11 @@ 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,7 +10,6 @@ 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)
|
||||||
@ -19,7 +18,6 @@ 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)
|
||||||
@ -45,31 +43,17 @@ function wm:_nextStep(dim, offs, cb)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function wm:_nextFullScreenStep()
|
function wm:_fullscreen()
|
||||||
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)
|
||||||
|
|
||||||
local nextSize = self.fullScreenSizes[1]
|
cell.x = 0
|
||||||
for i = 1, #self.fullScreenSizes do
|
cell.y = 0
|
||||||
if
|
cell.w = self.GRID.w
|
||||||
cell.w == self.GRID.w * self.fullScreenSizes[i]
|
cell.h = self.GRID.h
|
||||||
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
|
||||||
@ -163,7 +147,7 @@ function wm:init()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
hs.hotkey.bind(hyper, "m", function()
|
hs.hotkey.bind(hyper, "m", function()
|
||||||
self:_nextFullScreenStep()
|
self:_fullscreen()
|
||||||
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+alt+j=goto_split:top
|
keybind = super+ctrl+j=goto_split:top
|
||||||
keybind = super+alt+k=goto_split:bottom
|
keybind = super+ctrl+k=goto_split:bottom
|
||||||
keybind = super+alt+h=goto_split:left
|
keybind = super+ctrl+h=goto_split:left
|
||||||
keybind = super+alt+l=goto_split:right
|
keybind = super+ctrl+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,6 +128,7 @@ in
|
|||||||
ui = {
|
ui = {
|
||||||
logoless = true;
|
logoless = true;
|
||||||
headless = true;
|
headless = true;
|
||||||
|
skin = "darkerbg";
|
||||||
};
|
};
|
||||||
logger = {
|
logger = {
|
||||||
tail = 1000;
|
tail = 1000;
|
||||||
@ -137,6 +138,33 @@ 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,26 +1,12 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
git-nix-clone = ''
|
nix-prepare = ''
|
||||||
# Input is a git repository such as git@github.com:group/project-name.git
|
|
||||||
run() {
|
run() {
|
||||||
local repo="$1"
|
local dir
|
||||||
local projectName=$(echo "$repo" | sed 's/.*\///' | sed 's/\.git//')
|
echo "Preparing nix environment in $dir"
|
||||||
|
|
||||||
if [ "$repo" = "" ]; then
|
mkdir -p $dir
|
||||||
echo "Usage: git-nix-clone <repo>"
|
cd $dir
|
||||||
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
|
||||||
|
|
||||||
@ -41,8 +27,25 @@ let
|
|||||||
|
|
||||||
git add flake.lock
|
git add flake.lock
|
||||||
git commit -m "Lock flakes"
|
git commit -m "Lock flakes"
|
||||||
|
}
|
||||||
|
|
||||||
git clone "$repo"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
run "$@"
|
run "$@"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user