• 23 Posts
  • 770 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle

  • If I do ps aux | grep root, then the newline is preserved. So I’m not sure what exactly the problem is. There is a user option for ps, but it does not work with aux, ps --user root . You can ps ax --user root, but I’m not sure if this output is what you want.

    Btw if you grep, then I recommend using ^user , so it only matches the beginning of each line (the actual username), as ps aux | \grep ^root (notice the backslash). Do you have an alias for grep? Try \grep instead. The backslash in front of the command will use the actual command and ignore your alias.













  • I like these self made scripts. Some ideas to improve this: a) instead ls, use find command if you want use its output as input in another program (will yield fullpath too), b) fzf has a preview functionality, which I like a lot to use when it comes to directories or script files. As for the run command, I’m not sure why you use xargs and what i3-msg is needed for. Here is an alternative way.

    (Edit: I always forget that beehaw will convert my ampersand to &. Have this in mind if you read the below code.)

    bash -c 'cd "${HOME}/.local/bin"; path="$(find . -maxdepth 1 -type f -executable -printf "%f\n" | fzf --preview "cat {}")" && "${path}"'
    

    below same command in a bit more readable standalone script:

    #!/usr/bin/env bash
    cd "${HOME}/.local/bin" || exit 1
    path="$( \
        find . -maxdepth 1 -type f -executable -printf "%f\n" | \
        fzf --preview "cat {}" \
    )" && "${path}"
    

    The biggest problem with fzf is, that scripts that need an argument are not covered here. One could either use the input string from fzf as arguments or like that, or an optional input after fzf selection.


  • I might be missing something here but I don’t know how other launchers could possibly make this a simpler process.

    Shortcuts to launch an app directly in example. So my keyboard becomes my launcher.

    I use bunch of different tools, including KRunner (on KDE) and previously Rofi. These type name and search tools for launching an app have the problem that you need to remember what name the tool was. For programs I use often this is not an issue, but not all applications have names good to remember and not all of them are used often. The associated description helps, but sometimes I don’t know what words to type.

    Therefore I “need” the app menu with categories and favorites, to navigate with the mouse through. And the most used applications are usually assigned to a shortcut and my panel on the top. In short I use mostly all of these techniques as an application launcher (in that order):

    1. favorites on panel and my keyboard shortcuts
    2. app menu with categories, navigating with mouse
    3. run tool to search for app name and description (also integrated into the app menu)







  • I was using capital letters in the past, but they look so alien and are not fluid to type as small letters only. After some time I wasn’t sure which commands where capital and which were small letters, so left that concept behind me.

    But as a Vim user, I think of using single capital letters to open specific documents and files directly in Vim; emulating the global mark functionality of Vim. At the moment I have a convention of small letter+“rc” that will open configuration file in Vim, like this:

    alias brc='nvim ~/.bashrc && source ~/.bashrc'
    alias mrc='nvim ~/.config/MangoHud/MangoHud.conf'
    alias nrc='nvim ~/.config/nvim'
    ...
    

    But I might replace them with single letters brc as B in example.