Compare commits

...

No commits in common. "void-linux" and "macos" have entirely different histories.

49 changed files with 45 additions and 1770 deletions

View File

@ -1,15 +0,0 @@
[global]
script = ~/.config/dunst/playsound
corner_radius = 5
timeout = 1
[critical]
timeout = 0
[brightness]
summary = "Brightness:*"
history_ignore = yes
[volume]
summary = "Volume:*"
history_ignore = yes

View File

@ -1,3 +0,0 @@
#! /bin/sh
play "~/.config/sounds/dunst/$DUNST_STACK_TAG.*" || play "~/.config/sounds/dunst/$DUNST_DESKTOP_ENTRY.*" || play "~/.config/sounds/dunst/$DUNST_URGENCY.*"

View File

@ -2,14 +2,6 @@ set -x PATH "$HOME/bin:$PATH"
if not which sh > /dev/null 2>&1
alias which="command -v"
end
if not which hostname > /dev/null 2>&1
alias hostname="cat /etc/hostname"
end
if which doas > /dev/null 2>&1
alias sudo="doas"
else
@ -25,39 +17,22 @@ else
set -x EDITOR "vim -u ~/.config/vim/vimrc"
end
alias datenow="date '+%Y-%m-%d'"
function please
eval doas $history[1]
end
function x
startx ~/.config/xinitrc
if [ -f "$XDG_RUNTIME_DIR/logout" ]
rm "$XDG_RUNTIME_DIR/logout"
exit
end
end
function pingme
set COMMAND $argv
$argv
$COMMAND
notify-send --urgency=normal "Ping!" "Job '$COMMAND' exited with status $status."
end
function nope-syntax --on-event fish_posterror
if [ $status -gt 0 ]
play ~/.config/sounds/nope.mp3 > /dev/null 2>&1 & disown
end
end
function nope-command --on-event fish_postexec
if [ $status -gt 0 ]
play ~/.config/sounds/nope.mp3 > /dev/null 2>&1 & disown
end
tput bel
sleep 0.1
tput bel
sleep 0.1
tput bel
end
@ -77,19 +52,15 @@ end
if status --is-login
echo ""
end
if status --is-interactive
alias la="ls -a --color=always"
alias ll="ls -l --color=always"
alias ls="ls --color=always"
alias la="ls -a -G"
alias ll="ls -l -G"
alias ls="ls -G"
alias g="git"
mkdir -p ~/.local
if [ (expr (date '+%s') - (cat "$HOME/.local/last_shell" 2>/dev/null || echo 0)) -gt "28800" ]
timeout 5 git sit && date '+%s' > "$HOME/.local/last_shell"
git sit && date '+%s' > "$HOME/.local/last_shell"
echo ""
end

View File

@ -1,12 +1,12 @@
[init]
defaultBranch = main
[user]
name = Sam Greytalon
name = Sam Talonborn
email = sam@oaktal.com
[pull]
rebase = false
[alias]
sit = pull --rebase
flush = "git add -A && git commit -a; git push"
flush = "!git add -A && git commit -a; git push"
unstage = reset HEAD --
sync = !git sit && git flush
sync = "!git sit && git flush"

View File

@ -1,37 +0,0 @@
#!/usr/bin/env bash
hc() {
cmds="$cmds , $@"
}
hc emit_hook reload
. ~/.config/herbstluftwm/keybinds
hc unrule -F
hc rule focus=on # normally focus new clients
hc rule floatplacement=smart
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
hc set tree_style '╾│ ├└╼─┐'
. ~/.config/herbstluftwm/theme
herbstclient chain $cmds
#
# STOLEN FLOATING WINDOW CODE:
#
PADDING=$(herbstclient list_padding)
#re-add monitor called 'float' with same padding and dimensions as the monitor under focus in tag 9
herbstclient remove_monitor float
herbstclient add_monitor $(herbstclient list_monitors | grep \[FOCUS\] | grep -oe '[0-9]\+x[0-9]\++[0-9]\++[0-9]\+') "PIN" float
herbstclient lock_tag float
#add same padding:
herbstclient pad float $PADDING
# unlock after everything
hc unlock

View File

