this post was submitted on 27 Jun 2023
42 points (95.7% liked)

Linux

48721 readers
2343 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

right, so as the title suggests...

i like linux based OSes because you can pretty much mould your operating system to the shape of your brain. i call it cognitive ergonomy. and i'd like it to catch on. even on a relatively play-it-safe distro like the one i'm currently using, the repos are full of handy little applications to make life immeasurably easier for you, if they aren't installed already. thanks to xdotool, xdo, wmctrl, and sxhkd, pretty much any action can easily be bound to a shortcut key. for eg, i have xdotool search --name vimnote windowactivate || kitty --title=vimnote nvim -c "norm 13j" ~/notes/index.md bound to mod+n. it's so simple, and i was so proud of myself when i got it to work (i'm not really a scripty person). i just wanted to make something easy. then i wanted to make it a bit easier. then i was feeling like "idk this is still way too many key presses" so i found a way of making it even easier.

i've got a bunch of little hacks like this. before i found qmmp, i set up global keys for mpv so i could listen to podcasts on another workspace. i have ranger set up to give specific info from mediainfo as a preview for audio and video files. (which windows does easily in gui file browser but THAT'S NOT THE POINT OK)

anyway, the ubuntu forums and arch wiki are full of tricks that a lot of people want to set up, i'm curious as to the ones you had to set up for yourself.

you are viewing a single comment's thread
view the rest of the comments
[–] dethb0y 11 points 2 years ago (2 children)

lynx -dump https://wttr.in/XXXXX?u -width 127 > "/home/dethb0y/Documents/Obsidian Vault/Calendar Events/Astronomical Calendar/Weather.md"

Uses lynx to grab Wttr.in, format it appropriately, dump it into a specific MD file in my obsidian directory, which i then display in obsidian.

It is so hysterically niche that i can't imagine hardly anyone would ever need, use, or want such a thing but when i came up with the idea i simply had to make it happen.

[–] Secret300 3 points 2 years ago (2 children)

That's such a neat trick, but why do you need to display the weather in obsidian?

[–] dethb0y 4 points 2 years ago

I like having everything in one "dashboard" (so to speak) - calendar, weather, rss stuff.

[–] reallychris 2 points 2 years ago

this is something i come across sometimes - an application can be designed to do one thing i need, and do it well, but another application, which was designed to do something completely different, actually does the thing i need more conveniently, and does it well enough to work.

[–] [email protected] 3 points 2 years ago (1 children)

What does the MD file look like? Wonder if I can use it with logseq

[–] dethb0y 2 points 2 years ago

I'd not see why not - it's just plain text.

This is what it looks like "raw": https://pastebin.com/ejY8SHim

but i use sed to add ``` to the top so it looks like a quote (since i think it looks nicer, YMMV).

I also have it set up like this so if it fails it writes an error to the file:

    lynx -dump https://wttr.in/91311?u -width 127 > "/home/dethb0y/Documents/Obsidian Vault/Calendar Events/Astronomical Calendar/Weather.md"
	if [ ! -s "/home/dethb0y/Documents/Obsidian Vault/Calendar Events/Astronomical Calendar/Weather.md" ]
	then
		echo " Could not read weather" > "/home/dethb0y/Documents/Obsidian Vault/Calendar Events/Astronomical Calendar/Weather.md"
	fi

    sed -i '1i ```' "/home/dethb0y/Documents/Obsidian Vault/Calendar Events/Astronomical Calendar/Weather.md"

Now, how Logseq would display the file? I do not know but it's not doing anything fancy inside, it's all just spaced text.