diff options
-rw-r--r-- | bin/extra/keyboards.txt | 2 | ||||
-rwxr-xr-x | bin/extra/magnet2torrent | 27 | ||||
-rwxr-xr-x | bin/extra/p.sh | 682 | ||||
-rwxr-xr-x | bin/extra/snpdf | 2 | ||||
-rwxr-xr-x | bin/extra/ssimg | 4 | ||||
-rwxr-xr-x | bin/extra/steamidtoname | 8 | ||||
-rwxr-xr-x | bin/extra/swapclip | 8 | ||||
-rwxr-xr-x | bin/extra/timezone | 3 | ||||
-rwxr-xr-x | bin/extra/transfer.sh | 24 | ||||
-rwxr-xr-x | bin/menuscripts/mhelp | 4 | ||||
-rwxr-xr-x | config/common/tmux/tmux.conf | 1 |
11 files changed, 762 insertions, 3 deletions
diff --git a/bin/extra/keyboards.txt b/bin/extra/keyboards.txt index 03ec74b..62e77de 100644 --- a/bin/extra/keyboards.txt +++ b/bin/extra/keyboards.txt @@ -1,2 +1,2 @@ -be us +us -option ctrl:swapcaps -variant colemak diff --git a/bin/extra/magnet2torrent b/bin/extra/magnet2torrent new file mode 100755 index 0000000..0a1f83e --- /dev/null +++ b/bin/extra/magnet2torrent @@ -0,0 +1,27 @@ +#!/bin/sh + +################################# +# # +# Bash script to convert a # +# magnet link to a torrent file # +# # +# StrickStuff.com # +# # +################################# + + +# Check that the user entered a valid magnet link +if [ "$#" -ne 1 ] || [ "${1##*magnet*}" ] +then + echo "Usage: $0 " + exit 1 +fi + +# Extract the info hash from the magnet link +hash="${1##*btih:}" +hash="${hash%%&*}" + +# Download the torrent file from a torrent website +torrent_file="${hash}.torrent" +wget "https://itorrents.org/torrent/${hash}.torrent" -O "$torrent_file" +echo "Torrent file written to ${torrent_file}" diff --git a/bin/extra/p.sh b/bin/extra/p.sh new file mode 100755 index 0000000..98f8ede --- /dev/null +++ b/bin/extra/p.sh @@ -0,0 +1,682 @@ +#!/bin/sh + +list_pokemon() +{ + cat <<EOF +Bulbasaur +Ivysaur +Venusaur +Charmander +Charmeleon +Charizard +Squirtle +Wartortle +Blastoise +Caterpie +Metapod +Butterfree +Weedle +Kakuna +Beedrill +Pidgey +Pidgeotto +Pidgeot +Rattata +Raticate +Spearow +Fearow +Ekans +Arbok +Pikachu +Raichu +Sandshrew +Sandslash +Nidoran♀ +Nidorina +Nidoqueen +Nidoran♂ +Nidorino +Nidoking +Clefairy +Clefable +Vulpix +Ninetales +Jigglypuff +Wigglytuff +Zubat +Golbat +Oddish +Gloom +Vileplume +Paras +Parasect +Venonat +Venomoth +Diglett +Dugtrio +Meowth +Persian +Psyduck +Golduck +Mankey +Primeape +Growlithe +Arcanine +Poliwag +Poliwhirl +Poliwrath +Abra +Kadabra +Alakazam +Machop +Machoke +Machamp +Bellsprout +Weepinbell +Victreebel +Tentacool +Tentacruel +Geodude +Graveler +Golem +Ponyta +Rapidash +Slowpoke +Slowbro +Magnemite +Magneton +Farfetch'd +Doduo +Dodrio +Seel +Dewgong +Grimer +Muk +Shellder +Cloyster +Gastly +Haunter +Gengar +Onix +Drowzee +Hypno +Krabby +Kingler +Voltorb +Electrode +Exeggcute +Exeggutor +Cubone +Marowak +Hitmonlee +Hitmonchan +Lickitung +Koffing +Weezing +Rhyhorn +Rhydon +Chansey +Tangela +Kangaskhan +Horsea +Seadra +Goldeen +Seaking +Staryu +Starmie +Mr. Mime +Scyther +Jynx +Electabuzz +Magmar +Pinsir +Tauros +Magikarp +Gyarados +Lapras +Ditto +Eevee +Vaporeon +Jolteon +Flareon +Porygon +Omanyte +Omastar +Kabuto +Kabutops +Aerodactyl +Snorlax +Articuno +Zapdos +Moltres +Dratini +Dragonair +Dragonite +Mewtwo +Mew +Chikorita +Bayleef +Meganium +Cyndaquil +Quilava +Typhlosion +Totodile +Croconaw +Feraligatr +Sentret +Furret +Hoothoot +Noctowl +Ledyba +Ledian +Spinarak +Ariados +Crobat +Chinchou +Lanturn +Pichu +Cleffa +Igglybuff +Togepi +Togetic +Natu +Xatu +Mareep +Flaaffy +Ampharos +Bellossom +Marill +Azumarill +Sudowoodo +Politoed +Hoppip +Skiploom +Jumpluff +Aipom +Sunkern +Sunflora +Yanma +Wooper +Quagsire +Espeon +Umbreon +Murkrow +Slowking +Misdreavus +Unown +Wobbuffet +Girafarig +Pineco +Forretress +Dunsparce +Gligar +Steelix +Snubbull +Granbull +Qwilfish +Scizor +Shuckle +Heracross +Sneasel +Teddiursa +Ursaring +Slugma +Magcargo +Swinub +Piloswine +Corsola +Remoraid +Octillery +Delibird +Mantine +Skarmory +Houndour +Houndoom +Kingdra +Phanpy +Donphan +Porygon2 +Stantler +Smeargle +Tyrogue +Hitmontop +Smoochum +Elekid +Magby +Miltank +Blissey +Raikou +Entei +Suicune +Larvitar +Pupitar +Tyranitar +Lugia +Ho-Oh +Celebi +Treecko +Grovyle +Sceptile +Torchic +Combusken +Blaziken +Mudkip +Marshtomp +Swampert +Poochyena +Mightyena +Zigzagoon +Linoone +Wurmple +Silcoon +Beautifly +Cascoon +Dustox +Lotad +Lombre +Ludicolo +Seedot +Nuzleaf +Shiftry +Taillow +Swellow +Wingull +Pelipper +Ralts +Kirlia +Gardevoir +Surskit +Masquerain +Shroomish +Breloom +Slakoth +Vigoroth +Slaking +Nincada +Ninjask +Shedinja +Whismur +Loudred +Exploud +Makuhita +Hariyama +Azurill +Nosepass +Skitty +Delcatty +Sableye +Mawile +Aron +Lairon +Aggron +Meditite +Medicham +Electrike +Manectric +Plusle +Minun +Volbeat +Illumise +Roselia +Gulpin +Swalot +Carvanha +Sharpedo +Wailmer +Wailord +Numel +Camerupt +Torkoal +Spoink +Grumpig +Spinda +Trapinch +Vibrava +Flygon +Cacnea +Cacturne +Swablu +Altaria +Zangoose +Seviper +Lunatone +Solrock +Barboach +Whiscash +Corphish +Crawdaunt +Baltoy +Claydol +Lileep +Cradily +Anorith +Armaldo +Feebas +Milotic +Castform +Kecleon +Shuppet +Banette +Duskull +Dusclops +Tropius +Chimecho +Absol +Wynaut +Snorunt +Glalie +Spheal +Sealeo +Walrein +Clamperl +Huntail +Gorebyss +Relicanth +Luvdisc +Bagon +Shelgon +Salamence +Beldum +Metang +Metagross +Regirock +Regice +Registeel +Latias +Latios +Kyogre +Groudon +Rayquaza +Jirachi +Deoxys +Turtwig +Grotle +Torterra +Chimchar +Monferno +Infernape +Piplup +Prinplup +Empoleon +Starly +Staravia +Staraptor +Bidoof +Bibarel +Kricketot +Kricketune +Shinx +Luxio +Luxray +Budew +Roserade +Cranidos +Rampardos +Shieldon +Bastiodon +Burmy +Wormadam +Mothim +Combee +Vespiquen +Pachirisu +Buizel +Floatzel +Cherubi +Cherrim +Shellos +Gastrodon +Ambipom +Drifloon +Drifblim +Buneary +Lopunny +Mismagius +Honchkrow +Glameow +Purugly +Chingling +Stunky +Skuntank +Bronzor +Bronzong +Bonsly +Mime Jr. +Happiny +Chatot +Spiritomb +Gible +Gabite +Garchomp +Munchlax +Riolu +Lucario +Hippopotas +Hippowdon +Skorupi +Drapion +Croagunk +Toxicroak +Carnivine +Finneon +Lumineon +Mantyke +Snover +Abomasnow +Weavile +Magnezone +Lickilicky +Rhyperior +Tangrowth +Electivire +Magmortar +Togekiss +Yanmega +Leafeon +Glaceon +Gliscor +Mamoswine +Porygon-Z +Gallade +Probopass +Dusknoir +Froslass +Rotom +Uxie +Mesprit +Azelf +Dialga +Palkia +Heatran +Regigigas +Giratina +Cresselia +Phione +Manaphy +Darkrai +Shaymin +Arceus +Victini +Snivy +Servine +Serperior +Tepig +Pignite +Emboar +Oshawott +Dewott +Samurott +Patrat +Watchog +Lillipup +Herdier +Stoutland +Purrloin +Liepard +Pansage +Simisage +Pansear +Simisear +Panpour +Simipour +Munna +Musharna +Pidove +Tranquill +Unfezant +Blitzle +Zebstrika +Roggenrola +Boldore +Gigalith +Woobat +Swoobat +Drilbur +Excadrill +Audino +Timburr +Gurdurr +Conkeldurr +Tympole +Palpitoad +Seismitoad +Throh +Sawk +Sewaddle +Swadloon +Leavanny +Venipede +Whirlipede +Scolipede +Cottonee +Whimsicott +Petilil +Lilligant +Basculin +Sandile +Krokorok +Krookodile +Darumaka +Darmanitan +Maractus +Dwebble +Crustle +Scraggy +Scrafty +Sigilyph +Yamask +Cofagrigus +Tirtouga +Carracosta +Archen +Archeops +Trubbish +Garbodor +Zorua +Zoroark +Minccino +Cinccino +Gothita +Gothorita +Gothitelle +Solosis +Duosion +Reuniclus +Ducklett +Swanna +Vanillite +Vanillish +Vanilluxe +Deerling +Sawsbuck +Emolga +Karrablast +Escavalier +Foongus +Amoonguss +Frillish +Jellicent +Alomomola +Joltik +Galvantula +Ferroseed +Ferrothorn +Klink +Klang +Klinklang +Tynamo +Eelektrik +Eelektross +Elgyem +Beheeyem +Litwick +Lampent +Chandelure +Axew +Fraxure +Haxorus +Cubchoo +Beartic +Cryogonal +Shelmet +Accelgor +Stunfisk +Mienfoo +Mienshao +Druddigon +Golett +Golurk +Pawniard +Bisharp +Bouffalant +Rufflet +Braviary +Vullaby +Mandibuzz +Heatmor +Durant +Deino +Zweilous +Hydreigon +Larvesta +Volcarona +Cobalion +Terrakion +Virizion +Tornadus +Thundurus +Reshiram +Zekrom +Landorus +Kyurem +Keldeo +Meloetta +Genesect +EOF +} + +ask_pokemon() { list_pokemon | commander -xc; } + +html="/tmp/pk_tmp.html" +[ "$pokemon" ] || pokemon="$(ask_pokemon)" +[ "$pokemon" ] || exit 1 + +case "$1" in + # evolution + e*) + url="https://pokemondb.net/pokedex/$pokemon" + curl -Ls "$url" > "$html" + level1="$(pup -p 'span.infocard:nth-child(2) > small:nth-child(2) text{}' < "$html")" + level2="$(pup -p 'span.infocard:nth-child(4) > small:nth-child(2) text{}' < "$html")" + notify-send "p.sh" "$level1\n$level2" + ;; + + # moves + m*) $BROWSER "https://bulbapedia.bulbagarden.net/wiki/${pokemon}_(Pok%C3%A9mon)/Generation_V_learnset" ;; + + # stats + s*) $BROWSER "https://www.smogon.com/dex/bw/pokemon/$pokemon/" ;; + *) + choice="$(printf 'evolution\nmoves\nstats\n' | commander -c -w 3)" + [ "$choice" ] && pokemon="$pokemon" $0 "$choice" ;; +esac diff --git a/bin/extra/snpdf b/bin/extra/snpdf new file mode 100755 index 0000000..56d9e21 --- /dev/null +++ b/bin/extra/snpdf @@ -0,0 +1,2 @@ +#!/bin/sh +zathura "$(clipo | sed 's@^file://@@;s/\.pdf.*/.pdf/;s/%20/ /g')" diff --git a/bin/extra/ssimg b/bin/extra/ssimg new file mode 100755 index 0000000..d69db42 --- /dev/null +++ b/bin/extra/ssimg @@ -0,0 +1,4 @@ +#!/bin/sh +out="/tmp/ssimg.png" +clipo > "$out" || exit 1 +printf "file://clip" | ydotool type -d 40 -f - diff --git a/bin/extra/steamidtoname b/bin/extra/steamidtoname new file mode 100755 index 0000000..f1cee31 --- /dev/null +++ b/bin/extra/steamidtoname @@ -0,0 +1,8 @@ +#!/bin/sh + +[ "$#" -eq 0 ] && >&2 printf "usage: steamidtoname <id>" && exit 1 +name="$(curl -s https://store.steampowered.com/app/"$1"/ | + pup -p 'title text{}' | + sed 's/on Steam$//')" + +printf '%s\n' "$name" diff --git a/bin/extra/swapclip b/bin/extra/swapclip new file mode 100755 index 0000000..25b9857 --- /dev/null +++ b/bin/extra/swapclip @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$WAYLAND_DISPLAY" ] +then + paste="$(wl-paste)" + wl-paste -p | wl-copy -n + printf "%s" "$paste" | wl-copy -p -n +fi diff --git a/bin/extra/timezone b/bin/extra/timezone new file mode 100755 index 0000000..6f93aad --- /dev/null +++ b/bin/extra/timezone @@ -0,0 +1,3 @@ +#!/bin/sh +curl -s "https://www.timeanddate.com/time/zone/$1" | + pup -p '.tb-tz > tbody:nth-child(2) > tr:nth-child(1) > th:nth-child(1) text{}' diff --git a/bin/extra/transfer.sh b/bin/extra/transfer.sh new file mode 100755 index 0000000..e8c9480 --- /dev/null +++ b/bin/extra/transfer.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +die () { >&2 printf '%s\n' "$@"; exit 1; } + +[ $# -eq 0 ] && + die 'No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>' + +if [ -t 0 ] +then + file="$1" + file_name="$(basename "$file")" + [ -e "$file" ] || + die "$file: No such file or directory\n" + if [ -d "$file" ] + then + file_name="$file_name".zip + (cd "$file" && zip -r -q - .) | curl --upload-file - "https://transfer.sh/$file_name" + else + curl --upload-file "$file" "https://transfer.sh/$file_name" + fi +else + file_name="$1" + curl --upload-file - "https://transfer.sh/$file_name" +fi diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index cb7977b..4e83a0b 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,6 +1,6 @@ #!/usr/bin/env sh -program="$(commander -rcd)" +program="$(commander -rc)" [ "$program" ] || exit 1 @@ -10,7 +10,7 @@ option="$("$program" --help | tr -s ' ' | sort | uniq | column -l 2 -t | - commander -lxcd | + commander -lxc | awk '{print $1}')" [ "$option" ] || exit 1 diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index 1be3f71..d8a4969 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -44,6 +44,7 @@ bind M-x confirm -p "Kill Session?" kill-session bind M-X confirm -p "Kill Server?" kill-server # Restart pane bind k run -C "respawn-pane -k; send-keys !! 'C-j'" +bind K respawn-pane -k # Splitting bind v split-window -h -c "#{pane_current_path}" bind h split-window -v -c "#{pane_current_path}" |