mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-11-05 23:26:23 +01:00
get searchwolf running
This commit is contained in:
parent
ceccab3cb9
commit
6069dd0b2b
|
@ -1,2 +1,2 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
pkgs.writeShellScriptBin "searchwolf" builtins.readFile ./searchwolf.sh
|
pkgs.writeShellScriptBin "searchwolf" (builtins.readFile ./searchwolf.sh)
|
||||||
|
|
23
scripts/desktop/searchwolf.sh
Normal file → Executable file
23
scripts/desktop/searchwolf.sh
Normal file → Executable file
|
@ -1,20 +1,17 @@
|
||||||
|
if [ x"$@" = x"exit" ]; then
|
||||||
echo "retv $ROFI_RETV"
|
|
||||||
if [ x"$@" = x"exit" ]; then
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $ROFI_RETV in
|
case $ROFI_RETV in
|
||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
if [ $ROFI_DATA = x"" ]; then
|
val=${@%%.*}
|
||||||
exit 0
|
res=$(echo $ROFI_DATA | jq -r ".[$val]" )
|
||||||
fi
|
coproc ( librewolf --new-tab $res > /dev/null 2>&1 )
|
||||||
coproc ( librewolf --new-tab "$(echo $ROFI_DATA | jq -r.[${@%%.*}])" > /dev/null 2>&1 )
|
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
ddgrout=$(ddgr --json --num=25 "$@")
|
ddgrout=$(ddgr --json --num=25 "$@")
|
||||||
|
|
||||||
for i in $(echo $ddgrout | jq -r 'keys | @sh'); do
|
for i in $(echo $ddgrout | jq -r 'keys | @sh'); do
|
||||||
|
@ -25,4 +22,4 @@
|
||||||
|
|
||||||
echo -e "\0data\x1f$(echo $ddgrout | jq -r .[].url | jq -sRc '. | split("\n") | [ .[] | select(length > 0) ]')"
|
echo -e "\0data\x1f$(echo $ddgrout | jq -r .[].url | jq -sRc '. | split("\n") | [ .[] | select(length > 0) ]')"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue