There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

linux

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

tfkhdyt , in Tabby: A terminal for a more modern age

foot terminal enjoyer

aeroevan ,

My main complaint with foot is that I have to copy the terminfo everywhere, but other than that it just works I guess

treadful , in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)
@treadful@lemmy.zip avatar

Is there some reason you just don’t export those env vars in $HOME/.bashrc or $HOME/.bash_profile?

<pre style="background-color:#ffffff;">
<span style="font-weight:bold;color:#a71d5d;">export </span><span style="color:#323232;">SOME_ENV_VAR</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">value
</span>

If it’s every time you run the command, seems like it should be set globally.

cyclohexane OP ,

Because it’s not as maintainable as separating them by application or some other separation. Would not want to fill up my bashrc with single-application specific code.

treadful ,
@treadful@lemmy.zip avatar

You could break it out into other files if you really got that much going on. But if you really have hundreds or more env vars, maybe you should re-think using env vars at all.

Hard to give a rec without more detail, so I don’t really get it.

funk , in Share Your Favorite Linux Distros and Why You Love Them

Arch. I can’t live without the AUR at this point.

NakedGardenGnome ,

Seriously, the ease of installing any and all programs from the main repo’s or the AUR is such an extreme advantage over all other distros!

And it makes keeping your system and programs updated a breeze.

Contend6248 ,

It is nice to install much normally harder to install crap, but there are so little trusted devs on there, that i rather not install something than getting it from a untrusted source.

It is nice to play around, but i also switched from Windows to have a more secure platform

NakedGardenGnome ,

We cannot forget about the wiki, which is a great resource for not only the Arch distro, but for any Linux install.

SexualPolytope ,
@SexualPolytope@lemmy.sdf.org avatar

Seriously, I realize this every time I have to install something on my server (running AlmaLinux). Now I’ve manually set up a personal LURE repo for some software that I use.

oscar , in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)

You could write a shell script:

<pre style="background-color:#ffffff;">
<span style="font-style:italic;color:#969896;">#!/usr/bin/env sh
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">export </span><span style="color:#323232;">SOME_ENV_VAR</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">value
</span><span style="color:#323232;">
</span><span style="color:#62a35c;">command
</span>

Then place it on your path, for example /usr/local/bin/command_with_env.

I avoided overriding the command itself and naming the script the same, because then I think it would try to invoke itself.

deong ,

Just replace command in your script with /usr/bin/command or whatever. It’s generally good practice to full path anything run from a script anyway just to remove any unintended environment dependencies.

oscar ,

Good point. But then if both the script and the command have the same filename, it will be important to make sure the script has a higher precedence in the PATH. Adding it to the end of .bashrc should be enough I think.

manned_meatball , in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)
@manned_meatball@lemmy.ml avatar
<pre style="background-color:#ffffff;">
<span style="color:#323232;">function command_one() {
</span><span style="color:#323232;">    # activate the environment
</span><span style="color:#323232;">    source "$XDG_DATA_HOME/venvs/alpha.sh"
</span><span style="color:#323232;">    # run the thing
</span><span style="color:#323232;">    actual_command_one
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">function command_two() {
</span><span style="color:#323232;">    # activate the environment
</span><span style="color:#323232;">    source "$XDG_DATA_HOME/venvs/alpha.sh"
</span><span style="color:#323232;">    source "$XDG_DATA_HOME/venvs/bravo.sh"
</span><span style="color:#323232;">    # run the other thing
</span><span style="color:#323232;">    actual_command_two
</span><span style="color:#323232;">}
</span>
linuxduck , in Share Your Favorite Linux Distros and Why You Love Them

Manjaro. It just worked on any device I installed it on. And wifi just worked with no fiddling.

Then I installed it on surface tablet. What didn’t work, I found kernel fixes I could implement.

Of all the distros, for me, it was the easiest to use, install and manipulate!!

HulkSmashBurgers ,

Manjaro is my main distro too! The package manager is great!

linuxduck ,

Manjaro friends unite!

please_lemmy_out ,

Switched to Manjaro after running vanilla Arch for several years and haven’t looked back. I appreciate the slightly less bleeding edge updates and extra added stability around it.

Easy installs are probably less of a big deal nowadays after Arch overhauled their installation process.

heartlessevil , in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)

Is this a use case where you can use dotenv? (folder specific environment variables?)

If it’s not, aliases are the best you can do, or bash functions that are equivalent to them. The thing is that those only run in bash, so if you are expecting to run the commands outside of a shell, you will need to wrap them in bash -c or have a wrapper script.

This is just the broad strokes so if you have any questions please follow up.

nicoag328 , in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)

You could source an aliases.sh file on your .bashrc where you define your aliases, so that they don’t fill up your bashrc.

For example, in your bashrc:

source ~/.aliases.sh

This way you could also create a file with aliases per program.

treadful ,
@treadful@lemmy.zip avatar

FYI: $HOME/.bash_aliases is standard and most distros’ .bashrc will source that file by default.

oranki ,

Most Debian based distros, actually.

treadful ,
@treadful@lemmy.zip avatar

And at least arch. Probably others.

cyclohexane OP ,

That’s a good idea, but it only makes the problem a little better. I still wouldn’t want one large aliases.sh file with environment variables for every application I customized. Would rather have them separate somehow without gobbling up a file

nicoag328 ,

