new picom.conf and some funny scripts
This commit is contained in:
parent
c97e4ad0b7
commit
df1c9499de
|
|
@ -0,0 +1,557 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# I'm a bonsai-making machine!
|
||||
|
||||
#################################################
|
||||
##
|
||||
# author: John Allbritten
|
||||
# my website: theSynAck.com
|
||||
#
|
||||
# repo: https://gitlab.com/jallbrit
|
||||
# script can be found in the bin/bin/fun folder.
|
||||
#
|
||||
# license: this script is published under GPLv3.
|
||||
# I don't care what you do with it, but I do ask
|
||||
# that you leave this message please!
|
||||
#
|
||||
# inspiration: http://andai.tv/bonsai/
|
||||
# andai's version was written in JS and served
|
||||
# as the basis for this script. Originally, this
|
||||
# was just a port.
|
||||
##
|
||||
# https://gitlab.com/jallbrit/bonsai.sh.git
|
||||
# license : GNU GENERAL PUBLIC LICENSE
|
||||
# Version 3, 29 June 2007
|
||||
#################################################
|
||||
|
||||
# ------ vars ------
|
||||
# CLI options
|
||||
|
||||
flag_h=false
|
||||
live=false
|
||||
infinite=false
|
||||
|
||||
termCols=$(tput cols)
|
||||
termRows=$(tput lines)
|
||||
geometry="$((termCols - 1)),$termRows"
|
||||
|
||||
leafchar='&'
|
||||
termColors=false
|
||||
|
||||
message=""
|
||||
flag_m=false
|
||||
basetype=1
|
||||
multiplier=5
|
||||
|
||||
lifeStart=28
|
||||
steptime=0.01 # time between steps
|
||||
|
||||
# non-CLI options
|
||||
lineWidth=4 # words per line
|
||||
|
||||
# ------ parse options ------
|
||||
|
||||
OPTS="hlt:ig:c:Tm:b:M:L:" # the colon means it requires a value
|
||||
LONGOPTS="help,live,time:,infinite,geo:,leaf:,termcolors,message:,base:,multiplier:,life:"
|
||||
|
||||
parsed=$(getopt --options=$OPTS --longoptions=$LONGOPTS -- "$@")
|
||||
eval set -- "${parsed[@]}"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
flag_h=true
|
||||
shift
|
||||
;;
|
||||
|
||||
-l|--live)
|
||||
live=true
|
||||
shift
|
||||
;;
|
||||
|
||||
-t|--time)
|
||||
steptime="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
-i|--infinite)
|
||||
infinite=true
|
||||
shift
|
||||
;;
|
||||
|
||||
-g|--geo)
|
||||
geo=$2
|
||||
shift 2
|
||||
;;
|
||||
|
||||
-c|--leaf)
|
||||
leafchar="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
-T|--termcolors)
|
||||
termColors=true
|
||||
shift
|
||||
;;
|
||||
|
||||
-m|--message)
|
||||
flag_m=true
|
||||
message="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
-b|--basetype)
|
||||
basetype="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
-M|--multiplier)
|
||||
multiplier="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
-L|--life)
|
||||
lifeStart="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
--) # end of arguments
|
||||
shift
|
||||
break
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "error while parsing CLI options"
|
||||
flag_h=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
HELP="Usage: bonsai [-h] [-i] [-l] [-T] [-m message] [-t time]
|
||||
[-g x,y] [ -c char] [-M 0-9]
|
||||
|
||||
bonsai.sh is a static and live bonsai tree generator, written in bash.
|
||||
|
||||
optional args:
|
||||
-l, --live enable live generation
|
||||
-t, --time time time between each step of growth [default: 0.01]
|
||||
-m, --message text attach a message to the tree
|
||||
-b, --basetype 0-2 which ascii-art plant base to use (0 for none) [default: 1]
|
||||
-i, --infinite keep generating trees until quit (2s between each)
|
||||
-T, --termcolors use terminal colors
|
||||
-g, --geo geo set custom geometry [default: fit to terminal]
|
||||
-c, --leaf char character used for leaves [default: &]
|
||||
-M, --multiplier 0-9 branch multiplier; higher equals more branching [default: 5]
|
||||
-L, --life int life of tree; higher equals more overall growth [default: 28]
|
||||
-h, --help show help"
|
||||
|
||||
# check for help
|
||||
$flag_h && echo -e "$HELP" && exit 0
|
||||
|
||||
# geometry processing
|
||||
cols=$(echo "$geometry" | cut -d ',' -f1) # width; X
|
||||
rows=$(echo "$geometry" | cut -d ',' -f2) # height; Y
|
||||
|
||||
IFS=$'\n' # delimit strings by newline
|
||||
tabs 4 # set tabs to 4 spaces
|
||||
|
||||
declare -A gridMessage
|
||||
|
||||
# message processing
|
||||
if [ $flag_m = true ]; then
|
||||
|
||||
messageWidth=20
|
||||
|
||||
# make room for the message to go on the right side
|
||||
cols=$((cols - messageWidth - 8 ))
|
||||
|
||||
# wordwrap message, delimiting by spaces
|
||||
message="$(echo "$message" | fold -sw $messageWidth)"
|
||||
|
||||
# get number of lines in the message
|
||||
messageLineCount=0
|
||||
for line in $message; do
|
||||
messageLineCount=$((messageLineCount + 1))
|
||||
done
|
||||
|
||||
messageOffset=$((rows - messageLineCount - 7))
|
||||
|
||||
# put lines of message into a grid
|
||||
index=$messageOffset
|
||||
for line in $message; do
|
||||
gridMessage[$index]="$line"
|
||||
index=$((index + 1))
|
||||
done
|
||||
fi
|
||||
|
||||
# define colors
|
||||
if [ $termColors = true ]; then
|
||||
LightBrown='\e[1;33m'
|
||||
DarkBrown='\e[0;33m'
|
||||
BrownGreen='\e[1;32m'
|
||||
Green='\e[0;32m'
|
||||
else
|
||||
LightBrown='\e[38;5;172m'
|
||||
DarkBrown='\e[38;5;130m'
|
||||
BrownGreen='\e[38;5;142m'
|
||||
Green='\e[38;5;106m'
|
||||
fi
|
||||
Grey='\e[1;30m'
|
||||
R='\e[0m'
|
||||
|
||||
# create ascii base in lines
|
||||
base=""
|
||||
case $basetype in
|
||||
0)
|
||||
base="" ;;
|
||||
|
||||
1)
|
||||
width=15
|
||||
art="\
|
||||
${Grey}:${Green}___________${DarkBrown}./~~\\.${Green}___________${Grey}:
|
||||
\\ /
|
||||
\\________________________/
|
||||
(_) (_)"
|
||||
;;
|
||||
|
||||
2)
|
||||
width=7
|
||||
art="\
|
||||
${Grey}(${Green}---${DarkBrown}./~~\\.${Green}---${Grey})
|
||||
( )
|
||||
(________)"
|
||||
;;
|
||||
esac
|
||||
|
||||
# get base height
|
||||
baseHeight=0
|
||||
for line in $art; do
|
||||
baseHeight=$(( baseHeight + 1 ))
|
||||
done
|
||||
|
||||
# add spaces before base so that it's in the middle of the terminal
|
||||
iter=1
|
||||
for line in $art; do
|
||||
filler=''
|
||||
for (( i=0; i < $(( (cols / 2) - width )); i++)); do
|
||||
filler+=" "
|
||||
done
|
||||
base+="${filler}${line}"
|
||||
[ $iter -ne $baseHeight ] && base+='\n'
|
||||
iter=$((iter+1))
|
||||
done
|
||||
unset IFS # reset delimiter
|
||||
|
||||
rows=$((rows - baseHeight))
|
||||
|
||||
declare -A grid # must be done outside function for unknown reason
|
||||
|
||||
trap 'echo "press q to quit"' SIGINT # disable CTRL+C
|
||||
|
||||
init() {
|
||||
branches=0
|
||||
shoots=0
|
||||
|
||||
branchesMax=$((multiplier * 110))
|
||||
shootsMax=$multiplier
|
||||
|
||||
# fill grid full of spaces
|
||||
for (( row=0; row < $rows; row++ )); do
|
||||
for (( col=0; col < $cols; col++ )); do
|
||||
grid[$row,$col]=' '
|
||||
done
|
||||
done
|
||||
|
||||
# No echo stdin and hide the cursor
|
||||
if [ $live = true ]; then
|
||||
stty -echo
|
||||
echo -ne "\e[?25l"
|
||||
|
||||
echo -ne "\e[2J"
|
||||
fi
|
||||
}
|
||||
|
||||
grow() {
|
||||
local start=$((cols / 2))
|
||||
|
||||
local x=$((cols / 2)) # start halfway across the screen
|
||||
local y=$rows # start just above the base
|
||||
|
||||
branch $x $y trunk $lifeStart
|
||||
}
|
||||
|
||||
branch() {
|
||||
# argument declarations
|
||||
local x=$1
|
||||
local y=$2
|
||||
local type=$3
|
||||
local life=$4
|
||||
local dx=0
|
||||
local dy=0
|
||||
|
||||
# check if the user is hitting q
|
||||
timeout=0.001
|
||||
[ $live = "false" ] && timeout=.0001
|
||||
read -n 1 -t $timeout input
|
||||
[ "$input" = "q" ] && clean "quit"
|
||||
|
||||
branches=$((branches + 1))
|
||||
|
||||
# as long as we're alive...
|
||||
while [ $life -gt 0 ]; do
|
||||
|
||||
life=$((life - 1)) # ensure life ends
|
||||
|
||||
# case $life in
|
||||
# [0]) type=dead ;;
|
||||
# [1-4]) type=dying ;;
|
||||
# esac
|
||||
|
||||
# set dy based on type
|
||||
case $type in
|
||||
shoot*) # if this is a shoot, trend horizontal/downward growth
|
||||
case "$((RANDOM % 10))" in
|
||||
[0-1]) dy=-1 ;;
|
||||
[2-7]) dy=0 ;;
|
||||
[8-9]) dy=1 ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
dying) # discourage vertical growth
|
||||
case "$((RANDOM % 10))" in
|
||||
[0-1]) dy=-1 ;;
|
||||
[2-8]) dy=0 ;;
|
||||
[9-10]) dy=1 ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
*) # otherwise, let it grow up/not at all
|
||||
dy=0
|
||||
[ $life -ne $lifeStart ] && [ $((RANDOM % 10)) -gt 2 ] && dy=-1
|
||||
;;
|
||||
esac
|
||||
# if we're about to hit the ground, cut it off
|
||||
[ $dy -gt 0 ] && [ $y -gt $(( rows - 1 )) ] && dy=0
|
||||
[ $type = "trunk" ] && [ $life -lt 4 ] && dy=0
|
||||
|
||||
# set dx based on type
|
||||
case $type in
|
||||
shootLeft) # tend left: dx=[-2,1]
|
||||
case $(( RANDOM % 10 )) in
|
||||
[0-1]) dx=-2 ;;
|
||||
[2-5]) dx=-1 ;;
|
||||
[6-8]) dx=0 ;;
|
||||
[9]) dx=1 ;;
|
||||
esac ;;
|
||||
|
||||
shootRight) # tend right: dx=[-1,2]
|
||||
case $(( RANDOM % 10 )) in
|
||||
[0-1]) dx=2 ;;
|
||||
[2-5]) dx=1 ;;
|
||||
[6-8]) dx=0 ;;
|
||||
[9]) dx=-1 ;;
|
||||
esac ;;
|
||||
|
||||
dying) # tend left/right: dx=[-3,3]
|
||||
dx=$(( (RANDOM % 7) - 3)) ;;
|
||||
|
||||
*) # tend equal: dx=[-1,1]
|
||||
dx=$(( (RANDOM % 3) - 1)) ;;
|
||||
|
||||
esac
|
||||
|
||||
# re-branch upon conditions
|
||||
if [ $branches -lt $branchesMax ]; then
|
||||
|
||||
# branch is dead
|
||||
if [ $life -lt 3 ]; then
|
||||
branch $x $y dead $life
|
||||
|
||||
# branch is dying and needs to branch into leaves
|
||||
elif [ $type = trunk ] && [ $life -lt $((multiplier + 2)) ]; then
|
||||
branch $x $y dying $life
|
||||
|
||||
elif [[ $type = "shoot"* ]] && [ $life -lt $((multiplier + 2)) ]; then
|
||||
branch $x $y dying $life
|
||||
|
||||
# re-branch if: not close to the base AND (pass a chance test OR be a trunk, not have too man shoots already, and not be about to die)
|
||||
elif [[ $type = trunk && $life -lt $((lifeStart - 8)) \
|
||||
&& ( $(( RANDOM % (16 - multiplier) )) -eq 0 \
|
||||
|| ($type = trunk && $(( life % 5 )) -eq 0 && $life -gt 5) ) ]]; then
|
||||
|
||||
# if a trunk is splitting and not about to die, chance to create another trunk
|
||||
if [ $((RANDOM % 3)) -eq 0 ] && [ $life -gt 7 ]; then
|
||||
branch $x $y trunk $life
|
||||
|
||||
elif [ $shoots -lt $shootsMax ]; then
|
||||
|
||||
# give the shoot some life
|
||||
tmpLife=$(( life + multiplier - 2 ))
|
||||
[ $tmpLife -lt 0 ] && tmpLife=0
|
||||
|
||||
# first shoot is randomly directed
|
||||
if [ $shoots -eq 0 ]; then
|
||||
tmpType=shootLeft
|
||||
[ $((RANDOM % 2)) -eq 0 ] && tmpType=shootRight
|
||||
|
||||
|
||||
# secondary shoots alternate from the first
|
||||
else
|
||||
case $tmpType in
|
||||
shootLeft) # last shoot was left, shoot right
|
||||
tmpType=shootRight ;;
|
||||
shootRight) # last shoot was right, shoot left
|
||||
tmpType=shootLeft ;;
|
||||
esac
|
||||
fi
|
||||
branch $x $y $tmpType $tmpLife
|
||||
shoots=$((shoots + 1))
|
||||
fi
|
||||
fi
|
||||
else # if we're past max branches but want to branch...
|
||||
char='<>'
|
||||
fi
|
||||
|
||||
# implement dx,dy
|
||||
x=$((x + dx))
|
||||
y=$((y + dy))
|
||||
|
||||
# choose color
|
||||
case $type in
|
||||
trunk|shoot*)
|
||||
color=${DarkBrown}
|
||||
[ $(( RANDOM % 4 )) -eq 0 ] && color=${LightBrown}
|
||||
;;
|
||||
|
||||
dying) color=${BrownGreen} ;;
|
||||
|
||||
dead) color=${Green} ;;
|
||||
esac
|
||||
|
||||
# choose branch character
|
||||
case $type in
|
||||
trunk)
|
||||
if [ $dx -lt 0 ]; then
|
||||
char='\\'
|
||||
elif [ $dx -eq 0 ]; then
|
||||
char='/|'
|
||||
elif [ $dx -gt 0 ]; then
|
||||
char='/'
|
||||
fi
|
||||
[ $dy -eq 0 ] && char='/~' # not growing
|
||||
#[ $dy -lt 0 ] && char='/~' # growing
|
||||
;;
|
||||
|
||||
# shoots tend to look horizontal
|
||||
shootLeft)
|
||||
case $dx in
|
||||
[-3,-1]) char='\\|' ;;
|
||||
[0]) char='/|' ;;
|
||||
[1,3]) char='/' ;;
|
||||
esac
|
||||
#[ $dy -lt 0 ] && char='/~' # growing up
|
||||
[ $dy -gt 0 ] && char='/' # growing down
|
||||
[ $dy -eq 0 ] && char='\\_' # not growing
|
||||
;;
|
||||
|
||||
shootRight)
|
||||
case $dx in
|
||||
[-3,-1]) char='\\|' ;;
|
||||
[0]) char='/|' ;;
|
||||
[1,3]) char='/' ;;
|
||||
esac
|
||||
#[ $dy -lt 0 ] && char='' # growing up
|
||||
[ $dy -gt 0 ] && char='\\' # growing down
|
||||
[ $dy -eq 0 ] && char='_/' # not growing
|
||||
;;
|
||||
|
||||
#dead)
|
||||
# #life=$((life + 1))
|
||||
# char="${leafchar}"
|
||||
# [ $dx -lt -2 ] || [ $dx -gt 2 ] && char="${leafchar}${leafchar}"
|
||||
# ;;
|
||||
|
||||
esac
|
||||
|
||||
# set leaf if needed
|
||||
[ $life -lt 4 ] && char="${leafchar}"
|
||||
|
||||
# uncomment for help debugging
|
||||
#echo -e "$life:\t$x, $y: $char"
|
||||
|
||||
# put character in grid
|
||||
grid[$y,$x]="${color}${char}${R}"
|
||||
|
||||
# if live, print what we have so far and let the user see it
|
||||
if [ $live = true ]; then
|
||||
print
|
||||
sleep $steptime
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
print() {
|
||||
# parse grid for output
|
||||
output=""
|
||||
for (( row=0; row < $rows; row++)); do
|
||||
|
||||
line=""
|
||||
|
||||
for (( col=0; col < $cols; col++ )); do
|
||||
|
||||
# this prints a space at 0,0 and is necessary at the moment
|
||||
[ $live = true ] && echo -ne "\e[0;0H "
|
||||
|
||||
# grab the character from our grid
|
||||
line+="${grid[$row,$col]}"
|
||||
done
|
||||
|
||||
# add our message
|
||||
if [ $flag_m = true ]; then
|
||||
# remove trailing whitespace before we add our message
|
||||
line=$(sed -r 's/[ \t]*$//' <(printf "$line"))
|
||||
line+=" \t${gridMessage[$row]}"
|
||||
fi
|
||||
|
||||
line="${line}\n"
|
||||
|
||||
# end 'er with the ol' newline
|
||||
output+="$line"
|
||||
done
|
||||
|
||||
# add the ascii-art base we generated earlier
|
||||
output+="$base"
|
||||
|
||||
# output, removing trailing whitespace
|
||||
sed -r 's/[ \t]*$//' <(printf "$output")
|
||||
}
|
||||
|
||||
clean() {
|
||||
# Show cursor and echo stdin
|
||||
if [ $live = true ]; then
|
||||
echo -ne "\e[?25h"
|
||||
stty echo
|
||||
fi
|
||||
|
||||
echo "" # ensure the cursor resets to the next line
|
||||
|
||||
# if we wanna quit
|
||||
if [ "$1" = "quit" ]; then
|
||||
trap SIGINT
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
bonsai() {
|
||||
init
|
||||
grow
|
||||
print
|
||||
clean
|
||||
}
|
||||
|
||||
bonsai
|
||||
|
||||
while [ $infinite = true ]; do
|
||||
sleep 2
|
||||
bonsai
|
||||
done
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Original: http://frexx.de/xterm-256-notes/
|
||||
# http://frexx.de/xterm-256-notes/data/colortable16.sh
|
||||
# Modified by Aaron Griffin
|
||||
# and further by Kazuo Teramoto
|
||||
|
||||
FGNAMES=(' black ' ' red ' ' green ' ' yellow' ' blue ' 'magenta' ' cyan ' ' white ')
|
||||
BGNAMES=('DFT' 'BLK' 'RED' 'GRN' 'YEL' 'BLU' 'MAG' 'CYN' 'WHT')
|
||||
|
||||
echo " ┌──────────────────────────────────────────────────────────────────────────┐"
|
||||
for b in {0..8}; do
|
||||
((b>0)) && bg=$((b+39))
|
||||
|
||||
echo -en "\033[0m ${BGNAMES[b]} │ "
|
||||
|
||||
for f in {0..7}; do
|
||||
echo -en "\033[${bg}m\033[$((f+30))m ${FGNAMES[f]} "
|
||||
done
|
||||
|
||||
echo -en "\033[0m │"
|
||||
echo -en "\033[0m\n\033[0m │ "
|
||||
|
||||
for f in {0..7}; do
|
||||
echo -en "\033[${bg}m\033[1;$((f+30))m ${FGNAMES[f]} "
|
||||
done
|
||||
|
||||
echo -en "\033[0m │"
|
||||
echo -e "\033[0m"
|
||||
|
||||
((b<8)) &&
|
||||
echo " ├──────────────────────────────────────────────────────────────────────────┤"
|
||||
done
|
||||
echo " └──────────────────────────────────────────────────────────────────────────┘"
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Author: baskerville
|
||||
# Source: http://crunchbang.org/forums/viewtopic.php?pid=288344#p288344
|
||||
|
||||
printf "\033[0m
|
||||
\033[49;35m|\033[49;31m|\033[101;31m|\033[41;97m|\033[49;91m|\033[49;93m|\033[0m
|
||||
\033[105;35m|\033[45;97m|\033[49;97m||\033[100;97m||\033[49;37m||\033[103;33m|\033[43;97m|\033[0m
|
||||
\033[49;95m|\033[49;94m|\033[100;37m||\033[40;97m||\033[40;37m||\033[49;33m|\033[49;32m|\033[0m
|
||||
\033[104;34m|\033[44;97m|\033[49;90m||\033[40;39m||\033[49;39m||\033[102;32m|\033[42;97m|\033[0m
|
||||
\033[49;34m|\033[49;36m|\033[106;36m|\033[46;97m|\033[49;96m|\033[49;92m|\033[0m
|
||||
"
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ANSI color scheme script by pfh
|
||||
# Source: http://crunchbang.org/forums/viewtopic.php?pid=144011#p144011
|
||||
# Initializing mod by lolilolicon from Archlinux
|
||||
|
||||
f=3 b=4
|
||||
for j in f b; do
|
||||
for i in {0..7}; do
|
||||
printf -v $j$i %b "\e[${!j}${i}m"
|
||||
done
|
||||
done
|
||||
bld=$'\e[1m'
|
||||
rst=$'\e[0m'
|
||||
inv=$'\e[7m'
|
||||
|
||||
cat << EOF
|
||||
$f1█-----$bld█ $rst$f2█-----$bld█$rst $f3█-----$bld█$rst $f4█-----$bld█$rst $f5█-----$bld█$rst $f6█-----$bld█$rst
|
||||
$f1█---$bld█$rst $f2█---$bld█$rst $f3█---$bld█$rst $f4█---$bld█$rst $f5█---$bld█$rst $f6█---$bld█$rst
|
||||
$f1 █-$bld█$rst $f2 █-$bld█$rst $f3 █-$bld█$rst $f4 █-$bld█$rst $f5 █-$bld█$rst $f6 █-$bld█$rst
|
||||
$f1█$rst $f2█$rst $f3█$rst $f4█$rst $f5█$rst $f6█$rst
|
||||
$f1$bld█-$rst$f1█$rst $f2$bld█_$rst$f2█$rst $f3$bld█-$rst$f3█$rst $f4$bld█-$rst$f4█$rst $f5$bld█-$rst$f5█$rst $f6$bld█-$rst$f6█$rst
|
||||
$f1$bld█---$rst$f1█$rst $f2$bld█---$rst$f2█$rst $f3$bld█---$rst$f3█$rst $f4$bld█---$rst$f4█$rst $f5$bld█---$rst$f5█$rst $f6$bld█---$rst$f6█$rst
|
||||
$f1$bld█-----$rst$f1█$rst $f2$bld█-----$rst$f2█$rst $f3$bld█-----$rst$f3█$rst $f4$bld█-----$rst$f4█$rst $f5$bld█-----$rst$f5█$rst $f6$bld█-----$rst$f6█$rst
|
||||
$f1$bld█---$rst$f1█$rst $f2$bld█---$rst$f2█$rst $f3$bld█---$rst$f3█$rst $f4$bld█---$rst$f4█$rst $f5$bld█---$rst$f5█$rst $f6$bld█---$rst$f6█$rst
|
||||
$f1$bld█-$rst$f1█$rst $f2$bld█-$rst$f2█$rst $f3$bld█-$rst$f3█$rst $f4$bld█-$rst$f4█$rst $f5$bld█-$rst$f5█$rst $f6$bld█-$rst$f6█$rst
|
||||
$f1$bld█$rst $f2$bld█$rst $f3$bld█$rst $f4$bld█$rst $f5$bld█$rst $f6$bld█$rst
|
||||
$f1█-$bld█$rst $f2█-$bld█$rst $f3█-$bld█$rst $f4█-$bld█$rst $f5█-$bld█$rst $f6█-$bld█$rst
|
||||
$f1█---$bld█$rst $f2█---$bld█$rst $f3█---$bld█$rst $f4█---$bld█$rst $f5█---$bld█$rst $f6█---$bld█$rst
|
||||
$f1█-----$bld█ $rst$f2█-----$bld█$rst $f3█-----$bld█$rst $f4█-----$bld█$rst $f5█-----$bld█$rst $f6█-----$bld█$rst
|
||||
$f1█---$bld█$rst $f2█---$bld█$rst $f3█---$bld█$rst $f4█---$bld█$rst $f5█---$bld█$rst $f6█---$bld█$rst
|
||||
$f1 █-$bld█$rst $f2 █-$bld█$rst $f3 █-$bld█$rst $f4 █-$bld█$rst $f5 █-$bld█$rst $f6 █-$bld█$rst
|
||||
$f1█$rst $f2█$rst $f3█$rst $f4█$rst $f5█$rst $f6█$rst
|
||||
$f1$bld█-$rst$f1█$rst $f2$bld█_$rst$f2█$rst $f3$bld█-$rst$f3█$rst $f4$bld█-$rst$f4█$rst $f5$bld█-$rst$f5█$rst $f6$bld█-$rst$f6█$rst
|
||||
$f1$bld█---$rst$f1█$rst $f2$bld█---$rst$f2█$rst $f3$bld█---$rst$f3█$rst $f4$bld█---$rst$f4█$rst $f5$bld█---$rst$f5█$rst $f6$bld█---$rst$f6█$rst
|
||||
$f1$bld█-----$rst$f1█$rst $f2$bld█-----$rst$f2█$rst $f3$bld█-----$rst$f3█$rst $f4$bld█-----$rst$f4█$rst $f5$bld█-----$rst$f5█$rst $f6$bld█-----$rst$f6█$rst
|
||||
$f1$bld█---$rst$f1█$rst $f2$bld█---$rst$f2█$rst $f3$bld█---$rst$f3█$rst $f4$bld█---$rst$f4█$rst $f5$bld█---$rst$f5█$rst $f6$bld█---$rst$f6█$rst
|
||||
$f1$bld█-$rst$f1█$rst $f2$bld█-$rst$f2█$rst $f3$bld█-$rst$f3█$rst $f4$bld█-$rst$f4█$rst $f5$bld█-$rst$f5█$rst $f6$bld█-$rst$f6█$rst
|
||||
$f1$bld█$rst $f2$bld█$rst $f3$bld█$rst $f4$bld█$rst $f5$bld█$rst $f6$bld█$rst
|
||||
$f1█-$bld█$rst $f2█-$bld█$rst $f3█-$bld█$rst $f4█-$bld█$rst $f5█-$bld█$rst $f6█-$bld█$rst
|
||||
$f1█---$bld█$rst $f2█---$bld█$rst $f3█---$bld█$rst $f4█---$bld█$rst $f5█---$bld█$rst $f6█---$bld█$rst
|
||||
$f1█-----$bld█ $rst$f2█-----$bld█$rst $f3█-----$bld█$rst $f4█-----$bld█$rst $f5█-----$bld█$rst $f6█-----$bld█$rst
|
||||
EOF
|
||||
|
|
@ -0,0 +1,829 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2019 Erik Dubois
|
||||
# Copyright (c) 2019 Brad Heffernan
|
||||
# Copyright (c) 2016-2018 Dylan Araps
|
||||
# parts are coming from neofetch
|
||||
# e.g. terminal font code
|
||||
# and unknown sources
|
||||
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2016-2018 Dylan Araps, Erik Dubois, Brad Heffernan
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||
|
||||
get_packages(){
|
||||
has() { type -p "$1" >/dev/null && manager="$_"; }
|
||||
dir() { ((packages+=$#)); pac "$#"; }
|
||||
pac() { (($1 > 0)) && { managers+=("$1 (${manager})"); manager_string+="${manager}, "; }; }
|
||||
tot() { IFS=$'\n' read -d "" -ra pkgs < <("$@");((packages+="${#pkgs[@]}"));pac "${#pkgs[@]}"; }
|
||||
# Package Manager Programs.
|
||||
has "pacman-key" && tot pacman -Qq --color never
|
||||
has "dpkg" && tot dpkg-query -f '.\n' -W
|
||||
has "rpm" && tot rpm -qa
|
||||
has "xbps-query" && tot xbps-query -l
|
||||
has "apk" && tot apk info
|
||||
has "opkg" && tot opkg list-installed
|
||||
has "pacman-g2" && tot pacman-g2 -Q
|
||||
has "lvu" && tot lvu installed
|
||||
has "tce-status" && tot tce-status -i
|
||||
has "pkg_info" && tot pkg_info
|
||||
has "tazpkg" && tot tazpkg list && ((packages-=6))
|
||||
has "sorcery" && tot gaze installed
|
||||
has "alps" && tot alps showinstalled
|
||||
has "butch" && tot butch list
|
||||
|
||||
# Counting files/dirs.
|
||||
has "emerge" && dir /var/db/pkg/*/*/
|
||||
has "nix-env" && dir /nix/store/*/
|
||||
has "guix" && dir /gnu/store/*/
|
||||
has "Compile" && dir /Programs/*/
|
||||
has "eopkg" && dir /var/lib/eopkg/package/*
|
||||
has "crew" && dir /usr/local/etc/crew/meta/*.filelist
|
||||
has "pkgtool" && dir /var/log/packages/*
|
||||
has "cave" && dir /var/db/paludis/repositories/cross-installed/*/data/*/ \
|
||||
/var/db/paludis/repositories/installed/data/*/
|
||||
|
||||
# Other (Needs complex command)
|
||||
has "kpm-pkg" && ((packages+="$(kpm --get-selections | grep -cv deinstall$)"))
|
||||
|
||||
case "$kernel_name" in
|
||||
"FreeBSD") has "pkg" && tot pkg info ;;
|
||||
"SunOS") has "pkginfo" && tot pkginfo -i ;;
|
||||
*)
|
||||
has "pkg" && dir /var/db/pkg/*
|
||||
|
||||
((packages == 0)) && \
|
||||
has "pkg" && tot pkg list
|
||||
;;
|
||||
esac
|
||||
|
||||
# List these last as they accompany regular package managers.
|
||||
has "flatpak" && tot flatpak list
|
||||
|
||||
# Snap hangs if the command is run without the daemon running.
|
||||
# Only run snap if the daemon is also running.
|
||||
has "snap" && ps -e | grep -qFm 1 "snapd" >/dev/null && tot snap list && ((packages-=1))
|
||||
|
||||
if ((packages == 0)); then
|
||||
unset packages
|
||||
else
|
||||
packages+=" (${manager_string%,*})"
|
||||
fi
|
||||
|
||||
packages="${packages/pacman-key/pacman}"
|
||||
packages="${packages/nix-env/nix}"
|
||||
|
||||
echo "$packages"
|
||||
}
|
||||
|
||||
#{{{ MEMORY
|
||||
get_mem(){
|
||||
while IFS=":" read -r a b; do
|
||||
case "$a" in
|
||||
"MemTotal") mem_used="$((mem_used+=${b/kB}))"; mem_total="${b/kB}" ;;
|
||||
"Shmem") mem_used="$((mem_used+=${b/kB}))" ;;
|
||||
"MemFree" | "Buffers" | "Cached" | "SReclaimable")
|
||||
mem_used="$((mem_used-=${b/kB}))"
|
||||
;;
|
||||
esac
|
||||
done < /proc/meminfo
|
||||
|
||||
mem_used="$((mem_used / 1024))"
|
||||
mem_total="$((mem_total / 1024))"
|
||||
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB}"
|
||||
echo "$memory"
|
||||
}
|
||||
#}}}
|
||||
|
||||
#{{{ UPTIME
|
||||
|
||||
strip_date() {
|
||||
case "$1" in
|
||||
"0 "*) unset "${1/* }" ;;
|
||||
"1 "*) printf "%s" "${1/s}" ;;
|
||||
*) printf "%s" "$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_uptime(){
|
||||
seconds=`< /proc/uptime`
|
||||
seconds="${seconds/.*}"
|
||||
days="$((seconds / 60 / 60 / 24)) days"
|
||||
hours="$((seconds / 60 / 60 % 24)) hours"
|
||||
mins="$((seconds / 60 % 60)) minutes"
|
||||
|
||||
|
||||
# Remove plural if < 2.
|
||||
((${days/ *} == 1)) && days="${days/s}"
|
||||
((${hours/ *} == 1)) && hours="${hours/s}"
|
||||
((${mins/ *} == 1)) && mins="${mins/s}"
|
||||
|
||||
# Hide empty fields.
|
||||
((${days/ *} == 0)) && unset days
|
||||
((${hours/ *} == 0)) && unset hours
|
||||
((${mins/ *} == 0)) && unset mins
|
||||
|
||||
uptime="${days:+$days, }${hours:+$hours, }${mins}"
|
||||
uptime="${uptime%', '}"
|
||||
uptime="${uptime:-${seconds} seconds}"
|
||||
|
||||
uptime="${uptime/ days/d}"
|
||||
uptime="${uptime/ day/d}"
|
||||
uptime="${uptime/ hours/h}"
|
||||
uptime="${uptime/ hour/h}"
|
||||
uptime="${uptime/ minutes/m}"
|
||||
uptime="${uptime/ minute/m}"
|
||||
uptime="${uptime/ seconds/s}"
|
||||
uptime="${uptime//,}"
|
||||
echo "$uptime"
|
||||
}
|
||||
#}}}
|
||||
|
||||
#{{{ GPU
|
||||
get_gpu(){
|
||||
gpu_cmd="$(lspci -mm | awk -F '\"|\" \"|\\(' \
|
||||
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END {for(i in a)
|
||||
{if(!seen[a[i]]++) print a[i]}}')"
|
||||
IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd"
|
||||
[[ "${gpus[0]}" == *Intel* && "${gpus[1]}" == *Intel* ]] && unset -v "gpus[0]"
|
||||
|
||||
for gpu in "${gpus[@]}"; do
|
||||
case "$gpu" in
|
||||
*"AMD"*)
|
||||
brand="${gpu/*AMD*ATI*/AMD ATI}"
|
||||
brand="${brand:-${gpu/*AMD*/AMD}}"
|
||||
brand="${brand:-${gpu/*ATI*/ATi}}"
|
||||
|
||||
gpu="${gpu/'[AMD/ATI]' }"
|
||||
gpu="${gpu/'[AMD]' }"
|
||||
gpu="${gpu/OEM }"
|
||||
gpu="${gpu/Advanced Micro Devices, Inc.}"
|
||||
gpu="${gpu/ \/ *}"
|
||||
gpu="${gpu/*\[}"
|
||||
gpu="${gpu/\]*}"
|
||||
gpu="$brand $gpu"
|
||||
;;
|
||||
|
||||
*"nvidia"*)
|
||||
gpu="${gpu/*\[}"
|
||||
gpu="${gpu/\]*}"
|
||||
gpu="NVIDIA $gpu"
|
||||
;;
|
||||
|
||||
*"intel"*)
|
||||
gpu="${gpu/*Intel/Intel}"
|
||||
gpu="${gpu/'(R)'}"
|
||||
gpu="${gpu/'Corporation'}"
|
||||
gpu="${gpu/ \(*}"
|
||||
gpu="${gpu/Integrated Graphics Controller}"
|
||||
|
||||
[[ -z "$(trim "$gpu")" ]] && gpu="Intel Integrated Graphics"
|
||||
;;
|
||||
|
||||
*"virtualbox"*)
|
||||
gpu="VirtualBox Graphics Adapter"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
gpu="${gpu/AMD }"
|
||||
gpu="${gpu/NVIDIA }"
|
||||
gpu="${gpu/Intel }"
|
||||
echo "$gpu"
|
||||
}
|
||||
#gpu="$(glxinfo | grep -F 'OpenGL renderer string')"
|
||||
#gpu="${gpu/'OpenGL renderer string: '}"
|
||||
#gpu="${gpu/(*}"
|
||||
|
||||
#}}}
|
||||
|
||||
#{{{ SYSTEM
|
||||
|
||||
get_shell(){
|
||||
shell="${SHELL##*/} "
|
||||
case "${shell_name:=${SHELL##*/}}" in
|
||||
"bash") shell+="${BASH_VERSION/-*}" ;;
|
||||
"sh" | "ash" | "dash") ;;
|
||||
|
||||
"mksh" | "ksh")
|
||||
shell+="$("$SHELL" -c "printf %s \$KSH_VERSION")"
|
||||
shell="${shell/ * KSH}"
|
||||
shell="${shell/version}"
|
||||
;;
|
||||
|
||||
"tcsh")
|
||||
shell+="$("$SHELL" -c "printf %s \$tcsh")"
|
||||
;;
|
||||
|
||||
*)
|
||||
shell+="$("$SHELL" --version 2>&1)"
|
||||
shell="${shell/ "${shell_name}"}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove unwanted info.
|
||||
shell="${shell/, version}"
|
||||
shell="${shell/xonsh\//xonsh }"
|
||||
shell="${shell/options*}"
|
||||
shell="${shell/\(*\)}"
|
||||
|
||||
echo "$shell"
|
||||
}
|
||||
|
||||
get_cpu(){
|
||||
cpu_file="/proc/cpuinfo"
|
||||
speed_type="bios_limit"
|
||||
cpu_cores="physical"
|
||||
|
||||
case "$kernel_machine" in
|
||||
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
|
||||
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
|
||||
;;
|
||||
|
||||
"s390"*)
|
||||
cpu="$(awk -F'=' '/machine/ {print $4; exit}' "$cpu_file")"
|
||||
;;
|
||||
|
||||
"ia64" | "m32r")
|
||||
cpu="$(awk -F':' '/model/ {print $2; exit}' "$cpu_file")"
|
||||
[[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
|
||||
;;
|
||||
|
||||
*)
|
||||
cpu="$(awk -F ': | @' '/model name|Processor|^cpu model|chip type|^cpu type/ {
|
||||
printf $2;
|
||||
exit
|
||||
}' "$cpu_file")"
|
||||
|
||||
[[ "$cpu" == *"processor rev"* ]] && \
|
||||
cpu="$(awk -F':' '/Hardware/ {print $2; exit}' "$cpu_file")"
|
||||
;;
|
||||
esac
|
||||
|
||||
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
||||
|
||||
speed="$(awk -F ': |\\.' '/cpu MHz|^clock/ {printf $2; exit}' "$cpu_file")"
|
||||
speed="${speed/MHz}"
|
||||
|
||||
# Get CPU cores.
|
||||
cores="$(grep -c "^processor" "$cpu_file")"
|
||||
#cores="$(awk '/^core id/&&!a[$0]++{++i} END {print i}' "$cpu_file")"
|
||||
|
||||
|
||||
# Remove un-needed patterns from cpu output.
|
||||
|
||||
cpu="${cpu//(tm)}"
|
||||
cpu="${cpu//(TM)}"
|
||||
cpu="${cpu//(r)}"
|
||||
cpu="${cpu//(R)}"
|
||||
cpu="${cpu//CPU}"
|
||||
cpu="${cpu//Processor}"
|
||||
cpu="${cpu//Dual-Core}"
|
||||
cpu="${cpu//Quad-Core}"
|
||||
cpu="${cpu//Six-Core}"
|
||||
cpu="${cpu//Eight-Core}"
|
||||
cpu="${cpu//, * Compute Cores*}"
|
||||
cpu="${cpu//, * COMPUTE CORES*}"
|
||||
cpu="${cpu//Core / }"
|
||||
cpu="${cpu//(\"AuthenticAMD\"*)}"
|
||||
cpu="${cpu//with Radeon * Graphics}"
|
||||
cpu="${cpu//, altivec supported}"
|
||||
cpu="${cpu//FPU*}"
|
||||
cpu="${cpu//Chip Revision*}"
|
||||
cpu="${cpu//Technologies, Inc}"
|
||||
cpu="${cpu//Core2/Core 2}"
|
||||
|
||||
# Trim spaces from core and speed output
|
||||
cores="${cores//[[:space:]]}"
|
||||
speed="${speed//[[:space:]]}"
|
||||
|
||||
# Remove CPU brand from the output.
|
||||
cpu="${cpu/AMD }"
|
||||
cpu="${cpu/Intel }"
|
||||
cpu="${cpu/Core? Duo }"
|
||||
cpu="${cpu/Qualcomm }"
|
||||
|
||||
cpu="${cpu} (${cores}C)"
|
||||
echo "$cpu"
|
||||
}
|
||||
|
||||
#}}}
|
||||
|
||||
#{{{ ENVIROMENT
|
||||
|
||||
get_res(){
|
||||
if type -p xrandr >/dev/null; then
|
||||
|
||||
resolution="$(xrandr --nograb --current |\
|
||||
awk -F 'connected |\\+|\\(' \
|
||||
'/ connected/ && $2 {printf $2 ", "}')"
|
||||
resolution="${resolution/primary }"
|
||||
resolution="${resolution//\*}"
|
||||
|
||||
elif type -p xwininfo >/dev/null; then
|
||||
read -r w h \
|
||||
< <(xwininfo -root | awk -F':' '/Width|Height/ {printf $2}')
|
||||
resolution="${w}x${h}"
|
||||
|
||||
elif type -p xdpyinfo >/dev/null; then
|
||||
resolution="$(xdpyinfo | awk '/dimensions:/ {printf $2}')"
|
||||
fi
|
||||
|
||||
resolution="${resolution%,*}"
|
||||
|
||||
echo "$resolution"
|
||||
}
|
||||
get_wm(){
|
||||
((wm_run == 1)) && return
|
||||
if [[ "$DISPLAY" ]]; then
|
||||
id="$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)"
|
||||
id="${id##* }"
|
||||
if [[ "$id" != "found." ]]; then
|
||||
wm="$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)"
|
||||
wm="${wm/*WM_NAME = }"
|
||||
wm="${wm/\"}"
|
||||
wm="${wm/\"*}"
|
||||
fi
|
||||
|
||||
# Window Maker does not set _NET_WM_NAME
|
||||
[[ "$wm" =~ "WINDOWMAKER" ]] && wm="wmaker"
|
||||
|
||||
# Fallback for non-EWMH WMs.
|
||||
[[ -z "$wm" ]] && \
|
||||
wm="$(ps -e | grep -m 1 -o -F \
|
||||
-e "catwm" \
|
||||
-e "dwm" \
|
||||
-e "2bwm" \
|
||||
-e "monsterwm" \
|
||||
-e "tinywm")"
|
||||
fi
|
||||
wm_run=1
|
||||
echo "$wm"
|
||||
|
||||
}
|
||||
trim() {
|
||||
set -f
|
||||
# shellcheck disable=2048,2086
|
||||
set -- $*
|
||||
printf '%s\n' "${*//[[:space:]]/ }"
|
||||
set +f
|
||||
}
|
||||
trim_quotes() {
|
||||
trim_output="${1//\'}"
|
||||
trim_output="${trim_output//\"}"
|
||||
printf "%s" "$trim_output"
|
||||
}
|
||||
get_ppid() {
|
||||
# Get parent process ID of PID.
|
||||
ppid="$(grep -i -F "PPid:" "/proc/${1:-$PPID}/status")"
|
||||
ppid="$(trim "${ppid/PPid:}")"
|
||||
printf "%s" "$ppid"
|
||||
}
|
||||
get_process_name() {
|
||||
# Get PID name.
|
||||
name="$(< "/proc/${1:-$PPID}/comm")"
|
||||
printf "%s" "$name"
|
||||
}
|
||||
|
||||
get_term(){
|
||||
while [[ -z "$term" ]]; do
|
||||
parent="$(get_ppid "$parent")"
|
||||
[[ -z "$parent" ]] && break
|
||||
name="$(get_process_name "$parent")"
|
||||
|
||||
case "${name// }" in
|
||||
"${SHELL/*\/}"|*"sh"|"screen"|"su"*) ;;
|
||||
|
||||
"login"*|*"Login"*|"init"|"(init)")
|
||||
term="$(tty)"
|
||||
;;
|
||||
|
||||
"ruby"|"1"|"systemd"|"sshd"*|"python"*|"USER"*"PID"*|"kdeinit"*|"launchd"*)
|
||||
break
|
||||
;;
|
||||
|
||||
"gnome-terminal-") term="gnome-terminal" ;;
|
||||
*"nvim") term="Neovim Terminal" ;;
|
||||
*"NeoVimServer"*) term="VimR Terminal" ;;
|
||||
*"tmux"*) term="tmux" ;;
|
||||
*) term="${name##*/}" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Log that the function was run.
|
||||
term_run=1
|
||||
echo "$term"
|
||||
}
|
||||
|
||||
get_termfn(){
|
||||
xrdb="$(xrdb -query)"
|
||||
term_font="$(grep -i "${term/d}"'\**\.*font' <<< "$xrdb")"
|
||||
term_font="${term_font/*"*font:"}"
|
||||
term_font="${term_font/*".font:"}"
|
||||
term_font="${term_font/*"*.font:"}"
|
||||
term_font="$(trim "$term_font")"
|
||||
|
||||
[[ -z "$term_font" && "$term" == "xterm" ]] && \
|
||||
term_font="$(grep '^XTerm.vt100.faceName' <<< "$xrdb")"
|
||||
|
||||
term_font="$(trim "${term_font/*"faceName:"}")"
|
||||
|
||||
# xft: isn't required at the beginning so we prepend it if it's missing
|
||||
[[ "${term_font:0:1}" != "-" && \
|
||||
"${term_font:0:4}" != "xft:" ]] && \
|
||||
term_font="xft:$term_font"
|
||||
|
||||
# Xresources has two different font formats, this checks which
|
||||
# one is in use and formats it accordingly.
|
||||
case "$term_font" in
|
||||
*"xft:"*)
|
||||
term_font="${term_font/xft:}"
|
||||
term_font="${term_font/:*}"
|
||||
;;
|
||||
|
||||
"-"*)
|
||||
IFS=- read -r _ _ term_font _ <<< "$term_font"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$term_font"
|
||||
}
|
||||
|
||||
get_kernel(){
|
||||
IFS=" " read -ra uname <<< "$(uname -srm)"
|
||||
unset IFS
|
||||
echo "${uname[1]}"
|
||||
}
|
||||
|
||||
|
||||
|
||||
get_term_font() {
|
||||
((term_run != 1)) && get_term
|
||||
|
||||
case "$term" in
|
||||
"alacritty"*)
|
||||
shopt -s nullglob
|
||||
confs=({$XDG_CONFIG_HOME,$HOME}/{alacritty,}/{.,}alacritty.ym?)
|
||||
shopt -u nullglob
|
||||
|
||||
[[ -f "${confs[0]}" ]] || return
|
||||
|
||||
term_font="$(awk -F ':|#' '/normal:/ {getline; print}' "${confs[0]}")"
|
||||
term_font="${term_font/*family:}"
|
||||
term_font="${term_font/$'\n'*}"
|
||||
term_font="${term_font/\#*}"
|
||||
;;
|
||||
|
||||
"Apple_Terminal")
|
||||
term_font="$(osascript <<END
|
||||
tell application "Terminal" to font name of window frontmost
|
||||
END
|
||||
)"
|
||||
;;
|
||||
|
||||
"iTerm2")
|
||||
# Unfortunately the profile name is not unique, but it seems to be the only thing
|
||||
# that identifies an active profile. There is the "id of current session of current win-
|
||||
# dow" though, but that does not match to a guid in the plist.
|
||||
# So, be warned, collisions may occur!
|
||||
# See: https://groups.google.com/forum/#!topic/iterm2-discuss/0tO3xZ4Zlwg
|
||||
local current_profile_name profiles_count profile_name diff_font
|
||||
|
||||
current_profile_name="$(osascript <<END
|
||||
tell application "iTerm2" to profile name \
|
||||
of current session of current window
|
||||
END
|
||||
)"
|
||||
|
||||
# Warning: Dynamic profiles are not taken into account here!
|
||||
# https://www.iterm2.com/documentation-dynamic-profiles.html
|
||||
font_file="${HOME}/Library/Preferences/com.googlecode.iterm2.plist"
|
||||
|
||||
# Count Guids in "New Bookmarks"; they should be unique
|
||||
profiles_count="$(PlistBuddy -c "Print ':New Bookmarks:'" "$font_file" | \
|
||||
grep -w -c "Guid")"
|
||||
|
||||
for ((i=0; i<profiles_count; i++)); do
|
||||
profile_name="$(PlistBuddy -c "Print ':New Bookmarks:${i}:Name:'" "$font_file")"
|
||||
|
||||
if [[ "$profile_name" == "$current_profile_name" ]]; then
|
||||
# "Normal Font"
|
||||
term_font="$(PlistBuddy -c "Print ':New Bookmarks:${i}:Normal Font:'" \
|
||||
"$font_file")"
|
||||
|
||||
# Font for non-ascii characters
|
||||
# Only check for a different non-ascii font, if the user checked
|
||||
# the "use a different font for non-ascii text" switch.
|
||||
diff_font="$(PlistBuddy -c "Print ':New Bookmarks:${i}:Use Non-ASCII Font:'" \
|
||||
"$font_file")"
|
||||
|
||||
if [[ "$diff_font" == "true" ]]; then
|
||||
non_ascii="$(PlistBuddy -c "Print ':New Bookmarks:${i}:Non Ascii Font:'" \
|
||||
"$font_file")"
|
||||
|
||||
[[ "$term_font" != "$non_ascii" ]] && \
|
||||
term_font="$term_font (normal) / $non_ascii (non-ascii)"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
"deepin-terminal"*)
|
||||
term_font="$(awk -F '=' '/font=/ {a=$2} /font_size/ {b=$2} END {print a,b}' \
|
||||
"${XDG_CONFIG_HOME}/deepin/deepin-terminal/config.conf")"
|
||||
;;
|
||||
|
||||
"GNUstep_Terminal")
|
||||
term_font="$(awk -F '>|<' '/>TerminalFont</ {getline; f=$3}
|
||||
/>TerminalFontSize</ {getline; s=$3} END {print f,s}' \
|
||||
"${HOME}/GNUstep/Defaults/Terminal.plist")"
|
||||
;;
|
||||
|
||||
"Hyper"*)
|
||||
term_font="$(awk -F':|,' '/fontFamily/ {print $2; exit}' "${HOME}/.hyper.js")"
|
||||
term_font="$(trim_quotes "$term_font")"
|
||||
;;
|
||||
|
||||
"kitty"*)
|
||||
kitty_config="$(kitty --debug-config)"
|
||||
[[ "$kitty_config" != *font_family* ]] && return
|
||||
|
||||
term_font="$(awk '/^font_family|^font_size/ {$1="";gsub("^ *","",$0);print $0}' \
|
||||
<<< "$kitty_config")"
|
||||
;;
|
||||
|
||||
"konsole" | "yakuake")
|
||||
# Get Process ID of current konsole window / tab
|
||||
child="$(get_ppid "$$")"
|
||||
|
||||
IFS=$'\n' read -d "" -ra konsole_instances \
|
||||
<<< "$(qdbus | awk '/org.kde.konsole/ {print $1}')"
|
||||
|
||||
for i in "${konsole_instances[@]}"; do
|
||||
IFS=$'\n' read -d "" -ra konsole_sessions <<< "$(qdbus "$i" | grep -F '/Sessions/')"
|
||||
|
||||
for session in "${konsole_sessions[@]}"; do
|
||||
if ((child == "$(qdbus "$i" "$session" processId)")); then
|
||||
profile="$(qdbus "$i" "$session" environment |\
|
||||
awk -F '=' '/KONSOLE_PROFILE_NAME/ {print $2}')"
|
||||
break
|
||||
fi
|
||||
done
|
||||
[[ "$profile" ]] && break
|
||||
done
|
||||
|
||||
# We could have two profile files for the same profile name, take first match
|
||||
profile_filename="$(grep -l "Name=${profile}" "$HOME"/.local/share/konsole/*.profile)"
|
||||
profile_filename="${profile_filename/$'\n'*}"
|
||||
|
||||
[[ "$profile_filename" ]] && \
|
||||
term_font="$(awk -F '=|,' '/Font=/ {print $2,$3}' "$profile_filename")"
|
||||
;;
|
||||
|
||||
"lxterminal"*)
|
||||
term_font="$(awk -F '=' '/fontname=/ {print $2; exit}' \
|
||||
"${XDG_CONFIG_HOME}/lxterminal/lxterminal.conf")"
|
||||
;;
|
||||
|
||||
"mate-terminal")
|
||||
# To get the actual config we have to create a temporarily file with the
|
||||
# --save-config option.
|
||||
mateterm_config="/tmp/mateterm.cfg"
|
||||
|
||||
# Ensure /tmp exists and we do not overwrite anything.
|
||||
if [[ -d "/tmp" && ! -f "$mateterm_config" ]]; then
|
||||
mate-terminal --save-config="$mateterm_config"
|
||||
|
||||
role="$(xprop -id "${WINDOWID}" WM_WINDOW_ROLE)"
|
||||
role="${role##* }"
|
||||
role="${role//\"}"
|
||||
|
||||
profile="$(awk -F '=' -v r="$role" \
|
||||
'$0~r {
|
||||
getline;
|
||||
if(/Maximized/) getline;
|
||||
if(/Fullscreen/) getline;
|
||||
id=$2"]"
|
||||
} $0~id {if(id) {getline; print $2; exit}}' \
|
||||
"$mateterm_config")"
|
||||
|
||||
rm -f "$mateterm_config"
|
||||
|
||||
mate_get() {
|
||||
gsettings get org.mate.terminal.profile:/org/mate/terminal/profiles/"$1"/ "$2"
|
||||
}
|
||||
|
||||
if [[ "$(mate_get "$profile" "use-system-font")" == "true" ]]; then
|
||||
term_font="$(gsettings get org.mate.interface monospace-font-name)"
|
||||
else
|
||||
term_font="$(mate_get "$profile" "font")"
|
||||
fi
|
||||
term_font="$(trim_quotes "$term_font")"
|
||||
fi
|
||||
;;
|
||||
|
||||
"mintty")
|
||||
term_font="$(awk -F '=' '!/^($|#)/ && /Font/ {printf $2; exit}' "${HOME}/.minttyrc")"
|
||||
;;
|
||||
|
||||
"pantheon"*)
|
||||
term_font="$(gsettings get org.pantheon.terminal.settings font)"
|
||||
|
||||
[[ -z "${term_font//\'}" ]] && \
|
||||
term_font="$(gsettings get org.gnome.desktop.interface monospace-font-name)"
|
||||
|
||||
term_font="$(trim_quotes "$term_font")"
|
||||
;;
|
||||
|
||||
"qterminal")
|
||||
term_font="$(awk -F '=' '/fontFamily=/ {a=$2} /fontSize=/ {b=$2} END {print a,b}' \
|
||||
"${XDG_CONFIG_HOME}/qterminal.org/qterminal.ini")"
|
||||
;;
|
||||
|
||||
"sakura"*)
|
||||
term_font="$(awk -F '=' '/^font=/ {print $2; exit}' \
|
||||
"${XDG_CONFIG_HOME}/sakura/sakura.conf")"
|
||||
;;
|
||||
|
||||
"st")
|
||||
term_font="$(ps -o command= -p "$parent" | grep -F -- "-f")"
|
||||
|
||||
if [[ "$term_font" ]]; then
|
||||
term_font="${term_font/*-f/}"
|
||||
term_font="${term_font/ -*/}"
|
||||
|
||||
else
|
||||
# On Linux we can get the exact path to the running binary through the procfs
|
||||
# (in case `st` is launched from outside of $PATH) on other systems we just
|
||||
# have to guess and assume `st` is invoked from somewhere in the users $PATH
|
||||
[[ -L "/proc/$parent/exe" ]] && binary="/proc/$parent/exe" || binary="$(type -p st)"
|
||||
|
||||
# Grep the output of strings on the `st` binary for anything that looks vaguely
|
||||
# like a font definition. NOTE: There is a slight limitation in this approach.
|
||||
# Technically "Font Name" is a valid font. As it doesn't specify any font options
|
||||
# though it is hard to match it correctly amongst the rest of the noise.
|
||||
[[ -n "$binary" ]] && \
|
||||
term_font="$(strings "$binary" | grep -F -m 1 \
|
||||
-e "pixelsize=" \
|
||||
-e "size=" \
|
||||
-e "antialias=" \
|
||||
-e "autohint=")"
|
||||
fi
|
||||
|
||||
term_font="${term_font/xft:}"
|
||||
term_font="${term_font/:*}"
|
||||
;;
|
||||
|
||||
"terminology")
|
||||
term_font="$(strings "${XDG_CONFIG_HOME}/terminology/config/standard/base.cfg" |\
|
||||
awk '/^font\.name$/{print a}{a=$0}')"
|
||||
term_font="${term_font/.pcf}"
|
||||
term_font="${term_font/:*}"
|
||||
;;
|
||||
|
||||
"termite")
|
||||
[[ -f "${XDG_CONFIG_HOME}/termite/config" ]] && \
|
||||
termite_config="${XDG_CONFIG_HOME}/termite/config"
|
||||
|
||||
term_font="$(awk -F '= ' '/\[options\]/ {
|
||||
opt=1
|
||||
}
|
||||
/^\s*font/ {
|
||||
if(opt==1) a=$2;
|
||||
opt=0
|
||||
} END {print a}' "/etc/xdg/termite/config" \
|
||||
"$termite_config")"
|
||||
;;
|
||||
|
||||
"urxvt" | "urxvtd" | "rxvt-unicode" | "xterm")
|
||||
xrdb="$(xrdb -query)"
|
||||
term_font="$(grep -im 1 -e "^${term/d}"'\**\.*font' -e '^\*font' <<< "$xrdb")"
|
||||
term_font="${term_font/*"*font:"}"
|
||||
term_font="${term_font/*".font:"}"
|
||||
term_font="${term_font/*"*.font:"}"
|
||||
term_font="$(trim "$term_font")"
|
||||
|
||||
[[ -z "$term_font" && "$term" == "xterm" ]] && \
|
||||
term_font="$(grep '^XTerm.vt100.faceName' <<< "$xrdb")"
|
||||
|
||||
term_font="$(trim "${term_font/*"faceName:"}")"
|
||||
|
||||
# xft: isn't required at the beginning so we prepend it if it's missing
|
||||
[[ "${term_font:0:1}" != "-" && "${term_font:0:4}" != "xft:" ]] && \
|
||||
term_font="xft:$term_font"
|
||||
|
||||
# Xresources has two different font formats, this checks which
|
||||
# one is in use and formats it accordingly.
|
||||
case "$term_font" in
|
||||
*"xft:"*)
|
||||
term_font="${term_font/xft:}"
|
||||
term_font="${term_font/:*}"
|
||||
;;
|
||||
|
||||
"-"*)
|
||||
IFS=- read -r _ _ term_font _ <<< "$term_font"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"xfce4-terminal")
|
||||
term_font="$(awk -F '=' '/^FontName/{a=$2}/^FontUseSystem=TRUE/{a=$0} END {print a}' \
|
||||
"${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc")"
|
||||
|
||||
[[ "$term_font" == "FontUseSystem=TRUE" ]] && \
|
||||
term_font="$(gsettings get org.gnome.desktop.interface monospace-font-name)"
|
||||
|
||||
term_font="$(trim_quotes "$term_font")"
|
||||
|
||||
# Default fallback font hardcoded in terminal-preferences.c
|
||||
[[ -z "$term_font" ]] && term_font="Monospace 12"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
||||
get_term_font > /dev/null 2>&1
|
||||
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
res=$(get_res)
|
||||
wmname=$(get_wm)
|
||||
term=$(get_term)
|
||||
termfn=$term_font
|
||||
else
|
||||
wmname="none"
|
||||
res="none"
|
||||
term="none"
|
||||
termfn="none"
|
||||
fi
|
||||
|
||||
#cpuspe="`sed -n '/model\ name/s/^.*:\ //p' /proc/cpuinfo | uniq` (x`nproc`)"
|
||||
|
||||
system=`lsb_release -sir`
|
||||
system="${system/$'\n'/ }"
|
||||
birthd=`last | grep "begins" | sed 's/wtmp begins //g'`
|
||||
|
||||
#}}}
|
||||
|
||||
|
||||
c00=$'\e[0;30m' #d black
|
||||
c01=$'\e[0;31m' #d red
|
||||
c02=$'\e[0;32m' #l green
|
||||
c03=$'\e[0;33m' #d tan
|
||||
c04=$'\e[0;34m' #d grey
|
||||
c05=$'\e[0;35m' #d pink
|
||||
c06=$'\e[0;36m' #d teal
|
||||
c07=$'\e[0;37m' #d white
|
||||
|
||||
c08=$'\e[1;30m' #l black
|
||||
c09=$'\e[1;31m' #l red
|
||||
c10=$'\e[1;32m' #d brown
|
||||
c11=$'\e[1;33m' #l tan
|
||||
c12=$'\e[1;34m' #l blue
|
||||
c13=$'\e[1;35m' #l pink
|
||||
c14=$'\e[1;36m' #l teal
|
||||
c15=$'\e[1;37m' #l white
|
||||
|
||||
f0=$'\e[0;32m'
|
||||
f1=$'\e[1;37m'
|
||||
f2=$'\e[0;37m'
|
||||
|
||||
|
||||
cat << EOF
|
||||
|
||||
${c01}▉▉ | ${f2}System ${c08}....... $f1$system
|
||||
${c09} ▉▉| ${f2}Packages ${c08}..... $f1$(get_packages)
|
||||
${c07}▉▉ | ${f2}Uptime ${c08}...... $f1$(get_uptime)
|
||||
${c15} ▉▉| ${f2}Resolution ${c08}.. $f1$res
|
||||
${c02}▉▉ |
|
||||
${c10} ▉▉| ${f2}WM ${c08}........... $f1$wmname
|
||||
${c03}▉▉ | ${f2}Shell ${c08}........ $f1$(get_shell)
|
||||
${c11} ▉▉| ${f2}Terminal ${c08}..... $f1$term
|
||||
${c08}▉▉ | ${f2}Term Font ${c08}.... $f1$termfn
|
||||
${c12} ▉▉|
|
||||
${c05}▉▉ | ${f2}Kernel ${c08}....... $f1$(get_kernel)
|
||||
${c13} ▉▉| ${f2}Processor ${c08}.... $f1$(get_cpu)
|
||||
${c06}▉▉ | ${f2}Gpu ${c08}.......... $f1$(get_gpu)
|
||||
${c14} ▉▉|
|
||||
${c07}▉▉ | ${f2}Birthday ${c08}..... $f1$birthd
|
||||
${c15} ▉▉| ${f2}Memory ${c08}....... $f1$(get_mem)
|
||||
|
||||
EOF
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ANSI color scheme script featuring PACMAN
|
||||
# Author: pfh
|
||||
# Source: http://crunchbang.org/forums/viewtopic.php?pid=144481#p144481
|
||||
# Reworked for ArcoLinux
|
||||
|
||||
f=3 b=4
|
||||
for j in f b; do
|
||||
for i in {0..7}; do
|
||||
printf -v $j$i %b "\e[${!j}${i}m"
|
||||
done
|
||||
done
|
||||
bld=$'\e[1m'
|
||||
rst=$'\e[0m'
|
||||
|
||||
cat << EOF
|
||||
$rst
|
||||
$f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄
|
||||
$f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7███$f2██$f7███$f2█▄ $f4▄█$f7███$f4██$f7███$f4█▄ $f5▄█$f7███$f5██$f7███$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄
|
||||
$f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7▄▄█$f1██$f7▄▄█$f1███ $f2██$f7█ █$f2██$f7█ █$f2██ $f4██$f7█ █$f4██$f7█ █$f4██ $f5██$f7█ █$f5██$f7█ █$f5██ $f6███$f7█▄▄$f6██$f7█▄▄$f6█
|
||||
$f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████
|
||||
$f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██
|
||||
$f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀
|
||||
$rst
|
||||
EOF
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ANSI color scheme script featuring PACMAN
|
||||
# Author: pfh
|
||||
# Source: http://crunchbang.org/forums/viewtopic.php?pid=144481#p144481
|
||||
# Reworked for ArcoLinux
|
||||
|
||||
f=3 b=4
|
||||
for j in f b; do
|
||||
for i in {0..7}; do
|
||||
printf -v $j$i %b "\e[${!j}${i}m"
|
||||
done
|
||||
done
|
||||
bld=$'\e[1m'
|
||||
rst=$'\e[0m'
|
||||
|
||||
cat << EOF
|
||||
$rst
|
||||
$f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄
|
||||
$f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7███$f2██$f7███$f2█▄ $f4▄█$f7███$f4██$f7███$f4█▄ $f5▄█$f7███$f5██$f7███$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄
|
||||
$f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7▄▄█$f1██$f7▄▄█$f1███ $f2██$f7█ █$f2██$f7█ █$f2██ $f4██$f7█ █$f4██$f7█ █$f4██ $f5██$f7█ █$f5██$f7█ █$f5██ $f6███$f7█▄▄$f6██$f7█▄▄$f6█
|
||||
$f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████
|
||||
$f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██
|
||||
$f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀
|
||||
$bld
|
||||
$f3 ▄███████▄ $f1 ▄██████▄ $f2 ▄██████▄ $f4 ▄██████▄ $f5 ▄██████▄ $f6 ▄██████▄
|
||||
$f3▄█████████▀▀ $f1▄$f7█▀█$f1██$f7█▀█$f1██▄ $f2▄█$f7█ █$f2██$f7█ █$f2█▄ $f4▄█$f7█ █$f4██$f7█ █$f4█▄ $f5▄█$f7█ █$f5██$f7█ █$f5█▄ $f6▄██$f7█▀█$f6██$f7█▀█$f6▄
|
||||
$f3███████▀ $f7▄▄ ▄▄ ▄▄ $f1█$f7█▄▄$f1██$f7▄▄█$f1███ $f2██$f7███$f2██$f7███$f2██ $f4██$f7███$f4██$f7███$f4██ $f5██$f7███$f5██$f7███$f5██ $f6███$f7▄▄█$f6██$f7▄▄█$f6█
|
||||
$f3███████▄ $f7▀▀ ▀▀ ▀▀ $f1████████████ $f2████████████ $f4████████████ $f5████████████ $f6████████████
|
||||
$f3▀█████████▄▄ $f1██▀██▀▀██▀██ $f2██▀██▀▀██▀██ $f4██▀██▀▀██▀██ $f5██▀██▀▀██▀██ $f6██▀██▀▀██▀██
|
||||
$f3 ▀███████▀ $f1▀ ▀ ▀ ▀ $f2▀ ▀ ▀ ▀ $f4▀ ▀ ▀ ▀ $f5▀ ▀ ▀ ▀ $f6▀ ▀ ▀ ▀
|
||||
$rst
|
||||
EOF
|
||||
|
|
@ -77,7 +77,7 @@ exec --no-startup-id ~/.config/wpg/wp_init.sh
|
|||
#Clipster
|
||||
exec --no-startup-id clipster -d
|
||||
#Picom
|
||||
exec --no-startup-id picom -b
|
||||
exec --no-startup-id picom -b --experimental-backends --dbus --config /home/hate/.config/picom.conf
|
||||
#Gnome privileges
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
#Launch Polybar where appropriate:
|
||||
|
|
@ -133,7 +133,7 @@ bindsym Mod1+Shift+r exec ~/.config/Scripts/i3-resurrect-restore-all
|
|||
|
||||
#Composite manager:
|
||||
bindsym $mod+b exec --no-startup-id pkill picom
|
||||
bindsym $mod+Ctrl+b exec --no-startup-id picom -b
|
||||
bindsym $mod+Ctrl+b exec --no-startup-id picom -b --experimental-backends --dbus --config /home/hate/.config/picom.conf
|
||||
|
||||
###---Basic Bindings---###
|
||||
bindsym $mod+Return exec $term
|
||||
|
|
|
|||
|
|
@ -1,127 +1,55 @@
|
|||
#
|
||||
# ____ _
|
||||
# / ___|___ _ __ ___ _ __ | |_ ___ _ __
|
||||
# | | / _ \| '_ ` _ \| '_ \| __/ _ \| '_ \
|
||||
# | |__| (_) | | | | | | |_) | || (_) | | | |
|
||||
# \____\___/|_| |_| |_| .__/ \__\___/|_| |_|
|
||||
# |_|
|
||||
#
|
||||
|
||||
#################################
|
||||
#
|
||||
# Backend
|
||||
#
|
||||
#################################
|
||||
|
||||
# Backend to use: "xrender" or "glx".
|
||||
# GLX backend is typically much faster but depends on a sane driver.
|
||||
backend = "glx";
|
||||
|
||||
#################################
|
||||
#
|
||||
# GLX backend
|
||||
#
|
||||
#################################
|
||||
|
||||
glx-no-stencil = true;
|
||||
|
||||
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
|
||||
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
|
||||
# but a 20% increase when only 1/4 is.
|
||||
# My tests on nouveau show terrible slowdown.
|
||||
# Useful with --glx-swap-method, as well.
|
||||
# glx-copy-from-front = true;
|
||||
|
||||
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
|
||||
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
|
||||
# May break VSync and is not available on some drivers.
|
||||
# Overrides --glx-copy-from-front.
|
||||
# glx-use-copysubbuffermesa = true;
|
||||
|
||||
# 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).
|
||||
# Recommended if it works.
|
||||
glx-no-rebind-pixmap = true;
|
||||
|
||||
# Damage
|
||||
use-damage = true;
|
||||
|
||||
# GLX backend: GLX buffer swap method we assume.
|
||||
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
|
||||
# undefined is the slowest and the safest, and the default value.
|
||||
# copy is fastest, but may fail on some drivers,
|
||||
# 2-6 are gradually slower but safer (6 is still faster than 0).
|
||||
# Usually, double buffer means 2, triple buffer means 3.
|
||||
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
|
||||
# Useless with --glx-use-copysubbuffermesa.
|
||||
# Partially breaks --resize-damage.
|
||||
# Defaults to undefined.
|
||||
#glx-swap-method = "undefined";
|
||||
|
||||
#################################
|
||||
#
|
||||
# Shadows
|
||||
#
|
||||
#################################
|
||||
|
||||
# Enabled client-side shadows on windows.
|
||||
shadow = true;
|
||||
# Don't draw shadows on DND windows.
|
||||
#no-dnd-shadow = true;
|
||||
# Avoid drawing shadows on dock/panel windows.
|
||||
#no-dock-shadow = true;
|
||||
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
|
||||
#clear-shadow = true;
|
||||
# The blur radius for shadows. (default 12)
|
||||
# Shadow
|
||||
shadow = false;
|
||||
shadow-radius = 7;
|
||||
# The left offset for shadows. (default -15)
|
||||
shadow-offset-x = -7;
|
||||
# The top offset for shadows. (default -15)
|
||||
shadow-offset-y = -7;
|
||||
# The translucency for shadows. (default .75)
|
||||
shadow-opacity = 0.5;
|
||||
|
||||
# Set if you want different colour shadows
|
||||
log-level = "warn";
|
||||
# log-file = "/path/to/your/log/file";
|
||||
shadow-opacity = 0.0;
|
||||
# shadow-red = 0.0;
|
||||
# shadow-green = 0.0;
|
||||
# shadow-blue = 0.0;
|
||||
|
||||
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
|
||||
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
|
||||
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
|
||||
shadow-exclude = [
|
||||
#"! name~=''",
|
||||
"name = 'Notification'",
|
||||
"name *= 'Chrome'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"name *= 'Firefox'",
|
||||
"name = 'Polybar'",
|
||||
"class_g = 'rofi'",
|
||||
"_GTK_FRAME_EXTENTS@:c",
|
||||
"class_g = 'i3-frame'",
|
||||
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
|
||||
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
|
||||
"!I3_FLOATING_WINDOW@:c"
|
||||
"name = 'Notification'",
|
||||
"class_g = 'Conky'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g = 'Cairo-clock'",
|
||||
"_GTK_FRAME_EXTENTS@:c",
|
||||
"class_g = 'i3-frame'",
|
||||
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
|
||||
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
|
||||
"!I3_FLOATING_WINDOW@:c"
|
||||
];
|
||||
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
|
||||
shadow-ignore-shaped = true;
|
||||
# shadow-exclude = "n:e:Notification";
|
||||
# shadow-exclude-reg = "x10+0+0";
|
||||
# xinerama-shadow-crop = true;
|
||||
|
||||
#################################
|
||||
#
|
||||
# Opacity
|
||||
#
|
||||
#################################
|
||||
# inactive-opacity = 0.8;
|
||||
# active-opacity = 0.8;
|
||||
# frame-opacity = 0.7;
|
||||
# inactive-opacity-override = false;
|
||||
# inactive-dim = 0.2;
|
||||
# inactive-dim-fixed = true;
|
||||
|
||||
#menu-opacity = 1;
|
||||
#inactive-opacity = 1;
|
||||
#active-opacity = 1;
|
||||
#frame-opacity = 1;
|
||||
#inactive-opacity-override = false;
|
||||
alpha-step = 0.06;
|
||||
blur: {
|
||||
method = "dual_kawase";
|
||||
strength = 7.0;
|
||||
# deviation = 1.0;
|
||||
# kernel = "11x11gaussian";
|
||||
}
|
||||
|
||||
blur-kern = "7x7box";
|
||||
blur-method = "dual_kawase";
|
||||
blur-strength = 12;
|
||||
# blur-background = true;
|
||||
# blur-background-frame = true;
|
||||
blur-kern = "3x3box";
|
||||
# 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-background-fixed = true;
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
# opacity-rule = [ "80:class_g = 'URxvt'" ];
|
||||
|
||||
opacity-rule = [
|
||||
"99:class_g = 'i3-frame'",
|
||||
|
|
@ -130,149 +58,51 @@ opacity-rule = [
|
|||
"90:class_g = 'Alacritty' && focused",
|
||||
"60:class_g = 'Alacritty' && !focused",
|
||||
"99:class_g = 'mpv'",
|
||||
"60:class_g = 'kitty' && focused",
|
||||
"90:class_g = 'kitty' && focused",
|
||||
"99:class_g = 'kitty' && !focused",
|
||||
"0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'",
|
||||
"0:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_HIDDEN'",
|
||||
"0:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_HIDDEN'",
|
||||
"0:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_HIDDEN'",
|
||||
"0:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_HIDDEN'",
|
||||
|
||||
"90:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_STICKY'",
|
||||
"90:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_STICKY'",
|
||||
"90:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_STICKY'",
|
||||
"90:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_STICKY'",
|
||||
"90:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_STICKY'"
|
||||
];
|
||||
# max-brightness = 0.66
|
||||
|
||||
# Dim inactive windows. (0.0 - 1.0)
|
||||
inactive-dim = 0.1;
|
||||
# Do not let dimness adjust based on window opacity.
|
||||
inactive-dim-fixed = true;
|
||||
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
|
||||
blur-background = true;
|
||||
# Blur background of opaque windows with transparent frames as well.
|
||||
blur-background-frame = true;
|
||||
# Do not let blur radius adjust based on window opacity.
|
||||
blur-background-fixed = true;
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'",
|
||||
"name *= 'Chromium'",
|
||||
"name *= 'Chrome'",
|
||||
"name *= 'Firefox'",
|
||||
"name = 'Polybar'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g = 'mpv'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
#################################
|
||||
#
|
||||
# Fading
|
||||
#
|
||||
#################################
|
||||
|
||||
# Fade windows during opacity changes.
|
||||
fading = true;
|
||||
# The time between steps in a fade in milliseconds. (default 10).
|
||||
fade-delta = 4;
|
||||
# Opacity change between steps while fading in. (default 0.028).
|
||||
# fade-delta = 30;
|
||||
fade-in-step = 0.03;
|
||||
# Opacity change between steps while fading out. (default 0.03).
|
||||
fade-out-step = 0.03;
|
||||
# Fade windows in/out when opening/closing
|
||||
no-fading-openclose = false;
|
||||
# no-fading-openclose = true;
|
||||
# no-fading-destroyed-argb = true;
|
||||
fade-exclude = [ ];
|
||||
|
||||
# Specify a list of conditions of windows that should not be faded.
|
||||
fade-exclude = [
|
||||
];
|
||||
|
||||
#################################
|
||||
#
|
||||
# Other
|
||||
#
|
||||
#################################
|
||||
|
||||
# Try to detect WM windows and mark them as active.
|
||||
backend = "glx";
|
||||
mark-wmwin-focused = true;
|
||||
# Mark all non-WM but override-redirect windows active (e.g. menus).
|
||||
mark-ovredir-focused = true;
|
||||
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
|
||||
# Usually more reliable but depends on a EWMH-compliant WM.
|
||||
use-ewmh-active-win = true;
|
||||
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
|
||||
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.
|
||||
# This prevents opacity being ignored for some apps.
|
||||
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
|
||||
detect-client-opacity = true;
|
||||
|
||||
# Specify refresh rate of the screen.
|
||||
# If not specified or 0, compton will try detecting this with X RandR extension.
|
||||
refresh-rate = 60;
|
||||
|
||||
# Set VSync method. VSync methods currently available:
|
||||
# none: No VSync
|
||||
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
|
||||
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
|
||||
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
|
||||
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn’t have the effect of --sw-opti unlike other methods. Experimental.
|
||||
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
|
||||
# (Note some VSync methods may not be enabled at compile time.)
|
||||
vsync = "true";
|
||||
|
||||
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
|
||||
# Reported to have no effect, though.
|
||||
dbe = true;
|
||||
# Painting on X Composite overlay window. Recommended.
|
||||
#paint-on-overlay = true;
|
||||
|
||||
# Limit compton 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 = false;
|
||||
|
||||
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
|
||||
# Known to cause flickering when redirecting/unredirecting windows.
|
||||
# paint-on-overlay may make the flickering less obvious.
|
||||
unredir-if-possible = true;
|
||||
|
||||
# get rid of the screen tearing in full screen Chrome
|
||||
unredir-if-possible-exclude = [
|
||||
"name *= 'Chrome'",
|
||||
"name *= 'Chromium'",
|
||||
"name *= 'mpv'"
|
||||
];
|
||||
|
||||
# Specify a list of conditions of windows that should always be considered focused.
|
||||
focus-exclude = [
|
||||
];
|
||||
|
||||
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
|
||||
refresh-rate = 0;
|
||||
vsync = true;
|
||||
# sw-opti = true;
|
||||
# unredir-if-possible = true;
|
||||
# unredir-if-possible-delay = 5000;
|
||||
# unredir-if-possible-exclude = [ ];
|
||||
focus-exclude = [ "class_g = 'Cairo-clock'" ];
|
||||
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 = true;
|
||||
invert-color-include = [ ];
|
||||
# resize-damage = 1;
|
||||
|
||||
# GLX backend
|
||||
# glx-no-stencil = true;
|
||||
# glx-no-rebind-pixmap = true;
|
||||
# xrender-sync-fence = true;
|
||||
use-damage = true;
|
||||
|
||||
#################################
|
||||
#
|
||||
# Window type settings
|
||||
#
|
||||
#################################
|
||||
|
||||
wintypes:
|
||||
{
|
||||
tooltip =
|
||||
{
|
||||
# fade: Fade the particular type of windows.
|
||||
fade = true;
|
||||
# shadow: Give those windows shadow
|
||||
shadow = false;
|
||||
# opacity: Default opacity for the type of windows.
|
||||
opacity = 0.75;
|
||||
# focus: Whether to always consider windows of this type focused.
|
||||
focus = true;
|
||||
};
|
||||
tooltip = { fade = true; shadow = false; opacity = 0.75; focus = true; full-shadow = false; };
|
||||
dock = { shadow = false; }
|
||||
dnd = { shadow = false; }
|
||||
popup_menu = { opacity = 0.8; }
|
||||
dropdown_menu = { opacity = 0.8; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ exec --no-startup-id ~/.config/wpg/wp_init.sh
|
|||
#Clipster
|
||||
exec --no-startup-id clipster -d
|
||||
#Picom
|
||||
exec --no-startup-id picom -b
|
||||
exec --no-startup-id picom -b --experimental-backends --dbus --config /home/hate/.config/picom.conf
|
||||
#Gnome privileges
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
#Launch Polybar where appropriate:
|
||||
|
|
@ -133,7 +133,7 @@ bindsym Mod1+Shift+r exec ~/.config/Scripts/i3-resurrect-restore-all
|
|||
|
||||
#Composite manager:
|
||||
bindsym $mod+b exec --no-startup-id pkill picom
|
||||
bindsym $mod+Ctrl+b exec --no-startup-id picom -b
|
||||
bindsym $mod+Ctrl+b exec --no-startup-id picom -b --experimental-backends --dbus --config /home/hate/.config/picom.conf
|
||||
|
||||
###---Basic Bindings---###
|
||||
bindsym $mod+Return exec $term
|
||||
|
|
|
|||
Loading…
Reference in New Issue