@ -1,89 +0,0 @@
#!/bin/sh
Mod=Mod4
hc keyunbind --all
hc keybind $Mod-Shift-q spawn herbstclient quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close_or_remove
hc keybind $Mod-q close_or_remove
hc keybind $Mod-Return spawn "${TERMINAL} -d ~"
hc keybind $Mod-space spawn "${MENU}"
hc keybind Print spawn screenshot
hc keybind Shift-Print spawn selscreen
hc keybind $Mod-Left focus left
hc keybind $Mod-Down focus down
hc keybind $Mod-Up focus up
hc keybind $Mod-Right focus right
hc keybind $Mod-h focus left
hc keybind $Mod-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-l focus right
hc keybind $Mod-Shift-Left shift left
hc keybind $Mod-Shift-Down shift down
hc keybind $Mod-Shift-Up shift up
hc keybind $Mod-Shift-Right shift right
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right
hc keybind $Mod-Shift-BackSpace shift_to_monitor +1
hc keybind $Mod-u split bottom 0.5
hc keybind $Mod-o split right 0.5
hc keybind $Mod-Control-Space split explode
resizestep=0.02
hc keybind $Mod-Control-h resize left +$resizestep
hc keybind $Mod-Control-j resize down +$resizestep
hc keybind $Mod-Control-k resize up +$resizestep
hc keybind $Mod-Control-l resize right +$resizestep
hc keybind $Mod-Control-Left resize left +$resizestep
hc keybind $Mod-Control-Down resize down +$resizestep
hc keybind $Mod-Control-Up resize up +$resizestep
hc keybind $Mod-Control-Right resize right +$resizestep
hc keybind XF86AudioMute chain '->' spawn vol toggle '->' emit_hook volume_changed
hc keybind XF86AudioLowerVolume chain '->' spawn vol down '->' emit_hook volume_changed
hc keybind XF86AudioRaiseVolume chain '->' spawn vol up '->' emit_hook volume_changed
hc keybind XF86MonBrightnessDown spawn br down
hc keybind XF86MonBrightnessUp spawn br up
hc rename default "1"
for i in $(seq 1 9); do
hc add "$i"
num="$(expr $i - 1)"
hc keybind "$Mod-$i" use_index "$num"
hc keybind "$Mod-Shift-$i" move_index "$num"
done
hc add "PIN"
hc keybind "$Mod-Control-Shift-p" move "PIN"
hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma use_index -1 --skip-visible
hc keybind $Mod-r remove
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
hc keybind $Mod-p pseudotile toggle
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
hc keybind $Mod-BackSpace cycle_monitor
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-c cycle
hc keybind $Mod-i jumpto urgent
hc keybind $Mod-slash cycle_layout +1

View File

@ -1,3 +0,0 @@
include theme.conf
shell .

View File

@ -1,16 +0,0 @@
#! /bin/sh
choice=$(echo " Kill X11\n Logout\n襤 Poweroff" | rofi -dmenu -m -3 -hover-select -me-select-entry '' -me-accept-entry MousePrimary -theme-str ' * { width: 15em; scrollbar: false; } listview { fixed-height: false; } inputbar { enabled: false; }')
case "$choice" in
" Kill X11")
herbstclient quit
;;
" Logout")
touch $XDG_RUNTIME_DIR/logout
herbstclient quit
;;
"襤 Poweroff")
doas poweroff
;;
esac

View File

@ -1,3 +0,0 @@
#! /bin/sh
rofi -show window -show-icons -m -3 -hover-select -me-select-entry '' -me-accept-entry MousePrimary -kb-delete-entry MouseSecondary -window-format '{w} {c:10} {t:15}' -theme-str ' * { width: 15em; scrollbar: false; } listview { fixed-height: false; } inputbar { enabled: false; }'

View File

@ -1,37 +0,0 @@
#!/bin/sh
. ../mpanel.subr
align="left"
background="$(color 4)"
foreground="$(color 3)"
clickFunc=click
waitFunc="wait_for volume_changed"
click() {
vol toggle
}
print_volume() {
sleep 0.01
CURRENT_VOLUME="$(vol get)%%"
padding=11
if [ "$CURRENT_VOLUME" = "muted%%" ]; then
symbol=""
CURRENT_VOLUME=""
padding=10
elif [ "$CURRENT_VOLUME" -le "33" ]; then
symbol=""
elif [ "$CURRENT_VOLUME" -le "66" ]; then
symbol=""
else
symbol=""
fi
output="$(pad " $symbol $CURRENT_VOLUME" $padding)"
echo "$output"
}
loop print_volume

View File

@ -1,30 +0,0 @@
#!/bin/sh
. ../mpanel.subr
align="left"
background="$(color 5)"
foreground="$(color 3)"
waitFunc="wait_for tag_changed"
print_tags() {
output=""
for element in $(herbstclient tag_status); do
pref="$(echo "$element" | cut -c1-1)"
tag="$(echo "$element" | cut -c2-)"
if [ "$pref" = "#" ]; then
output="$output%{R}$tag%{R}"
elif [ "$pref" = ":" ]; then
output="$output%{A:herbstclient use_index $(expr $tag - 1):} $tag %{A}"
else
output="$output"
fi
done
echo "$output"
}
loop print_tags

View File

@ -1,24 +0,0 @@
#!/bin/sh
. ../mpanel.subr
align="left"
background="$(color 6)"
foreground="$(color 3)"
waitFunc="wait_for focus_changed tag_changed window_title_changed"
clickFunc="../menus/windows"
print_focus() {
title="$(herbstclient attr clients.focus.title)"
output="$(trim "$title" 25)"
if [ "$?" = "3" ]; then
echo " $output... "
else
echo " $output "
fi
}
loop print_focus

