mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-01-30 22:57:54 +00:00
Update personal scripts
This commit is contained in:
parent
861bc01ac0
commit
5a429485ad
@ -9,6 +9,8 @@
|
|||||||
# ```
|
# ```
|
||||||
# will open a search result page on Google and Arch Wiki
|
# will open a search result page on Google and Arch Wiki
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# - Make the config compatible to bangs database from Duckduckgo.
|
||||||
proc usage() {
|
proc usage() {
|
||||||
cat <<HELP
|
cat <<HELP
|
||||||
bangs - a ripoff from Duckduckgo bangs, except
|
bangs - a ripoff from Duckduckgo bangs, except
|
||||||
@ -102,13 +104,13 @@ if (len(ARGV) == 0) {
|
|||||||
|
|
||||||
for i in @ARGV {
|
for i in @ARGV {
|
||||||
write -- $i | rg --quiet $bangs_format || {
|
write -- $i | rg --quiet $bangs_format || {
|
||||||
push :search_query $i
|
append :search_query $i
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
var bang = $(write -- $i | sed --regexp-extended --expression "s/^${bangs_prefix}//")
|
var bang = $(write -- $i | sed --regexp-extended --expression "s/^${bangs_prefix}//")
|
||||||
if (bang in bangs) {
|
if (bang in bangs) {
|
||||||
push :valid_bangs $bang
|
append :valid_bangs $bang
|
||||||
warnf "%s will be used to search." $bang
|
warnf "%s will be used to search." $bang
|
||||||
} else {
|
} else {
|
||||||
warnf "%s is not found in the database." $bang
|
warnf "%s is not found in the database." $bang
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env nix-shell
|
||||||
|
#! nix-shell --pure -i bash -p mktemp wget gnused gawk rofi xclip libnotify
|
||||||
|
|
||||||
# Simply create a universal emoji selection list.
|
# Simply create a universal emoji selection list.
|
||||||
# The emoji list should be the following file:
|
# The emoji list should be the following file:
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env oil
|
#!/usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i oil -p coreutils sqlite unzip ripgrep jq file
|
||||||
|
|
||||||
# Convert a Newpipe database (assuming it was exported within the app) into OPML v2.
|
# Convert a Newpipe database (assuming it was exported within the app) into OPML v2.
|
||||||
|
|
||||||
# Dependencies:
|
# Dependencies:
|
||||||
# * osh (oil shell) v0.8.5
|
# * osh (oil shell) v0.8.12
|
||||||
# * sqlite3 v3.34.0
|
# * sqlite3 v3.34.0
|
||||||
# * unzip
|
# * unzip
|
||||||
# * ripgrep v12.1.1
|
# * ripgrep v12.1.1
|
||||||
@ -26,7 +27,7 @@ var NEWPIPE_DB_QUERY = "SELECT name, url, service_id, group_concat(tag, ',') AS
|
|||||||
FROM subscriptions
|
FROM subscriptions
|
||||||
LEFT JOIN feed_group_subscription_join AS subs_join
|
LEFT JOIN feed_group_subscription_join AS subs_join
|
||||||
LEFT JOIN feed_group
|
LEFT JOIN feed_group
|
||||||
ON subs_join.subscription_id = subscriptions.uid AND feed_group.uid = subs_join.group_id) GROUP BY name"
|
ON subs_join.subscription_id = subscriptions.uid AND feed_group.uid = subs_join.group_id) GROUP BY name ORDER BY name COLLATE NOCASE;"
|
||||||
|
|
||||||
# Print the beginning of the template.
|
# Print the beginning of the template.
|
||||||
cat <<OPML
|
cat <<OPML
|
||||||
|
@ -164,7 +164,7 @@ proc prompt(msg, :out, prefix = ">> ") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc kebab-case(word) {
|
proc kebab-case(word) {
|
||||||
write -- $word | sed --regexp-extended --expression 's/./\L&/g' --expression 's/\s+/-/g' --expression 's/[^.a-z0-9-]//g' --expression 's/^-+|-+$//g' --expression 's/-+/-/g'
|
write -- $word | sed --regexp-extended --expression 's/./\L&/g' --expression 's/\s+/-/g' --expression 's/[^a-z0-9-]//g' --expression 's/^-+|-+$//g' --expression 's/-+/-/g'
|
||||||
}
|
}
|
||||||
|
|
||||||
test -f $audio_file || errorf '%s is not a regular file' $audio_file
|
test -f $audio_file || errorf '%s is not a regular file' $audio_file
|
||||||
@ -236,7 +236,7 @@ for index in @(seq $[chapter_len]) {
|
|||||||
setvar has_error = true
|
setvar has_error = true
|
||||||
}
|
}
|
||||||
|
|
||||||
push :job_queue ">&2 printf '[%d/%d] %s\\n' $[index] $[chapter_len] \"$[output_data['chapters'][index - 1]['title']]\" && ffmpeg -loglevel quiet -nostdin -i '${audio_file}' -ss ${start} $['-to ' + end if index != chapter_len else ''] ${title_slug}/${filename}"
|
append :job_queue ">&2 printf '[%d/%d] %s\\n' $[index] $[chapter_len] \"$[output_data['chapters'][index - 1]['title']]\"; ffmpeg -loglevel quiet -nostdin -i '${audio_file}' -ss ${start} $['-to ' + end if index != chapter_len else ''] ${title_slug}/${filename}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (has_error) { exit 1 }
|
if (has_error) { exit 1 }
|
||||||
|
Loading…
Reference in New Issue
Block a user