The officially official Devuan Forum!

You are not logged in.

#1 2021-06-07 14:30:42

dice
Member
Registered: 2020-11-22
Posts: 520  
Website

Today I Learned

That if you have have a fontconfig file in ~/.config/fontconfig/fonts.conf the setting for monospace family fonts will set the line inside ~/.Xresources

*vt100.faceName: Mono:style=Regular:size=12

to the font font specified in the the fonts.conf file.

I think this is only xterm behaviour though, possibly urxvt but i dont use it.

fontconfig...

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <edit mode="assign" name="hinting" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="autohint" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="hintstyle" >
            <const>hintslight</const>
        </edit>
        <edit mode="assign" name="rgba" >
            <const>rgb</const>
        </edit>
        <edit mode="assign" name="antialias" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="lcdfilter">
            <const>lcddefault</const>
        </edit>
    </match>

    <alias>
        <family>serif</family>
        <prefer>
            <family>Noto Serif</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Noto Sans</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>PT Mono</family>
        </prefer>
    </alias>

</fontconfig>

what did you learn today in the unix world?

Last edited by dice (2021-06-07 14:31:19)


Do good things.  Share.  Be helpful.  Be decent.  Live large.
E.V.I.L = Electronic Virtual Intelligent Life
"everything is magnetized" - kmart employee
"you just opened pandora's shitbox ray" - jim lahey

Offline

#2 2021-06-07 14:38:27

starbreaker
Member
From: United States
Registered: 2021-06-03
Posts: 16  
Website

Re: Today I Learned

I learned that if I wanted to trim the front matter and end matter off of a text file so I could insert the text into an Atom feed entry's <content> tag, I could use head and tail like so:

tail -n +5 $filename | head -n -5

Much easier than using sed. smile


"Out of order? [BLEEP!] Even in the future nothing works."
desktop: refurbished ThinkCentre M92p (i7, 32GB RAM, 1TB SSD, 2TB HDD)
laptop: refurbished Thinkpad T60 (Core 2 Duo, 3GB RAM, 1TB SSD)
gemini capsule: starbreaker.org

Offline

#3 2021-06-07 14:46:18

dice
Member
Registered: 2020-11-22
Posts: 520  
Website

Re: Today I Learned

starbreaker wrote:

I learned that if I wanted to trim the front matter and end matter off of a text file so I could insert the text into an Atom feed entry's <content> tag, I could use head and tail like so:

tail -n +5 $filename | head -n -5

Much easier than using sed. smile

that looks useful, do you use this in a script?

Last edited by dice (2021-06-07 14:46:35)


Do good things.  Share.  Be helpful.  Be decent.  Live large.
E.V.I.L = Electronic Virtual Intelligent Life
"everything is magnetized" - kmart employee
"you just opened pandora's shitbox ray" - jim lahey

Offline

#4 2021-06-07 15:00:17

starbreaker
Member
From: United States
Registered: 2021-06-03
Posts: 16  
Website

Re: Today I Learned

dice wrote:

that looks useful, do you use this in a script?

As a matter of fact, I do.

#!/usr/bin/env bash

# atomgen: Atom feed generator for textblogs
# © 2021 Matthew Graybosch <contact@matthewgraybosch.com>
# available under GPLv3
# based on code by Len Falken
# http://len.falken.ink/misc/writing-for-the-internet-across-a-human-lifetime.txt

SETTINGS=${1}
FLAG=${2}

# $FLAG should be --full for a full text feed

# read settings file
. ${SETTINGS}

# find posts for processing
POSTS=$(
    find . -name '*.txt'                | \
    grep -v .git                        | \
    xargs ls -Stl --time-style=long-iso | \
    awk '{ print $8 }'                  | \
    sed 's/.\/public\///')

# begin atom feed
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<feed xmlns=\"http://www.w3.org/2005/Atom\">
  <title>${TITLE}</title>
  <subtitle>${DESCRIPTION}</subtitle>
  <id>${DOMAIN}feed.xml</id>
  <link href=\"${DOMAIN}feed.xml\" rel=\"self\"/>
  <icon>${DOMAIN}icon.png</icon>
  <updated>$(atomdate)</updated>
  <rights>© $(date '+%Y') $AUTHOR, $LICENSE</rights>
  <generator>atomgen</generator>
  <author>
    <name>${AUTHOR}</name>
    <email>${EMAIL}</email>
    <uri>${DOMAIN}about.txt</uri>
  </author>";

