| Post Reply | RetroFed Forum Forum Index » Free and Open Source Software |
| Author | Message | ||
|---|---|---|---|
|
lilith267
lemmy.blahaj.zone
lilith267@lemmy.blahaj.zone Joined: 2024-02-02 |
Repo: codeberg.org/Lunar267/fish_cute-greeting A very tiny bit of code but I figured some other ricing enthusiast might like use it |
||
| 63 Original | |||
heliotrope
slrpnk.net
heliotrope@slrpnk.netJoined: 2026-08-15 |
I love this! Gonna have to port it to ksh, but I'm definitely using this! |
||
| 10 | |||
inari
piefed.zip
inari@piefed.zipJoined: 2026-02-07 |
Cute |
||
| 2 | |||
Vivian
lemmy.blahaj.zone
thestrike@lemmy.blahaj.zoneJoined: 2026-02-11 |
š®š®š® neeeeeed thank you so much for posting, Iām obsessed |
||
| 1 | |||
thingsiplay
lemmy.ml
thingsiplay@lemmy.mlJoined: 2026-01-09 |
That's really cute. I personally won't use it (don't even use Fish), but wanted to give some tips. First, the code is intended to run each time a new terminal (more accurately a new instance of Fish is run) is opened up, right? If so, then I suggest to optimize a bit for performance, so opening a terminal stays snappy. There are parts that do not change usually, so running and grabbing the content each time is a bit of waste. I'll suggest creating a single cache file with all the content that stays the same. In example following lines
need to run only once, if the cache file doesn't exist already. At start of script check if the cache file exists, and read the file once only. The file could be in /tmp/ directory, so it gets deleted with reboot and should run once and always up to date. There is also a file
do
Note my code examples are in Bash syntax, not sure if there are differences that matters here. I see you like Edit: Changed the line with |
||
| 9 | |||
|
lilith267
lemmy.blahaj.zone
lilith267@lemmy.blahaj.zone Joined: 2024-02-02 |
That's really cute. I personally won't use it (don't even use Fish), but wanted to give some tips. First, the code is intended to run each time a new terminal (more accurately a new instance of Fish is run) is opened up, right? If so, then I suggest to optimize a bit for performance, so opening a terminal stays snappy. There are parts that do not change usually, so running and grabbing the cont...
Thanks a lot for the advice!
In practice fish is extremely more efficient then bash with the script profiling at 9ms. Not amazing but since this will only run once when opening the shell its small enough to not be noticeable
So thats where it was! My original script tried to loop over all the cpu max and mins and calculate the percentage before deciding uptime was just more practical. Thanks for the info!
Its just so damn easy to grab the piece of info you want with lol Really thanks for all the feedback Ill have to work some of your advice in when I get back to my computer |
||
| 5 | |||
Ertain
feddit.online
Ertain@feddit.onlineJoined: 2026-08-12 |
Looks good. |
||
| 1 | |||
| Post Reply |
Back to top |