Skip to content

u/indieross

In this archive from May 2009 to May 2023

0
posts
50
comments
0
media
118
score

The /usr/bin and /usr/local/bin directories are part of the Unix/Linux filesystem hierarchy, and they both serve different purposes.

  • /usr/bin: This is the primary directory of executable commands on the system. It's managed by the system's package manager (apt, yum, dnf, etc.) and should only contain binaries provided and managed by the system's package management. When you update your system, updates to programs within this directory will be handled by your package manager.

  • /usr/local/bin: This is intended for executables that are local to the machine, i.e., not part of the system's standard distribution. This includes scripts and binaries installed manually by the system administrator. This directory is usually included in a user's PATH, meaning executables here can be run directly from the command line without specifying the full path.

The main reason for keeping custom scripts in /usr/local/bin instead of /usr/bin is to avoid interfering with the system's package manager.

If you were to place your custom scripts in /usr/bin, it could potentially be erased or overwritten when you update your system. Additionally, you might unintentionally replace a system command with one of your scripts, which could cause unexpected behavior.

Placing custom scripts in /usr/local/bin helps keep them separate from system-managed binaries and reduces the risk of conflicts.

7 points

You're really looking to use After=network-online.target instead of Requires=network.target. I'd recommend putting your custom script in /usr/local/bin/ instead of /usr/bin/. And then if your system is up for a while maybe use a timer service to rerun the script every 24 hours.

  1. Create a systemd service unit file

    Let's create a service unit file. You may create a file named wallpaper.service in the /etc/systemd/system/ directory. Note that you require root privileges to do so. Use a text editor like nano or vim to create and edit the file:

    sudo nano /etc/systemd/system/wallpaper.service
    

    Paste in the following, making sure to adjust paths if necessary:

    [Unit]
    Description=Downloads the APOD and saves it as Wallpaper
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    ExecStart=/usr/local/bin/bg.sh
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    

    Save and close the file.

  2. Create a systemd timer unit file

    Now we'll create a corresponding timer for our service. Create a new file /etc/systemd/system/wallpaper.timer:

    sudo nano /etc/systemd/system/wallpaper.timer
    

    Paste in the following:

    [Unit]
    Description=Runs bg.sh every day
    
    [Timer]
    OnBootSec=0min
    OnUnitActiveSec=24h
    
    [Install]
    WantedBy=timers.target
    

    In the [Timer] section, OnBootSec=0min means the service will run immediately after the system boots. OnUnitActiveSec=24h means the service will rerun 24 hours after it was last activated.

    Save and close the file.

  3. Reload systemd daemon and enable the timer

    Next, reload the systemd daemon to make it aware of your new service and timer. Then, enable and start the timer:

    sudo systemctl daemon-reload
    sudo systemctl enable wallpaper.timer
    sudo systemctl start wallpaper.timer
    
  4. Check the status of your timer

    To make sure your timer is active and will trigger the service as expected, check its status:

    sudo systemctl status wallpaper.timer
    

That's it. Your script should now run at startup (with a delay until the network is up) and once daily.

18 points

the contents of cat /etc/modprobe.d/blacklist.conf should be

blacklist i915

and the nvidia modules should be placed in /etc/mkinitcpio.conf as follows

MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

and then run as root/sudo

mkinitcpio -P

ideally to blacklist i915 as early as possible, you may want to add the following to your boot arguments:

module_blacklist=i915

1 points

To get the sensor (and gdm) working again you can downgrade fprintd from 1.92 back to 1.90 for the time being.

sudo pacman -U /var/cache/pacman/pkg/fprintd-1.90.9-1-x86_64.pkg.tar.zst

And then in /etc/pacman.conf perhaps add the line

IgnorePkg = fprintd

to prevent it from upgrading again.

2 points

You had failed to mount a filesystem to '/mnt'. The pacstrap command will have worked to install the base system to /mnt without having successfully mounted a separate filesystem. To try again, make sure /mnt is completely empty (i.e. unmounting /mnt/boot/ and "rm -rf /mnt/*") before mounting the target filesystem.

1 points

adding pcie_aspm=off to my boot options got rid of the error message for me.

Linux also provides some ASPM driver kernel parameters to allow some level of tweakability. The following kernel parameters can be used:

disable ASPM: pcie_aspm=off

use default firmware configuration: pcie_aspm=default

disables ASPM and clock power management: pcie_aspm=performance

highest power saving mode, enable ASPM and clock power management: pcie_aspm=powersave

force ASPM on: pcie_aspm=force

You may wish to tinker with the last setting to see if you can override the default ASPM settings.

2 points

A lot of gnome apps have changed their .desktop names (look under /usr/share/applications). For instance "Files" used to be called nautilus.desktop but is now renamed to org.gnome.Nautilus.desktop. If you open in a text editor one of the .desktop files you will see the "Icon=foo" reflects the name change. Outdated icon theme packs obviously do not reflect these changes.

So there are a couple things you can do to fix the icons. For starters you can make sure you're using the latest version of the icon theme. The other fix is to copy the .desktop file to /home/$USER/.local/share/applications/ then modify the "Icon=foo" line of the copied file to the appropriate application name of your choosing reflected by your icon theme in /usr/share/icons/$ICON_THEME/. Copying the .desktop to this directory overrides the file in /usr/share/applications/.

Personally I use this numix theme from aur and recompile about once a month to keep those pesky changes at bay.

3 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.