Compare commits

...

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

46 changed files with 13 additions and 1763 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
@ -33,33 +25,14 @@ 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
@ -79,21 +52,17 @@ 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
set time_diff (expr (date '+%s') - (cat "$HOME/.local/last_shell" 2>/dev/null || echo 0))
if [ "$time_diff" -gt "28800" ]
[ -d "$HOME/tmp" ] && rm -rf "$HOME/tmp/*"
timeout 5 git sit && date '+%s' > "$HOME/.local/last_shell"
git sit && date '+%s' > "$HOME/.local/last_shell"
echo ""
end

View File

@ -7,6 +7,6 @@
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,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.
#
# blur-background-frame = false
# Use fixed blur strength rather than adjusting according to window opacity.
# blur-background-fixed = false
# Specify the blur convolution kernel, with the following format:
# example:
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
#
# blur-kern = ''
blur-kern = "3x3box";
# Exclude conditions for background blur.
# blur-background-exclude = []
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"class_g = 'slop'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# General Settings #
#################################
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
# backend = 'glx'
backend = "glx";
# Enable/disable VSync.
# vsync = false
vsync = true
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
# dbus = false
# Try to detect WM windows (a non-override-redirect window with no
# child that has 'WM_STATE') and mark them as active.
#
# mark-wmwin-focused = false
mark-wmwin-focused = true;
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
# mark-ovredir-focused = false
mark-ovredir-focused = true;
# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# detect-rounded-corners = false
detect-rounded-corners = true;
# Detect '_NET_WM_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_OPACITY' of client windows to frame windows.
#
# detect-client-opacity = false
detect-client-opacity = true;
# Specify refresh rate of the screen. If not specified or 0, picom will
# try detecting this with X RandR extension.
#
# refresh-rate = 60
refresh-rate = 0
# Limit picom to repaint at most once every 1 / 'refresh_rate' second to
# boost performance. This should not be used with
# vsync drm/opengl/opengl-oml
# as they essentially does sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#
# sw-opti =
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
#
# use-ewmh-active-win = false
# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
# unredir-if-possible-exclude = []
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# detect-transient = false
detect-transient = true
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if
# detect-transient is enabled, too.
#
# detect-client-leader = false
detect-client-leader = true
# Resize damaged region by a specific number of pixels.
# A positive value enlarges it while a negative one shrinks it.
# If the value is positive, those additional pixels will not be actually painted
# to screen, only used in blur calculation, and such. (Due to technical limitations,
# with use-damage, those pixels will still be incorrectly painted to screen.)
# Primarily used to fix the line corruption issues of blur,
# in which case you should use the blur radius value here
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
# with a 5x5 one you use `--resize-damage 2`, and so on).
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
#
# resize-damage = 1
# Specify a list of conditions of windows that should be painted with inverted color.
# Resource-hogging, and is not well tested.
#
# invert-color-include = []
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content (but never
# practically happened) and may not work with blur-background.
# My tests show a 15% performance boost. Recommended.
#
# glx-no-stencil = false
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes,
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
# Recommended if it works.
#
# glx-no-rebind-pixmap = false
# Disable the use of damage information.
# This cause the whole screen to be redrawn everytime, instead of the part of the screen
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
# The opposing option is use-damage
#
# no-use-damage = false
use-damage = true
# Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers
# with GLX backend for some users.
#
# xrender-sync-fence = false
# GLX backend: Use specified GLSL fragment shader for rendering window contents.
# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
# in the source tree for examples.
#
# glx-fshader-win = ''
# Force all windows to be painted with blending. Useful if you
# have a glx-fshader-win that could turn opaque pixels transparent.
#
# force-win-blend = false
# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# no-ewmh-fullscreen = false
# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
#
# max-brightness = 1.0
# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them.
#
# transparent-clipping = false
# Set the log level. Possible values are:
# "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case doesn't matter.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# log-level = "debug"
log-level = "warn";
# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = '/path/to/your/log/file'
# Show all X errors (for debugging)
# show-all-xerrors = false
# Write process ID to a file.
# write-pid-path = '/path/to/your/log/file'
# Window type settings
#
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
# "tooltip", "notification", "combo", and "dnd".
#
# Following per window-type options are available: ::
#
# fade, shadow:::
# Controls window-type-specific shadow and fade settings.
#
# opacity:::
# Controls default opacity of the window type.
#
# focus:::
# Controls whether the window of this type is to be always considered focused.
# (By default, all window types except "normal" and "dialog" has this on.)
#
# full-shadow:::
# Controls whether shadow is drawn under the parts of the window that you
# normally won't be able to see. Useful when the window has parts of it
# transparent, and you want shadows in those areas.
#
# redir-ignore:::
# Controls whether this type of windows should cause screen to become
# redirected again after been unredirected. If you have unredir-if-possible
# set, and doesn't want certain window to cause unnecessary screen redirection,
# you can set this to `true`.
#
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
};