View File

@ -1,22 +0,0 @@
#!/bin/sh
. ../mpanel.subr
align="center"
background="$(color 7)"
foreground="$(color 3)"
clickFunc="toggle flag"
waitFunc="sleep 1"
flag="true"
print_time() {
if [ "$flag" = "true" ]; then
echo " $(date "+%b. %d, %H:%M") "
else
echo " $(date "+%H:%M") "
fi
}
loop print_time

View File

@ -1,11 +0,0 @@
#!/bin/sh
. ../mpanel.subr
align="center"
background="$(color 8)"
foreground="$(color 3)"
echo "$module_name/$align!$background!$foreground/%{A:./menus/powermenu:} $(whoami)@$(hostname) %{A}"
sleep infinity

View File

@ -1,71 +0,0 @@
#!/bin/sh
. ../mpanel.subr
align="right"
background="$(color 9)"
foreground="$(color 3)"
clickFunc="toggle flag"
waitFunc="sleep 5"
notify=""
flag=true
print_batt() {
level="$(cat /sys/class/power_supply/BAT1/capacity)"
if [ "$level" -ge "100" ]; then
SYMBOL=""
elif [ "$level" -ge "90" ]; then
SYMBOL=""
elif [ "$level" -ge "80" ]; then
SYMBOL=""
elif [ "$level" -ge "70" ]; then
SYMBOL=""
elif [ "$level" -ge "60" ]; then
SYMBOL=""
elif [ "$level" -ge "50" ]; then
SYMBOL=""
elif [ "$level" -ge "40" ]; then
SYMBOL=""
elif [ "$level" -ge "30" ]; then
SYMBOL=""
elif [ "$level" -ge "20" ]; then
SYMBOL=""
notify=""
elif [ "$level" -ge "10" ]; then
SYMBOL=""
if [ "$notify" = "" ]; then
notify-send --urgency=normal "Battery Low!"
fi
notify="low"
elif [ "$level" -ge "0" ]; then
SYMBOL=""
if [ "$notify" = "" ] || [ "$notify" = "low" ]; then
notify-send --urgency=critical "Battery Critically Low!"
fi
notify="critical"
fi
if [ "$(cat /sys/class/power_supply/BAT1/status)" = "Charging" ]; then
SYMBOL="$SYMBOL"
else
SYMBOL="$SYMBOL"
fi
if [ "$flag" = "true" ]; then
output=" $SYMBOL $(cat /sys/class/power_supply/BAT1/capacity)% "
else
output=" $SYMBOL "
fi
echo "$output"
}
loop print_batt

View File

@ -1,34 +0,0 @@
#! /bin/sh
. ../mpanel.subr
align="right"
background="$(color 10)"
foreground="$(color 3)"
waitFunc="sleep 1"
clickFunc='toggle flag; [ "$flag" = "true" ] && waitFunc="sleep 1" || waitFunc="sleep infinity"'
flag="true"
STORE_FILE="$XDG_RUNTIME_DIR/stats-cpu.tmp"
SYMBOL="﬙"
INTERVAL=""
store_stats() {
cpu="$(vmstat 1 2 | tail -1 | awk '{printf "%3.0f", 100-$15}')"
echo "$cpu" | atomic_write "$STORE_FILE"
}
print_stats() {
if [ "$flag" = "true" ]; then
echo " $SYMBOL$(cat "$STORE_FILE")%"
else
echo " $SYMBOL"
fi
}
kickoff store_stats $INTERVAL &
loop print_stats

View File

@ -1,35 +0,0 @@
#! /bin/sh
. ../mpanel.subr
align="right"
background="$(color 10)"
foreground="$(color 3)"
waitFunc="sleep 1"
clickFunc='toggle flag; [ "$flag" = "true" ] && waitFunc="sleep 1" || waitFunc="sleep infinity"'
flag="true"
STORE_FILE="$XDG_RUNTIME_DIR/stats-mem.tmp"
SYMBOL=""
INTERVAL="1"
store_stats() {
memTotal="$(cat /proc/meminfo | grep MemTotal | awk '{print $2}')"
memFree="$(cat /proc/meminfo | grep MemFree | awk '{print $2}')"
awk "BEGIN {printf \"%3.0f\", 100*(($memTotal-$memFree)/$memTotal)}" | atomic_write "$STORE_FILE"
}
print_stats() {
if [ "$flag" = "true" ]; then
echo "$SYMBOL$(cat "$STORE_FILE")%"
else
echo "$SYMBOL"
fi
}
kickoff store_stats $INTERVAL &
loop print_stats

View File

