Updated most files under misc/ and added asound.conf.

This commit is contained in:
Mid Favila 2021-11-23 12:34:15 -04:00
parent b07bba6293
commit 2331870c68
10 changed files with 55 additions and 211 deletions

49
misc/asound.conf Normal file
View File

@ -0,0 +1,49 @@
defaults.pcm.card 1
defaults.ctl.card 1
defaults.pcm.rate_converter "speexrate_best"
pcm.!default {
type asym
playback.pcm "plug:Output"
}
pcm.Output {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "hw:1,0"
rate 48000
periods 128
period_time 0
period_size 2048
buffer_size 32768
}
}
pcm.Input {
type dsnoop
ipc_key 1025
ipc_perm 0666
slave {
pcm "hw:1,0"
rate 48000
periods 128
period_time 0
period_size 2048
buffer_size 32768
}
}
ctl.dmixer {
type hw
card 0
}

View File

@ -1,63 +0,0 @@
#!/bin/es
fn interval{
n=`{date|sed -ne 's^.*[0-9][0-9]:[0-9][0-9]:\([0-9][0-9]\).*^\1^p'}
sleep `{expr - 60 `{expr % $n 60}}
}
# Display Time using 24h notation.
fn clock{
date|sed -ne 's^.*\([0-9][0-9]\):\([0-9][0-9]\):[0-9][0-9].*^\1\2^p'
}
# Acquire the name of the current machine's primary interface.
fn iface_get{
if{~ $HOSTNAME speculatores}
{printf wlp2s0}\
{printf eno1}
}
# Acquire the IP of the current connection. Needs to be made portable.
fn ip{
x=`{ifconfig wlp2s0|sed -ne 's^.*addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*^\1^p'}
if{~ `{route|sed 3!d|cut -b1-7} 'default'}
{if {!~ $x ''}
{printf %s $x}\
{printf %s 'G/W'}
}\
{printf N/A}
}
# Display the current battery capacity and status
fn pwr{
if{~ `{cat /sys/class/power_supply/BAT1/status} 'Discharging'}\
{printf --%s%% `{cat /sys/class/power_supply/BAT1/capacity}}\
{printf ++%s%% `{cat /sys/class/power_supply/BAT1/capacity}}
}
fn tmp_helper{
snarf 'http://wttr.in/?format=3' -|sed -ne \
's^.*\(.[0-9][0-9]*.C\)^\1^p' > $FXDE_DIR/fxde-core/info/temp
touch $FXDE_DIR/fxde-core/info/timepiece
}
fn tmp{
ival=120
# If we've rolled over into a second minute and timepiece does not exist...
if {`{expr % `{expr - $ival `{expr \* `{date|cut -d':' -f2} 60}} 60}&&\
! test -e $FXDE_DIR/fxde-core/info/timepiece}
{printf UPD
tmp_helper}\
{test -e $FXDE_DIR/fxde-core/info/timepiece && ! `{expr % `{expr - 120 `{expr \* `{date|cut -d':' -f2} 60}} 1200}}
{rm $FXDE_DIR/fxde-core/info/timepiece}\
{test -s $FXDE_DIR/fxde-core/info/temp}
{cat $FXDE_DIR/fxde-core/info/temp}\
{printf CND}
}
fn curdesk iter {if{~ $wm shod}{if {~ `{lsd|sed $iter!d|cut -b1} '*'}{printf %i $iter}{curdesk `{expr + 1 $iter}}}{printf %s N/A}}
while {true}{
printf '%%{l}[ %s | %%{A:xcalendar:}%s%%{A} | %s | %s ]\n' `{pwr} `{clock} `{ip} `{curdesk 1}
sleep 1
}

View File