View File

@ -1 +0,0 @@
oneshot

View File

@ -1,14 +0,0 @@
#! /bin/sh
trap "trap - TERM && kill -- -$$" INT TERM EXIT
herbstluftwm -c ~/.config/herbstluftwm/autostart &
WM_ID=$!
feh --bg-fill ~/.config/xtheme/wallpaper.jpg &
~/.config/mpanel/start &
picom &
wait "$WM_ID"
kill $$

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

View File

@ -1,6 +1,7 @@
Include config.d/*
Host *
HostKeyAlgorithms=+ssh-rsa
IgnoreUnknown UseKeychain
UseKeychain yes
AddKeysToAgent yes

View File

@ -1,13 +0,0 @@
#!/bin/sh
[ -z "$THEME_DIR" ] && THEME_DIR="$HOME/.config/xthemes"
if [ ! -d "$THEME_DIR/$1" ]; then
echo "Theme $1 does not exist!"
exit 1
fi
CURRENT_THEME="$(cat ~/.config/xtheme/name)"
cd "$THEME_DIR" || exit 1
stow -t "$HOME" -D "$CURRENT_THEME"
stow -t "$HOME" "$1"

View File

@ -1,16 +0,0 @@
#!/bin/sh
[ -z "$THEME_DIR" ] && THEME_DIR="$HOME/.config/xthemes"
[ -z "$WALLPAPERS_DIR" ] && WALLPAPERS_DIR="$HOME/pictures/wallpapers"
file=$1
if [ "`echo $1 | head -c 1`" != "/" ]; then
file="$WALLPAPERS_DIR/$1"
fi
ext="$(echo "$file" | rev | cut -d'.' -f1 | rev)"
rm -f ~/.config/xtheme/wallpaper*
cp "$file" "~/.config/xtheme/wallpaper.$ext"
feh --bg-fill "~/.config/xtheme/wallpaper.$ext"

View File

@ -1,11 +0,0 @@
#! /bin/sh
[ -z "$THEME_DIR" ] && THEME_DIR="$HOME/.config/xthemes"
if [ -d "$THEME_DIR/$1" || -f "$THEME_DIR/$1" ];
echo "Theme $1 already exists!"
exit 1
fi
cp -r "$THEME_DIR/$(curtheme)" "$THEME_DIR/$1"
chtheme "$1"

View File

@ -1,11 +0,0 @@
#! /usr/bin/env bash
[ -z "$THEME_DIR"] && THEME_DIR="$HOME/.config/xthemes"
read -n 1 -p "You are about to remove theme '$1'. Are you sure? (y/n)" REPLY
echo
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
rm -rf "$THEME_DIR/$1"
echo "Theme '$1' has been removed."
fi

View File

@ -1,6 +0,0 @@
#! /bin/sh
DATE="$(date "+%Y-%m-%d")"
NUM="$(ls ~/pictures/screenshots | grep "$DATE" | wc -l | xargs)"
NAME="${DATE}_${NUM}.png"
maim "$HOME/pictures/screenshots/$NAME"

View File

@ -1,6 +0,0 @@
#! /bin/sh
DATE="$(date "+%Y-%m-%d")"
NUM="$(ls ~/pictures/screenshots | grep "$DATE" | wc -l | xargs)"
NAME="${DATE}_${NUM}.png"
maim -s "$HOME/pictures/screenshots/$NAME"