@ -1,34 +0,0 @@
#! /bin/sh
. ../mpanel.subr
align="right"
background="$(color 10)"
foreground="$(color 3)"
waitFunc="sleep 1"
clickFunc='toggle flag; [ "$flag" = "true" ] && waitFunc="sleep 1" || waitFunc="sleep infinity"'
flag="true"
STORE_FILE="$XDG_RUNTIME_DIR/stats-diskr.tmp"
SYMBOL=""
INTERVAL=""
store_stats() {
disk="$(zpool iostat -Hp 1 2 | tail -1 | awk '{r=$6 ; rSuf="B " ; if (r >= 1000) {r=r/1000; rSuf="KB";} if (r >= 1000) {r=r/1000; rSuf="MB";} if (r >= 1000) {r=r/1000; rSuf="GB";} printf "%3.0f", r; printf rSuf;}')"
echo "$disk" | atomic_write "$STORE_FILE"
}
print_stats() {
if [ "$flag" = "true" ]; then
echo "$SYMBOL$(cat "$STORE_FILE")"
else
echo "$SYMBOL"
fi
}
kickoff store_stats $INTERVAL &
loop print_stats

View File

@ -1,34 +0,0 @@
#! /bin/sh
. ../mpanel.subr
align="right"
background="$(color 10)"
foreground="$(color 3)"
waitFunc="sleep 1"
clickFunc='toggle flag; [ "$flag" = "true" ] && waitFunc="sleep 1" || waitFunc="sleep infinity"'
flag="true"
STORE_FILE="$XDG_RUNTIME_DIR/stats-diskw.tmp"
SYMBOL=""
INTERVAL=""
store_stats() {
disk="$(zpool iostat -Hp 1 2 | tail -1 | awk '{w=$7 ; wSuf="B " ; if (w >= 1000) {w=w/1000; wSuf="KB";} if (w >= 1000) {w=w/1000; wSuf="MB";} if (w >= 1000) {w=w/1000; wSuf="GB";} printf "%3.0f", w; printf wSuf;}')"
echo "$disk" | atomic_write "$STORE_FILE"
}
print_stats() {
if [ "$flag" = "true" ]; then
echo "$SYMBOL$(cat "$STORE_FILE")"
else
echo "$SYMBOL"
fi
}
kickoff store_stats $INTERVAL &
loop print_stats

View File

@ -1,34 +0,0 @@
#! /bin/sh
. ../mpanel.subr
align="right"
background="$(color 10)"
foreground="$(color 3)"
waitFunc="sleep 1"
clickFunc='toggle flag; [ "$flag" = "true" ] && waitFunc="sleep 1" || waitFunc="sleep infinity"'
flag="true"
warn=""
SYMBOL=""
print_stats() {
temp="$(cat /sys/class/thermal/thermal_zone4/temp | awk '{printf "%3.0f", $1/1000}')"
if [ "$(echo "$temp" | head -c2)" -gt "80" ]; then
[ "$warn" != "urgent" ] && notify-send --urgency=critical "CPU Temperature High!"
warn="urgent"
else
warn=""
fi
if [ "$flag" = "true" ]; then
echo "$SYMBOL$temp°C "
else
echo "$SYMBOL "
fi
}
loop print_stats

View File

@ -1,91 +0,0 @@
#!/bin/sh
. ../mpanel.subr
. ../aux/secrets
align="right"
background="$(color 11)"
foreground="$(color 3)"
waitFunc="sleep 1"
clickFunc="toggle flag"
flag="true"
connected() {
state="$(iwctl station $wifi_if show | grep State | awk '{print $2}')"
[ "$state" = "connected" ] && return 0
return 1
}
internet() {
if nc -zw1 google.com 443; then
return 0
fi
return 1
}
vpn() {
if ping -c 1 -w 5 $vpn_ip >/dev/null 2>&1; then
return 0
fi
return 1
}
home() {
if ping -c 1 -w 5 $home_ip >/dev/null 2>&1; then
return 0
fi
return 1
}
store_speeds() {
R1="$(cat /sys/class/net/$wifi_if/statistics/rx_bytes)"
T1="$(cat /sys/class/net/$wifi_if/statistics/tx_bytes)"
sleep 1
R2="$(cat /sys/class/net/$wifi_if/statistics/rx_bytes)"
T2="$(cat /sys/class/net/$wifi_if/statistics/tx_bytes)"
r="$(echo $R1 $R2 | awk '{r=$2-$1 ; rSuf="B " ; if (r >= 1000) {r=r/1000; rSuf="KB";} if (r >= 1000) {r=r/1000; rSuf="MB";} printf "%3.0f", r; printf rSuf;}')"
t="$(echo $T1 $T2 | awk '{t=$2-$1 ; tSuf="B " ; if (t >= 1000) {t=t/1000; tSuf="KB";} if (t >= 1000) {t=t/1000; tSuf="MB";} printf "%3.0f", t; printf tSuf;}')"
echo " $r 祝$t" | atomic_write "$XDG_RUNTIME_DIR/wifi-speeds.tmp"
}
store_symbol() {
if connected; then
if internet; then
if vpn; then
out="直"
elif home; then
out=""
else
out=""
fi
else
out=""
fi
else
out="睊"
fi
echo "$out" | atomic_write "$XDG_RUNTIME_DIR/wifi-symbol.tmp"
}
print_stats() {
if [ "$flag" = "true" ]; then
echo " $(cat "$XDG_RUNTIME_DIR/wifi-symbol.tmp")$(cat "$XDG_RUNTIME_DIR/wifi-speeds.tmp") "
else
echo " $(cat "$XDG_RUNTIME_DIR/wifi-symbol.tmp") "
fi
}
kickoff store_speeds &
kickoff store_symbol 5 &
loop print_stats

