mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
24 Commits
c9e7c7d83e
...
1b9c76f939
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b9c76f939 | ||
|
|
c43f390f07 | ||
|
|
6f67789b8b | ||
|
|
61026e18de | ||
|
|
628ed4dc99 | ||
|
|
a9cde940c2 | ||
|
|
779ef2f5fe | ||
|
|
131dcce268 | ||
|
|
368d3583a6 | ||
|
|
cf38cd5ba8 | ||
|
|
82ddcd87ec | ||
|
|
c771c66b18 | ||
|
|
d56ca0c95b | ||
|
|
22141ca754 | ||
|
|
b4b462029c | ||
|
|
e8ba78c518 | ||
|
|
dda032a37d | ||
|
|
e64728177b | ||
|
|
e1bfc20f96 | ||
|
|
6556ef5c4d | ||
|
|
475e4abb40 | ||
|
|
7a9bfe6f69 | ||
|
|
534348e0b6 | ||
|
|
3fb60852de |
@ -92,25 +92,37 @@ cmd delete ${{
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
cmd moveto ${{
|
cmd moveto ${{
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
|
||||||
set -f
|
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 --prompt 'Move to where? ' | sed 's|~|$HOME|')
|
||||||
dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
|
[ -z "$dest" ] && exit
|
||||||
|
destpath=$(eval printf '%s' \"$dest\")
|
||||||
|
clear; tput cup $(($(tput lines)/3)); tput bold
|
||||||
|
echo "From:"
|
||||||
|
echo "$fx" | sed 's/^/ /'
|
||||||
|
printf "To:\n %s\n\n\tmove?[y/N]" "$destpath"
|
||||||
|
read -r ans
|
||||||
|
[ "$ans" != "y" ] && exit
|
||||||
for x in $fx; do
|
for x in $fx; do
|
||||||
eval mv -iv \"$x\" \"$dest\"
|
mv -iv "$x" "$destpath"
|
||||||
done &&
|
done &&
|
||||||
notify-send "🚚 File(s) moved." "File(s) moved to $dest."
|
notify-send "🚚 File(s) moved." "File(s) moved to $destpath."
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd copyto ${{
|
cmd copyto ${{
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
|
||||||
set -f
|
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 --prompt 'Copy to where? ' | sed 's|~|$HOME|')
|
||||||
dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
|
[ -z "$dest" ] && exit
|
||||||
|
destpath=$(eval printf '%s' \"$dest\")
|
||||||
|
clear; tput cup $(($(tput lines)/3)); tput bold
|
||||||
|
echo "From:"
|
||||||
|
echo "$fx" | sed 's/^/ /'
|
||||||
|
printf "To:\n %s\n\n\tcopy?[y/N]" "$destpath"
|
||||||
|
read -r ans
|
||||||
|
[ "$ans" != "y" ] && exit
|
||||||
for x in $fx; do
|
for x in $fx; do
|
||||||
eval cp -ivr \"$x\" \"$dest\"
|
cp -ivr "$x" "$destpath"
|
||||||
done &&
|
done &&
|
||||||
notify-send "📋 File(s) copied." "File(s) copies to $dest."
|
notify-send "📋 File(s) copied." "File(s) copied to $destpath."
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd setbg "$1"
|
cmd setbg "$1"
|
||||||
@ -172,7 +184,7 @@ map U $printf "%s" "$fx" | xclip -selection clipboard
|
|||||||
map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard
|
map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard
|
||||||
map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
||||||
map <gt> $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
map <gt> $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
||||||
map T $sxiv -t "$(pwd)" # opens thumbnail mode
|
map T $nsxiv -t "$(pwd)" # opens thumbnail mode
|
||||||
map <c-l> unselect
|
map <c-l> unselect
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,17 +19,22 @@ image() {
|
|||||||
|
|
||||||
case "$(file --dereference --brief --mime-type -- "$1")" in
|
case "$(file --dereference --brief --mime-type -- "$1")" in
|
||||||
image/avif) 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)"
|
image/avif) 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" ] && convert "$1" "$CACHE.jpg"
|
[ ! -f "$CACHE" ] && magick "$1" "$CACHE.jpg"
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
image/vnd.djvu)
|
image/vnd.djvu)
|
||||||
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)"
|
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" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&1
|
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | magick -density 200 - "$CACHE.jpg" > /dev/null 2>&1
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
image/svg+xml)
|
image/svg+xml)
|
||||||
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)"
|
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" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1"
|
[ ! -f "$CACHE" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1"
|
||||||
image "$CACHE.png" "$2" "$3" "$4" "$5" "$1"
|
image "$CACHE.png" "$2" "$3" "$4" "$5" "$1"
|
||||||
;;
|
;;
|
||||||
|
image/x-xcf)
|
||||||
|
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 | awk '{print $1}')"
|
||||||
|
[ ! -f "$CACHE.jpg" ] && magick "$1[0]" "$CACHE.jpg"
|
||||||
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||||
|
;;
|
||||||
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
||||||
text/troff) man ./ "$1" | col -b ;;
|
text/troff) man ./ "$1" | col -b ;;
|
||||||
|
|||||||
@ -7,10 +7,8 @@ restore_paused "yes"
|
|||||||
max_output_buffer_size "16384"
|
max_output_buffer_size "16384"
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pulse"
|
type "pipewire"
|
||||||
name "pulse"
|
name "PipeWire Sound Server"
|
||||||
#type "alsa"
|
|
||||||
#name "ALSA"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
|
|||||||
@ -14,11 +14,11 @@ do
|
|||||||
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
||||||
;;
|
;;
|
||||||
"r")
|
"r")
|
||||||
convert -rotate 90 "$file" "$file" ;;
|
magick -rotate 90 "$file" "$file" ;;
|
||||||
"R")
|
"R")
|
||||||
convert -rotate -90 "$file" "$file" ;;
|
magick -rotate -90 "$file" "$file" ;;
|
||||||
"f")
|
"f")
|
||||||
convert -flop "$file" "$file" ;;
|
magick -flop "$file" "$file" ;;
|
||||||
"y")
|
"y")
|
||||||
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
|
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
|
||||||
notify-send "$file copied to clipboard" & ;;
|
notify-send "$file copied to clipboard" & ;;
|
||||||
|
|||||||
@ -1,247 +0,0 @@
|
|||||||
# Daemon config file for PipeWire version "0.3.40" #
|
|
||||||
#
|
|
||||||
# Copy and edit this file in /etc/pipewire for system-wide changes
|
|
||||||
# or in ~/.config/pipewire for local changes.
|
|
||||||
|
|
||||||
context.properties = {
|
|
||||||
## Configure properties in the system.
|
|
||||||
#library.name.system = support/libspa-support
|
|
||||||
#context.data-loop.library.name.system = support/libspa-support
|
|
||||||
#support.dbus = true
|
|
||||||
#link.max-buffers = 64
|
|
||||||
link.max-buffers = 16 # version < 3 clients can't handle more
|
|
||||||
#mem.warn-mlock = false
|
|
||||||
#mem.allow-mlock = true
|
|
||||||
#mem.mlock-all = false
|
|
||||||
#clock.power-of-two-quantum = true
|
|
||||||
#log.level = 2
|
|
||||||
#cpu.zero.denormals = true
|
|
||||||
|
|
||||||
core.daemon = true # listening for socket connections
|
|
||||||
core.name = pipewire-0 # core name and socket name
|
|
||||||
|
|
||||||
## Properties for the DSP configuration.
|
|
||||||
#default.clock.rate = 48000
|
|
||||||
#default.clock.allowed-rates = [ 48000 ]
|
|
||||||
#default.clock.quantum = 1024
|
|
||||||
#default.clock.min-quantum = 32
|
|
||||||
#default.clock.max-quantum = 8192
|
|
||||||
#default.video.width = 640
|
|
||||||
#default.video.height = 480
|
|
||||||
#default.video.rate.num = 25
|
|
||||||
#default.video.rate.denom = 1
|
|
||||||
#
|
|
||||||
# These overrides are only applied when running in a vm.
|
|
||||||
vm.overrides = {
|
|
||||||
default.clock.min-quantum = 1024
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
context.spa-libs = {
|
|
||||||
#<factory-name regex> = <library-name>
|
|
||||||
#
|
|
||||||
# Used to find spa factory names. It maps an spa factory name
|
|
||||||
# regular expression to a library name that should contain
|
|
||||||
# that factory.
|
|
||||||
#
|
|
||||||
audio.convert.* = audioconvert/libspa-audioconvert
|
|
||||||
api.alsa.* = alsa/libspa-alsa
|
|
||||||
api.v4l2.* = v4l2/libspa-v4l2
|
|
||||||
api.libcamera.* = libcamera/libspa-libcamera
|
|
||||||
api.bluez5.* = bluez5/libspa-bluez5
|
|
||||||
api.vulkan.* = vulkan/libspa-vulkan
|
|
||||||
api.jack.* = jack/libspa-jack
|
|
||||||
support.* = support/libspa-support
|
|
||||||
#videotestsrc = videotestsrc/libspa-videotestsrc
|
|
||||||
#audiotestsrc = audiotestsrc/libspa-audiotestsrc
|
|
||||||
}
|
|
||||||
|
|
||||||
context.modules = [
|
|
||||||
#{ name = <module-name>
|
|
||||||
# [ args = { <key> = <value> ... } ]
|
|
||||||
# [ flags = [ [ ifexists ] [ nofail ] ]
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# Loads a module with the given parameters.
|
|
||||||
# If ifexists is given, the module is ignored when it is not found.
|
|
||||||
# If nofail is given, module initialization failures are ignored.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Uses RTKit to boost the data thread priority.
|
|
||||||
{ name = libpipewire-module-rtkit
|
|
||||||
args = {
|
|
||||||
#nice.level = -11
|
|
||||||
#rt.prio = 88
|
|
||||||
#rt.time.soft = 2000000
|
|
||||||
#rt.time.hard = 2000000
|
|
||||||
}
|
|
||||||
flags = [ ifexists nofail ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set thread priorities without using RTKit.
|
|
||||||
#{ name = libpipewire-module-rt
|
|
||||||
# args = {
|
|
||||||
# nice.level = -11
|
|
||||||
# rt.prio = 88
|
|
||||||
# rt.time.soft = 2000000
|
|
||||||
# rt.time.hard = 2000000
|
|
||||||
# }
|
|
||||||
# flags = [ ifexists nofail ]
|
|
||||||
#}
|
|
||||||
|
|
||||||
# The native communication protocol.
|
|
||||||
{ name = libpipewire-module-protocol-native }
|
|
||||||
|
|
||||||
# The profile module. Allows application to access profiler
|
|
||||||
# and performance data. It provides an interface that is used
|
|
||||||
# by pw-top and pw-profiler.
|
|
||||||
{ name = libpipewire-module-profiler }
|
|
||||||
|
|
||||||
# Allows applications to create metadata objects. It creates
|
|
||||||
# a factory for Metadata objects.
|
|
||||||
{ name = libpipewire-module-metadata }
|
|
||||||
|
|
||||||
# Creates a factory for making devices that run in the
|
|
||||||
# context of the PipeWire server.
|
|
||||||
{ name = libpipewire-module-spa-device-factory }
|
|
||||||
|
|
||||||
# Creates a factory for making nodes that run in the
|
|
||||||
# context of the PipeWire server.
|
|
||||||
{ name = libpipewire-module-spa-node-factory }
|
|
||||||
|
|
||||||
# Allows creating nodes that run in the context of the
|
|
||||||
# client. Is used by all clients that want to provide
|
|
||||||
# data to PipeWire.
|
|
||||||
{ name = libpipewire-module-client-node }
|
|
||||||
|
|
||||||
# Allows creating devices that run in the context of the
|
|
||||||
# client. Is used by the session manager.
|
|
||||||
{ name = libpipewire-module-client-device }
|
|
||||||
|
|
||||||
# The portal module monitors the PID of the portal process
|
|
||||||
# and tags connections with the same PID as portal
|
|
||||||
# connections.
|
|
||||||
{ name = libpipewire-module-portal
|
|
||||||
flags = [ ifexists nofail ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# The access module can perform access checks and block
|
|
||||||
# new clients.
|
|
||||||
{ name = libpipewire-module-access
|
|
||||||
args = {
|
|
||||||
# access.allowed to list an array of paths of allowed
|
|
||||||
# apps.
|
|
||||||
#access.allowed = [
|
|
||||||
# /usr/bin/pipewire-media-session
|
|
||||||
#]
|
|
||||||
|
|
||||||
# An array of rejected paths.
|
|
||||||
#access.rejected = [ ]
|
|
||||||
|
|
||||||
# An array of paths with restricted access.
|
|
||||||
#access.restricted = [ ]
|
|
||||||
|
|
||||||
# Anything not in the above lists gets assigned the
|
|
||||||
# access.force permission.
|
|
||||||
#access.force = flatpak
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Makes a factory for wrapping nodes in an adapter with a
|
|
||||||
# converter and resampler.
|
|
||||||
{ name = libpipewire-module-adapter }
|
|
||||||
|
|
||||||
# Makes a factory for creating links between ports.
|
|
||||||
{ name = libpipewire-module-link-factory }
|
|
||||||
|
|
||||||
# Provides factories to make session manager objects.
|
|
||||||
{ name = libpipewire-module-session-manager }
|
|
||||||
]
|
|
||||||
|
|
||||||
context.objects = [
|
|
||||||
#{ factory = <factory-name>
|
|
||||||
# [ args = { <key> = <value> ... } ]
|
|
||||||
# [ flags = [ [ nofail ] ]
|
|
||||||
#}
|
|
||||||
#
|
|
||||||
# Creates an object from a PipeWire factory with the given parameters.
|
|
||||||
# If nofail is given, errors are ignored (and no object is created).
|
|
||||||
#
|
|
||||||
#{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc Spa:Pod:Object:Param:Props:patternType = 1 } }
|
|
||||||
#{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] }
|
|
||||||
#{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } }
|
|
||||||
#{ factory = spa-node-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } }
|
|
||||||
#{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test } }
|
|
||||||
#{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } }
|
|
||||||
|
|
||||||
# A default dummy driver. This handles nodes marked with the "node.always-driver"
|
|
||||||
# property when no other driver is currently active. JACK clients need this.
|
|
||||||
{ factory = spa-node-factory
|
|
||||||
args = {
|
|
||||||
factory.name = support.node.driver
|
|
||||||
node.name = Dummy-Driver
|
|
||||||
node.group = pipewire.dummy
|
|
||||||
priority.driver = 20000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{ factory = spa-node-factory
|
|
||||||
args = {
|
|
||||||
factory.name = support.node.driver
|
|
||||||
node.name = Freewheel-Driver
|
|
||||||
priority.driver = 19000
|
|
||||||
node.group = pipewire.freewheel
|
|
||||||
node.freewheel = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# This creates a new Source node. It will have input ports
|
|
||||||
# that you can link, to provide audio for this source.
|
|
||||||
#{ factory = adapter
|
|
||||||
# args = {
|
|
||||||
# factory.name = support.null-audio-sink
|
|
||||||
# node.name = "my-mic"
|
|
||||||
# node.description = "Microphone"
|
|
||||||
# media.class = "Audio/Source/Virtual"
|
|
||||||
# audio.position = "FL,FR"
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
|
|
||||||
# This creates a single PCM source device for the given
|
|
||||||
# alsa device path hw:0. You can change source to sink
|
|
||||||
# to make a sink in the same way.
|
|
||||||
#{ factory = adapter
|
|
||||||
# args = {
|
|
||||||
# factory.name = api.alsa.pcm.source
|
|
||||||
# node.name = "alsa-source"
|
|
||||||
# node.description = "PCM Source"
|
|
||||||
# media.class = "Audio/Source"
|
|
||||||
# api.alsa.path = "hw:0"
|
|
||||||
# api.alsa.period-size = 1024
|
|
||||||
# api.alsa.headroom = 0
|
|
||||||
# api.alsa.disable-mmap = false
|
|
||||||
# api.alsa.disable-batch = false
|
|
||||||
# audio.format = "S16LE"
|
|
||||||
# audio.rate = 48000
|
|
||||||
# audio.channels = 2
|
|
||||||
# audio.position = "FL,FR"
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
]
|
|
||||||
|
|
||||||
context.exec = [
|
|
||||||
#{ path = <program-name> [ args = "<arguments>" ] }
|
|
||||||
#
|
|
||||||
# Execute the given program with arguments.
|
|
||||||
#
|
|
||||||
# You can optionally start the session manager here,
|
|
||||||
# but it is better to start it as a systemd service.
|
|
||||||
# Run the session manager with -h for options.
|
|
||||||
#
|
|
||||||
{ path = "/usr/bin/wireplumber" args = "" }
|
|
||||||
#
|
|
||||||
# You can optionally start the pulseaudio-server here as well
|
|
||||||
# but it is better to start it as a systemd service.
|
|
||||||
# It can be interesting to start another daemon here that listens
|
|
||||||
# on another address with the -a option (eg. -a tcp:4713).
|
|
||||||
#
|
|
||||||
{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" }
|
|
||||||
]
|
|
||||||
4
.config/pipewire/pipewire.conf.d/user-session.conf
Normal file
4
.config/pipewire/pipewire.conf.d/user-session.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
context.exec = [
|
||||||
|
{ path = "/usr/bin/wireplumber" args = "" condition = [ { exec.session-manager = null } { exec.session-manager = true } ] }
|
||||||
|
{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" condition = [ { exec.pipewire-pulse = null } { exec.pipewire-pulse = true } ] }
|
||||||
|
]
|
||||||
@ -16,7 +16,7 @@ done; unset command
|
|||||||
se() {
|
se() {
|
||||||
choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
|
choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
|
||||||
[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
|
[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
|
||||||
;}
|
}
|
||||||
|
|
||||||
# Verbosity and settings that you pretty much just always are going to want.
|
# Verbosity and settings that you pretty much just always are going to want.
|
||||||
alias \
|
alias \
|
||||||
@ -57,5 +57,4 @@ alias \
|
|||||||
alias \
|
alias \
|
||||||
lf="lfub" \
|
lf="lfub" \
|
||||||
magit="nvim -c MagitOnly" \
|
magit="nvim -c MagitOnly" \
|
||||||
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
|
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
||||||
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \
|
|
||||||
|
|||||||
@ -13,6 +13,16 @@ map J zoom out
|
|||||||
map i recolor
|
map i recolor
|
||||||
map p print
|
map p print
|
||||||
map g goto top
|
map g goto top
|
||||||
|
map [fullscreen] u scroll half-up
|
||||||
|
map [fullscreen] d scroll half-down
|
||||||
|
map [fullscreen] D toggle_page_mode
|
||||||
|
map [fullscreen] r reload
|
||||||
|
map [fullscreen] R rotate
|
||||||
|
map [fullscreen] K zoom in
|
||||||
|
map [fullscreen] J zoom out
|
||||||
|
map [fullscreen] i recolor
|
||||||
|
map [fullscreen] p print
|
||||||
|
map [fullscreen] g goto top
|
||||||
|
|
||||||
set default-bg "{background}"
|
set default-bg "{background}"
|
||||||
set default-fg "{foreground}"
|
set default-fg "{foreground}"
|
||||||
|
|||||||
@ -13,3 +13,13 @@ map J zoom out
|
|||||||
map i recolor
|
map i recolor
|
||||||
map p print
|
map p print
|
||||||
map g goto top
|
map g goto top
|
||||||
|
map [fullscreen] u scroll half-up
|
||||||
|
map [fullscreen] d scroll half-down
|
||||||
|
map [fullscreen] D toggle_page_mode
|
||||||
|
map [fullscreen] r reload
|
||||||
|
map [fullscreen] R rotate
|
||||||
|
map [fullscreen] K zoom in
|
||||||
|
map [fullscreen] J zoom out
|
||||||
|
map [fullscreen] i recolor
|
||||||
|
map [fullscreen] p print
|
||||||
|
map [fullscreen] g goto top
|
||||||
|
|||||||
@ -15,6 +15,7 @@ setopt inc_append_history
|
|||||||
|
|
||||||
# Load aliases and shortcuts if existent.
|
# Load aliases and shortcuts if existent.
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
||||||
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
||||||
|
|
||||||
|
|||||||
@ -9,12 +9,12 @@ output="$(date '+%y%m%d-%H%M-%S').png"
|
|||||||
xclip_cmd="xclip -sel clip -t image/png"
|
xclip_cmd="xclip -sel clip -t image/png"
|
||||||
ocr_cmd="xclip -sel clip"
|
ocr_cmd="xclip -sel clip"
|
||||||
|
|
||||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\ncopy selected image to text" | dmenu -l 7 -i -p "Screenshot which area?")" in
|
||||||
"a selected area") maim -u -s pic-selected-"${output}" ;;
|
"a selected area") maim -u -s pic-selected-"${output}" ;;
|
||||||
"current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;;
|
"current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;;
|
||||||
"full screen") maim -q -d 0.2 pic-full-"${output}" ;;
|
"full screen") maim -q -d 0.2 pic-full-"${output}" ;;
|
||||||
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
|
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
|
||||||
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
|
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
|
||||||
"full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;;
|
"full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;;
|
||||||
"a selected area (OCR)") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;;
|
"copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -79,8 +79,13 @@ case "$chosen" in
|
|||||||
💾*)
|
💾*)
|
||||||
chosen="${chosen%% *}"
|
chosen="${chosen%% *}"
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
chosen="${chosen:1}" # This is a bashism.
|
||||||
|
parttype="$(echo "$lsblkoutput" | grep "$chosen")"
|
||||||
attemptmount || getmount
|
attemptmount || getmount
|
||||||
sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
case "${parttype##* }" in
|
||||||
|
vfat) sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;;
|
||||||
|
btrfs) sudo -A mount "$chosen" "$mp" ;;
|
||||||
|
*) sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;;
|
||||||
|
esac
|
||||||
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
|
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
|
|||||||
|
|
||||||
# Output locations. Unactivated progs should go to /dev/null.
|
# Output locations. Unactivated progs should go to /dev/null.
|
||||||
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
||||||
|
shell_env_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
|
||||||
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
||||||
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
|
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
|
||||||
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
|
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
|
||||||
@ -16,12 +17,14 @@ vifm_shortcuts="/dev/null"
|
|||||||
rm -f "$lf_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
|
rm -f "$lf_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
|
||||||
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
||||||
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
||||||
|
printf "# vim: filetype=sh\\n" > "$shell_env_shortcuts"
|
||||||
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
||||||
|
|
||||||
# Format the `directories` file in the correct syntax and sent it to all three configs.
|
# Format the `directories` file in the correct syntax and sent it to all three configs.
|
||||||
eval "echo \"$(cat "$bmdirs")\"" | \
|
eval "echo \"$(cat "$bmdirs")\"" | \
|
||||||
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
||||||
printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
||||||
|
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
|
||||||
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
||||||
printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
||||||
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ;
|
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ;
|
||||||
@ -33,6 +36,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
|||||||
eval "echo \"$(cat "$bmfiles")\"" | \
|
eval "echo \"$(cat "$bmfiles")\"" | \
|
||||||
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
||||||
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
||||||
|
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
|
||||||
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
||||||
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
||||||
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;
|
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;
|
||||||
|
|||||||
@ -67,7 +67,6 @@ if [ -n "${audio+x}" ]; then
|
|||||||
*) echo "That doesn't look like an audio file."; exit 1 ;;
|
*) echo "That doesn't look like an audio file."; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))"
|
totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))"
|
||||||
endtime="$((totseconds-seconds))"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prepdir="${prepdir:-$cache/$file}"
|
prepdir="${prepdir:-$cache/$file}"
|
||||||
@ -95,10 +94,10 @@ do
|
|||||||
# If images have already been made in a previous run, do not recreate
|
# If images have already been made in a previous run, do not recreate
|
||||||
# them unless -r was given.
|
# them unless -r was given.
|
||||||
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
||||||
convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
|
magick -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
|
||||||
else
|
else
|
||||||
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
||||||
convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
|
magick -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the first line, do not write yet.
|
# If the first line, do not write yet.
|
||||||
@ -111,6 +110,7 @@ duration $duration"
|
|||||||
prevseconds="$(date '+%s' -d "$prevtime")"
|
prevseconds="$(date '+%s' -d "$prevtime")"
|
||||||
done < "$file"
|
done < "$file"
|
||||||
# Do last file which must be given twice as follows
|
# Do last file which must be given twice as follows
|
||||||
|
endtime="$((totseconds-seconds))"
|
||||||
echo "file '$base'
|
echo "file '$base'
|
||||||
duration ${endtime:-5}
|
duration ${endtime:-5}
|
||||||
file '$base'"
|
file '$base'"
|
||||||
|
|||||||
23
.local/bin/statusbar/sb-brightness
Executable file
23
.local/bin/statusbar/sb-brightness
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# current brightness
|
||||||
|
curr_brightness=$(cat /sys/class/backlight/*/brightness)
|
||||||
|
|
||||||
|
# max_brightness
|
||||||
|
max_brightness=$(cat /sys/class/backlight/*/max_brightness)
|
||||||
|
|
||||||
|
# brightness percentage
|
||||||
|
brightness_per=$((100 * curr_brightness / max_brightness))
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
1)
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
notify-send "💡 Brightness module" "\- Shows current brightness level ☀️."
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
setsid -f "$TERMINAL" -e "$EDITOR" "$0"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "💡 ${brightness_per}%"
|
||||||
@ -19,7 +19,7 @@ case "$clock" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|sed 's/ //g')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
||||||
2) setsid -f "$TERMINAL" -e calcurse ;;
|
2) setsid -f "$TERMINAL" -e calcurse ;;
|
||||||
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
||||||
- Middle click opens calcurse if installed" ;;
|
- Middle click opens calcurse if installed" ;;
|
||||||
|
|||||||
@ -28,7 +28,9 @@ filestat="$(stat -c %x "$pricefile" 2>/dev/null)"
|
|||||||
|
|
||||||
[ -d "$dir" ] || mkdir -p "$dir"
|
[ -d "$dir" ] || mkdir -p "$dir"
|
||||||
|
|
||||||
updateprice() { curl -sf -m 1 --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile" ||
|
updateprice() { curl -sf \
|
||||||
|
--fail-early "${denom}.${url}/1${target}" "${denom}.${url}/${target}${interval}" \
|
||||||
|
--output "$pricefile" --output "$chartfile" ||
|
||||||
rm -f "$pricefile" "$chartfile" ;}
|
rm -f "$pricefile" "$chartfile" ;}
|
||||||
|
|
||||||
[ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] &&
|
[ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] &&
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
|
1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
|
||||||
2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
|
2) wpctl set-mute @DEFAULT_SINK@ toggle ;;
|
||||||
4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
|
4) wpctl set-volume @DEFAULT_SINK@ 1%+ ;;
|
||||||
5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
|
5) wpctl set-volume @DEFAULT_SINK@ 1%- ;;
|
||||||
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
||||||
- Middle click to mute.
|
- Middle click to mute.
|
||||||
- Scroll to change." ;;
|
- Scroll to change." ;;
|
||||||
|
|||||||
@ -3,14 +3,7 @@
|
|||||||
# Clears the build files of a LaTeX/XeLaTeX build.
|
# Clears the build files of a LaTeX/XeLaTeX build.
|
||||||
# I have vim run this file whenever I exit a .tex file.
|
# I have vim run this file whenever I exit a .tex file.
|
||||||
|
|
||||||
case "$1" in
|
[ "${1##*.}" = "tex" ] && {
|
||||||
*.tex)
|
find "$(dirname "${1}")" -regex '.*\(_minted.*\|.*\.\(4tc\|xref\|tmp\|pyc\|pyg\|pyo\|fls\|vrb\|fdb_latexmk\|bak\|swp\|aux\|log\|synctex\(busy\)\|lof\|lot\|maf\|idx\|mtc\|mtc0\|nav\|out\|snm\|toc\|bcf\|run\.xml\|synctex\.gz\|blg\|bbl\)\)' -delete
|
||||||
file=$(readlink -f "$1")
|
} || printf "Provide a .tex file.\n"
|
||||||
dir=$(dirname "$file")
|
|
||||||
base="${file%.*}"
|
|
||||||
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete
|
|
||||||
rm -rdf "$dir/_minted-$(basename -- "$base")"
|
|
||||||
;;
|
|
||||||
*) printf "Give .tex file as argument.\\n" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|||||||
25
.local/bin/weath
Normal file
25
.local/bin/weath
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Get the weather on the terminal. You can pass an alternative location as a parameter,
|
||||||
|
# and/or use the 'cp' option to copy the forecast as plaintext to the clipboard.
|
||||||
|
|
||||||
|
report="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
||||||
|
|
||||||
|
if [ "$1" = 'cp' ]; then
|
||||||
|
# shellcheck disable=SC2015
|
||||||
|
[ -z "$2" ] && sed 's/\x1b\[[^m]*m//g' "$report" | xclip -selection clipboard &&
|
||||||
|
notify-send "Weather forecast for '${LOCATION:-$(head -n 1 "$report" | cut -d' ' -f3-)}' copied to clipboard." ||
|
||||||
|
{ data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$2?T")" &&
|
||||||
|
notify-send "Weather forecast for '$2' copied to clipboard." &&
|
||||||
|
echo "$data" | xclip -selection clipboard ||
|
||||||
|
notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'; }
|
||||||
|
else
|
||||||
|
[ -n "$2" ] &&
|
||||||
|
notify-send "Invalid option '$1'! The only valid option is 'cp'." &&
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
# shellcheck disable=SC2015
|
||||||
|
[ -z "$1" ] && less -S "$report" ||
|
||||||
|
data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$1")" && echo "$data" | less -S ||
|
||||||
|
notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user