Merge branch 'dev' into master

This commit is contained in:
Daniel Flanagan 2020-10-03 10:40:52 -05:00
commit 5cdebc9603
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
20 changed files with 403 additions and 41 deletions

View file

@ -1,5 +1,6 @@
MAKEFILE_PATH ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
all: install
default: install
install:

View file

@ -12,6 +12,7 @@ set $right l
set $term term
set $fterm floating-term
set $menu app-launcher
set $fileexplorer thunar
output * bg $HOME/.wallpaper fill
@ -29,8 +30,9 @@ bindsym $mod+t exec $term
bindsym $mod+Alt+Return exec urxvt
bindsym $mod+Shift+Alt+Return exec kitty
bindsym $mod+c kill
bindsym $mod+Shift+c kill # TODO: kill -9
bindsym $mod+Shift+c kill # TODO: kill -9?
bindsym $mod+Space exec $menu
bindsym $mod+e exec $fileexplorer
bindsym $mod+Shift+r reload
bindsym $mod+Control+Escape exit
bindsym $mod+Shift+e exit
@ -44,7 +46,6 @@ bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# TODO: this should nudge if floating?
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
@ -87,8 +88,6 @@ bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+b splith
bindsym $mod+v splitv
bindsym $mod+e layout toggle split
bindsym $mod+Shift+f fullscreen
bindsym $mod+f floating toggle
bindsym $mod+s floating disable
@ -159,6 +158,7 @@ client.focused #66d9ef #66d9ef #66d9ef #66d9ef #66d9ef
client.focused_inactive #111111 #111111 #ffffff #111111 #111111
client.unfocused #111111 #111111 #ffffff #111111 #111111
exec swayidle -w timeout 300 'swaylock -f -c 000000' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 000000'
exec mako
exec gammastep -t 6500:3500 -l 39.0:-94.5
exec_always makoctl reload
@ -166,5 +166,3 @@ exec_always notify-send -a "Sway" -i ~/.wallpaper "Sway configuration loaded."
include $ENV_PATH/sway/config.d/*
exec mako
exec libinput-gestures -c $DOTFILES_PATH/apps/de/libinput/sway-gestures.conf

View file

@ -43,9 +43,8 @@ window#waybar.empty {
color: #111111;
}
#workspaces button.empty {
#workspaces button.persistent {
color: #666666;
/* background-color: #111111; */
}
#workspaces button.urgent {

View file

@ -64,3 +64,5 @@
[include]
path = $ENV_PATH/gitconfig
[color]
ui = auto

172
apps/rofi/theme Normal file
View file