View File

@ -1,96 +0,0 @@
#! /bin/sh
module_name="$(basename "$0")"
align="left"
color() {
sed "$1!d" ../colors
}
background="$(color 1)"
foreground="$(color 2)"
trap "echo "$module_name//!DEAD" && trap - TERM && kill -- -$$" INT TERM EXIT
loop() {
echo "$module_name/$align!$background!$foreground/"
if [ ! -z "$clickFunc" ]; then
trap "$clickFunc" 10
prefix="%{A:kill -10 $$:}"
suffix="%{A}"
fi
while :; do
data="$($1)"
if [ "$?" = "1" ]; then
sleep 0.01
continue
fi
echo "$module_name//$prefix$data$suffix"
$waitFunc &
wait $!
done
}
wait_for() {
[ "$1" = "" ] && exit
if [ "$2" = "" ]; then
herbstclient --wait $1 > /dev/null &
wait
else
list=""
for arg in $@; do
list="$list|$arg"
done
herbstclient --wait "$list" > /dev/null &
wait
fi
}
kickoff() {
if [ "$2" = "" ]; then
while :; do
$1
done
else
while :; do
$1
sleep $2
done
fi
}
pad() {
len="$(echo -n "$1" | wc -c)"
padding="$(expr $2 - $len)"
if [ "$padding" -lt 1 ]; then
echo "$1"
return
fi
printf "$1%*s\n" $padding ''
}
trim() {
len="$(echo -n "$1" | wc -c)"
echo "$1" | colrm $2
[ "$len" -gt "$2" ] && return 3
}
toggle() {
eval "[ \"\$$1\" = \"true\" ] && $1=false || $1=true"
}
atomic_write() {
cat - > "$1.atom"
mv "$1.atom" "$1"
}

View File

@ -1,3 +0,0 @@
module oaktal.com/parser
go 1.20

View File

