• 0 Posts
  • 27 Comments
Joined 2 years ago
cake
Cake day: December 31st, 2023

help-circle

  • It can be useful if you want a different desktop layout for different use cases

    I set up a Personal activity, and a Work activity, with different backgrounds and different apps pinned to the taskbar. That helps maintain a “virtual” separation of work and personal life, and helps me not screw off on discord as much

    Well, it would if i actually used it








  • The technology behind the registry is fine (which is what I think @VinesNFluff meant)

    But it’s execution in Windows was ass

    In theory, a configuration manager with DB-like abilities (to maintain relationships, schematic integrity, and to abstract the file storage details), isn’t a bad idea

    But the registry as it is today is pure pain



  • that is a little more complicated

    p.communicate() will take a string (or bytes) and send it to the stdin of the process, then wait for p to finish execution

    there are ways to stream input into a running process (without waiting for the process to finish), but I don’t remember how off the top of my head

    
    from shutil import which
    from subprocess import Popen, PIPE, run
    from pathlib import Path
    
    LS   = which('ls')
    REV  = which('rev')
    
    ls   = run([LS, Path.home()], stdout=PIPE)
    
    p = Popen([REV], stdin=PIPE, stdout=PIPE)
    stdout, stderr = p.communicate(ls.stdout)
    
    print(stdout.decode('utf-8'))
    


  • just use python instead.

    • wrap around subprocess.run(), to call to system utils
    • use pathlib.Path for file paths and reading/writing to files
    • use shutil.which() to resolve utilities from your Path env var

    Here’s an example of some python i use to launch vscode (and terminals, but that requires dbus)

    
    from pathlib import Path
    from shutil import which
    from subprocess import run
    
    def _run(cmds: list[str], cwd=None):
        p = run(cmds, cwd=cwd)
    
        # raises an error if return code is non-zero
        p.check_returncode()
    
        return p
    
    VSCODE = which('code')
    SUDO   = which('sudo')
    DOCKER = which('docker')
    
    proj_dir = Path('/path/to/repo')
    
    docker_compose = proj_dir / 'docker/'
    
    windows = [
      proj_dir / 'code',
      proj_dir / 'more_code',
      proj_dir / 'even_more_code/subfolder',
    ]
    for w in windows:
      _run([VSCODE, w])
    
    _run([SUDO, DOCKER, 'compose', 'up', '-d'], cwd=docker_compose)
    


  • The kernel does stuff like

    • process and CPU task management
    • hardware abstraction
    • memory management (at the process level),
    • file system managment
    • and resource isolation (such as randomized memory addresses (ASLR))

    The rest of the OS provides the actual software that users interact with, like

    • file managers
    • desktop rendering and window management
    • settings menus
    • sound mixing between applications
    • graphics rendering



  • It’s not a permanent one and it works for the time being, can’t see the reason for the downvotes honestly.

    It’s just a bad idea in general. A better option would be to patch the binary to use 15. They both have the issue of forcing paru to work with a library it wasn’t explicitly designed for, but symlinking (or copying) 15 to 14 forces the hack to be “system wide” instead of restricted to a single binary

    as well, your solution is “temporary” only if you remember to fix it, vs patching which is (by default) overwritten the next time paru is updated

    it “works”, but it’s not something i’d recommend someone else do