You can source other files inside aliases.sh or as @treadful noted .bash_aliases

.bash_aliases:

source .aliases/program_x.sh``source .aliases/program_y.sh

This way you can have a file with aliases for each application or group of applications.

But it would be helpful if you provided more information on what you really want to do. Read https://xyproblem.info/

solidgrue , in How to make it such that, when running `command`, it automatically does `SOME_ENV_VAR=value command`? (something cleaner than aliases?)
@solidgrue@lemmy.world avatar

You could alias the your programs’ commands to invoke the environment variables.

Or, use an alias to source an environment file before launching the binary?

Genrawir , in KDE connect on xfce?

Gsconnect is the gnome version; I think that’s how I had it working on xfce

MischievousTomato , in Share Your Favorite Linux Distros and Why You Love Them

Nixos. For all its complexity and dilemmas and issues it has given me, it’s the comfiest for me and gives me really cool features

gustulus ,

Congrats for making it to the treasure! I’m like half way in and not sure if I can fight through…

MischievousTomato ,

just keep on going. i cant be happy on any other distro, so i have to use nixos

amanwithausername ,

It still blows my mind that with nixos, setting up and continuously renewing an ssl cert is literally just two lines in the config file. I use nixos on my homeserver, thinking about switching my laptop to it too (currently Void linux).

yanutta ,
@yanutta@mastodonapp.uk avatar

@amanwithausername got an older laptop celeron processor running xubuntu? Any better ideas?

amanwithausername ,

Hmmm never used xubuntu per se, but XFCE already seems like a good option for a low-spec computer. You could probably chip away at the resource usage some more by building your own desktop environment around a bare window manager, but honestly at this point the gain is negligible. If anything, you might want to look into tiling window managers just because they can offer a much more fluid and customizeable desktop experience as opposed to floating WMs. I’m using BSPWM right now, but considering switching to wayland with hyprland or qtile.

As for choice of distro: Not sure if NixOS would run well on your machine – my homeserver is also a pretty low-spec computer (dual-core Intel Atom), and nixos-rebuild switch takes ages to run. Otherwise, go for Debian Testing if you want stability, Void if you want to not have systemd. There’s also Devuan, which is basically Debian without systemd, but iirc it’s not as popular as Void. But honestly if xubuntu works for you, then it’s fine.

Also, some miscellaneous tweaks for improved performance:

  1. IF YOU BOOT FROM A HARD DRIVE REPLACE IT WITH AN SSD! Solid-state drives are pretty cheap nowadays, and the upgrade from hdd to sdd is the single biggest performance improvement you can do for an old laptop
  2. If on x11, disable compositing. On XFCE, there should be an option for it somewhere in the settings. If on a bare window manager, simply don’t install any compositing manager (picom, xcompmgr, etc.). The downside is screen tearing and no proper window transparency, but it does put less strain on the CPU.
  3. Consider looking into a custom linux kernel? I boot linux-tkg on my main laptop and it gives some pretty good performance improvements. But I’m not so sure whether it would translate well to a low-spec system.
  4. Again, not exactly a performance tip, but consider formatting your boot partition as btrfs. Apart from all of the other cool features that you get with BTRFS, transparent file compression can, in some cases, be a win-win-win situation: less disk usage, faster file access, and longer SSD longevity. On low end system tho it may actually be the case that the CPU is the bottleneck as opposed to the disk, so transparent file compression may actually slow things down. Here are the settings I use for btrfs on my laptop (thinkpad with a core i7-5600U, mSATA solid state drive): lazytime,noatime,autodefrag,compress=zstd:3,discard=async,space_cache=v2,ssd. Again, not sure how well these translate to a low-end system, you should do your research.
  5. If your system supports uefi, consider using EFISTUB as opposed to Grub. Much faster boot times. Another option is to add two efi entries: one for EFISTUB (and have that be the default), and a second one for Grub, for when you need to change boot options or boot into recovery mode.
yanutta ,
@yanutta@mastodonapp.uk avatar

@amanwithausername comprehensive and good advice. Thank you. I tuck a look at linux, because other laptop isn't win11 compatible "soon".

Corngood ,

Since you mentioned slow build times…

You can do nixos-rebuild --target-host to build locally and deploy over ssh. You can also use something like nixops.

amanwithausername ,

No way, that’s awesome! I’ll give it a try for sure!

joyjoy , in Tabby: A terminal for a more modern age

I use this simply because I work in an offline environment and the Windows Terminal doesn’t work there.

Edit: I haven’t tried it since microsoft/terminal#6010 got closed. I’ll have to try again soon.

Makussu , in Tabby: A terminal for a more modern age

Why would anybody use this over wezterm or alacritty?

Grass ,

Damn I gave those a brief lookup and they seem quite sexy. I’ll have to try them out.

Fryboyter ,

Why should I use wezterm or alacritty and not Terminator?

The answer to your question and mine should be pretty much the same. Because everyone has different preferences and requirements.

Makussu ,

I think you misunderstood. I want to know what requirements you have, that are not met with wezterm. I understand, that some people like different software, but this is a huge github repo for a terminal written with electron. Just confuses me

WeirdGoesPro , in Tabby: A terminal for a more modern age

I’ve been using Warp recently and really enjoy it.

luthis , in Tabby: A terminal for a more modern age

I heard about this here, definitely going to give it a try, but I generally prefer simple, lightweight

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines