Skip to content

u/Nebu

In this archive from Jan 2009 to Nov 2026

15
posts
427
comments
1
media
1.6k
score

sox is primarily for converting audio files from one format to another? It says it also does filters (like adding echo?) but that seems like a pretty niche use case. I can already convert between audio formats with ffmpeg. Can any fans of sox give some more usecases for why I might want to check out sox?

3 points

Sometimes I do have computers where I would want to install an OS and use it and maybe put it away and use it later whenever I want to.

Sure, and that's fully within your rights. The point is, on such computers, you should probably not use Archlinux.

I use Archlinux on the computers I use every day. On computers I use less than once a month, I use Ubuntu instead.

You're, of course, free to install Archlinux on computers you only use once every couple of years, but we're trying to provide you with practical advice here, and the relevant practical advice is that this will probably cause you a lot of pain, and you'd be better off with a different distro for that kind of usage pattern.

3 points

Turns out the issue was with a wrapper script I wrote.

I've set up some systemd-slice https://www.freedesktop.org/software/systemd/man/systemd.slice.html to limit the memory usage of individual Brave processes and I wrote a wrapper script in Ruby that would try to detect whether an existing instance of Brave was running, and either redirect URLs to the existing instance, or launch a new instance in the slice:

#!/usr/bin/env ruby

BRAVE_LOCATION="/usr/bin/brave"

if BRAVE_LOCATION.empty? # TODO: Check if file exists and is executable.
  puts "Could not find brave."
  exit 1
end

system('pgrep -x brave > /dev/null')
if $?.exitstatus == 0
  puts "Found existing brave instance; redirecting request to that instance..."
  Process.detach(fork do
    [$stdout, $stderr].each { |s|
      s.reopen(File.new('/dev/null', 'w'))
    }
    exec(BRAVE_LOCATION, *ARGV)
  end)
else
  puts "Starting new instance of brave in web-browsers.slice cgroup..."
  Process.detach(fork do
    [$stdout, $stderr].each { |s|
      s.reopen(File.new('/dev/null', 'w'))
    }
    exec("systemd-run", "--user", "--slice=web-browsers.slice", "--working-directory=#{Dir.getwd}", BRAVE_LOCATION, *ARGV)
  end)
end

This is likely what was returning the error code 141. When I rewrote the script in bash, I consistently get an exit code of 0 and when I ctrl-click on links in Obsidian, the links correctly open in Brave.

#!/usr/bin/env bash

BRAVE_LOCATION="/usr/bin/brave"

if [ ! -f "$BRAVE_LOCATION" ]; then
	echo "Could not find brave at $BRAVE_LOCATION"
	exit 1
fi

pgrep -x brave > /dev/null

if [ $? -eq 0 ]; then
	echo "Found existing brave instance; redirecting request to that instance..."
	exec $BRAVE_LOCATION $@
else
	echo "Starting new instance of brave in web-browsers.slice cgroup..."
	WORKING_DIR=$(pwd)
	exec systemd-run --user --slice=web-browsers.slice --working-directory="$WORKING_DIR" $BRAVE_LOCATION $@
fi
2 points

I traced it to something about the behavior of Brave itself.

In the source code for xdg-open, there's a function search_desktop_file which searches through all the .desktop files, and tries to execute the relevant one

https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-open.in?id=8ae02631a9806da11b34cd6b274af02d28aee5da#n268

Once xdg-open finds the right desktop file, it does this:

    env "$command" "$@"

    if [ $? -eq 0 ]; then
        exit_success
    fi

Where I've confirmed that $command is brave and $@ is the URL to open.

When I run xdg-open https://example.com/ from the command line, the exit code is 0, and so xdg-open is satisfied and stops here, performing the exit_success function.

But when I click on a link in Obsidian, the exit code is 141, and so xdg-open doesn't exit, and proceeds to execute some fallback logic, which eventually leads to running Firefox.

I have no idea why Brave is returning 0 in one case and 141 in the other case, but either way, the problem seems to be with Brave, and not with xdg-open.

1 points

the Person making the Tutorial Puts their own subjective opinions in, and you're Most certainly going to end Up with a broken system.

To be fair, the wiki is also written by humans, who also have subjective opinions about what information to emphasize, and how to present it.

For example, at the time of writing, the install guide's "Install essential packages" gives the command pacstrap -K /mnt base linux linux-firmware. They subjectively decided not to include a dhcp client in there, e.g. pacstrap -K /mnt base linux linux-firmware dhcpcd, even though the vast, vast, vast majority of users will need a dhcp client installed to make use of their system (the wiki even admits this when they say "other packages may be necessary for a fully functional base system").

I understand why they omitted this package, but I think they made the wrong choice. Still, my primary point is that subjectivity is unavoidable here.

1 points

I don't have locate installed, so I used find instead; not sure if it's equivalent to what you're testing:

