Compare commits

...

2 Commits

Author SHA1 Message Date
tosu 34c606d965 Shebangs, alacritty bell 2024-06-17 16:58:12 +02:00
tosu 5a3e24c943 Add path script 2024-06-17 05:11:01 +02:00
24 changed files with 107 additions and 74 deletions

View File

@ -2,8 +2,9 @@ live_config_reload = true
[bell]
animation = "EaseOutExpo"
color = "0xffffff"
duration = 0
# color = "0xffffff"
color = "0x111111"
duration = 100
[colors.bright]
black = "#5b6268"

View File

@ -43,9 +43,9 @@ vim.opt.colorcolumn = '80'
vim.opt.paste = false
vim.opt.splitright = false
-- vim.diagnostic.config({
-- virtual_lines = false,
-- virtual_text = false,
-- underline = false,
-- signs = true,
-- })
vim.diagnostic.config({
virtual_lines = false,
virtual_text = false,
underline = false,
signs = true,
})

View File

@ -1,10 +1,6 @@
#!/bin/bash
#! /bin/sh -
set -euo pipefail
###################### STOP ###################
# Put device in pairing mode!!!
# MUST be uppercase
# hex MUST be uppercase
MX5_MAC="AC:80:0A:6D:F3:7B"
MX5_SINK="bluez_sink.AC_80_0A_6D_F3_7B.a2dp_sink"
MX3_MAC="14:3F:A6:A8:7F:CD"
@ -12,14 +8,9 @@ MX3_MAC="14:3F:A6:A8:7F:CD"
DEVICE_MAC="${MX5_MAC}"
DEVICE_SINK="${MX5_SINK}"
function log () {
printf "\n\033[31m%s\033[m\n" "${@}" >/dev/tty
}
bluetoothctl power on && bluetoothctl connect "${DEVICE_MAC}"
bluetoothctl power on \
&& bluetoothctl connect "${DEVICE_MAC}"
pactl set-default-sink "${DEVICE_SINK}" || true
pactl set-default-sink "${DEVICE_SINK}"
bluetoothctl connect "${DEVICE_MAC}" ||
{ sleep 3; bluetoothctl connect "${DEVICE_MAC}"; }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#! /bin/python3 --
import os
import re

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output DP-1 --same-as eDP-1 --auto
#! /bin/sh -
exec xrandr --output eDP-1 --auto --output DP-1 --same-as eDP-1 --auto

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output DP-1 --auto --output eDP-1 --off
#! /bin/sh -
exec xrandr --output DP-1 --auto --output eDP-1 --off

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output DP-1 --right-of eDP-1 --auto
#! /bin/sh -
exec xrandr --output eDP-1 --auto --output DP-1 --right-of eDP-1 --auto

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output HDMI-1 --off --output DP-1 --off
#! /bin/sh -
exec xrandr --output eDP-1 --auto --output HDMI-1 --off --output DP-1 --off

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output HDMI-1 --same-as eDP-1 --auto
#! /bin/sh -
exec xrandr --output eDP-1 --auto --output HDMI-1 --same-as eDP-1 --auto

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output HDMI-1 --auto --output eDP-1 --off
#! /bin/sh -
exec xrandr --output HDMI-1 --auto --output eDP-1 --off

View File

@ -1,2 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --auto --output HDMI-1 --right-of eDP-1 --auto
#! /bin/sh -
exec xrandr --output eDP-1 --auto --output HDMI-1 --right-of eDP-1 --auto

View File

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh -
command -v squote_escape >/dev/null 2>&1 || { echo "${0} depends on squote_escape"; exit 1; }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#! /bin/bash --
set -e

View File