@ -1,69 +0,0 @@
#!/bin/sh -e
FXDE_DIR=/home/midfavila/.config/fxde
tme() #Display current time in 24h notation
{
date|sed -ne 's/ */ /gp'|cut -d ' ' -f4|sed -ne 's/\([0-9][0-9]\):\([0-9][0-9]\).*/\1\2/p'
}
pwr() #Display current battery capacity and whether we're discharging or not.
{
if [ "$(cat /sys/class/power_supply/BAT1/status)" = "Discharging" ]
then printf "%s%%--" "$(cat /sys/class/power_supply/BAT1/capacity)"
else printf "%s%%++" "$(cat /sys/class/power_supply/BAT1/capacity)"
fi
}
ip() #Acquire the IP of our current connection. This is awful. I'm so sorry.
{
x=$(ifconfig wlp2s0|sed -ne 's/.*addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/p')
if [ "$(route|sed 3!d|cut -b1-7)" != "default" ]
then printf "GW!"
ssu route add default gw 192.168.1.1
elif [ "${x}" ]
then printf "%s" "${x}"
else
printf "N/A"
fi
}
tmp_helper()
{
curl -s http://wttr.in/?format=1|\
sed -ne 's/.*\(.[0-9][0-9]*.C\)/\1/p' > "${FXDE_DIR}/fxde-core/info/temp"
touch "${FXDE_DIR}/fxde-core/info/timepiece"
}
tmp() #Acquire ambient temperature from wttr.in every ival seconds
{
ival=120 #How often do we check?
if [ $(expr % $(expr - "${ival}" $(expr \* $(date|cut -d ':' -f2) 60)) "${ival}" ) ] && \
[ ! -e "${FXDE_DIR}/fxde-core/info/timepiece" ]
then printf "UPD"
tmp_helper
elif [ -e "${FXDE_DIR}/fxde-core/info/timepiece" ] && \
[ ! $(expr % $(expr - 120 $(expr \* $(date|cut -d ':' -f2) 60)) 1200) ]
then rm "${FXDE_DIR}/fxde-core/info/timepiece"
elif [ -s "${FXDE_DIR}/fxde-core/info/temp" ]
then cat "${FXDE_DIR}/fxde-core/info/temp"
else
printf "COND"
fi
}
curdesk()
{
x=0
target=' '
while [ "$target" != "*" ]
do
x=$(expr + 1 $x)
target=$(lsd|sed "${x}!d"|cut -b1)
done
printf "%s" "${x}"
}
while true;do sleep 1; printf "%%{l}[ %s | %%{A:xcalendar:}%s%%{A} | %s | %s | %%{A:rm "${FXDE_DIR}/fxde-core/info/timepiece":}%s%%{A} ]\n" "$(curdesk)" "$(tme)" "$(pwr)" "$(ip)" "$(tmp)";done

View File

@ -1,6 +1,6 @@
#!/bin/sh
for service in stalonetray sxhkd picom aepanel $wm
for service in repsawn xclock xload stalonetray sxhkd picom $wm
do
pkill $service
done

Binary file not shown.

View File