@ -0,0 +1,172 @@
/**
* rofi -dump-theme output.
* Rofi version: 1.6.0
**/
* {
red: rgba ( 220, 50, 47, 100 % );
selected-active-foreground: var(background);
lightfg: rgba ( 88, 104, 117, 100 % );
separatorcolor: var(foreground);
urgent-foreground: var(red);
alternate-urgent-background: var(lightbg);
lightbg: rgba ( 238, 232, 213, 100 % );
background-color: rgba ( 0, 0, 0, 0 % );
border-color: var(foreground);
normal-background: var(background);
selected-urgent-background: var(red);
alternate-active-background: var(lightbg);
spacing: 2;
blue: rgba ( 38, 139, 210, 100 % );
alternate-normal-foreground: var(foreground);
urgent-background: var(background);
selected-normal-foreground: var(lightbg);
active-foreground: var(blue);
background: rgba ( 253, 246, 227, 100 % );
selected-active-background: var(blue);
active-background: var(background);
selected-normal-background: var(lightfg);
alternate-normal-background: var(lightbg);
foreground: rgba ( 0, 43, 54, 100 % );
selected-urgent-foreground: var(background);
normal-foreground: var(foreground);
alternate-urgent-foreground: var(red);
alternate-active-foreground: var(blue);
}
element {
padding: 1px ;
spacing: 5px ;
border: 0;
}
element normal.normal {
background-color: var(normal-background);
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: var(alternate-normal-background);
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-text {
background-color: rgba ( 0, 0, 0, 0 % );
highlight: inherit;
text-color: inherit;
}
element-icon {
background-color: rgba ( 0, 0, 0, 0 % );
size: 1.2000ch ;
text-color: inherit;
}
window {
padding: 0;
background-color: var(background);
border: 0;
font: 'Iosevka Term';
}
mainbox {
padding: 0;
border: 0;
}
message {
padding: 1px ;
border-color: var(separatorcolor);
border: 0px ;
}
textbox {
text-color: var(foreground);
}
listview {
padding: 2px 0px 0px ;
scrollbar: false;
border-color: var(separatorcolor);
spacing: 5px ;
fixed-height: 0;
border: 0px ;
}
scrollbar {
width: 4px ;
padding: 0;
handle-width: 8px ;
border: 0;
handle-color: var(normal-foreground);
}
sidebar {
border-color: var(separatorcolor);
border: 2px dash 0px 0px ;
}
button {
spacing: 0;
text-color: var(normal-foreground);
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
num-filtered-rows {
expand: false;
text-color: rgba ( 128, 128, 128, 100 % );
}
num-rows {
expand: false;
text-color: rgba ( 128, 128, 128, 100 % );
}
textbox-num-sep {
expand: false;
str: "/";
text-color: rgba ( 128, 128, 128, 100 % );
}
inputbar {
padding: 1px ;
spacing: 0px ;
text-color: var(normal-foreground);
children: [ prompt,textbox-prompt-colon,entry,num-filtered-rows,textbox-num-sep,num-rows,case-indicator ];
}
case-indicator {
spacing: 0;
text-color: var(normal-foreground);
}
entry {
placeholder-color: rgba ( 128, 128, 128, 100 % );
spacing: 0;
placeholder: "Type to filter";
text-color: var(normal-foreground);
}
prompt {
spacing: 0;
text-color: var(normal-foreground);
}
textbox-prompt-colon {
margin: 0px 0.3000em 0.0000em 0.0000em ;
expand: false;
str: ":";
text-color: inherit;
}
mode-switcher {
border: 0px ;
}

View file

@ -20,6 +20,7 @@ function fish_user_key_bindings
bind -M insert \ce end-of-line
bind -M insert \ca beginning-of-line
bind -M insert \cw forward-word
bind -M insert \ct tmuxswitcher
bind -M insert \cv edit_command_buffer
bind -M default \cv edit_command_buffer

View file

@ -108,6 +108,11 @@ bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -T copy-mode-vi "y" send -X copy-selection
bind-key -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel -X 'clip'
# various control binds
bind-key n command-prompt -p "New Session:" "new-session -s '%1'"
bind-key K kill-pane
bind-key C-S-k kill-session -C
set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.config/tmux/plugins/"
# list of plugins

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
pacaur -Syyu --noconfirm --noedit
pacaur -Syu --noconfirm --noedit
# TODO: update kernel with a flag?
# yes | pacman -Syu && kexec -l --initrd=/boot/initramfs-linux.img /boot/vmlinuz-linux && kexec -e

View file

@ -1,16 +1,30 @@
#!/usr/bin/env bash
set -x
umask 077
d="$(date +"%Y-%m-%d_%H-%M-%S")"
fn="$SCROTS_PATH/clipshot_$d.png"
if is_wayland; then
grim -g "$(slurp -d)" - | wl-copy
dim="$(slurp -d)"
if [ $? -eq 0 ]; then
grim -g "$dim" - | wl-copy
wl-paste -n > "$fn"
echo "$fn"
# grim -g "$dim" - | tee "$fn" | wl-copy -f
else
exit 1
fi
else
pkill unclutter
sleep 0.1
fn="$SCROTS_PATH/clipshot_$(date +"%Y-%m-%d_%H-%M-%S").png"
import "$fn"
chmod 700 "$fn"
< "$fn" xclip -t image/png -i -selection clipboard
< "$fn" xclip -t image/png -i -selection primary
< "$fn" xclip -t image/png -i -selection secondary
< "$fn" xclip -t image/png -i -selection buffer-cut
unclutter &
echo "$fn"
fi
set -x

15
bin/fzf-history-weight Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
rf="$1" # history count record file
cf="$1" # all choices file
touch "$record"
app="$(
< "$rf" awk 'NF{NF--};1' | cat - "$cf" | \
sort | uniq -c | sort -nr | \
sd '^\s+' '' | \
cut -d' ' -f2- | \
fzf
)"
echo "$app $(date +%s)" >> "$LAUNCHER_HISTORY_FILE"
echo "$app"

View file

@ -6,7 +6,11 @@ FZFP_PASS_DIR="$HOME/.password-store"
FZFP_HEIGHT="${FZFP_HEIGHT:-40%}"
FZFP_PROMPT="${FZFP_PROMPT:-"$FZFP_PASS_CMD@$FZFP_PASS_DIR> "}"
FZFP_PASS_OPTS="${FZFP_PASS_OPTS:-}"
cd "$FZFP_PASS_DIR" || { echo "Could not cd to $FZFP_PASS_DIR" >&2; exit 1; }
pp="$(fd gpg | sd ".gpg" "" | fzf --height "$FZFP_HEIGHT" --prompt "$FZFP_PROMPT")"
"${FZFP_PASS_CMD}" $FZFP_PASS_OPTS "$@" "$pp"
# TODO: weighted history (see ./launch)
"${FZFP_PASS_CMD}" $FZFP_PASS_OPTS "$@" \
"$(fd gpg | sd ".gpg" "" | fzf --height "$FZFP_HEIGHT" --prompt "$FZFP_PROMPT")"
cd - >/dev/null || return 1

View file

@ -1,15 +1,3 @@
#!/usr/bin/env sh
# TODO: can we use fzfp here?
floating-term \
bash -c "
cd $HOME/.password-store
fd gpg |
sd '.gpg\$' '' |
fzf --height 100% --prompt 'fzf-pass> ' > /tmp/fzfp-key
pass \"\$(cat /tmp/fzfp-key)\" |
head -n 1 |
sd '\s+\$' '' |
nohup clip &>/dev/null &
notify-send -a 'pass' 'Password in Clipboard'
"
env WAYLAND_DEBUG=1 FZFP_HEIGHT="100%" floating-term bash -c "fzfp | head -n 1 | wl-copy &"

12
bin/pass-otp Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# TODO: check for pass
key="$1"; shift
args=("$@")
otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp.*: ?.*$' | cut -d ':' -f 2 | sed 's/ //g')"
otp_status="$?"
[[ $otp_status != 0 ]] && { echo "pass command failed with exit code $otp_status"; exit 1; }
[[ -z $otp ]] && { echo "No OTP secret found for pass entry '$key'"; exit 2; }
simple-otp "$otp"

View file

@ -1,9 +1,19 @@
#!/usr/bin/env bash
f="${HOME}/.scrup.png"
set -x
pkill unclutter
sleep 0.1
import "${f}"
upload "${f}" "scrup-$(date +%Y-%m-%d_%H-%M-%S).png" "scrots"
unclutter &
remote_dir="scrots"
url_prefix="https://files.lyte.dev/$remote_dir"
u="$(uuid -v4)"
d="$(date +%Y-%m-%d_%H-%M-%S)"
fn="$(clipshot)"
if [ $? -eq 0 ]; then
echo "Scrot captured. Uploading..."
upload "${fn}" "scrup-$u-$d.png" "$remote_dir"
echo "$url_prefix/scrup-$u-$d.png" | clip
notify-send "Scrot uploaded. URL in clipboard."
else
exit 1
fi

8
bin/simple-otp Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# TODO: check for oathtool
key="$1"; shift
args=("$@")
oathtool --totp=sha1 -b "$key" "${args[@]}"

View file

@ -2,13 +2,13 @@
# TODO: progress bar!
HOST="ld"
HOST="faceless"
f="${1}"
fname="${2:-$(basename "${f}")}"
subdir="${3:-uploads}"
internal_dir="/home/daniel/services/data/files/${subdir}"
url="https://lyte.dev/${subdir}/${fname}"
internal_dir="/home/daniel/files/${subdir}"
url="https://files.lyte.dev/${subdir}/${fname}"
[ "${f}" = "" ] && echo "No file provided. Exiting." >&2 && exit 2
[ ! -f "${f}" ] && echo "File '$f' does not exist. Exiting." >&2 && exit 1
@ -18,11 +18,9 @@ if [ "$(curl -s -o /dev/null -w "%{http_code}" "${url}")" -eq 200 ]; then
exit 3
fi
ssh ld mkdir -p "${internal_dir}"
rsync --progress --no-owner --no-group --no-perms --stats --ignore-existing "${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log"
ssh "$HOST" mkdir -p "${internal_dir}"
rsync --progress --no-owner --no-group --chmod=644 --ignore-existing "${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log"
code="$?"
# shellcheck disable=SC2029
ssh ld chmod a+r "${internal_dir}/${fname}"
echo "Uploaded to: ${url}"
if [ "$code" -ne 0 ]; then

28
bofa.json Normal file
View file

@ -0,0 +1,28 @@
{
"date": "d/m/Y",
"default_account": 1,
"delimiter": "comma",
"headers": true,
"ignore_duplicate_lines": true,
"ignore_duplicate_transactions": true,
"rules": true,
"skip_form": false,
"specifics": [
"AppendHash"
],
"roles": [
"date_transaction",
"description",
"amount",
],
"do_mapping": [true, true ,true],
"mapping": {
"3": {
"Savings Account": 3
},
"4": {
"Savings Account": 3
}
},
"version": 2
}

105
env/desktop/nix/base.nix vendored Normal file
View file

@ -0,0 +1,105 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
# TODO: fork?
(import "${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos")
];
home-manager.users.daniel = {
}
# TODO: bootloader will vary by device
boot = {
supportedFilesystems = [ "exfat" ];
loader = {
grub = {
enable = true;
version = 2;
device = "/dev/sda";
};
};
};
networking = {
hostName = "nether";
useDHCP = true;
firewall = {
allowedTCPPorts = [ 22 80 443 7770 ];
allowedUDPPorts = [ 53 57 63 67 7770 ];
# enable = false;
};
};
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
time.timeZone = "America/Chicago";
environment = {
systemPackages = with pkgs; [
wget lsof vim git curl fish fzf neovim
];
variables.EDITOR = "nvim";
};
services = {
openssh.enable = true;
xserver = {
enable = true;
layout = "us";
libinput.enable = true;
desktopManager.plasma5.enable = true;
};
};
fonts = {
enableFontDir = true;
enableGhostscriptFonts = true;
fontconfig = {
enable = true;
antialias = true;
useEmbeddedBitmaps = true;
defaultFonts = {
serif = [ "Iosevka Type" ];
sansSerif = [ "Iosevka Type" ];
monospace = [ "Iosevka Type" ];
};
};
fonts = with pkgs; [
iosevka
nerdfonts
];
};
sound.enable = true;
hardware.pulseaudio.enable = true;
users.extraUsers.daniel = {
isNormalUser = true;
group = "users";
extraGroups = [ "wheel" ];
home = "/home/daniel/.home";
shell = pkgs.fish;
createHome = true;
uid = 1000;
};
nixpkgs.config = {
allowUnfree = true;
};
system.stateVersion = "20.03";
}

View file

@ -14,3 +14,5 @@ input type:touchpad {
input type:keyboard {
xkb_options ctrl:nocaps
}
exec libinput-gestures -c $DOTFILES_PATH/apps/de/libinput/sway-gestures.conf

View file

@ -61,5 +61,5 @@ cd '~/.config/dotfiles' && ./setup.bash # follow the instructions!
[upstream]: https://git.faceless.lytedev.io/lytedev/dotfiles
[github]: https://github.com/lytedev/dotfiles
[desktop-screenshot]: https://lyte.dev/unix/desktop-screenshot.png
[desktop-screenshot]: https://files.lyte.dev/unix/desktop-screenshot.png
[1]: https://smallstep.com/blog/ssh-tricks-and-tips/