@ -1,373 +0,0 @@
package main
import (
"bufio"
"os"
"strings"
"errors"
"fmt"
"sort"
)
const LEFT = 0
const CENTER = 1
const RIGHT = 2
const GLOBAL_PREFIX = ""
const GLOBAL_SUFFIX = "%{B-}%{F-}"
const LEFT_BORDER_CHAR = ""
const RIGHT_BORDER_CHAR = ""
const RIGHT_ALIGN_PREFIX = "%%{B%s}%%{F%s}"
const LEFT_FACING_BORDER = "%%{B%s}%%{F%s}" + LEFT_BORDER_CHAR + "%%{B%s}%%{F%s}"
const RIGHT_ALIGN_SUFFIX = ""
const LEFT_ALIGN_PREFIX = "%%{B%s}%%{F%s}"
const RIGHT_FACING_BORDER = "%%{B%s}%%{F%s}" + RIGHT_BORDER_CHAR + "%%{B%s}%%{F%s}"
const LEFT_ALIGN_SUFFIX = ""
const LEFT_HANGING_BORDER = "%%{F%s}" + LEFT_BORDER_CHAR
const RIGHT_HANGING_BORDER = "%%{B-}%%{F%s}" + RIGHT_BORDER_CHAR
const CENTER_PREFIX = "%%{B%s}%%{F%s}"
const CENTER_BORDER = ""
const CENTER_SUFFIX = ""
type block struct {
tag string
align int
back string
fore string
content string
}
func main() {
blocks := make([]block, 0, 16)
reader := bufio.NewReader(os.Stdin)
for {
line, _ := reader.ReadString('\n')
if (line == "") {
os.Exit(0)
}
var err error = nil
new_blocks, err := runCommandOnSlice(line, blocks)
if (err != nil) {
continue
} else {
blocks = new_blocks
}
output := generateStringFromSlice(blocks)
if (err != nil) {
fmt.Printf("Fatal error! %w\n", err)
os.Exit(1)
}
fmt.Println(GLOBAL_PREFIX + output + GLOBAL_SUFFIX)
}
}
func runCommandOnSlice(command string, targetSlice []block) ([]block, error) {
tag, format, content, err := extractFieldsFromCommand(command)
if (err != nil) {
return nil, err
}
if (len(content) > 0) {
if (content == "!DEAD") {
return removeBlockFromSliceWithTag(targetSlice, tag), nil
}
if (content[0] == '\\') {
content = content[1:]
}
}
align, back, fore := parseFormatString(format)
curBlock := block {tag: tag, align: align, back: back, fore: fore, content: content}
newSlice, err := mergeBlockToSlice(curBlock, targetSlice)
if (err != nil) {
return nil, fmt.Errorf("runCommandOnSlice: %v", err)
}
newSlice = sortSliceOfBlocks(newSlice)
return newSlice, nil
}
func extractFieldsFromCommand(command string) (string, string, string, error) {
trimmedCommand := strings.TrimRight(command, " \n")
tag := ""
format := ""
content := ""
splitCommand := strings.SplitN(trimmedCommand, "/", 3)
tag = splitCommand[0]
if (len(splitCommand) == 3) {
format = splitCommand[1]
content = splitCommand[2]
} else if (len(splitCommand) == 2) {
format = ""
content = splitCommand[1]
} else {
return "", "", "", fmt.Errorf("Malformed command: %v", command)
}
if (content == "NULL") {
content = ""
}
return tag, format, content, nil
}
func removeBlockFromSliceWithTag(targetSlice []block, tag string) ([]block) {
outputSlice := make([]block, len(targetSlice), cap(targetSlice))
index := -1
copy(outputSlice, targetSlice)
for i, v := range outputSlice {
if v.tag == tag {
index = i
break
}
}
if (index != -1) {
outputSlice = removeIndexFromSlice(outputSlice, index)
}
return outputSlice
}
func removeIndexFromSlice(targetSlice []block, index int) []block {
outputSlice := make([]block, len(targetSlice), cap(targetSlice))
copy(outputSlice, targetSlice)
outputSlice[index] = outputSlice[len(outputSlice) - 1]
return outputSlice[:len(outputSlice) - 1]
}
func parseFormatString(format string) (int, string, string) {
align := LEFT
back := ""
fore := ""
splitFormat := strings.Split(format, "!")
align = parseAlignString(splitFormat[0])
if (len(splitFormat) > 1) {
back = splitFormat[1]
}
if (len(splitFormat) > 2) {
fore = splitFormat[2]
}
return align, back, fore
}
func parseAlignString(align string) int {
switch align {
case "left":
return LEFT
case "center":
return CENTER
case "right":
return RIGHT
default:
return -1
}
}
func mergeBlockToSlice(newBlock block, targetSlice []block) ([]block, error) {
targetBlock, index := getBlockAndIndexFromSliceWithTag(targetSlice, newBlock.tag)
outputSlice := make([]block, len(targetSlice), cap(targetSlice))
copy(outputSlice, targetSlice)
if (index == -1) {
outputSlice = append(outputSlice, newBlock)
return outputSlice, nil
}
mergedBlock, err := mergeTwoBlocks(newBlock, targetBlock)
if (err != nil) {
return nil, fmt.Errorf("mergeBlockToSlice: %v", err)
}
outputSlice[index] = mergedBlock
return outputSlice, nil
}
func getBlockAndIndexFromSliceWithTag(targetSlice []block, tag string) (block, int) {
for i, curBlock := range targetSlice {
if (curBlock.tag == tag) {
return curBlock, i
}
}
return block {tag: "", align: -1, back: "", fore: ""}, -1
}
func mergeTwoBlocks(newBlock block, oldBlock block) (block, error) {
if (newBlock.tag != "") {
oldBlock.tag = newBlock.tag
}
if (newBlock.align != -1) {
oldBlock.align = newBlock.align
}
if (newBlock.back != "") {
oldBlock.back = newBlock.back
}
if (newBlock.fore != "") {
oldBlock.fore = newBlock.fore
}
if (newBlock.content != "") {
oldBlock.content = newBlock.content
}
if (oldBlock.tag == "") {
return block {tag: "", align: -1, back: "", fore: ""}, errors.New("No tag given for new block!")
}
if (oldBlock.align == -1) {
oldBlock.align = LEFT
}
if (oldBlock.back == "") {
oldBlock.back = "-"
}
if (oldBlock.fore == "") {
oldBlock.fore = "-"
}
if (oldBlock.content == "") {
oldBlock.content = ""
}
return oldBlock, nil
}
func sortSliceOfBlocks(targetSlice []block) []block {
outputSlice := make([]block, len(targetSlice), cap(targetSlice))
copy(outputSlice, targetSlice)
sort.Slice(outputSlice, func (i, j int) bool {
if (outputSlice[i].align < outputSlice[j].align) {
return true
}
return outputSlice[i].tag < outputSlice[j].tag
})
return outputSlice
}
func generateStringFromSlice(sourceSlice []block) string {
if (len(sourceSlice) == 0) {
return ""
}
outputString := ""
mode := LEFT
index := 0
prevBlock := block {
tag: "",
align: sourceSlice[0].align,
back: sourceSlice[0].back,
fore: sourceSlice[0].fore,
content: "" }
nextBlock := block {
tag: "",
align: -1,
back: "",
fore: "",
content: "" }
for _, curBlock := range sourceSlice {
if (index == len(sourceSlice) - 1) {
nextBlock = block {
tag: "",
align: sourceSlice[0].align,
back: sourceSlice[0].back,
fore: sourceSlice[0].fore,
content: "" }
} else {
nextBlock = sourceSlice[index + 1]
}
index = index + 1
alignSegment := ""
if (curBlock.align != mode) {
switch curBlock.align {
case LEFT:
alignSegment = "%{l}"
case CENTER:
alignSegment = "%{c}"
case RIGHT:
alignSegment = "%{r}"
}
mode = curBlock.align
}
blockString := ""
switch curBlock.align {
case LEFT:
if (nextBlock.align == curBlock.align) {
blockString = fmt.Sprintf(LEFT_ALIGN_PREFIX, curBlock.back, curBlock.fore) + curBlock.content + fmt.Sprintf(RIGHT_FACING_BORDER, nextBlock.back, curBlock.back, nextBlock.back, nextBlock.fore)
} else {
blockString = fmt.Sprintf(LEFT_ALIGN_PREFIX, curBlock.back, curBlock.fore) + curBlock.content + fmt.Sprintf(RIGHT_HANGING_BORDER, curBlock.back)
}
case CENTER:
prefix := fmt.Sprintf(CENTER_PREFIX, curBlock.back, curBlock.fore)
suffix := ""
if (prevBlock.align != curBlock.align) {
prefix = fmt.Sprintf(LEFT_HANGING_BORDER, curBlock.back) + prefix
} else {
prefix = CENTER_BORDER + prefix
}
if (nextBlock.align != curBlock.align) {
suffix = suffix + fmt.Sprintf(RIGHT_HANGING_BORDER, curBlock.back)
}
blockString = prefix + curBlock.content + suffix
case RIGHT:
if (prevBlock.align == curBlock.align) {
blockString = fmt.Sprintf(LEFT_FACING_BORDER, prevBlock.back, curBlock.back, curBlock.back, curBlock.fore) + curBlock.content
} else {
blockString = fmt.Sprintf(LEFT_HANGING_BORDER, curBlock.back) + fmt.Sprintf(RIGHT_ALIGN_PREFIX, curBlock.back, curBlock.fore) + curBlock.content
}
}
outputString = outputString + alignSegment + blockString
prevBlock = curBlock
}
return outputString
}