@ -1,68 +0,0 @@
#!/bin/sh -e
FXDE_DIR=/home/midfavila/.config/fxde
tme() #Display current time in 24h notation
{
date|sed -ne 's/ */ /gp'|cut -d ' ' -f4|sed -ne 's/\([0-9][0-9]\):\([0-9][0-9]\).*/\1\2/p'
}
pwr() #Display current battery capacity and whether we're discharging or not.
{
if [ "$(cat /sys/class/power_supply/BAT1/status)" = "Discharging" ]
then printf "%s%%--" "$(cat /sys/class/power_supply/BAT1/capacity)"
else printf "%s%%++" "$(cat /sys/class/power_supply/BAT1/capacity)"
fi
}
ip() #Acquire the IP of our current connection. This is awful. I'm so sorry.
{
x=$(ifconfig wlp2s0|sed -ne 's/.*addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/p')
if [ "$(route|sed 3!d|cut -b1-7)" != "default" ]
then printf "ERR"
elif [ "${x}" ]
then printf "%s" "${x}"
else
printf "N/A"
fi
}
tmp_helper()
{
curl -s http://wttr.in/?format=1|\
sed -ne 's/.*\(.[0-9][0-9]*.C\)/\1/p' > "${FXDE_DIR}/fxde-core/info/temp"
touch "${FXDE_DIR}/fxde-core/info/timepiece"
}
tmp() #Acquire ambient temperature from wttr.in every ival seconds
{
ival=120 #How often do we check?
if [ $(expr % $(expr - "${ival}" $(expr \* $(date|cut -d ':' -f2) 60)) "${ival}" ) ] && \
[ ! -e "${FXDE_DIR}/fxde-core/info/timepiece" ]
then printf "UPD"
tmp_helper
elif [ -e "${FXDE_DIR}/fxde-core/info/timepiece" ] && \
[ ! $(expr % $(expr - 120 $(expr \* $(date|cut -d ':' -f2) 60)) 1200) ]
then rm "${FXDE_DIR}/fxde-core/info/timepiece"
elif [ -s "${FXDE_DIR}/fxde-core/info/temp" ]
then cat "${FXDE_DIR}/fxde-core/info/temp"
else
printf "COND"
fi
}
curdesk()
{
x=0
target=' '
while [ "$target" != "*" ]
do
x=$(expr + 1 $x)
target=$(lsd|sed "${x}!d"|cut -b1)
done
printf "%s" "${x}"
}
while true;do sleep 1; printf "%%{l}[ %s | %%{A:xcalendar:}%s%%{A} | %s | %s | %%{A:rm "${FXDE_DIR}/fxde-core/info/timepiece":}%s%%{A} ]\n" "$(curdesk)" "$(tme)" "$(pwr)" "$(ip)" "$(tmp)";done

View File

@ -13,7 +13,7 @@ Inet
Browser Links
IM Pidgin
Media
Paint mtpaint
Paint classic-colors
Systools
Editor emacsclient -cunq
Terminal xterm

View File

@ -8,11 +8,11 @@ ctrl + Pause ; ctrl + r
#Prompt the user for a Scheme expression
ctrl + Pause ; shift + colon
gsi -e "$(printf "\n"|xprompt 'gsi>')"|xmessage -file -
gsi -e "$(printf "\n"|dmenu 'gsi>')"|xmessage -file -
#Prompt the user for a shell command
ctrl + Pause ; shift + exclam
printf "\n"|xprompt "sh:"|sh -
printf "\n"|dmenu "sh:"|sh -
#Start our IM client
ctrl + Pause ; p ; i
@ -44,7 +44,7 @@ ctrl + Pause ; w ; t
#Switch between windows
ctrl + Pause ; shift + W
wmctrl -ia "$(${FXDE_DIR}/fxde-core/scripts/winlist.sh|sort -rfn|xprompt -dsi '?: '|sed 's/\(^ *\)//')"
wmctrl -ia "$(${FXDE_DIR}/fxde-core/scripts/winlist.sh|sort -rfn|dmenu '?: '|sed 's/\(^ *\)//')"
#Kill the current window
ctrl + Pause ; w ; shift + K

View File

@ -1,5 +0,0 @@
#!/bin/es
fn swap_win{
$FXDE_DIR/fxde-core/scripts/winlist.sh|sort -rfn|xprompt -dfi \?:|sed 's/\(^ *\)//'|wtf `{cat /dev/stdin};chwso -r `pfw
}

View File

@ -18,7 +18,7 @@ fn setup_daemons{
picom -cCzfGD3 -i.85 --shadow-exclude bounding_shaped --vsync --no-use-damage --backend $backend&
# Manage clicks on the root window.
# xclickroot -1 aemenu &
# xclickroot -1 xmenu &
# Manage hotkeys.
sxhkd -c $FXDE_DIR/fxde-core/config/sxhkdrc &