@ -1,17 +1,16 @@
#!/bin/bash
#! /bin/sh -
set -euo pipefail
###################### STOP ###################
# Put device in pairing mode!!!
# MUST be uppercase
# hex MUST be uppercase
MX5_MAC="AC:80:0A:6D:F3:7B"
MX3_MAC="14:3F:A6:A8:7F:CD"
DEVICE_MAC="${MX5_MAC}"
DEVICE_MAC="$MX5_MAC"
function log () {
printf "\n\033[31m%s\033[m\n" "${@}" >/dev/tty
log () {
printf "\n\033[31m%s\033[m\n" "$*" >/dev/tty
}
log "rfkill block bluetooth..."
@ -33,7 +32,7 @@ sleep 3
log "Powering on bluetooth agent..."
cat <<- CMDS
power on
power on
agent on
default-agent
pairable on

33
.local/bin/path Executable file
View File

@ -0,0 +1,33 @@
#! /bin/sh -
# POSIX-compliant shell script to print the PATH contents line by line,
# without duplicated, in order, without empty lines.
__arrvar="__arr_random_n8241vn81y39c"
in_list () {
max_idx="$(($1))"
arg="$2"
[ "$max_idx" -ge 1 ] || return 1
[ -n "$arg" ] || return 2
idx_in_list=0
while [ "$idx_in_list" -le "$max_idx" ]; do
val="$(eval "printf %s "'"'"\$${__arrvar}_$idx_in_list"'"')"
[ "$val" = "$arg" ] && return 0
idx_in_list="$((idx_in_list+1))"
done
return 1
}
idx=0
printf "%s\n" "$PATH" | sed "s/^:\+//; s/:\+$//; s/:\+/\n/g" | while IFS= read -r line; do
eval "unset ${__arrvar}_$idx"
idx="$((idx+1))"
done
idx=0
printf "%s\n" "$PATH" | sed "s/^:\+//; s/:\+$//; s/:\+/\n/g" | while IFS= read -r line; do
in_list "$idx" "$line" && continue
printf "%s\n" "$line"
eval "${__arrvar}_$idx=\$line"
idx="$((idx+1))"
done

View File

@ -1,27 +1,36 @@
#!/bin/sh
#! /bin/sh -
err () {
printf '\033[31m%s\033[m\n' "$*"
}
# mia's 0x0.st -- fast!
curl -sfSL -F"file=@${1:--}" 0x0.st && exit 0
err "Mia's (0x0.st) pastebin failed!"
trap 'rm -f "$file"' EXIT
# pb1n.de -- fast!
curl -sfSL -F"f=@${1:--}" pb1n.de && exit 0
err "pb1n.de pastebin failed!"
[ ! -t 0 ] && [ -z "$1" ] && file=$(mktemp) && cat >"$file" || [ -n "$1" ] && file="$1"
# chris titus' hastebin -- not that fast
response="$(curl -sfSL --data-binary @"${1:--}" bin.christitus.com/documents)" &&
{ hasteKey="$(printf %s "$response" | jq -r '.key')" && [ -n "${hasteKey}" ] &&
echo "http://bin.christitus.com/raw/$hasteKey" && exit 0 || err "Couldn't extract hasteKey. Sorry!"; }
err "Chris' pastebin failed!"
# mia's 0x0.st -- fast! -- prints \n
# curl -sfSL -F"file=@$file" 0x0.st && exit 0 ; err "Mia's (0x0.st) pastebin failed!"
# paste.rs -- damn slow
curl -sfSL --data-binary @"${1:--}" paste.rs && exit 0
err "paste.rs pastebin failed!"
# pb1n.de -- fast! -- prints \n
# curl -sfSL -F"f=@$file" pb1n.de && exit 0 ; err "pb1n.de pastebin failed!"
# ix.io, broken
curl -sfSL -F"f=@${1:--}" pb1n.de && exit 0
err "ix.io pastebin failed!"
# chris titus' hastebin -- not that fast -- prints \n
# response="$(curl -sfSL --data-binary @"$file" bin.christitus.com/documents)" &&
# { hasteKey="$(printf %s "$response" | jq -r '.key')" && [ -n "${hasteKey}" ] &&
# echo "http://bin.christitus.com/raw/$hasteKey" && exit 0 || err "Couldn't extract hasteKey. Sorry!"; }
# err "Chris' pastebin failed!"
# paste.rs -- damn slow -- prints without \n
# curl -sfSL --data-binary @"$file" paste.rs && exit 0 ; err "paste.rs pastebin failed!"
# transfer.sh -- requires https -- not that fast -- prints \n
curl -sfSL --upload-file "$file" https://transfer.sh && exit 0 ; err "transfer.sh pastebin failed!"
# clbin.com -- requires https -- not that fast -- prints \n
curl -sfSL -F"clbin=<$file" https://clbin.com && exit 0 ; err "clbin.com pastebin failed!"
# sprunge.us -- RIP
curl -sfSL -F"sprunge=<$file" http://sprunge.us && exit 0 ; err "sprunge.us pastebin failed!"
# ix.io, "taking a break" -- RIP
curl -sfSL -F"f:1=<$file" ix.io && exit 0 ; err "ix.io pastebin failed!"

View File

@ -1,5 +1,5 @@
#!/bin/sh
#! /bin/sh -
[ -t 1 ] &&
qrencode -m2 -t ANSI256UTF8 "$@" ||
qrencode -m2 -t UTF8 "$@"
exec qrencode -m2 -t ANSI256UTF8 "$@" ||
exec qrencode -m2 -t UTF8 "$@"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#! /bin/bash --
curl -s "https://archlinux.org/mirrorlist/?country=DE&protocol=https&use_mirror_status=on" \
| sed -e 's/^#Server/Server/' -e '/^#/d' \

View File

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh -
min="${1-}"
sec="${2-}"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh -
if [ -t 0 ] && [ -n "${1}" ]; then
while [ -n "${1}" ]; do

View File

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh -
run () {
if [ "$(date "+%H")" = "06" ] ; then
@ -6,7 +6,7 @@ run () {
fi
sleep 10
export PATH="${PATH}:/home/tosuman/.local/bin"
export SHELL='/usr/bin/bash'
export SHELL='/bin/bash'
number_of_tmux_sessions="$(tmux ls | wc -l)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#! /usr/bin/python3 --
# -*- coding: utf-8 -*-
import re

View File

@ -1,4 +1,4 @@
#!/usr/bin/bash
#! /bin/bash --
choose_from_menu () {
local prompt="${1}"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#! /bin/sh -
for pid in $(pgrep -f "updatebar") ; do
[ "${pid}" != "${$}" ] && 2>/dev/null kill -9 "${pid}"