View File

@ -1,31 +0,0 @@
#!/bin/sh
[ -z "$MPANEL_FONT" ] && MPANEL_FONT="JetBrainsMono Nerd Font Mono"
[ -z "$MPANEL_MAX_LINKS" ] && MPANEL_MAX_LINKS="25"
PIPE="$XDG_RUNTIME_DIR/mpanel.fifo"
if [ -p "$PIPE" ] || [ -f "$PIPE" ]; then
rm -f "$PIPE"
[ -p "$PIPE" ] && exit 1
[ -f "$PIPE" ] && exit 1
fi
mkfifo -m 0660 "$PIPE" || exit 1
cd "$(dirname "$0")" || exit 1
./parser < "$PIPE" | lemonbar \
-f "$MPANEL_FONT" \
-B "$(sed '1!d' ./colors)" \
-F "$(sed '2!d' ./colors)" \
-a "$MPANEL_MAX_LINKS" | sh &
trap "trap - TERM && kill -- -$$" INT TERM EXIT
cd "modules" || exit 1
for module in $(ls); do
"./$module" > "$PIPE" &
done
wait

View File

@ -1 +0,0 @@
@theme "/usr/share/rofi/themes/gruvbox-dark-soft.rasi"

View File

@ -1,3 +0,0 @@
#! /bin/sh
exec syncthing >"$HOME/.config/service/syncthing/log" 2>&1

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,5 @@
nnoremap gf :let @a='../'.expand('%')<CR>vi>y<Esc>:tabnew <C-R>"<CR>:let @"=@a
vnoremap gf y<Esc>:let @a='../'.expand('%')<CR>:tabnew <C-R>"<CR>:let @"=@a
nnoremap mf viwc[]<Esc>hpla(<>)<Left><Left><C-R>=expand('%')<CR><Esc>F/l"_dt>hpa.md<Esc>
vnoremap mf c[]<Esc>hpla(<>)<Left><Left><C-R>=expand('%')<CR><Esc>F/l"_dt>hpa.md<Esc>
nnoremap ml :r!grep -Rl '' .<Left><Left><Left>
vnoremap ml y<Esc>:execute 'r!grep -Rl '.shellescape(@", 1).' .'<CR>
nnoremap gl vi)y<Esc>:tabnew <C-R>"<CR>
vnoremap gl y<Esc>:tabnew <C-R>"<CR>
nnoremap ml viwc[]<Esc>hpla()<Esc>hpa.md<Esc>
vnoremap ml c[]<Esc>hpla()<Esc>hpa.md<Esc>

View File

