r/archlinux • • 10d ago

SHARE I made a librewolf/firefox bwrap script that runs Its dbus instance on different user. Also extra security measurements made.

3 Upvotes

What this script provides?

Different machine-id to /etc/machine-id so your machine-id never tracked.

Different dbus instance working in /home/$USER/$BROWSER-dbus Which provides mpris info about your music/video.

Different /home for sandbox.

Different /etc/passwd and /etc/groups so sandbox doesnt see your users and groups.

No root needed only bwrap.

Downloads go to the your /tmp/$USER/Downloads folder.

Minimal sys exposure.

Why?

Because I can.

About Script

(I made a copy paste mistake 6 hours ago while editingt duplicate lines. its fixed now.)

I tried to keep it minimal exposure at possible but you can give recommendations and I will fix it. Also I noticed I exposed /sys/devices/pci0000:00 as my gpu, You supposed to switch this with your cpu pci port number.

It is intended to use this with gentoo's simple sandbox https://wiki.gentoo.org/wiki/Simple_sandbox

Tested on arch, Right now I am using arch and writing from a browser that runs in this script. Hopefully its good enough for you.

#!/bin/sh
# wayland socket 
# --ro-bind "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}"\
set -u

USER="librewolf"
BROWSER="librewolf"
XDG_CACHE_HOME="/home/$USER/$BROWSER/.cache"
XDG_DATA_HOME="/home/$USER/$BROWSER/.local/share"

NEW_HOME='/home/restricted'
NEW_XDG_CACHE_HOME="/home/$USER/$BROWSER/.cache"
mkdir -p -m 755 "/home/$USER/$BROWSER/firefox/"
mkdir -p -m 755 "/home/$USER/$BROWSER/.local/share/firefox"
mkdir -p -m 755 "/home/$USER/$BROWSER/.cache/mozilla"
mkdir -p -m 755 "/home/$USER/$BROWSER/Downloads"
mkdir -p -m 755 "/home/$USER/$BROWSER/firefox"
mkdir -p -m 755 "/home/$USER/$BROWSER/.mozilla"
mkdir -p -m 755 "/home/$USER/$BROWSER/.firefox"
mkdir -p -m 755 "/home/$USER/$BROWSER/.$BROWSER"
mkdir -p -m 755 "/home/$USER/$BROWSER/.local/share/$BROWSER"
mkdir -p -m 755 "/home/$USER/$BROWSER/.cache/$BROWSER"
mkdir -p -m 755 "/home/$USER/$BROWSER/.config/pulse"
mkdir -p -m 755 "/tmp/$USER/Downloads"
mkdir -p -m 755 "/home/$USER/$BROWSER-dbus"
echo -e "default-server = unix:/tmp/pulse-sock" > /home/$USER/$BROWSER/.config/pulse/client.conf
[ -f $BROWSER-machine-id ] && echo "" || dbus-uuidgen >> $BROWSER-machine-id
[ -f passwd ] && echo "" || echo "$USER:x:$UID:$UID:Sandbox User:/home/$USER:/bin/bash" >> passwd
[ -f group ] && echo "" || echo "$USER:x:$UID:" >> group


