diff options
| author | ryo <ryo@nopwd.lol> | 2024-12-17 00:15:40 +0000 | 
|---|---|---|
| committer | ryo <ryo@nopwd.lol> | 2024-12-17 00:15:40 +0000 | 
| commit | 8321c0e378204ed93e391b1ec3933aabe28e757d (patch) | |
| tree | e19e4b130e05c4b73aec7b1df7a160c7fbb0c751 | |
| parent | 30beb339e8566d3b336b60292a3a2592b92d256f (diff) | |
Added null.sh and zathura plus some fixes
In scripts don't specify dash but just sh.
Removed bc from aliases.
Changed pocket to dl.
| -rw-r--r-- | README | 10 | ||||
| -rwxr-xr-x | bin/blind.sh | 2 | ||||
| -rwxr-xr-x | bin/null.sh | 88 | ||||
| -rwxr-xr-x | bin/record.sh | 2 | ||||
| -rwxr-xr-x | bin/scshot.sh | 2 | ||||
| -rwxr-xr-x | bin/xray.sh | 2 | ||||
| -rw-r--r-- | config/shell/aliases | 1 | ||||
| -rw-r--r-- | config/zathura/zathurarc | 47 | 
8 files changed, 144 insertions, 10 deletions
@@ -4,7 +4,6 @@ Setup contains some programs so you should install them.  All of them are included in many linux distros like Arch and Void.  zsh: main shell -dash: run scripts faster  i3: window manager  i3blocks: i3 status bar  alacritty: terminal emulator @@ -36,11 +35,11 @@ Folders Structure  -----------------  It's not necessary but just to know how my home looks like. +- dl  - src  - doc -- media -- pocket  - proj +- media  Zsh config @@ -59,10 +58,11 @@ $ hgit <url1> zsh-as  $ hgit <url2> zsh-fsh -Good to have ------------- +Recommended +-----------  This programs are not required but I recommend you to install. +dash: run scripts faster  tmux: terminal multiplexer  mpv: media player  curl: download/upload data diff --git a/bin/blind.sh b/bin/blind.sh index 431967c..81d7d16 100755 --- a/bin/blind.sh +++ b/bin/blind.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env dash +#!/bin/sh  now=$(TZ=Iran date +%H)  night=21 diff --git a/bin/null.sh b/bin/null.sh new file mode 100755 index 0000000..938913c --- /dev/null +++ b/bin/null.sh @@ -0,0 +1,88 @@ +#!/bin/sh + +# ==== DELETE THIS LINES ===== +echo "NOTHING HAPPENED!" +echo "FIRST READ THE SCRIPT!" +exit +# ============================ + +set -e + +host="https://x.nopwd.lol" +links="$HOME/.local/null-links.txt" +exp="1" +sec="" +prog="${0##*/}" + +usage() { +	cat <<-_EOF +	Usage: +		  $prog [option] [file|url] +		 +	Options: +		  -l			long link +		  -s			shorten url +		  -e [hour]		expire time +		 +	Examples: +		  # upload file +		  $prog somefile.png + +		  # expire time 24 hours +		  $prog -e 24 somefile.png +		 +		  # upload piped data +		  echo "something" | $prog - +		 +		  # get long link +		  $prog -l somefile.png +		 +		  # shorten url +		  $prog -s https://verylongurl + +		  # combine expire and long +		  $prog -e 5 -s somefile.txt +	_EOF +	exit +} + +if [ $1 = "-e" ]; then +	exp=$2 +	shift 2 +fi + +if [ $# -ge 3 ] || [ $# -eq 0 ]; then +	usage +fi + +if [ $# -eq 2 ]; then +	case $1 in +	-s) +		url=$(curl -s -Fshorten=$2 $host) +		echo $url +		echo -e "$url\t# shorten: $2" >> $links +		exit +		;; +	-l) +		long="secret=" +		shift +		;; +	*) +		echo "$prog: unrecognized option '$1'" +		usage +		;; +	esac +fi + +if [ -f $1 ] || [ $1 = "-" ]; then +	out=$(curl -s -Ffile=@$1 -F$long -Fexpires=$exp -w '%header{x-token}' $host) +else +	echo "$prog: file '$1' not exist" +	exit +fi + +url=$(echo "$out" | sed '1q;d') +token=$(echo "$out" | sed '2q;d') + +echo $url +echo -e "$url\t\t# expire: $exp, token: $token" >> $links diff --git a/bin/record.sh b/bin/record.sh index be85a2f..9796672 100755 --- a/bin/record.sh +++ b/bin/record.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env dash +#!/bin/sh  if [ $# -ne 1 ]; then  	echo "bad usage" diff --git a/bin/scshot.sh b/bin/scshot.sh index e789c6e..a709c63 100755 --- a/bin/scshot.sh +++ b/bin/scshot.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env dash +#!/bin/sh  sspath="$HOME/media"  ssname="$(date +"%F_%I%M").png" diff --git a/bin/xray.sh b/bin/xray.sh index faf4c0b..2b8fa11 100755 --- a/bin/xray.sh +++ b/bin/xray.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env dash +#!/bin/sh  if [ -n "$(pgrep xray)" ]; then  	pkill xray diff --git a/config/shell/aliases b/config/shell/aliases index 0b6287a..cdbedac 100644 --- a/config/shell/aliases +++ b/config/shell/aliases @@ -15,7 +15,6 @@ alias \  	cp="cp -i" \  	mv="mv -i" \  	rm="rm -I" \ -	bc="bc -ql" \  	d='doas'  # colorize commands when possible. diff --git a/config/zathura/zathurarc b/config/zathura/zathurarc new file mode 100644 index 0000000..b847f37 --- /dev/null +++ b/config/zathura/zathurarc @@ -0,0 +1,47 @@ +# theme was forked from: +# https://github.com/eastack/zathura-gruvbox/blob/master/zathura-gruvbox-light + +# ============== gruvbox light theme ================= +set notification-error-bg       "rgba(242,229,188,1)"  # bg +set notification-error-fg       "rgba(157,0,6,1)"      # bright:red +set notification-warning-bg     "rgba(242,229,188,1)"  # bg +set notification-warning-fg     "rgba(181,118,20,1)"   # bright:yellow +set notification-bg             "rgba(242,229,188,1)"  # bg +set notification-fg             "rgba(121,116,14,1)"   # bright:green + +set completion-bg               "rgba(235,218,180,1)"  # bg2 +set completion-fg               "rgba(60,56,54,1)"     # fg +set completion-group-bg         "rgba(235,219,178,1)"  # bg1 +set completion-group-fg         "rgba(146,131,116,1)"  # gray +set completion-highlight-bg     "rgba(7,102,120,1)"    # bright:blue +set completion-highlight-fg     "rgba(213,196,161,1)"  # bg2 + +set index-bg                    "rgba(235,218,180,1)"  # bg2 +set index-fg                    "rgba(60,56,54,1)"     # fg +set index-active-bg             "rgba(7,102,120,1)"    # bright:blue +set index-active-fg             "rgba(213,196,161,1)"  # bg2 + +set inputbar-bg                 "rgba(242,229,188,1)"  # bg +set inputbar-fg                 "rgba(60,56,54,1)"     # fg + +set statusbar-bg                "rgba(213,196,161,1)"  # bg2 +set statusbar-fg                "rgba(60,56,54,1)"     # fg + +set highlight-color             "rgba(181,118,20,0.5)" # bright:yellow +set highlight-active-color      "rgba(175,58,3,0.5)"   # bright:orange + +set default-bg                  "rgba(50,48,47,1)"  # bg +set default-fg                  "rgba(60,56,54,1)"     # fg +set render-loading              true +set render-loading-bg           "rgba(242,229,188,1)"  # bg +set render-loading-fg           "rgba(60,56,54,1)"     # fg + +set recolor-lightcolor          "rgba(242,229,188,1)"  # bg +set recolor-darkcolor           "rgba(60,56,54,1)"     # fg +set recolor                     "true" +set recolor-keephue             "true"                 # keep original color +# ==================================================== + +set database sqlite +set adjust-open width +set selection-clipboard clipboard  |