refactore directory structure

This commit is contained in:
Chris Cochrun 2023-06-09 06:06:37 -05:00
parent 3830eef1f4
commit e87bfb7c39
485 changed files with 66 additions and 1696 deletions

View file

@ -0,0 +1,10 @@
# `contrib` directory
This directory contains cool things our community has contributed, or some
niceties we've added that they might find useful.
| Directory | Description |
| -----------------: | :------------------------------------------------------------------------------------- |
| [scripts](scripts) | A collection of scripts that supercharge _macchina_. |
| [ascii](ascii) | A collection of ASCII art files that you can display alongside your system statistics. |
| [themes](themes) | A collection of themes that you should definitely steal! |

View file

@ -0,0 +1,15 @@
              ..             
              cl             
             :ooc            
            ;oooo:           
           .looooo:          
          ;c;:looooc         
         :ooooooooooc        
        :ooooooooooool       
       coooool;;loooool.     
     .looooo'    .oooooo.    
    .ooooooc      ;oooocl'   
   'ooooooo:      'ooooo:,   
  ,oool:,..        ..,:looo; 
 :c,.                    .,c:
..                          .'

View file

@ -0,0 +1,16 @@
.:-======-:.
:=++++++++++++=-.
-++++++++++++++++++-
.+++++++++++=:::-=+++++.
.+++++++++++. .. :+++++.
=++++++++++- +++= =+++++
:+++++++++++: .++++:.=+++++:
-++++++++==+- .===+++++++++=
=+++++- -- .+++++++++=
=++++. -==+- .==++++++++++-
=+++- +++++- .++++++++++++
=+++= -++++. :+++++++++++.
=++++- .. .+++++++++++:
=++++++-:..:=++++++++++=
-++++++++++++++++++++-.
:=+++++++++++++=-:.

View file

@ -0,0 +1,17 @@
                                                  
                                                  
                     .. .,  .                     
                  c,'cc;cc::cc.;c                 
               c::ccccccccccccccc:cc         .    
 .  ,,      :::ccccccccccccccccccccc:c.    ,c:  ; 
 c: .cc   ''cccccccccccccccccccccccccc;'. .cc:.;; 
  cc:cc   :ccccccccccccccccccccccccccccc,  .ccc   
    .c,  ccccccccccccOc.:cccdx.;ccccccccc;.',     
       ';ccccccccccc'o' .cc,'l  ccccccccccc'      
      'c;.:ccccccccc:...;ccc'..;ccccccc:.;'c,     
       'c  .     ::cccccc'.'cccc::.     . ;,      
         ..                              '        
           .                            .         
                                                  
                                                  
                                                  

View file

@ -0,0 +1,48 @@
# Specifies the network interface to use for the LocalIP readout
interface = "wlp170s0"
# Lengthen uptime output
long_uptime = true
# Lengthen shell output
long_shell = false
# Lengthen kernel output
long_kernel = false
# Toggle between displaying the current shell or your user's default one.
current_shell = true
# Toggle between displaying the number of physical or logical cores of your
# processor.
physical_cores = true
# Themes need to be placed in "$XDG_CONFIG_DIR/macchina/themes" beforehand.
# e.g.:
# if theme path is /home/foo/.config/macchina/themes/Sodium.toml
# theme should be uncommented and set to "Sodium"
#
theme = "Lithium"
# Displays only the specified readouts.
# Accepted values (case-sensitive):
# - Host
# - Machine
# - Kernel
# - Distribution
# - OperatingSystem
# - DesktopEnvironment
# - WindowManager
# - Resolution
# - Backlight
# - Packages
# - LocalIP
# - Terminal
# - Shell
# - Uptime
# - Processor
# - ProcessorLoad
# - Memory
# - Battery
# Example:
show = ["Host", "Machine", "Kernel", "Distribution", "DesktopEnvironment", "ProcessorLoad", "Memory", "Battery"]

View file