@ -6,6 +6,10 @@ autocmd FileType markdown set columns=80
autocmd FileType markdown set linebreak
autocmd FileType markdown setlocal comments+=">"
autocmd FileType gemtext setlocal wrap
autocmd FileType gemtext setlocal linebreak
autocmd FileType gemtext setlocal columns=80
autocmd FileType text setlocal textwidth=120
autocmd FileType text setlocal formatoptions=tcroqawn
autocmd FileType text,markdown,gemtext set spell

View File

@ -1,10 +0,0 @@
#! /bin/sh
export TERMINAL="kitty"
export MENU="rofi -show run"
xrdb -merge ~/.config/Xresources
~/.config/xsession
exec dbus-launch ~/.config/xtheme/start

View File

@ -1,3 +0,0 @@
#! /bin/sh
pulseaudio &

View File

@ -1,32 +0,0 @@
#!/bin/sh
TERMINAL="kitty"
MENU="rofi -show run"
hc pad 0 44 7 7 7
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_active_color '#222222'
hc set frame_border_normal_color '#101010'
hc set frame_bg_normal_color '#565656'
hc set frame_bg_active_color '#345F0C'
hc set frame_border_width 0
hc set always_show_frame off
hc set frame_bg_transparent on
hc set frame_transparent_width 0
hc set frame_gap 6
hc attr theme.active.color '#c26b50'
hc attr theme.normal.color '#454545'
hc attr theme.urgent.color orange
hc attr theme.inner_width 1
hc attr theme.inner_color '#5C5453'
hc attr theme.border_width 3
hc attr theme.active.inner_color '#D9834E'
hc set window_gap 4
hc set frame_padding 0
hc set smart_window_surroundings off
hc set smart_frame_surroundings on
hc set mouse_recenter_gap 0

View File

@ -1,29 +0,0 @@
# COLORS
background #28211c
foreground #a6a28c
cursorColor #a6a28c
color0 #20201d
color8 #7d7a68
color1 #d73737
color9 #d73737
color2 #60ac39
color10 #60ac39
color3 #cfb017
color11 #cfb017
color4 #6684e1
color12 #6684e1
color5 #b854d4
color13 #b854d4
color6 #1fad83
color14 #1fad83
color7 #a6a28c
color15 #fefbec

View File

@ -1,11 +0,0 @@
#00000000
#C826131D
#C826131D
#FF471A32
#FFd9b279
#FF5a2ead
#FFd9b279
#FF752E2C
#FFd9b279
#FF5B1D4E
#FFd9b279

View File

@ -1,427 +0,0 @@
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = true;
# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 7;
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
# shadow-opacity = .75
# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
shadow-offset-x = -7;
# The top offset for shadows, in pixels. (defaults to -15)
# shadow-offset-y = -15
shadow-offset-y = -7;
# Avoid drawing shadows on dock/panel windows. This option is deprecated,
# you should use the *wintypes* option in your config file instead.
#
# no-dock-shadow = false
# Don't draw shadows on drag-and-drop windows. This option is deprecated,
# you should use the *wintypes* option in your config file instead.
#
# no-dnd-shadow = false
# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0
# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0
# Do not paint shadows on shaped windows. Note shaped windows
# here means windows setting its shape through X Shape extension.
# Those using ARGB background is beyond our control.
# Deprecated, use
# shadow-exclude = 'bounding_shaped'
# or
# shadow-exclude = 'bounding_shaped && !rounded_corners'
# instead.
#
# shadow-ignore-shaped = ''
# Specify a list of conditions of windows that should have no shadow.
#
# examples:
# shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"_GTK_FRAME_EXTENTS@:c"
];
# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
# shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
# xinerama-shadow-crop = false
#################################
# Fading #
#################################
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used.
# fading = false
fading = true
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
fade-in-step = 0.03;
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
# fade-out-step = 0.03
fade-out-step = 0.03;
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
# fade-delta = 10
# Specify a list of conditions of windows that should not be faded.
# fade-exclude = []
# Do not fade on window open/close.
# no-fading-openclose = false
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false
#################################
# Transparency / Opacity #
#################################
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
#inactive-opacity = 0.75;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
frame-opacity = 0.7;
# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
# menu-opacity = 1.0
# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
# inactive-opacity-override = true
inactive-opacity-override = false;
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
#active-opacity = 1.0
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0
# Specify a list of conditions of windows that should always be considered focused.
# focus-exclude = []
focus-exclude = [ "class_g = 'Cairo-clock'" ];
# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
# 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 = [ "85:class_g = 'kitty' && focused",
"75:class_g = 'kitty' && !focused",
"85:class_g = 'Rofi'" ];
#################################
# Background-Blurring #
#################################
# Parameters for background blurring, see the *BLUR* section for more information.
# blur-method =
# blur-size = 12
#
# blur-deviation = false
# Blur background of semi-transparent / ARGB windows.
# Bad in performance, with driver-dependent behavior.
# The name of the switch may change without prior notifications.
#
blur-background = true
# Blur background of windows when the window frame is not opaque.
# Implies:
# blur-background
# Bad in performance, with driver-dependent behavior. The name may change.