#generate entries
echo "$POSTS" | while read -r FILE; do
    POST_DATE=$(tail -n 1 ${PUBLIC_DIR}${FILE} | cut -d' ' -f 2);
	  POST_TITLE=$(head -n 1 ${PUBLIC_DIR}${FILE});
	  POST_SUMMARY=$(head -n 2 ${PUBLIC_DIR}${FILE} | tail -n 1);
	  POST_CATEGORY=$(echo ${POST_TITLE} | cut -d' ' -f 1 | sed -e 's/\[//' -e 's/\]//' | tr '[:upper:]' '[:lower:]')

    echo "  <entry>
    <title>${POST_TITLE}</title>
    <id>${DOMAIN}${FILE}</id>
    <link href=\"${DOMAIN}${FILE}\"/>
    <category term=\"$POST_CATEGORY\"/>
    <summary>${POST_SUMMARY}</summary>
    <author>
      <name>${AUTHOR}</name>
      <email>${EMAIL}</email>
      <uri>${DOMAIN}about.txt</uri>
    </author>
    <updated>${POST_DATE}</updated>";

    # pull content for full-text feeds
    if [ "$FLAG" = "--full" ]; then
        POST_CONTENT=$(tail -n +5 ${PUBLIC_DIR}${FILE} | head -n -5)
        echo "    <content type='text'>
$POST_CONTENT
    </content>";
    fi
    
    echo "  </entry>";
done

echo "</feed>";

"Out of order? [BLEEP!] Even in the future nothing works."
desktop: refurbished ThinkCentre M92p (i7, 32GB RAM, 1TB SSD, 2TB HDD)
laptop: refurbished Thinkpad T60 (Core 2 Duo, 3GB RAM, 1TB SSD)
gemini capsule: starbreaker.org

Offline

#5 2021-06-07 20:22:12

starbreaker
Member
From: United States
Registered: 2021-06-03
Posts: 16  
Website

Re: Today I Learned

Also, I just learned about using heredocs in bash scripts.


"Out of order? [BLEEP!] Even in the future nothing works."
desktop: refurbished ThinkCentre M92p (i7, 32GB RAM, 1TB SSD, 2TB HDD)
laptop: refurbished Thinkpad T60 (Core 2 Duo, 3GB RAM, 1TB SSD)
gemini capsule: starbreaker.org

Offline

#6 2021-06-07 23:06:23

ComputerBob
Member
From: The Sunshine State
Registered: 2018-10-11
Posts: 68  
Website

Re: Today I Learned

dice wrote:

what did you learn today in the unix world?

I learned to understand about 1/4 of what you learned today.  wink


ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 22 Million Views
My Ministry- My Massive Stroke
Your Life Matters

Offline

#7 2021-06-08 13:27:52

dice
Member
Registered: 2020-11-22
Posts: 520  
Website

Re: Today I Learned

starbreaker wrote:

Also, I just learned about using heredocs in bash scripts.

Yep they good to use for relaying info inside the script itself. You can use also EOM (end of message) or EOF with heredocs, you can also use PURPLEMONSTERS if you like wink


Do good things.  Share.  Be helpful.  Be decent.  Live large.
E.V.I.L = Electronic Virtual Intelligent Life
"everything is magnetized" - kmart employee
"you just opened pandora's shitbox ray" - jim lahey

Offline

#8 2021-06-08 13:29:27

dice
Member
Registered: 2020-11-22
Posts: 520  
Website

Re: Today I Learned

ComputerBob wrote:
dice wrote:

what did you learn today in the unix world?

I learned to understand about 1/4 of what you learned today.  wink

Hey glad you did, its bare bones type of stuff, that most dont even care about as the desktop environments handle all this.


Do good things.  Share.  Be helpful.  Be decent.  Live large.
E.V.I.L = Electronic Virtual Intelligent Life
"everything is magnetized" - kmart employee
"you just opened pandora's shitbox ray" - jim lahey

Offline

#9 2021-06-08 13:41:06

dice
Member
Registered: 2020-11-22
Posts: 520  
Website

Re: Today I Learned

So today i learned you can install the window manager EXWM from inside emacs.

not very well documented on debian, but archlinux has a nice wiki on it.

https://wiki.archlinux.org/title/EXWM


Do good things.  Share.  Be helpful.  Be decent.  Live large.
E.V.I.L = Electronic Virtual Intelligent Life
"everything is magnetized" - kmart employee
"you just opened pandora's shitbox ray" - jim lahey

Offline

#10 2021-06-08 13:55:50

ComputerBob
Member
From: The Sunshine State
Registered: 2018-10-11
Posts: 68  
Website

Re: Today I Learned

dice wrote:
ComputerBob wrote:
dice wrote:

what did you learn today in the unix world?

I learned to understand about 1/4 of what you learned today.  wink

Hey glad you did, its bare bones type of stuff, that most dont even care about as the desktop environments handle all this.

Yup -- I thank God for desktop environments (Xfce here, for many years).  wink


ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 22 Million Views
My Ministry- My Massive Stroke
Your Life Matters

Offline

Board footer