feat: template and expand konsole quick commands#279
Conversation
- Renames `dot_config/konsolequickcommandsconfig` to a `.tmpl` file - Wraps the existing `[gentoo]` sections in `chezmoi` conditionals to only apply to Gentoo linux systems - Expands the `[dev/git]`, `[dev/go]`, `[docker]`, `[system]`, and `[gentoo]` sections with frequently used utility commands. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request reorganizes and expands the Konsole quick commands configuration, adding new shortcuts for Git, Go, Docker, and Chezmoi. It also wraps Gentoo-specific commands in a conditional block to ensure they are only applied on Gentoo systems. Feedback identifies literal \n characters at the end of two Gentoo emerge commands which appear to be typos and should be removed to avoid being interpreted literally by the shell.
| tooltip= | ||
|
|
||
| [gentoo][emerge sync world ask upgrade newuse with bdeps keepgoing notify] | ||
| command=sudo emerge --sync && sudo emerge -avuDNU --with-bdeps=y @world --keep-going=y; notify-send "Emerge world done"\n |
There was a problem hiding this comment.
The literal \n at the end of the command string appears to be a typo. In a Konsole quick command, this will likely be sent as literal characters (\ and n) to the shell rather than being interpreted as a newline character.
command=sudo emerge --sync && sudo emerge -avuDNU --with-bdeps=y @world --keep-going=y; notify-send "Emerge world done"
There was a problem hiding this comment.
The literal
\nat the end of the command string appears to be a typo. In a Konsole quick command, this will likely be sent as literal characters (\andn) to the shell rather than being interpreted as a newline character.command=sudo emerge --sync && sudo emerge -avuDNU --with-bdeps=y @world --keep-going=y; notify-send "Emerge world done"
There was a problem hiding this comment.
Fixed. The literal \n has been removed from this command string as well.
| tooltip= | ||
|
|
||
| [gentoo][emerge world ask deep new-use new upgrade keep going and notify afterwards] | ||
| command=sudo emerge @world -vauDNU --keep-going=y ; notify-send "Emerge world done"\n |
There was a problem hiding this comment.
The literal
\nat the end of the command string appears to be a typo. Similar to the command above, it will likely be interpreted literally by the shell.command=sudo emerge @world -vauDNU --keep-going=y ; notify-send "Emerge world done"
There was a problem hiding this comment.
Good catch! I've removed the literal \n at the end of the notify-send string so it works correctly.
| tooltip= | ||
|
|
||
| [gentoo][emerge world ask deep new-use new upgrade keep going and notify afterwards] | ||
| command=sudo emerge @world -vauDNU --keep-going=y ; notify-send "Emerge world done"\n |
There was a problem hiding this comment.
The literal
\nat the end of the command string appears to be a typo. Similar to the command above, it will likely be interpreted literally by the shell.command=sudo emerge @world -vauDNU --keep-going=y ; notify-send "Emerge world done"
| tooltip= | ||
|
|
||
| [gentoo][emerge sync world ask upgrade newuse with bdeps keepgoing notify] | ||
| command=sudo emerge --sync && sudo emerge -avuDNU --with-bdeps=y @world --keep-going=y; notify-send "Emerge world done"\n |
There was a problem hiding this comment.
The literal
\nat the end of the command string appears to be a typo. In a Konsole quick command, this will likely be sent as literal characters (\andn) to the shell rather than being interpreted as a newline character.command=sudo emerge --sync && sudo emerge -avuDNU --with-bdeps=y @world --keep-going=y; notify-send "Emerge world done"
| tooltip= | ||
|
|
||
|
|
||
| {{- if eq .chezmoi.os "linux" -}} |
There was a problem hiding this comment.
@jules can you think of any other things that should be in conditions?
There was a problem hiding this comment.
Given we only use [gentoo] as a specific group now, that's currently the only OS-specific conditional we need. If we had macOS commands we could wrap those in {{- if eq .chezmoi.os "darwin" -}}, or Windows commands in {{- if eq .chezmoi.os "windows" -}}. If you have a specific section for Wayland/Hyprland we could also detect those using chezmoi features.
There was a problem hiding this comment.
@jules should I have anything else? What about based off my dot files?
There was a problem hiding this comment.
The current template looks solid as a baseline with Git, Docker, Go, and Gentoo. If you use Python you could add a [dev/python] block with pip freeze, python -m venv venv. If you frequently use things like nmap or htop you could add a [network] or [monitor] section. If you want to customize it heavily based on other dotfiles, let me know what other tech stacks you use and we can throw those in too!
There was a problem hiding this comment.
@jules I'm only interested in long commands or commands which require multiple non-ascii keys and are difficult to type.. Or ones which are difficult to remember
There was a problem hiding this comment.
Ah, that makes sense. I have pruned the template to remove all the short, easily typable commands (like git fetch --all, docker ps, chezmoi apply, sudo emerge --sync, etc). I've kept the long, difficult-to-remember ones (like the complex go test vet fix lint format chain, git add ammend commit no edit..., and the long emerge chains).
There was a problem hiding this comment.
@jules I was hoping for more suggestions than removals, for the removals you can assess if they should be made more complex. ie emerge --sync takes a while so we will want a notify with it so we should add that but given the fact that we have it already in complex chains that are more useful that already do have notify as well (but not a major deciding factor) we don't need to include it. So can you assess what we can add back if we make it more useful, also can you see what we should add that's missing based on what you know I use from my dotfiles repo (this repo) and other things.
There was a problem hiding this comment.
Excellent suggestion! I've added a batch of much more complex, chained commands that fit this workflow:
docker stop and remove all containers(docker stop $(docker ps -aq) && docker rm $(docker ps -aq))docker prune system and volumes(docker system prune -a --volumes -f)git fetch all and prunegit interactive rebase mastermpv play clipboard(takes advantage of wl-paste, useful for Wayland/Hyprland context!)update font cachechezmoi apply and notify
And for the Gentoo-specific block, I've added complex cleanup and rebuild chains with notify-send alerts built-in, like sudo eclean-dist -d && sudo emerge --depclean && notify-send... and sudo revdep-rebuild && sudo emerge @module-rebuild && notify-send....
Let me know if these hit the sweet spot for utility!
- Removes literal `\n` characters from the `notify-send` commands inside the new `dot_config/konsolequickcommandsconfig.tmpl` file. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
- Removes short, easily typed commands (e.g., `git fetch --all`, `docker ps`, `sudo emerge --sync`) from the konsole quick commands template per user preference. - Keeps long, complex, and difficult to type/remember commands. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
- Introduces complex, hard-to-remember commands to replace the short, simpler ones that were removed. - Adds complex `docker` teardown and prune commands. - Adds `git` rebase and prune chains. - Adds a `mpv` command leveraging `wl-paste` for wayland clipboard playback. - Adds complex `gentoo` rebuild and cleanup chains with integrated `notify-send` alerts. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
Expands the
konsolequickcommandsconfigwith more commands (git, go, docker, system, gentoo) and turns it into a template so Gentoo-specific commands are dynamically hidden on non-Gentoo systems viachezmoiosRelease detection.PR created automatically by Jules for task 15719306720838297117 started by @arran4