@ -0,0 +1,92 @@
#!/usr/bin/env sh
# Will only work on macchina v0.7.3 or higher
# This script will download and run a video from youtube / any site supported by youtube-dl
# and display the video in macchina.
# The flow is
# youtube-dl -> ffmpeg -> jp2a -> macchina
# First argument is video url.
# Second argument is frame wait time.
PID=$$
DIR="/tmp/ffmpeg_$PID"
if [ -n "$1" ]; then
URL="$1"
else
URL=$(echo "aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQo=" | base64 -d)
fi
if [ -n "$2" ]; then
FRAME_WAIT_TIME=$2
else
FRAME_WAIT_TIME=5
fi
required="youtube-dl ffmpeg base64 awk jp2a macchina"
for r in "$required"; do
if ! [ -n "$(which "$r" 2>/dev/null)" ]; then # need the quotes
printf '\x1b[31m%s not found\x1b[0m\n' "$r"
exit 1
fi
done
# polling rate is .05 i.e. once every 50ms
WAIT=$(echo - | awk -v seconds="$FRAME_WAIT_TIME" '{print seconds/.05}')
trap_ctrlc() {
printf '\x1b[?25h' # shows cursor
if [ -n "$FFMPEG_PID" -a -d "/proc/$FFMPEG_PID" ]; then
kill -0 "$FFMPEG_PID"
wait "$FFMPEG_PID"
fi
if [ -n "$DIR" -a -d "$DIR" ]; then
rm -rf "$DIR" 2>/dev/null
fi
exit
}
mkdir "$DIR"
# youtube-dl -f best $URL -o - | ffmpeg -i pipe: -r 10 -update 1 "$DIR/out_%d.png" > /dev/null 2>&1 &
youtube-dl -f best "$URL" -o - 2>/dev/null | ffmpeg -i pipe: -r 10 "$DIR/out_%d.png" >/dev/null 2>&1 &
FFMPEG_PID=$!
trap trap_ctrlc INT
printf '\x1b[?25l' # hides the cursor
for img in "$(# increasing this too much will break it
seq 1 999999
)"; do
count=0
while ! [ -f "$DIR/out_$img.png" ]; do
sleep .05
count=$((count + 1))
if [ "$count" -ge "$WAIT" ]; then break; fi
done
printf '\x1b[s' # saves cursor position
target/debug/macchina --custom-ascii <(jp2a --color --width=50 "$DIR/out_$img".png)
# jp2a --color --width=50 $DIR/out_$img.png # just display the video wihout macchina
printf '\x1b[u'
if [ -f "$DIR/out_$img.png" ]; then
rm -f "$DIR/out_$img".png
fi
sleep .02
done
printf '\x1b[?25h' # shows cursor
if [ -n "$FFMPEG_PID" -a -d "/proc/$FFMPEG_PID" ]; then
kill -0 "$FFMPEG_PID"
wait "$FFMPEG_PID"
fi
if [ -n "$DIR" -a -d "$DIR" ]; then
rm -rf "$DIR" 2>/dev/null
fi
wait "$FFMPEG_PID"

View file

@ -0,0 +1,26 @@
# Beryllium
spacing = 3
hide_ascii = true
key_color = "#7067CF"
separator = ""
[box]
border = "plain"
visible = true
[palette]
glyph = "○ "
visible = true
[bar]
glyph = "○"
hide_delimiters = true
visible = true
[box.inner_margin]
x = 2
y = 1
[custom_ascii]
color = "#FF7001"

View file

@ -0,0 +1,51 @@
# Helium
hide_ascii = false
spacing = 2
padding = 0
separator = "->"
key_color = "Blue"
separator_color = "Yellow"
[bar]
glyph = "o"
symbol_open = "("
symbol_close = ")"
hide_delimiters = false
visible = false
[box]
title = " Helium "
border = "rounded"
visible = false
[box.inner_margin]
x = 2
y = 1
[custom_ascii]
color = "Yellow"
[randomize]
key_color = false
separator_color = false
[keys]
host = "Host"
kernel = "Kernel"
battery = "Battery"
os = "OS"
de = "DE"
wm = "WM"
distro = "Distro"
terminal = "Terminal"
shell = "Shell"
packages = "Packages"
uptime = "Uptime"
memory = "Memory"
machine = "Machine"
local_ip = "IP"
backlight = "Brightness"
resolution = "Resolution"
cpu_load = "CPU Load"
cpu = "CPU"

View file

@ -0,0 +1,51 @@
# Hydrogen
spacing = 2
padding = 0
hide_ascii = true
separator = ">"
key_color = "Cyan"
separator_color = "White"
[palette]
type = "Full"
visible = false
[bar]
glyph = "ߋ"
symbol_open = '['
symbol_close = ']'
hide_delimiters = true
visible = true
[box]
border = "plain"
visible = true
[box.inner_margin]
x = 1
y = 0
[randomize]
key_color = false
separator_color = false
[keys]
host = "Host"
kernel = "Kernel"
battery = "Battery"
os = "OS"
de = "DE"
wm = "WM"
distro = "Distro"
terminal = "Terminal"
shell = "Shell"
packages = "Packages"
uptime = "Uptime"
memory = "Memory"
machine = "Machine"
local_ip = "Local IP"
backlight = "Brightness"
resolution = "Resolution"
cpu_load = "CPU Load"
cpu = "CPU"

View file

@ -0,0 +1,57 @@
# Lithium
spacing = 1
padding = 0
hide_ascii = true
separator = " "
key_color = "Yellow"
separator_color = "Yellow"
[palette]
type = "Light"
glyph = " ● "
visible = true
[bar]
glyph = "●"
symbol_open = '('
symbol_close = ')'
visible = false
hide_delimiters = true
[box]
title = " Syl "
border = "plain"
visible = true
[box.inner_margin]
x = 2
y = 1
[custom_ascii]
color = "Yellow"
[randomize]
key_color = true
separator_color = false
pool = "base"
[keys]
host = "Host"
kernel = "Kernel"
battery = "Battery"
os = "OS"
de = "DE"
wm = "WM"
distro = "Distro"
terminal = "Terminal"
shell = "Shell"
packages = "Packages"
uptime = "Uptime"
memory = "Memory"
machine = "Machine"
local_ip = "IP"
backlight = "Brightness"
resolution = "Resolution"
cpu_load = "CPU Load"
cpu = "CPU"