$ locate brave-browser.desktop
fish: Unknown command: locate
$ find ~/.local/share/applications/ -iname "brave-browser.desktop"
/home/nebu/.local/share/applications/brave-browser.desktop
$ find /usr/share/applications/ -iname brave-browser.desktop
/usr/share/applications/brave-browser.desktop
$ diff /usr/share/applications/brave-browser.desktop ~/.local/share/applications/brave-browser.desktop 
116d115
< MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns;
224c223,224
< MimeType=x-scheme-handler/unknown;x-scheme-handler/about;text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;
---
> MimeType=x-scheme-handler/tel;application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns;
> x-scheme-handler/unknown;x-scheme-handler/about;text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;
$ pgrep -fa portal
1293 /usr/lib/ibus/ibus-portal
1350 /usr/lib/xdg-desktop-portal
1380 /usr/lib/xdg-document-portal
1389 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc
1393 /usr/lib/xdg-desktop-portal-gtk
4034 /usr/lib/xdg-desktop-portal
4053 /usr/lib/xdg-desktop-portal-gtk
4086 /usr/lib/ibus/ibus-portal

No idea why I have a .desktop entry in both my ~/.local/share/applications override and in the /usr/share directory. I've now deleted the entry in ~/.local/share/applications but that hasn't seemed to fix the issue either.

1 points

I'm assuming you installed by booting from a USB key with the install media flashed onto it.

If you reboot into the USB key's environment again, does the internet work there? For example, are you able to ping www.google.com in that environment?

One key insight that makes understanding the Arch process easier is that the install environment is an Arch environment too, but it's distinct from the Arch environment that will eventually become your permanent one. The install environment may have certain drivers and network programs installed in it, and if you want those programs to also exist in your permanent environment, you need to install them there as well.

For example, the installation environment has dhcpcd and systemd-networkd installed in it, so if you may want to install those into your permanent environment as well, assuming the internet works when you're in the installation environment.

1 points

For those suggesting rEFInd, how do I completely remove GRUB from my system and replace it with rEFInd without having to reinstall? Is this possible?

Yes it's possible, because the mechanism through which GRUB, rEFInd, etc. work only involves having files on the EFI partition. The partitions where the OS's are installed are not involved (except for the fact that the programs you use to produce the correct files are probably going to live on the OS partitions).

2 points

Do I have to reformat and install both again or can I wipe just my Arch drive and install as normal?

You can wipe just your arch drive. Not sure what you mean by "install as normal" -- the arch install is very manual, so there's an expectation that you understand what each step is doing, and whether it makes sense for you to perform that step. For example, if you would normally completely wipe out the harddrive, you should not do that step since it would destroy your Windows partition.

Note that depending on how you wipe your arch drive, some (but not necessarily all) of its identifiers might change. And then, depending on how your GRUB files refer to partitions, you may or may not need to update those files.

I installed GRUB as my bootloader and plan on keeping it as my bootloader on the new install. Will GRUB replace/overwrite the GRUB files that exist on the EFI partition or do I need to remove them first?

GRUB will not replace/overwrite the files on the EFI partition unless you instruct GRUB to do that. That's part of what I mean by the Arch install process being very manual, and your needing to understand what each step does and why it's doing it.

6 points

Why do so many posts asking about the number of distros exists when 99% of them are almost identical rephrasings that feel like they haven't searched for previous answers to this question?

I guess you made yet another post like this because:

  • You weren't happy with the existing posts.
  • You didn't do an extensive search the existing posts to see if somebody already made one that suits your needs.
  • It's pretty easy to make a new post, so why not? It's fun.
  • You don't like the idea of somebody stopping you from making your own post, even if similar posts already exist.
  • You think making a new post like this is harmless. If people don't like your post, those people can just ignore it.
  • The idea that your post might be "cluttering up" Reddit and preventing people from finding quality posts is ridiculous. There's a ranking system, and a search feature, so people can easily find what they want.

Anyway, here are the answers I can think of why someone might make yet another distro:

  • They weren't happy with the existing distros.
  • They didn't do an extensive search the existing distros to see if somebody already made one that suits your needs.
  • It's pretty easy to make a new distro, so why not? It's fun.
  • They don't like the idea of somebody stopping them from making their own distro, even if similar distros already exist.
  • They think making a new distro like this is harmless. If people don't like their distro, those people can just ignore it.
  • The idea that their distro might be "cluttering up" Distrowatch and preventing people from finding quality distros is ridiculous. There's a ranking system, and a search feature, so people can easily find what they want.
3 points

Why waste time learning non-posix syntax? Zsh can be made to function like it / better.

Why waste time learning how to configure Zsh to function like Fish? If your goal is a shell that behaves like Fish, then Fish is indisputably the best shell for that particular use case.

4 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.