RL_Dane, (edited )
@RL_Dane@fosstodon.org avatar

New blog post!

"Using cal and plain text to track things"

https://rldane.space/using-cal-and-plain-text-to-track-things.html


Where's my chorus at?
@joel @benjaminhollon @sotolf @pixx

P.S. Many thanks to @thelinuxcast and @matthew for the boosts! :ablobcatheart:

sotolf,

deleted_by_author

  • Loading...
  • RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    Thanks man! Plain text FTW! ;)

    sotolf,

    deleted_by_author

  • Loading...
  • RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    I feel a little embarrassed for all those word docs I created in uni.

    In my defense, I don't think I knew about Markdown (and other groovy text formats) back then.

    Still... I was mac-simpin' it pretty hard from 2008-2018. :P~

    sotolf,

    deleted_by_author

  • Loading...
  • RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    I'm going to have a lot of fun converting my old Mac-only documents like .rtfd and documents in the iWork suite. :P
    (At least .rtfd is literally just an .rtf file and a directory for images)

    ...

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    Random aside, the modern mac .rtfd format reminds me a LOT of the classic mac "TeachText" format, which used a plain text file as the text itself, but used the of the file to store images.

    So the files looked like they were rich text because they had headers in a larger font than the rest of the body, but it was really just plain text with bitmap headers ;)

    ...

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    ...

    The Resource Fork was something really unique that the did. I haven't seen anything like that today. Even modern macs just use a directory and the GUI makes you think that it's a file (but the command line shows a directory).

    sotolf,

    deleted_by_author

  • Loading...
  • benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @sotolf @RL_Dane @joel @pixx
    It was so funny to me back when I was on windows that I could:

    • change a .docx to .zip
    • unzip it
    • rezip it
    • change it back to .docx

    and the file size would be significantly smaller. Word's compression must have been terrible.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @sotolf @joel @pixx

    Probably optimized for speed.

    One of the reasons I love tar is that you can compress all the files as a single data stream, rather than compressing files individually. That really saves a lot of space when there's similarity, or very small files.

    The only GUI archiver I ever used that had that option was 7zip.

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @sotolf @joel @pixx
    It wasn't even a contest, though—the Windows-compressed versions were half the file size. You'd think they could, maybe, compress for speed while the program's open, then on the final save before close compress better?

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @sotolf @joel @pixx

    That's not a bad idea, tbh.

    But if you're not asking the user if they want to save the file before closing, then you're

    1. modifying the file after it was already saved
    2. slowing down the final close of the file every time it's closed.

    There's trade-offs.

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @sotolf @joel @pixx
    I mean, saving can be done asynchronously in the background while they're still editing—why optimize for speed at all?

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @sotolf @joel @pixx

    Dunno, but didn't the format come out in 2006? Some folks were still using floppy disks back then. ;)

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @sotolf @joel @pixx
    All the more reason to optimize space, right? It doesn't matter as much today.

    sotolf,

    deleted_by_author

  • Loading...
  • RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @benjaminhollon @joel @pixx

    I was blown away to find a 7z file I compressed years ago was smaller than the equivalent using tar and xz -9e

    :o

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    You're right, ever since at least .JAR files, zip has become the universal "resource fork" ;)

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @sotolf @joel @benjaminhollon @pixx

    ...

    I still kinda like the idea behind the crazy iWork spreadsheet -- instead of having 1024x1048576 or however many empty cells to work with, you only get as many cells as you need for what you're doing. It works slightly more like tables in word processing documents instead of a huge blank canvas like most spreadsheets. (But it's functionally the same, and you're not limited to a certain page size)

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @sotolf @RL_Dane @joel @pixx
    I've only been in it since ~2022, so… ;)

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @sotolf @joel @pixx

    Half of my conversations with Benjamin be like,

    "Yo Ben, remember back when you were basically just a dream and $widget was cool back in 1997?"

    And I kinda love it, tbh. XD

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @sotolf @joel @pixx
    My parents weren't married yet, maybe not even dating (can't remember when they started). ;)

    They got married in 2000, I think. I know they moved to Afghanistan in mid-2001 (they've got stories about the evacuation right before 9/11). I was born three years later in '04.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @sotolf @joel @pixx

    Ah, but even before your parents dreamed you, you were the Dreamer's dream. :blobcatheartbongo:

    https://yewtu.be/watch?v=uRhJwNDilLw

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @sotolf @joel @pixx
    No, because that song was released when I was already six. ;)

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @sotolf @joel @pixx

    I hope ${THE_POINT} whizzing over your head didn't mess up your hair. 😆

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @sotolf @joel @pixx
    I style my hair that way now, which is why I intentionally missed ${THE_POINT}. :)

    joel,
    @joel@fosstodon.org avatar

    @benjaminhollon @RL_Dane @sotolf @pixx but avocados don't have hair, right? :blobcateyes:

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @joel @RL_Dane @sotolf @pixx
    This one does. ;)

    joel,
    @joel@fosstodon.org avatar

    @RL_Dane @benjaminhollon @sotolf @pixx just use khal instead. For dav support

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @joel @RL_Dane @sotolf @pixx
    I mean I already use that, but cal could be useful for hooking up to scripts.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @joel @benjaminhollon @sotolf @pixx

    Not really where I'm going with cal, but that looks fascinating! You just point it to a CalDav URL and it can show you your calendar entries? So you could use it instead of Thunderbird for your appointments and such?

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx
    Well, actually, khal reads from a local directory, but vdirsyncer, developed by the same team, will read your CalDav to that directory. I'm able to use the same directory with todoman. I also use it with CardDAV via their other utility, khard.

    Yeah, so, I use khal for my own calendar stuff.

    joel,
    @joel@fosstodon.org avatar

    @RL_Dane yes but it needs vdirsyncer to work, vdirsyncer does the heavy lifting by talking to the dav server and storing the data in vdirs, from there khal can read those

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @joel

    I'm not familiar with vdirs

    Man... why are github pages so bloomin' awful to view in text-based browsers? 😔

    joel,
    @joel@fosstodon.org avatar

    @RL_Dane tbh they look like normal folders to me but idk

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @joel @RL_Dane
    Pretty sure "vdir" actually refers to the server's copy of the calendar/contactlist.

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx
    So, uh, how do you do that replacement with periods? That could come in really hand in a lot of my scripts.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx

    Just manually. It's a Zen kinda thing, haha

    (Really doesn't take that long)

    If you want to script it, it can be done. I guess you could accept n>1 parameters, assume that $1 is the month, and everything else are days, maybe use run something like sed 's/'"$day"'/ ./' against the cal output.

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx
    Oh, okay. Yeah, I'll need to make a script for it. Shouldn't be impossible.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx

    Done. Updating my codeberg repo now.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar
    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    Very cool, thank you! I'll make good use of this.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    Coolness! I honestly don't anticipate using it, but it's just the kind of script I really enjoy writing. Very short and to the point. ;)

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    I should be using it, myself.

    I did some scripting yesterday actually: https://codeberg.org/benjaminhollon/.dotfiles/src/branch/main/.local/bin/sandbox

    It's for when I have a writing project I don't have a finalized name for yet or when I just want to mess around; it'll create a file for me, let me scroll through them and see the content to select one, etc. The one thing I still want to implement is some form of easy migration to my standard write script's time and wordcount tracking.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    Best bet is to move those functions to a separate file that can be sourced by several of your scripts.

    It makes reading the script by others kind of a pain, though. Then they have to hunt through your repo for that extra source file and figure out which functions you're actually using.

    I do like the use of fzf, though. I've started using that in some of my scripts, especially my journal one.

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    Yeah, I have a journal script too and I want to use fzf for it.

    What I want to figure out is some way to search by the previewed content of the file, and not just by the non-descriptive filename. But having the preview is a good start.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    What do you mean by previewed content? Are you doing something like markdown -> HTML conversion with it?

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    No, it just uses cat, but it displays it when you've got your selection thingy on an entry. Try it; go to a directory with some markdown files in it and run fzf --preview 'cat {}'.

    I probably could use something like glow for the preview, though.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    HOLY AMAZBALLS!! That's like ranger! I love it!!

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    You'd probably just need to do a grep beforehand. Can fzf take a list of files as a parameter?

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    You can pipe whatever you want searched to fzf. I've tried solutions that pipe each line of every file to fzf, separated by a : so you can still separate the filename from the output, but it doesn't look great.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    Hmmm, then it looks like the only solution would be a janky one involving a temp directory with symlinks --

    do the grep for the search term first, grab the list of matching files, create a temp directory with symlinks to the files that matched, and then fzf from there.

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    The thing that really irks me is that I knwo it's possible because zk (https://github.com/mickael-menu/zk) does it. Maybe I just need to take a closer look at their code.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    It's written in Go, though

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    Yeah, that's why I don't know exactly how to do the same thing in bash…

    joel,
    @joel@fosstodon.org avatar

    @benjaminhollon @RL_Dane @sotolf @pixx @mirabilos just ask chatgpt!

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @joel @RL_Dane @sotolf @pixx @mirabilos

    hisssssssssss

    joel,
    @joel@fosstodon.org avatar

    @benjaminhollon @RL_Dane @sotolf @pixx @mirabilos the moment you cave in, you'll understand

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @joel @RL_Dane @sotolf @pixx @mirabilos

    evil

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    evil ** evil

    hyde,
    @hyde@lazybear.social avatar

    @RL_Dane @benjaminhollon @joel @sotolf @pixx @mirabilos evil³

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @hyde @benjaminhollon @joel @sotolf @pixx @mirabilos

    evilplex (evil ** evil ** evil)

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar
    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos

    Okay I've got some ideas…

    --ansi can parse color codes, so I can use that for styling
    --nth and --delimeter can control which fields are searched (and how they're separated)
    I could use --bind 'enter:become(echo {2})' to, say, only return the second field from the selected entry.

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    Are those all parameters for fzf?

    Please share once you've got it figured out. ;)

    I might give glow a try. :D

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    Yeah, those are fzf options.

    Okay, I did it: https://codeberg.org/benjaminhollon/.dotfiles/src/branch/main/.local/bin/sandbox

    I passed the --ansi option, so I can do some formatting to make things clearer, but I haven't bothered yet. The thing I did was pass the cat output to xargs to remove newlines and tabs, then used tab as a delimiter for the fields.

    hyde,
    @hyde@lazybear.social avatar

    @RL_Dane @benjaminhollon @joel @sotolf @pixx @mirabilos i do that in neovim/vim. I configured it a way to search through a list of predefined directories. I'm using vimwiki, and there is a way to have journal files there too, and everything with fzf ;)

    RL_Dane,
    @RL_Dane@fosstodon.org avatar

    @benjaminhollon @joel @sotolf @pixx @mirabilos

    Glow doesn't have a manpage.

    For shame.

    LibreOffice has a manpage, AND IT'S A GUI APP. :P

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @RL_Dane @joel @sotolf @pixx @mirabilos
    Okay that surprises me, since it's developed by Charm and they've really made a name for themselves in developing CLIs.

    joel,
    @joel@fosstodon.org avatar

    @benjaminhollon @RL_Dane @sotolf @pixx @mirabilos why are your filenames not descriptive?

    benjaminhollon,
    @benjaminhollon@lowkey.zone avatar

    @joel @RL_Dane @sotolf @pixx @mirabilos
    Because that's the point of this script; I don't have a descriptive name for the writing project yet, so it sticks it somewhere with an id as the filename and facilitates opening and editing the one I want. Then (ideally) I'll be able to migrate that to a final location once I know the name I want.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Durango
  • DreamBathrooms
  • thenastyranch
  • ngwrru68w68
  • cisconetworking
  • magazineikmin
  • Youngstown
  • osvaldo12
  • rosin
  • slotface
  • khanakhh
  • mdbf
  • kavyap
  • ethstaker
  • JUstTest
  • InstantRegret
  • GTA5RPClips
  • modclub
  • tacticalgear
  • everett
  • cubers
  • Leos
  • tester
  • normalnudes
  • provamag3
  • megavids
  • anitta
  • lostlight
  • All magazines