dotfiles-x1169905fb
changes
+84 −30
9 files changed
- M .config/shell/profile +1 −0
- M .local/bin/maimshot +0 −1
- D .local/bin/metadata +0 −12
- A .local/bin/pirokit +68 −0
- M .local/bin/sbar +1 −1
- A .local/bin/sd +11 −0
- D .local/bin/spammer +0 −15
- M .local/bin/upfile +2 −1
- M .local/share/vocab/words.txt +1 −0
| @@ -28,6 +28,7 @@ export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" | |||
| 28 | 28 | export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" | |
| 29 | 29 | export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" | |
| 30 | 30 | export PATH=$PATH:$HOME/.local/bin | |
| 31 | + | export PATH=$PATH:$HOME/.local/pbin # personal bin | |
| 31 | 32 | export PATH="$PATH:$XDG_DATA_HOME/cargo/bin" | |
| 32 | 33 | ||
| 33 | 34 | export MPD_HOST="localhost" | |
| @@ -7,5 +7,4 @@ case "$(printf "a selected area (copy)\\ncurrent window (copy)\\nfull screen (co | |||
| 7 | 7 | "a selected area") maim -s ~/pix/ss/pic-selected-"$(date '+%y-%m-%d-%H-%M').png" ;; | |
| 8 | 8 | "current window") maim -i "$(xdotool getactivewindow)" ~/pix/ss/pic-window-"$(date '+%y-%m-%d-%H-%M').png" ;; | |
| 9 | 9 | "full screen") sleep 0.2 ; maim ~/pix/ss/pic-full-"$(date '+%y-%m-%d-%H-%M').png" ;; | |
| 10 | − | ||
| 11 | 10 | esac | |
| @@ -1,12 +0,0 @@ | |||
| 1 | − | #!/bin/sh | |
| 2 | − | if [ -z "$*" ]; then | |
| 3 | − | input_file=$(fzf) | |
| 4 | − | else | |
| 5 | − | input_file=$* | |
| 6 | − | fi | |
| 7 | − | read -p "Title: " title | |
| 8 | − | read -p "Artist: " artist | |
| 9 | − | read -p "album: " album | |
| 10 | − | output_name="metadata-$input_file" | |
| 11 | − | ffmpeg -i "$input_file" -metadata title="$title" -metadata artist="$artist" -metadata album="$album" -c copy "$output_name" | |
| 12 | − | mv -f "$output_name" "$input_file" | |
| @@ -0,0 +1,68 @@ | |||
| 1 | + | #!/usr/bin/bash | |
| 2 | + | ||
| 3 | + | mkdir -p $HOME/.cache/pirokit | |
| 4 | + | ||
| 5 | + | if [ -z $1 ]; then | |
| 6 | + | query=$(echo "" | dmenu -p "Search Torrent: ") | |
| 7 | + | else | |
| 8 | + | query=$1 | |
| 9 | + | fi | |
| 10 | + | ||
| 11 | + | baseurl="https://1337x.to" | |
| 12 | + | cachedir="$HOME/.cache/pirokit" | |
| 13 | + | query="$(sed 's/ /+/g' <<<$query)" | |
| 14 | + | ||
| 15 | + | #curl -s https://1337x.to/category-search/$query/Movies/1/ > $cachedir/tmp.html | |
| 16 | + | curl -s https://1337x.to/search/$query/1/ > $cachedir/tmp.html | |
| 17 | + | ||
| 18 | + | # Get Titles | |
| 19 | + | grep -o '<a href="/torrent/.*</a>' $cachedir/tmp.html | | |
| 20 | + | sed 's/<[^>]*>//g' > $cachedir/titles.bw | |
| 21 | + | ||
| 22 | + | result_count=$(wc -l $cachedir/titles.bw | awk '{print $1}') | |
| 23 | + | if [ "$result_count" -lt 1 ]; then | |
| 24 | + | notify-send "😔 No Result found. Try again 🔴" | |
| 25 | + | exit 0 | |
| 26 | + | fi | |
| 27 | + | ||
| 28 | + | ||
| 29 | + | # Seeders and Leechers | |
| 30 | + | grep -o '<td class="coll-2 seeds.*</td>\|<td class="coll-3 leeches.*</td>' $cachedir/tmp.html | | |
| 31 | + | sed 's/<[^>]*>//g' | sed 'N;s/\n/ /' > $cachedir/seedleech.bw | |
| 32 | + | ||
| 33 | + | # Size | |
| 34 | + | grep -o '<td class="coll-4 size.*</td>' $cachedir/tmp.html | | |
| 35 | + | sed 's/<span class="seeds">.*<\/span>//g' | | |
| 36 | + | sed -e 's/<[^>]*>//g' > $cachedir/size.bw | |
| 37 | + | ||
| 38 | + | # Links | |
| 39 | + | grep -E '/torrent/' $cachedir/tmp.html | | |
| 40 | + | sed -E 's#.*(/torrent/.*)/">.*/#\1#' | | |
| 41 | + | sed 's/td>//g' > $cachedir/links.bw | |
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + | # Clearning up some data to display | |
| 46 | + | sed 's/\./ /g; s/\-/ /g' $cachedir/titles.bw | | |
| 47 | + | sed 's/[^A-Za-z0-9 ]//g' | tr -s " " > $cachedir/tmp && mv $cachedir/tmp $cachedir/titles.bw | |
| 48 | + | ||
| 49 | + | awk '{print NR " - ["$0"]"}' $cachedir/size.bw > $cachedir/tmp && mv $cachedir/tmp $cachedir/size.bw | |
| 50 | + | awk '{print "[S:"$1 ", L:"$2"]" }' $cachedir/seedleech.bw > $cachedir/tmp && mv $cachedir/tmp $cachedir/seedleech.bw | |
| 51 | + | ||
| 52 | + | # Getting the line number | |
| 53 | + | LINE=$(paste -d\ $cachedir/size.bw $cachedir/seedleech.bw $cachedir/titles.bw | | |
| 54 | + | dmenu -i -l 25 | | |
| 55 | + | cut -d\- -f1 | | |
| 56 | + | awk '{$1=$1; print}') | |
| 57 | + | ||
| 58 | + | url=$(head -n $LINE $cachedir/links.bw | tail -n +$LINE) | |
| 59 | + | fullURL="${baseurl}${url}/" | |
| 60 | + | ||
| 61 | + | # Requesting page for magnet link | |
| 62 | + | curl -s $fullURL > $cachedir/tmp.html | |
| 63 | + | magnet=$(grep -Po "magnet:\?xt=urn:btih:[a-zA-Z0-9]*" $cachedir/tmp.html | head -n 1) | |
| 64 | + | ||
| 65 | + | transadd "$magnet" | |
| 66 | + | ||
| 67 | + | # Simple notification | |
| 68 | + | notify-send "⬇️ Start downloading File 📁" | |
| @@ -10,7 +10,7 @@ update_cpu () { | |||
| 10 | 10 | } | |
| 11 | 11 | ||
| 12 | 12 | update_memory () { | |
| 13 | − | memory=" $(free -h | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")" | |
| 13 | + | memory=" $(free -h --si | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")" | |
| 14 | 14 | } | |
| 15 | 15 | ||
| 16 | 16 | update_time () { | |
| @@ -0,0 +1,11 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | ||
| 3 | + | # Open a terminal window in the same directory as the currently active window. | |
| 4 | + | ||
| 5 | + | PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p") | |
| 6 | + | PID="$(pstree -lpA "$PID")" | |
| 7 | + | PID="${PID##*"${SHELL##*/}"(}" | |
| 8 | + | PID="${PID#*lf(}" | |
| 9 | + | PID="${PID%%)*}" | |
| 10 | + | cd "$(readlink /proc/"$PID"/cwd)" || return 1 | |
| 11 | + | "$TERMINAL" | |
| @@ -1,15 +0,0 @@ | |||
| 1 | − | #!/bin/sh | |
| 2 | − | ||
| 3 | − | i=0 | |
| 4 | − | ||
| 5 | − | if [ -z $1 ]; then | |
| 6 | − | read -p "enter query: " query | |
| 7 | − | else | |
| 8 | − | query=$1 | |
| 9 | − | fi | |
| 10 | − | ||
| 11 | − | while [ $i -le 100 ] | |
| 12 | − | do | |
| 13 | − | xdotool type "$query" ;xdotool key KP_Enter; sleep 1 ; | |
| 14 | − | ||
| 15 | − | done | |
| @@ -8,5 +8,6 @@ fi | |||
| 8 | 8 | ||
| 9 | 9 | [ -z "$file" ] && exit | |
| 10 | 10 | ||
| 11 | − | curl -F"file=@$file" 0x0.st | xclip -sel c | |
| 11 | + | # curl -F"file=@$file" 0x0.st | xclip -sel c | |
| 12 | + | curl -F"file=@$file" 0.tildevarsh.in | xclip -sel c | |
| 12 | 13 | notify-send "The url has been copied to your clipboard. $(xclip -sel c -o)" | |
| @@ -85,3 +85,4 @@ apprehension -> anziety or fear that something bad or unpleasant will happen | |||
| 85 | 85 | reprise -> a repeated passage in music | |
| 86 | 86 | reluctant -> unwilling and hesitant; disinclined | |
| 87 | 87 | trait -> a distinguishing quality or characteristic, typically one belonging to a person. | |
| 88 | + | pedantic -> excessively concerned with minor details or rules; overscrupulous. | |