diff options
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | crontab | 2 | ||||
| -rw-r--r-- | dwmblocks/config | 2 | ||||
| -rw-r--r-- | lf/cleaner | 4 | ||||
| -rw-r--r-- | lf/icons | 327 | ||||
| -rw-r--r-- | lf/lfrc | 124 | ||||
| -rw-r--r-- | lf/scope | 50 | ||||
| m--------- | nvim | 0 | ||||
| -rw-r--r-- | picom/picom.conf | 7 | ||||
| -rw-r--r-- | redshift/redshift.conf | 70 | ||||
| -rwxr-xr-x | scripts/icstocal | 3 | ||||
| -rwxr-xr-x | scripts/lfub | 23 | ||||
| -rwxr-xr-x | scripts/plumber | 209 | ||||
| -rwxr-xr-x | scripts/rotdir | 13 | ||||
| -rwxr-xr-x | scripts/ytdl | 22 | ||||
| -rwxr-xr-x | sx/sxrc | 9 | ||||
| -rw-r--r-- | sxhkd/sxhkdrc | 10 | ||||
| -rw-r--r-- | wallpapers/SFW/guitar/wallhaven-0pjzxm.jpg | bin | 0 -> 82874 bytes | |||
| -rw-r--r-- | wallpapers/SFW/guitar/wallhaven-0w78p6.jpg | bin | 0 -> 504584 bytes | |||
| -rw-r--r-- | wallpapers/SFW/guitar/wallhaven-4olmom.png | bin | 0 -> 73985 bytes | |||
| -rw-r--r-- | wallpapers/SFW/guitar/wallhaven-5w38p7.jpg | bin | 0 -> 945106 bytes | |||
| -rw-r--r-- | wallpapers/SFW/guitar/wallhaven-nzq17v.jpg | bin | 0 -> 208787 bytes | |||
| -rw-r--r-- | wallpapers/SFW/memes/Kmm7WsF_d.jpg | bin | 0 -> 56384 bytes | |||
| -rw-r--r-- | wallpapers/SFW/planes/shuttle.jpg | bin | 0 -> 35409 bytes | |||
| -rw-r--r-- | zsh/.zprofile | 5 | ||||
| -rw-r--r-- | zsh/.zshenv | 4 | ||||
| -rw-r--r-- | zsh/.zshrc | 32 | ||||
| -rw-r--r-- | zsh/gitHelp | 15 |
28 files changed, 905 insertions, 32 deletions
@@ -1,4 +1,9 @@ ## uninteresting configs +PCSX2/ +geany/ +supertuxkart/ +trizen/ +unity3d/ pulse/ var/ JetBrains/ @@ -25,4 +30,5 @@ gops/ ## other stuff scummvm/ paliasrc +epitaliasrc pavucontrol.ini @@ -0,0 +1,2 @@ +0,10,20,30,40,50 * * * * kill -52 $(pidof dwmblocks); randwp +30 * * * * kill -49 $(pidof dwmblocks) diff --git a/dwmblocks/config b/dwmblocks/config index 91f8f1d..76138b7 100644 --- a/dwmblocks/config +++ b/dwmblocks/config @@ -12,7 +12,7 @@ volume = true // 44 mic = false // 45 news = false // 46 mail = false // 47 -weather = false // 48 +weather = false // 48 daypercent = false // 49 date = true // 50 time = true // 51 diff --git a/lf/cleaner b/lf/cleaner new file mode 100644 index 0000000..a184d84 --- /dev/null +++ b/lf/cleaner @@ -0,0 +1,4 @@ +#!/bin/sh +if [ -n "$FIFO_UEBERZUG" ]; then + printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG" +fi diff --git a/lf/icons b/lf/icons new file mode 100644 index 0000000..be94780 --- /dev/null +++ b/lf/icons @@ -0,0 +1,327 @@ +# vim:ft=conf + +# file types +ln " " # LINK +or " " # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow " " # OTHER_WRITABLE +st t # STICKY +di " " # DIR +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex " " # EXEC +fi " " # FILE + +# file extensions +*.styl " " +*.sass " " +*.scss " " +*.htm " " +*.html " " +*.slim " " +*.haml " " +*.ejs " " +*.css " " +*.less " " +*.md " " +*.mdx " " +*.markdown " " +*.rmd " " +*.json " " +*.webmanifest " " +*.js " " +*.mjs " " +*.jsx " " +*.rb " " +*.gemspec " " +*.rake " " +*.php " " +*.py " " +*.pyc " " +*.pyo " " +*.pyd " " +*.coffee " " +*.mustache " " +*.hbs " " +*.conf " " +*.ini " " +*.yml " " +*.yaml " " +*.toml " " +*.bat " " +*.mk " " +*.twig " " +*.cpp " " +*.c++ " " +*.cxx " " +*.cc " " +*.cp " " +*.c " " +*.cs " " +*.h " " +*.hh " " +*.hpp " " +*.hxx " " +*.hs " " +*.lhs " " +*.nix " " +*.lua " " +*.java " " +*.sh " " +*.fish " " +*.bash " " +*.zsh " " +*.ksh " " +*.csh " " +*.awk " " +*.ps1 " " +*.ml "λ " +*.mli "λ " +*.diff " " +*.db " " +*.sql " " +*.dump " " +*.clj " " +*.cljc " " +*.cljs " " +*.edn " " +*.scala " " +*.go " " +*.dart " " +*.xul " " +*.sln " " +*.suo " " +*.pl " " +*.pm " " +*.t " " +*.rss " " +*.xml " " +'*.f#' " " +*.fsscript " " +*.fsx " " +*.fs " " +*.fsi " " +*.rs " " +*.rlib " " +*.d " " +*.erl " " +*.hrl " " +*.ex " " +*.exs " " +*.eex " " +*.leex " " +*.heex " " +*.vim " " +*.ai " " +*.psd " " +*.psb " " +*.ts " " +*.tsx " " +*.jl " " +*.pp " " +*.vue "﵂ " +*.elm " " +*.swift " " +*.xcplayground " " +*.tex "ﭨ " +*.r "ﳒ " +*.rproj "鉶 " +*.sol "ﲹ " +*.pem " " +*.gpg " " +*.pdf " " +*.1 " " +*.nfo " " +*.info " " +*.iso " " +*.img " " +*.part " " +*.torrent " " +*.zig " " + +# file names +*gruntfile.coffee " " +*gruntfile.js " " +*gruntfile.ls " " +*gulpfile.coffee " " +*gulpfile.js " " +*gulpfile.ls " " +*mix.lock " " +*dropbox " " +*.ds_store " " +*.gitconfig " " +*.gitignore " " +*.gitattributes " " +*.gitlab-ci.yml " " +*.bashrc " " +*.zshrc " " +*.zshenv " " +*.zprofile " " +*.vimrc " " +*.gvimrc " " +*_vimrc " " +*_gvimrc " " +*.bashprofile " " +*favicon.ico " " +*license " " +*node_modules " " +*react.jsx " " +*procfile " " +*dockerfile " " +*docker-compose.yml " " +*rakefile " " +*config.ru " " +*gemfile " " +*makefile " " +*cmakelists.txt " " +*robots.txt "ﮧ " +*Gruntfile.coffee " " +*Gruntfile.js " " +*Gruntfile.ls " " +*Gulpfile.coffee " " +*Gulpfile.js " " +*Gulpfile.ls " " +*Dropbox " " +*.DS_Store " " +*LICENSE " " +*React.jsx " " +*Procfile " " +*Dockerfile " " +*Docker-compose.yml " " +*Rakefile " " +*Gemfile " " +*Makefile " " +*CMakeLists.txt " " +*jquery.min.js " " +*angular.min.js " " +*backbone.min.js " " +*require.min.js " " +*materialize.min.js " " +*materialize.min.css " " +*mootools.min.js " " +*vimrc " " +*calendar " " +*conf " " +*config " " + +# archives or compressed +*.tar " " +*.tgz " " +*.arc " " +*.arj " " +*.taz " " +*.lha " " +*.lz4 " " +*.lzh " " +*.lzma " " +*.tlz " " +*.txz " " +*.tzo " " +*.t7z " " +*.zip " " +*.z " " +*.dz " " +*.gz " " +*.lrz " " +*.lz " " +*.lzo " " +*.xz " " +*.zst " " +*.tzst " " +*.bz2 " " +*.bz " " +*.tbz " " +*.tbz2 " " +*.tz " " +*.deb " " +*.rpm " " +*.jar " " +*.war " " +*.ear " " +*.sar " " +*.rar " " +*.alz " " +*.ace " " +*.zoo " " +*.cpio " " +*.7z " " +*.rz " " +*.cab " " +*.wim " " +*.swm " " +*.dwm " " +*.esd " " + +# image formats +*.jpg " " +*.jpeg " " +*.mjpg " " +*.gif " " +*.ico " " +*.bmp " " +*.pbm " " +*.pgm " " +*.ppm " " +*.tga " " +*.xbm " " +*.xpm " " +*.tif " " +*.tiff " " +*.png " " +*.svg " " +*.svgz " " +*.webp " " +*.mng " " +*.pcx " " +*.flc " " +*.fli " " +*.xcf " " +*.xwd " " +*.cgm " " +*.emf " " +*.ff " " + +# video formats +*.webm " " +*.ogm " " +*.mp4 " " +*.m4v " " +*.mp4v " " +*.mkv " " +*.mpg " " +*.mpeg " " +*.avi " " +*.mov " " +*.wmv " " +*.flv " " +*.m2v " " +*.vob " " +*.qt " " +*.asf " " +*.rm " " +*.rmvb " " +*.ogv " " +*.ogx " " +*.mjpeg " " + +# audio formats +*.aac " " +*.au " " +*.flac " " +*.m4a " " +*.mid " " +*.midi " " +*.mka " " +*.mp3 " " +*.mpc " " +*.ogg " " +*.ra " " +*.wav " " +*.oga " " +*.opus " " +*.spx " " +*.xspf " " @@ -0,0 +1,124 @@ +# Stolen from Luke Smith config +# Note on Image Previews +# For those wanting image previews, like this system, there are four steps to +# set it up. These are done automatically for those that useed my Makefile users, +# but I will state them here for others doing it manually. +# +# 1. ueberzug must be installed. +# 2. The scope file (~/.local/etc/lf/scope for me), must have a command similar to +# mine to generate ueberzug images. +# 3. A `set cleaner` line as below is a cleaner script. +# 4. lf should be started through a wrapper script (~/.local/bin/lfub for me) +# that creates the environment for ueberzug. This command can be be aliased +# in your shellrc (`alias lf="lfub") or if set to a binding, should be +# called directly instead of normal lf. + +# Basic vars +set shellopts '-eu' +set ifs "\n" +set scrolloff 10 +set icons +set period 1 +set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" +set cleaner '~/.local/etc/lf/cleaner' +set previewer '~/.local/etc/lf/scope' +set autoquit true + +# cmds/functions +cmd open ${{ + case $(file --mime-type "$(readlink -f $f)" -b) in + image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; + text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | + setsid -f nsxiv -aio 2>/dev/null | while read -r file; do + [ -z "$file" ] && continue + lf -remote "send select \"$file\"" + lf -remote "send toggle" + done & ;; + audio/*|video/x-ms-asf) mpv --audio-display=no $f ;; + video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; + application/pdf|application/vnd.djvu|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; + application/pgp-encrypted) $EDITOR $fx ;; + *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; + esac +}} + +cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" + +cmd extract ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + printf "%s\n\t" "$fx" + printf "extract?[y/N]" + read ans + [ $ans = "y" ] && aunpack $fx +}} + +cmd delete ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + printf "%s\n\t" "$fx" + printf "delete?[y/N]" + read ans + [ $ans = "y" ] && rm -rf -- $fx +}} + +cmd moveto ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + clear; echo "Move to where?" + dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && + for x in $fx; do + eval mv -iv \"$x\" \"$dest\" + done && + notify-send "File(s) moved to $dest." +}} + +cmd copyto ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + clear; echo "Copy to where?" + dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && + for x in $fx; do + eval cp -ivr \"$x\" \"$dest\" + done && + notify-send "File(s) copies to $dest." +}} + +cmd q quit + +# Bindings +map <c-f> $lf -remote "send $id select \"$(fzf)\"" +map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" +map gh +map g top +map d +map D delete +map <delete> delete +map <backspace2> delete +map E extract +map C copyto +map M moveto +map <c-n> push :mkdir<space> +map <c-r> reload +map <c-s> set hidden! +map <enter> shell +map x $$f +map X !$f +map o &mimeopen "$f" +map O $mimeopen --ask "$f" + +map A rename # at the very end +map c push A<c-u> # new rename +map I push A<c-a> # at the very beginning +map i push A<a-b><a-b><a-f> # before extension +map a push A<a-b> # after extension +map w $env IGNORE="" randwp "$f" + +map <c-e> down +map <c-y> up +map V push :!nvim<space> + +map W $setsid -f $TERMINAL >/dev/null 2>&1 + +map Y $printf "%s" "$fx" | xclip -selection clipboard diff --git a/lf/scope b/lf/scope new file mode 100644 index 0000000..bcefeab --- /dev/null +++ b/lf/scope @@ -0,0 +1,50 @@ +#!/bin/sh + +# File preview handler for lf. + +set -C -f +IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" +THEME=gruvbox-dark + +image() { + if [ -f "$1" ] && [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1; then + printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG" + else + mediainfo "$6" + fi +} + +ifub() { + [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1 +} + +# Note that the cache file name is a function of file information, meaning if +# an image appears in multiple places across the machine, it will not have to +# be regenerated once seen. + +case "$(file --dereference --brief --mime-type -- "$1")" in + image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;; + text/html) w3m -dump "$1" ;; # lynx -width="$4" -display_charset=utf-8 -dump "$1" ;; + text/troff) man ./ "$1" | col -b ;; + text/* | */xml | application/json) bat --theme=$THEME --terminal-width "$(($4-2))" -f "$1" ;; + audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;; + video/* ) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" + [ ! -f "$CACHE" ] && ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0 + image "$CACHE" "$2" "$3" "$4" "$5" "$1" + ;; + */pdf) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" + [ ! -f "$CACHE.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE" + image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" + ;; + */epub+zip|*/mobi*) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" + [ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg" + image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" + ;; + application/*zip) atool --list -- "$1" ;; + *opendocument*) odt2txt "$1" ;; + application/pgp-encrypted) gpg -d -- "$1" ;; +esac +exit 1 diff --git a/nvim b/nvim new file mode 160000 +Subproject 1a971cbdcffdc204e073d8142e5491e1f976a3e diff --git a/picom/picom.conf b/picom/picom.conf index 1731c3a..573f1d6 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -111,10 +111,10 @@ frame-opacity = 0.9; # Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows. # inactive-opacity-override = true -inactive-opacity-override = false; +inactive-opacity-override = true; # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) -# active-opacity = 1.0 +active-opacity = 0.95; # Dim inactive windows. (0.0 - 1.0, defaults to 0.0) # inactive-dim = 0.0 @@ -131,8 +131,7 @@ focus-exclude = [ "class_g = 'Cairo-clock'" ]; # Note we don't make any guarantee about possible conflicts with other # programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. # example: -# opacity-rule = [ "80:class_g = 'URxvt'" ]; -# +opacity-rule = [ "100:class_g= 'mpv'", "95:name *= 'librewolf'" ]; # opacity-rule = [] diff --git a/redshift/redshift.conf b/redshift/redshift.conf new file mode 100644 index 0000000..9ad4cce --- /dev/null +++ b/redshift/redshift.conf @@ -0,0 +1,70 @@ +; Global settings for redshift +[redshift] +; Set the day and night screen temperatures +temp-day=5700 +temp-night=3500 + +; Disable the smooth fade between temperatures when Redshift starts and stops. +; 0 will cause an immediate change between screen temperatures. +; 1 will gradually apply the new screen temperature over a couple of seconds. +fade=1 + +; Solar elevation thresholds. +; By default, Redshift will use the current elevation of the sun to determine +; whether it is daytime, night or in transition (dawn/dusk). When the sun is +; above the degrees specified with elevation-high it is considered daytime and +; below elevation-low it is considered night. +;elevation-high=3 +;elevation-low=-6 + +; Custom dawn/dusk intervals. +; Instead of using the solar elevation, the time intervals of dawn and dusk +; can be specified manually. The times must be specified as HH:MM in 24-hour +; format. +;dawn-time=6:00-7:45 +;dusk-time=18:35-20:15 + +; Set the screen brightness. Default is 1.0. +; brightness=0.9 +; It is also possible to use different settings for day and night +; since version 1.8. +brightness-day=0.8 +brightness-night=0.6 +; Set the screen gamma (for all colors, or each color channel +; individually) +gamma=0.8 +;gamma=0.8:0.7:0.8 +; This can also be set individually for day and night since +; version 1.10. +;gamma-day=0.8:0.7:0.8 +;gamma-night=0.6 + +; Set the location-provider: 'geoclue2', 'manual' +; type 'redshift -l list' to see possible values. +; The location provider settings are in a different section. +location-provider=manual + +; Set the adjustment-method: 'randr', 'vidmode' +; type 'redshift -m list' to see all possible values. +; 'randr' is the preferred method, 'vidmode' is an older API. +; but works in some cases when 'randr' does not. +; The adjustment method settings are in a different section. +adjustment-method=randr + +; Configuration of the location-provider: +; type 'redshift -l PROVIDER:help' to see the settings. +; ex: 'redshift -l manual:help' +; Keep in mind that longitudes west of Greenwich (e.g. the Americas) +; are negative numbers. +[manual] +lat=48.864716 +lon=2.349014 + +; Configuration of the adjustment-method +; type 'redshift -m METHOD:help' to see the settings. +; ex: 'redshift -m randr:help' +; In this example, randr is configured to adjust only screen 0. +; Note that the numbering starts from 0, so this is actually the first screen. +; If this option is not specified, Redshift will try to adjust _all_ screens. +[randr] +screen=0 diff --git a/scripts/icstocal b/scripts/icstocal index 3d086ca..9bff2be 100755 --- a/scripts/icstocal +++ b/scripts/icstocal @@ -68,7 +68,8 @@ while line != "END:VCALENDAR\n": starts.append([year, month, day, hour, min]) elif line.startswith("DTEND"): end = line.lstrip("DTEND") - while start[n] != ":": + n = 0 + while end[n] != ":": n+=1 hour = "" min = "" diff --git a/scripts/lfub b/scripts/lfub new file mode 100755 index 0000000..0d8b7fe --- /dev/null +++ b/scripts/lfub @@ -0,0 +1,23 @@ +#!/bin/sh +# This is a wrapper script for lf that allows it to create image previews with +# ueberzug. This works in concert with the lf configuration file and the +# lf-cleaner script. + +set -e + +cleanup() { + exec 3>&- + rm "$FIFO_UEBERZUG" +} + +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + lf "$@" +else + [ ! -d "$XDG_CACHE_HOME/lf" ] && mkdir -p "$XDG_CACHE_HOME/lf" + export FIFO_UEBERZUG="$XDG_CACHE_HOME/lf/ueberzug-$$" + mkfifo "$FIFO_UEBERZUG" + ueberzug layer -s <"$FIFO_UEBERZUG" -p json & + exec 3>"$FIFO_UEBERZUG" + trap cleanup HUP INT QUIT TERM PWR EXIT + lf "$@" 3>&- +fi diff --git a/scripts/plumber b/scripts/plumber new file mode 100755 index 0000000..b6931a1 --- /dev/null +++ b/scripts/plumber @@ -0,0 +1,209 @@ +#!/bin/sh +# Copywrong © 2023 Ratakor. Under ISC License. +# plumber 🪠 +# dependencies: +# - default programs +# - xdo +# - xclip or xsel +# - (optional) herbe and dmenusearch web +# - (optional) dmenu_path +# - (optional) st with plumber patch +# shellcheck disable=SC2086 + +# default programs +WEB="xdg-open" +TEXT="$TERMINAL -e $EDITOR" +VIDEO="mpv --ytdl-format=22 --loop" +AUDIO="music --shuffle" +PIC="nsxiv -a" +DOC="zathura" +DIR="$TERMINAL -e lfub" + +openlink() { + case "$1" in + *.mkv|*.webm|*.mp4|*.mov|*youtube.com/watch*|*youtube.com/playlist*|\ + *youtube.com/shorts*|*youtu.be*|*inv*/playlist*|*inv*/watch*) + setsid -f $VIDEO "$1" >/dev/null 2>&1 ;; + *.mp3|*.flac|*.opus|*mp3?source*|*.ogg|*.wav|*soundcloud.com*) + setsid -f $AUDIO "$1" >/dev/null 2>&1 ;; + *.png|*.jpg|*.jpeg|*.gif|*.webp) + file=$(printf '%s' "$1" | sed "s/.*\///;s/%20/ /g") + curl -sL "$1" > "/tmp/$file" && + $PIC "/tmp/$file" >/dev/null 2>&1 & ;; + *.pdf|*.ps|*.cbz|*.cbr|*.djvu|*.epub) + file=$(printf '%s' "$1" | sed "s/.*\///;s/%20/ /g") + curl -sL "$1" > "/tmp/$file" && + $DOC "/tmp/$file" >/dev/null 2>&1 & ;; + *wp.com/stonetoss.com*) + file=$(printf '%s' "${1%"?resize=150%2C150&ssl=1"}" |\ + sed "s/.*\///;s/%20/ /g") + curl -sL "${1%"?resize=150%2C150&ssl=1"}" > "/tmp/$file" && + $PIC "/tmp/$file" >/dev/null 2>&1 & ;; + git://*|git@*|*.git) + "$TERMINAL" -e git clone "$1" ;; + *) + setsid -f $WEB "$1" >/dev/null 2>&1 ;; + esac +} + +openfile() { + if [ -d "$1" ]; then + setsid -f $DIR "$1" >/dev/null 2>&1 + return + fi + + if [ ! -f "$1" ]; then + printf '\033[31mError:\033[m %s is not a valid file\n' "$1" >&2 + return 1 + fi + + case "$1" in + *.mkv|*.webm|*.mp4|*.mov) + setsid -f $VIDEO "$1" >/dev/null 2>&1 ;; + *.mp3|*.flac|*.opus|*.ogg|*.wav) + setsid -f $AUDIO "$1" >/dev/null 2>&1 ;; + *.png|*.jpg|*.jpeg|*.gif|*.webp) + setsid -f $PIC "$1" >/dev/null 2>&1 ;; + *.pdf|*.ps|*.cbz|*.cbr|*.djvu|*.epub) + setsid -f $DOC "$1" >/dev/null 2>&1 ;; + *) + setsid -f $TEXT "$1" >/dev/null 2>&1 ;; + esac +} + +checksel() { + case "$1" in + http://*|https://*|irc://*|ircs://*|git://*|git@*) + openlink "$1" ;; + /*) + opensel "$1" "$1" ;; + + *) + pid=$(pstree -lpA "$(xdo pid)" | tail -n 1 |\ + awk -F '---' '{print $NF}' | sed -re 's/[^0-9]//g') + opensel "$(readlink "/proc/$pid/cwd")/$1" "$1" ;; + esac +} + +opensel() { + if [ -d "$1" ]; then + case $1 in + "$XDG_MUSIC_DIR"/*) + setsid -f $AUDIO "$1" >/dev/null 2>&1 ;; + *) + xdo kill + $TERMINAL -e sh -c "cd $1; $SHELL" ;; + esac + return + fi + + if [ ! -f "$1" ]; then + progname=${2%\ *} + for prog in $(dmenu_path); do + case $prog in + "$progname") + $TERMINAL -e sh -c\ + "cd ${1%"$2"}; echo \$ $2; $2; $SHELL" + return ;; + esac + done + herbe "Do you want to search for '$2' ?" && dmenusearch web "$2" + return + fi + + case "$1" in + *.mkv|*.webm|*.mp4|*.mov) + setsid -f $VIDEO "$1" >/dev/null 2>&1 ;; + *.mp3|*.flac|*.opus|*.ogg|*.wav) + setsid -f $AUDIO "$1" >/dev/null 2>&1 ;; + *.png|*.jpg|*.jpeg|*.gif|*.webp) + setsid -f $PIC "$1" >/dev/null 2>&1 ;; + *.pdf|*.ps|*.cbz|*.cbr|*.djvu|*.epub) + setsid -f $DOC "$1" >/dev/null 2>&1 ;; + *) + pid=$(xdo pid) + xdo hide -p "$pid" + $TEXT "$1" >/dev/null 2>&1 + xdo show -p "$pid" ;; + esac +} + + +usage() { + cat << EOF >&2 +Usage: ${0##*/} [options] [arg] + +Options: + no option [arg] | Try to guess what to do + -l|--link [link] | Open the link + -f|--file [file] | Open the file or the folder + -s|--sel | Use the selection buffer instead, Plan9's way + -t|--term | To be used only when invoking through a patched st + -h|--help │ Print this help message + +Config: + browser = $WEB + editor = $TEXT + video = $VIDEO + audio = $AUDIO + picture = $PIC + document = $DOC + file manager = $DIR +EOF +} + +main() { + case "$1" in + -l|--link) + if [ -z "$2" ]; then + printf '\033[31mError:\033[m no argument given\n' >&2 + usage + return 1 + fi + openlink "$2" ;; + -f|--file) + if [ -z "$2" ]; then + printf '\033[31mError:\033[m no argument given\n' >&2 + usage + return 1 + fi + openfile "$2" ;; + -s|--sel|'') + sel=$(xclip -o -sel 2>/dev/null || xsel -opn 2>/dev/null) + sel=${sel#"${sel%%[![:space:]]*}"} + + # clear clipboard + true | xclip 2>/dev/null || true | xsel 2>/dev/null + + if [ -z "$sel" ]; then + printf '\033[31mError:\033[m selection buffer is empty\n' >&2 + usage + return 1 + fi + + checksel "$sel" ;; + -t|--term) + #if [ "$(ps -o comm= $PPID)" != "st" ]; then + # printf '\033[31mError:\033[m --term option used outside of st\n' >&2 + # usage + # return 1 + #fi + [ -n "$2" ] && checksel "$2" ;; + -h|--help) + usage + return 0 ;; + -*) + printf '\033[31mError:\033[m unknown option\n' >&2 + usage + return 1 ;; + *) + case "$1" in + http://*|https://*|git://*|irc://*|ircs://*) + openlink "$1" ;; + *) + openfile "$1" ;; + esac + esac +} + +main "$@" diff --git a/scripts/rotdir b/scripts/rotdir new file mode 100755 index 0000000..3b3f39d --- /dev/null +++ b/scripts/rotdir @@ -0,0 +1,13 @@ +#!/bin/sh + +# When I open an image from the file manager in sxiv (the image viewer), I want +# to be able to press the next/previous keys to key through the rest of the +# images in the same directory. This script "rotates" the content of a +# directory based on the first chosen file, so that if I open the 15th image, +# if I press next, it will go to the 16th etc. Autistic, I know, but this is +# one of the reasons that sxiv is great for being able to read standard input. +# ^ this is Luke's toughts and I approve them + +[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 +base="$(basename "$1")" +ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }' diff --git a/scripts/ytdl b/scripts/ytdl index e69cf26..9aafb42 100755 --- a/scripts/ytdl +++ b/scripts/ytdl @@ -1,33 +1,33 @@ #!/bin/sh # wrapper for yt-dlp -MUSICDIR="${XDG_MUSIC_DIR:-$HOME/Music}" +MUSICDIR="${XDG_MUSIC_DIR:-$HOME/music}" VIDEODIR="${XDG_VIDEOS_DIR:-$HOME/Videos}" case $1 in v) mkdir -p "$VIDEODIR" - notify-send "Video download started" + herbe "Video download started" yt-dlp -f 'bv,ba' -o '%(title)s [%(id)s].%(ext)s'\ -P "$VIDEODIR" "$2" && - notify-send "Video downloaded" || - (notify-send "Error: No internet connection" && exit 1) ;; + herbe "Video downloaded" || + (herbe "Error: No internet connection" && exit 1) ;; m) mkdir -p "$MUSICDIR/download" - notify-send "Music download started" + herbe "Music download started" yt-dlp -f 'ba' -x --embed-thumbnail --audio-format mp3\ -o '%(title)s [%(id)s].%(ext)s' -P "$MUSICDIR/download" "$2" && - notify-send "Music downloaded" || - (notify-send "Error: No internet connection" && exit 1) ;; + herbe "Music downloaded" || + (herbe "Error: No internet connection" && exit 1) ;; p) NAME=$(printf '' | dmenu -p 'Name ') mkdir -p "$MUSICDIR/$NAME" - notify-send "Playlist download started" + herbe "Playlist download started" yt-dlp -f 'ba' -x --embed-thumbnail --audio-format mp3\ -o '%(playlist_index)s - %(title)s [%(id)s].%(ext)s'\ -P "$MUSICDIR/$NAME" "$2" && - notify-send "Playlist downloaded" || - (notify-send "Error: No internet connection" && exit 1) ;; + herbe "Playlist downloaded" || + (herbe "Error: No internet connection" && exit 1) ;; *) exit 1 ;; -esac
\ No newline at end of file +esac @@ -0,0 +1,9 @@ +setxkbmap fr +killall scron +scron -f ~/.config/crontab +$HOME/.config/scripts/randwp +sxhkd& +picom& +dwmblocks& +redshift& +exec dwm diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc index 91436f3..01027a5 100644 --- a/sxhkd/sxhkdrc +++ b/sxhkd/sxhkdrc @@ -12,6 +12,12 @@ Scroll_Lock themeswap Print screenshot +XF86Explorer + st -e lfub ~ +super + g + st -e lfub ~/games +XF86WakeUp + nsxiv -f ~/img/wakeup.png XF86MonBrightnessUp BRIGHTNESS=$(($BRIGHTNESS+0.1));setbrightness $BRIGHTNESS XF86MonBrightnessDown @@ -24,8 +30,8 @@ XF86AudioMute pamixer -t; kill -44 $(pidof dwmblocks) XF86Mail betterbird -{super + n,super + shift + n} - $TERMINAL -e {lfub "$XDG_DATA_HOME/notes",newsboat} +XF86Calculator + $TERMINAL -e calc super + m music super + shift + m diff --git a/wallpapers/SFW/guitar/wallhaven-0pjzxm.jpg b/wallpapers/SFW/guitar/wallhaven-0pjzxm.jpg Binary files differnew file mode 100644 index 0000000..70780f3 --- /dev/null +++ b/wallpapers/SFW/guitar/wallhaven-0pjzxm.jpg diff --git a/wallpapers/SFW/guitar/wallhaven-0w78p6.jpg b/wallpapers/SFW/guitar/wallhaven-0w78p6.jpg Binary files differnew file mode 100644 index 0000000..670ea4a --- /dev/null +++ b/wallpapers/SFW/guitar/wallhaven-0w78p6.jpg diff --git a/wallpapers/SFW/guitar/wallhaven-4olmom.png b/wallpapers/SFW/guitar/wallhaven-4olmom.png Binary files differnew file mode 100644 index 0000000..165057f --- /dev/null +++ b/wallpapers/SFW/guitar/wallhaven-4olmom.png diff --git a/wallpapers/SFW/guitar/wallhaven-5w38p7.jpg b/wallpapers/SFW/guitar/wallhaven-5w38p7.jpg Binary files differnew file mode 100644 index 0000000..6b19987 --- /dev/null +++ b/wallpapers/SFW/guitar/wallhaven-5w38p7.jpg diff --git a/wallpapers/SFW/guitar/wallhaven-nzq17v.jpg b/wallpapers/SFW/guitar/wallhaven-nzq17v.jpg Binary files differnew file mode 100644 index 0000000..2a35f0e --- /dev/null +++ b/wallpapers/SFW/guitar/wallhaven-nzq17v.jpg diff --git a/wallpapers/SFW/memes/Kmm7WsF_d.jpg b/wallpapers/SFW/memes/Kmm7WsF_d.jpg Binary files differnew file mode 100644 index 0000000..af45845 --- /dev/null +++ b/wallpapers/SFW/memes/Kmm7WsF_d.jpg diff --git a/wallpapers/SFW/planes/shuttle.jpg b/wallpapers/SFW/planes/shuttle.jpg Binary files differnew file mode 100644 index 0000000..bcd78ff --- /dev/null +++ b/wallpapers/SFW/planes/shuttle.jpg diff --git a/zsh/.zprofile b/zsh/.zprofile index d8f183c..dad305e 100644 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -1,2 +1,5 @@ +curl -m 3 -s "$CAL_PERSO" | grep -v END:VCALENDAR >/tmp/calendar.ics +curl -m 3 -s "$CAL_SCHOOL" | grep -v BEGIN:VCALENDAR >> /tmp/calendar.ics +icstocal /tmp/calendar.ics /tmp/calendar >/dev/null -[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx +[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec sx diff --git a/zsh/.zshenv b/zsh/.zshenv index c80ce3a..a020302 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -1,3 +1,6 @@ +[ -f "$ZDOTDIR/paliasrc" ] && source "$ZDOTDIR/paliasrc" # Private aliases +[ -f "$ZDOTDIR/epitaliasrc" ] && source "$ZDOTDIR/epitaliasrc" # Private aliases + export PATH="$HOME/.config/scripts:$PATH" export TERMINAL="st" export EDITOR="nvim" @@ -5,6 +8,7 @@ export BROWSER="librewolf" export BRIGHTNESS=1 export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/data" export XDG_PICTURES_DIR="$HOME/img" # Following line was automatically added by arttime installer @@ -1,39 +1,46 @@ -[ -f "$ZDOTDIR/paliasrc" ] && source "$ZDOTDIR/paliasrc" # Private aliases - -curl -s $CAL_PERSO | grep -v END:VCALENDAR >/tmp/calendar.ics -curl -s $CAL_SCHOOL | grep -v BEGIN:VCALENDAR >>/tmp/calendar.ics -icstocal /tmp/calendar.ics /tmp/calendar >/dev/null -flashfetch -quand - autoload -U colors && colors # Load colors -PS1="%B%(?.0.%F{red}%?) %F{blue}%n %F{green}%~ %f$%b " +PS1="%B%F{214}%n %F{209}%~ %f%F{45} %f%b " +RPS1="%f(%B%(?.%F{green}0%f.%F{red}%?%f)%b%)" + +# To do +cat ~/todo alias ls="ls -a --color=auto" alias shut="sudo openrc-shutdown -p now" alias shutr="sudo openrc-shutdown -r now" +alias upd="sudo pacman -Syuu; setxkbmap fr" alias ins="sudo pacman -Syu" alias uins="sudo pacman -Rns" -alias c="clear; quand" +alias c="clear; cat ~/todo" # git + +alias aled="cat $XDG_CONFIG_HOME/zsh/gitHelp" +alias {clone,cloner}="git clone" alias {tirer,tir,poule}="git pull" alias {statut,sta}="git status" alias {ajouter,aj}="git add" alias {atome_de_code,ato}="git commit -m" # voir bitoduc.fr, Commit alias {pousser,pous}="git push" +alias {poussétiquettes,poussE}="git push --follow-tags" alias {difference,ference}="git diff" alias {tronc,tr}="git log" alias {resto,restau}="git restore" +alias {étiquette,etiqu}="git tag" +alias branche="git branch" alias bri5="xrandr --output eDP-1 --brightness 0.5" alias bri6="xrandr --output eDP-1 --brightness 0.6" alias ascii="ascii -d" +alias sudo="sudo " +alias lf="lfub" +alias vmk="v Makefile" +alias cmk="xsel -bo > Makefile" alias cf="$HOME/.config/" alias cspt="$HOME/.config/scripts" alias cz="$HOME/.config/zsh" -alias czr="v $ZDOTDIR/.zshrc" +alias czr="v $ZDOTDIR/.zshrc && source $ZDOTDIR/.zshrc" alias cn="$XDG_CONFIG_HOME/nvim" alias rps="echo help | nc ratakor.com 9998" alias v="nvim" @@ -42,6 +49,7 @@ alias py="python3" alias wtr="curl wttr.in/Lyon" alias doc="$HOME/Documents" alias usbmnt="sudo mount /dev/sdb1 $HOME/usb" +alias sss="ssh root@140.82.10.231" autoload -U compinit zstyle ':completion:*' menu select @@ -55,7 +63,7 @@ autoload -Uz vcs_info precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) setopt prompt_subst -RPROMPT=\$vcs_info_msg_0_ +# RPROMPT=\$vcs_info_msg_0_ zstyle ':vcs_info:git:*' formats '%F{cyan}(%b)%f' zstyle ':vcs_info:*' enable git diff --git a/zsh/gitHelp b/zsh/gitHelp new file mode 100644 index 0000000..4d4d686 --- /dev/null +++ b/zsh/gitHelp @@ -0,0 +1,15 @@ +# Trouduction de Git + +clone / cloner : "git clone" +tirer / tir / poule : "git pull" +statut / sta : "git status" +ajouter / aj : "git add" +atome_de_code / ato : "git commit -m" # voir bitoduc.fr, Commit +pousser / pous : "git push" +poussétiquettes / poussE : "git push --follow-tags" +difference / ference / "git diff" +tronc / tr : "git log" +resto / restau : "git restore" +étiquette / etiqu : "git tag" +branche : "git branch" + |