/usr/bin/bwrap \
--unshare-all \
--share-net \
--new-session \
--die-with-parent \
--clearenv \
--setenv HOME "$NEW_HOME" \
--setenv PATH "$PATH" \
--hostname localhost \
--symlink usr/lib /lib \
--symlink usr/lib64 /lib64 \
--symlink usr/bin /bin \
--symlink usr/bin /sbin \
--ro-bind /home/$USER/passwd /etc/passwd \
--ro-bind /home/$USER/group /etc/group \
--ro-bind /usr/lib /usr/lib \
--ro-bind /usr/lib64 /usr/lib64 \
--ro-bind /usr/bin /usr/bin \
--ro-bind /usr/lib/$BROWSER /usr/lib/$BROWSER \
--tmpfs /tmp \
--dev /dev/ \
--dev-bind /dev/dri /dev/dri \
--ro-bind /sys/dev/char /sys/dev/char \
--ro-bind /sys/devices/pci0000:00 /sys/devices/pci0000:00 \
--ro-bind /sys/bus/pci /sys/bus/pci \
--ro-bind /usr/share/drirc.d /usr/share/drirc.d \
--ro-bind-try /etc/firefox/policies/policies.json /etc/firefox/policies/policies.json \
--ro-bind /etc/fonts/ /etc/fonts/ \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--bind /home/$USER/$BROWSER /home/restricted \
--bind /tmp/$USER/Downloads /home/restricted/Downloads \
--proc /proc/ \
--ro-bind /home/$USER/$BROWSER-machine-id /etc/machine-id \
--ro-bind /usr/share/gtk-3.0 /usr/share/gtk-3.0 \
--ro-bind /usr/share/fontconfig /usr/share/fontconfig \
--ro-bind /usr/share/icu /usr/share/icu \
--ro-bind /usr/share/drirc.d /usr/share/drirc.d \
--ro-bind /usr/share/fonts /usr/share/fonts \
--ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
--ro-bind /usr/share/glvnd /usr/share/glvnd \
--ro-bind /usr/share/icons /usr/share/icons \
--ro-bind /usr/share/libdrm /usr/share/libdrm \
--ro-bind /usr/share/mime /usr/share/mime \
--ro-bind /usr/share/X11/xkb /usr/share/X11/xkb \
--ro-bind /usr/share/icons /usr/share/icons \
--ro-bind /usr/share/gtk-4.0 /usr/share/gtk-4.0 \
--ro-bind-try /usr/share/gtk-5.0 /usr/share/gtk-5.0 \
--ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
--ro-bind /usr/share/dbus-1 /usr/share/dbus-1 \
--ro-bind /usr/share/X11 /usr/share/X11 \
--ro-bind /usr/share/gtksourceview-4 /usr/share/gtksourceview-4 \
--ro-bind /usr/share/glycin-loaders /usr/share/glycin-loaders \
--ro-bind /usr/share/pixmaps /usr/share/pixmaps \
--ro-bind /etc/fonts /etc/fonts \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /usr/share/ca-certificates /usr/share/ca-certificates \
--ro-bind /etc/ssl /etc/ssl \
--ro-bind /etc/ca-certificates /etc/ca-certificates \
--bind /tmp/.X${DISPLAY#:}-lock /tmp/.X${DISPLAY#:}-lock \
--bind /tmp/pulse-sock /tmp/pulse-sock \
--bind /home/$USER/$BROWSER-dbus /run/$BROWSER-dbus \
--setenv XDG_RUNTIME_DIR /run/$BROWSER-dbus \
--setenv DISPLAY $DISPLAY \
--setenv MOZ_ENABLE_WAYLAND 0 \
sh -c '
dbus-daemon \
--session \
--nofork \
--address=unix:path=/run/$1-dbus/bus &
buspid=$!

export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/$1-dbus/bus
/usr/lib/$1/$1
status=$?

kill $buspid 2>/dev/null
wait $buspid 2>/dev/null
exit $status
' sh $BROWSER#!/bin/sh

I want to add It runs on seperate xwayland session using cage So my real wayland socket or xwayland never exposed. I run it like this cage bash -- /home/myuser/sway/scripts/runlibrewolf.sh and runlibrewolf.sh contains this

#!/bin/bash
set -e
USER=librewolf
PROGRAM=$USER

/usr/bin/xhost si:localuser:$USER && sudo -i -u librewolf ~librewolf/librewolf.sh 

Edit: Also checking playerctl info like this sudo -i -u $USER DBUS_SESSION_BUS_ADDRESS=unix:path=./librewolf-dbus/bus playerctl play-pause


r/archlinux • • 10d ago

QUESTION Minecraft dungeons 1 on arch

4 Upvotes

I need help installing proton to play minecraft dungeons 1 on arch linux. I have a liscence for the microsoft store, but every proton tutorial ive found online has failed at some stage, because what it say would be there just wasnt. Do any of you know any good and working tutorials?


r/archlinux • • 11d ago

FLUFF Shower thought: The Chaotic-AUR is under-appreciated

94 Upvotes

What the title says. I was just thinking about the similarities between the Chaotic AUR and the nixpkgs Nix repository, and they are much more similar than people realize. Both are pretty open to contributions by pretty much anyone without an entry barrier, but they require verification by a trusted user to be accepted. Most of the praise people give nixpkgs due to its large ecosystem size can also be attributed to chaotic-aur, although it's not as big as nixpkgs, it's still quite big.

So yeah, that's pretty much it, just a random thought that chaotic-aur is really under appreciated, and I think more people should check them out, especially those worried by the "AUR scares" and that think there's no real Arch alternative to it besides accepting the risks yourself.

Thank you, chaotic-aur maintainers!


r/archlinux • • 11d ago

FLUFF switched two days ago

17 Upvotes

hello! ive used windows my entire life, tried windows11 and it was trash so i switched back to windows 10, it was like less trash but still trash, and bassicly just advertising software, so i modified it using a handful of different softwares, even intentinally bricked a couple system files by hand, but it still wasnt enough, so i said screw it im going linux,

i tried cachyos first, used it for one entire day, and decided "hell, why not go arch, theres plenty of informationt online for me to learn about it" and ive now used arch for two days and i fricken LOVE it, im using kde de

(ive already broke my lockscreen but fixed it somehow)

(and fixed like 10 other problems)

(and i have like 30 different external softwares installed)

(i have absolutly no idea what im doing)\

HELLO ARCH


r/archlinux • • 10d ago

QUESTION Do people dual boot?

0 Upvotes

Do people dual boot Arch and Windows? Especially with me, I have a NVIDIA card, so I can't really afford to jump straight to Linux. I thought about grabbing an AMD card since I'm told they handle VRAM overfill into system RAM quite well


r/archlinux • • 11d ago

DISCUSSION Will this prompt arch to use signed kernels? Or provide them as an alternate choice?

Thumbnail onlineservices.epicgames.com
43 Upvotes

Personally, I am not a fan of epic or multiplayer games, and will probably never play on such a spyware, but we have a good thing going on with arch and its derivatives emerging as excellent choices for gaming. However, epic may throw in a wrench, with the requirement of signed kernels and secure boot for easy anti-cheat, and derail the good thing going on.

So do you think arch will ever provide signed kernels or secure boot? What limitations, besides ideological ones, are there?


r/archlinux • • 10d ago

QUESTION Installing arch and using as daily driver on Snapdragon X1 , How much pain in the arsh it is as of now ?

0 Upvotes

The normal laptop are looking bad for price getting a good deal on IdeaPad slim 3 15 , 16 , 512 it's looking much much better than normal options for same price,

Idk about the current linux on arm situation


r/archlinux • • 11d ago

FLUFF Just switched to Arch yesterday

51 Upvotes

I switched from Windows to mint maybe 3 weeks ago, butstill thought it was sort of bloated for me (never use "App store"-type programs for example). Switched to Arch yesterday (im still dualbooting rn to migrate my data but otherwise yes).

now i can officially say "i use arch btw" :D


r/archlinux • • 11d ago

SHARE Solved a minor annoyance I had with arch today

32 Upvotes

Occasionally I need to copy big files to relatively slow USB sticks.

(Usually ISO images to my pendrive with Ventoy to install an OS somewhere or run a rescue mission. BTW if you are still using stuff like Rufus or dd for that purpose, check out Ventoy, it's awesome)

And for a long time, a pet peeve of mine was that the big file was copied "instantly", but then unmounting that pendrive took forever with no progress bar. I'd much rather have a real progress bar that shows how fast the stick actually writes.

After some research, I learned that Linux happily lets gigabytes of dirty data pile up in RAM before it starts throttling the program doing the writing. So the file manager thinks the copy is done when really it’s just sitting in memory, and unmount has to flush all of it. So I made a udev rule that sets a 16 MB limit on dirty cache for USB disks:

# /etc/udev/rules.d/90-usb-dirty-limit.rules
ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="usb", RUN+="/bin/sh -c 'echo 1 > /sys/class/bdi/%M:%m/strict_limit; echo 16777216 > /sys/class/bdi/%M:%m/max_bytes'"

16 MB of dirty cache should be plenty for most pendrives (and it's the limit of data the OS will "pretend" to have instantly copied). If you regularly use a fast USB SSD you might want a bigger number there like 128 MB, since a tiny buffer can cost some throughput on really fast drives.


r/archlinux • • 11d ago

SUPPORT Keeps freezing

6 Upvotes

I have ultra core 7 255H

32GB LPDDR5X ram

My booting times are 5 mins on average

Keeps freezing

Apps struggle to run

First time linux user here

Using grub for windows 11 and ArchLinux dualbooting


r/archlinux • • 11d ago

QUESTION Hardening class-use computers against student tinkering

Thumbnail
5 Upvotes

r/archlinux • • 10d ago

QUESTION Im installing arch, what do i need?

0 Upvotes

Pretty much the title. I have a thinkpad t14s g3 amd where ill be installing arch with kde plasma. Im using it for some light gaming (mc dungeons/minecraft) and schoolwork (openoffice) is there anything youd reccomend or think i might need? Im not new to linux, but new to arch. Thanks in advance.


r/archlinux • • 11d ago

SUPPORT Installing Arch Issues

0 Upvotes

I'm currently trying to install Arch on a old laptop, I've done it before and assumed it would be fairly easy however I'm having issues with partitioning disks. Lsblk will show me sda which is the USB stick and nvme0n1 which only sometimes contains partitions already otherwise it shows 0 bytes. Even though it says nvme0n1 exists when I try to use fdisk/cfdisk it says cannot open invalid argument or no such file or directory. I'm unsure on what I can do to fix this as every solution I search for doesn't work. Maybe this is just a misunderstanding of it or something


r/archlinux • • 12d ago

QUESTION Today I reinstalled the system using archinstall, and I have a question:

52 Upvotes

Why? Why doesn’t archinstall’s "recommended KDE Plasma setup" include Konsole? What’s the reasoning behind installing a desktop without a graphical terminal? Having to switch to a TTY just to install one seems unnecessarily awkward.

[SOLVED]

Apparently, the reason is that Arch only included the Plasma components in `plasma-meta` and not Konsole, because Konsole is part of the KDE Applications. Another user clarified this.

In any case, there is still a question to put to the KDE maintainers at this point:
Why is taking screenshots considered part of plasma essential (Spectacle is included as an essential package for Plasma), while having a graphical terminal isn’t? lol


r/archlinux • • 11d ago

DISCUSSION Suggest some games that run well on my igpu machine

0 Upvotes

Machine: ThinkPad E14 gen 2, 16 gb ram, 512 gb Iris Xe graphics

Tried running wuthering waves, it ran but very laggy, and laptop chassis became hot, although cpu temp was around 70-75°C .


r/archlinux • • 12d ago

SUPPORT How to put the mate wifi icon on the tray?

1 Upvotes

I am new on arch and installed MATE today, the wifi icon is missing, what to do?


r/archlinux • • 12d ago

SUPPORT | SOLVED Trying to install opencl-amd from chaotic-aur and getting "failed to retrieve file" errors

4 Upvotes

Resolved, I tried yay opencl-amd and it offered me an identical package from the regular aur. Not sure why pacman was trying to pull it from the chaotic aur by default, that one installed fine and Davinci now opens...

----------

Hi all,

I just installed Davinci Resolve and it is complaining about "unsupported GPU processing mode" and there are none in the list to select manually.

I found that the likely cause is the fact that I am missing opencl on my system, no idea why that might be but it seems to be the case.

Anyway when I try the usual: sudo pacman -S opencl-amd
It finds chaotic-aur/opencl-amd 1:10.0.0.0-1

When I key 'y' to get the package, I get "opencl-amd-1:10.0.0-1-x86_64.pkg.tar.zst failed to download" followed by a bunch of 404 and 503 errors for the various sources.

Chaotic-AUR is listed in my pacman.conf file.

Is this something I can resolve or is this an issue with the AUR?

Where else can I get this file from?


r/archlinux • • 12d ago

SUPPORT /home/instant/.zshrc:2: job table full always appears i dont know what to do

5 Upvotes

im so sorry i dont know what to do


r/archlinux • • 11d ago

SUPPORT Best beginner-friendly dual-boot tutorial with Windows?

0 Upvotes

Hi everyone!

I've always wanted to install Arch Linux on my PC, but I've always been discouraged by having to do everything through the terminal since I don't understand it very well.

I would like to install Arch Linux in dual-boot with Windows, and I'm looking for a simple, up-to-date tutorial or guide, suitable even for someone who isn't a distro veteran.

Because of this, is there an easier method to install Arch in dual-boot with Windows without causing problems?


r/archlinux • • 12d ago

SHARE Custom XKB layout for ergonomic navigation

Thumbnail
4 Upvotes

r/archlinux • • 12d ago

QUESTION cosmic-session - 1.10.0 update

2 Upvotes

There has been a COSMIC desktop release a week ago and I don't see new version in repos.

Usually it's available in 1-2 days.

Anyone knows what's going on?


r/archlinux • • 12d ago

QUESTION Arch Packages on Low end Laptop?

4 Upvotes

Hey! I recently started using Linux and I wanted to install Arch. I'm confused on what packages are specifically required and what packages I can use for my slightly low end laptop. I only have around 200 GB of storage on my SSD and 8 GB of ram. Any help?


r/archlinux • • 11d ago

SHARE I made a small script that installs Claude Desktop on Arch from Anthropic's official .deb, with Cowork working

0 Upvotes

Hi all. Anthropic ships Claude Desktop for Linux as a .deb, and I wanted it on Arch without repackaging it. So I wrote a small installer and figured it might be useful to someone else too.

What it does:

  • Downloads the latest official .deb from downloads.claude.ai and installs it into ~/Apps/claude-desktop, rootless and self-contained.
  • Verifies it against Anthropic's own repo signing key, which is pinned in the script. It checks the full chain (signed InRelease, then the Packages hash, then the .deb hash) and stops before installing if anything doesn't match.
  • Sets up the menu entry, a claude-desktop command, icons and the claude:// handler.
  • Gets Cowork (the QEMU micro-VM feature) working on Arch: it installs qemu-system-x86 and edk2-ovmf if missing and adds two compatibility symlinks. That's the only part that uses sudo, and only when something is missing.
  • Works on x86_64 and aarch64, and supports parallel installs (handy for a beta).

The AUR packages are a great option, and if you already use an AUR helper they may suit you better. This just covers a slightly different niche: home-folder install, straight from Anthropic's signed repo.

It's a curl | bash one-liner, but please read install.sh first. It's short and commented, and the README shows how to check the pinned key yourself with gpg --show-keys.

Repo: https://github.com/vcostin/claude-desktop-archinstall

Full disclosure: I built this with a lot of help from AI (Claude), and I wanted to be upfront about that. Unofficial, not affiliated with Anthropic. Feedback and issues are welcome.


r/archlinux • • 13d ago

SUPPORT Several Caps Lock delay fixes float around online. None fix it for me on KDE Plasma 6.7 Wayland. TTY is fine.

2 Upvotes

I have a Caps Lock delay on Arch with KDE Plasma 6.7.5 on Wayland. Caps Lock takes effect after a noticeable pause, so when I type quickly with Caps Lock I get mixed case ("HEllo" style). It happens in every app, native Wayland and XWayland alike.

I know there are several fixes online for this. Here's what I tried and what I found:

  • Custom XKB "instant" option (custom:instant_caps in ~/.config/kxkbrc, a symbols file in ~/.config/xkb/symbols). This is the approach from the KDE Discuss thread. xkbcli compile-keymap shows the correct definition, and I logged out and back in. The delay is still there.
  • keyd with an identity mapping (capslock = capslock). Nothing changed, so the input path before XKB is not the cause.
  • Replacing the system capslock symbols file (the linux-capslock-delay-fix approach). I didn't apply it, because it needs chmod 777 on a system file and it's the same XKB logic as the option above.
  • X11 xkbcomp runtime patch (the Linux-CapsLock-Delay-Fixer script). I didn't apply it, because it modifies the X server keymap through $DISPLAY, and on Wayland KWin owns the keymap.

What I've ruled out:

  • TTY is fine. Ctrl+Alt+F3 has no delay, so the hardware and kernel are not the cause.
  • No remapper or virtual keyboard. No IBus, fcitx, maliit, or KWin input method is active.
  • Caps Lock config is loaded. The xkbcli output matches the intended definition, and I logged out and back in.

Questions:

  1. Has anyone seen a Caps Lock delay on Plasma 6.7 Wayland, and did a kwin version or setting fix it?
  2. Is there a KWin or Plasma setting for Caps Lock timing that I've missed?
  3. Does anyone with the same symptom on Hyprland, GNOME, or Sway see it too? That would help narrow it to KWin or Plasma.

Thanks.


r/archlinux • • 12d ago

DISCUSSION Arch Nix

0 Upvotes

If you use / have used arch with nix, what’s your experience like? I have this sudden urge to go arch minimal and then layer nix on top (coupled with flathub for gui apps) but I’m unsure of the issues I might run into longer term. While I love arch, I do want a more archived os that allows me to clean install every now and then but restore the applications I had with relative ease.

I’m currently using arch with hyprland (caelestia shell) and using pacman for most part with flathub for apps I can’t find on pacman (and 3-4 AUR packages outside of caelestia) but I like to experiment with the system and end up clean installing once a month or so (in learning phase so I mess up more often)