Skip to content
Permalink
Browse files

skroll, commit some functions

  • Loading branch information
neeasade committed Mar 15, 2020
1 parent e2535e4 commit ed23b48fafae08ad73fa9a8955ad10df49eaf478
Showing with 39 additions and 18 deletions.
  1. +9 −0 nixos/expr/default.nix
  2. +2 −0 nixos/packages.nix
  3. +28 −18 shell/.sh.d/functions
@@ -11,6 +11,13 @@
src = builtins.fetchGit {url = "https://www.uninformativ.de/git/bevelbar.git"; ref = "master"; };
}));

skroll = stdenv.mkDerivation rec {
name = "skroll";

src = builtins.fetchGit {url = "https://github.com/z3bra/skroll"; ref = "master"; };
nativeBuildInputs = [ gcc ];
installPhase = "make install PREFIX=$out";
};

drawterm = stdenv.mkDerivation rec {
name = "drawterm";
@@ -70,6 +77,8 @@
src = builtins.fetchGit {url = "https://github.com/baskerville/bspwm"; ref = "master"; };
}));



pfetch-neeasade = (edge.pfetch.overrideAttrs(old: {
src = builtins.fetchGit {url = "https://github.com/neeasade/pfetch"; ref = "neeasade"; };
}));
@@ -168,6 +168,8 @@ let
]) ++ ( with expr; [
# qutebrowser-git

skroll

pfetch-neeasade
colort-git

@@ -27,20 +27,23 @@ bspwm_kill_visual() {
done
}

# todo: finish record functions
recordfull() {
echo nop
}

record() {
read -r X Y W H G ID < <(slop -f '%x %y %w %h %g %i')
byzanz-record -x $X -y $Y -w $W -h $H
# screenkey -s small -t 0.5
}

pfetch() {
export PF_SEP=""
export PF_ASCII="linux"
export PF_ASCII="GNU"
# title os kernel host uptime pkgs memory wm de shell editor palette
export PF_SYNC=t
stoprecord() {
# todo: pkill everything record

export PF_INFO="ascii n n title theme editor shell wm playlist"
# todo: use github.com/neeasade/pfetch neeasade branch
# this function is just for reference
EDITOR='𝓮𝓶𝓪𝓬𝓼' SHELL='M-x shell' ~/git/og/pfetch
pkill byzanz-record

# rm -rf "$path_ext"
echo nop
}

blog_add_post() {
@@ -123,7 +126,9 @@ shot() {
}

shellshot() {
eval printf "$(elisp '(ns/windowshot)' | sed 's/%/%%/g')" | pb 0x0
# todo: esc $
# printf '%s\n' "$(elisp '(ns/windowshot)')" | curl -F "file=@-" https://0x0.st
printf '%s\n' "$(elisp '(ns/windowshot)')" | pb 0x0
}

fullshot() {
@@ -212,9 +217,13 @@ groot() {
# nix query
nq() {
local CACHE="$HOME/.cache/nq-cache"

if ! ( [ -e $CACHE ] && [ $(stat -c %Y $CACHE) -gt $(( $(date +%s) - 3600 )) ] ); then
echo "update cache" && nix-env -qa --json > "$CACHE"
# if true; then
echo "update cache"
nix-env -qa --json > "$CACHE"
fi

jq -r 'to_entries | .[] | .key + "|" + .value.meta.description' < "$CACHE" |
{
if [ $# -gt 0 ]; then
@@ -338,9 +347,9 @@ jtemp() {
selected=$(
for context in ${working_dir}/*/context.txt; do
desc=$(cat $context)
echo "$desc | $context"
done | fzf
)
# do not add a space after the pipe!
echo "$desc |$context"
done | fzf)

cd "$(dirname "$(echo "$selected" | awk -F\| '{print $2}')")"
}
@@ -359,16 +368,17 @@ ttemp() {
# dump the structure of some json to find paths
jqpeek() {
# paths:
# cat - | jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]'
# jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]'

# paths with values:
# note: numbers in path are array indices
# may get in the way of searching for like a number
cat - | jq -r '
jq -r '
paths(scalars) as $p
| [ ( [ $p[] | tostring ] | join(".") )
, ( getpath($p) | tojson )
]
| join(" = ")
'
}

0 comments on commit ed23b48

Please sign in to comment.
You can’t perform that action at this time.