ctr1

joined 1 year ago
[–] [email protected] 11 points 8 months ago

Yes! Awk is great, I use it all the time for text processing problems that are beyond the scope of normal filters but aren't worth writing a whole program for. It's pretty versatile, and you can split expressions up and chain them together when they get too complicated. Try piping the output into sh sometime. It can be messy though and my awk programs tend to be write-only

[–] [email protected] 1 points 10 months ago

Yeah for me it's been great and I do essentially leave it plugged in the whole time I'm using my PC (attached to my keys). It does require a pin entered each boot, so leaving it in would still offer security. But as someone else mentioned getting kwallet PAM working would make things easier in any case

[–] [email protected] 1 points 10 months ago

Lol. I press a button on the device (which I unlocked with a pin before boot), but it would be nice to have the DB unlock automatically

[–] [email protected] 5 points 10 months ago (9 children)

Personally, I've relied on an OnlyKey for a few years (with backups and an extra fallback device) and haven't needed to type passwords since. This doesn't help with the number of prompts, but it does make them easier to dismiss.

I do use autologin, but I don't use a system wallet (only KeePassXC, which I do need to unlock manually). Autologin with system wallets can be tricky, but I've had some luck setting it up in the past. You might want to check out this wiki for PAM configuration.

[–] [email protected] 1 points 10 months ago

Nice, sounds pretty cool. FZF is great, I need to try out some new things with it. Never got into snippets but I'm sure that speeds things up considerably, will think about it.

Yeah separate config files is probably the best approach if you have a lot of things configured. I haven't done that yet, but might try soon. My config has generally been pretty simple, mostly bindings and plugin settings. But I started developing in the TTY and had to shoehorn-in a conditional theme and such to get it to work properly, leaving it pretty unorganized.

| I can never leave vim. It has taken over the pathways in my brain.

Haha, yeah

[–] [email protected] 1 points 10 months ago (2 children)

My neovim config is a total mess :D. But yeah i3-msg+jq is great, I've written a number of solutions to this problem before using the API and external scripts, but it's nice having things inline in the config file

[–] [email protected] 1 points 10 months ago

For a while I would have agreed, and I used sway for years. But recently I switched back to i3 (i3-rounded) due to display issues with my AMD GPU. I started doing most of my development in the TTY, and found that switching from TTY to Wayland takes half a second and can sometimes break my GPU (until I switch between TTY and display a few times). With X11 it's instant and without issue ¯\_(ツ)_/¯. Hoping that gets fixed down the road, or that it's specific to my GPU.

[–] [email protected] 0 points 10 months ago* (last edited 10 months ago) (4 children)

This is always the first thing I get set up:

# focus next available workspace on this output

bindsym $mod+q exec --no-startup-id ws=$(i3-msg -t get_workspaces | jq '.[] | select(.focused) | .num') && ofs=$(i3-msg -t get_outputs | jq 'map(select(.active)) | length') && i3-msg workspace $(($ws-$ofs))

bindsym $mod+w exec --no-startup-id ws=$(i3-msg -t get_workspaces | jq '.[] | select(.focused) | .num') && ofs=$(i3-msg -t get_outputs | jq 'map(select(.active)) | length') && i3-msg workspace $(($ws+$ofs))

# move window to next available workspace on this output

bindsym $mod+Shift+q exec --no-startup-id ws=$(i3-msg -t get_workspaces | jq '.[] | select(.focused) | .num') && ofs=$(i3-msg -t get_outputs | jq 'map(select(.active)) | length') && dest=$(($ws-$ofs)) && i3-msg move workspace $dest && i3-msg workspace $dest

bindsym $mod+Shift+w exec --no-startup-id ws=$(i3-msg -t get_workspaces | jq '.[] | select(.focused) | .num') && ofs=$(i3-msg -t get_outputs | jq 'map(select(.active)) | length') && dest=$(($ws+$ofs)) && i3-msg move workspace $dest && i3-msg workspace $dest

Works with sway if you replace i3-msg with swaymsg (and remove --no-startup-id, since it's not needed for Wayland).

Edit: ampersand issues, trying quote instead of code block

[–] [email protected] 7 points 10 months ago

I usually use Awk to do the heavy lifting within my Bash scripts (e.g. arg parsing, filtering, stream transformation), or I'll embed a Node.JS script for anything more advanced. In some cases, I'll use eval to process generated bash syntax, or I'll pipe into sh (which can be a good way to set up multiprocessing). I've also wanted to try zx, but I generally just stick to inlining since it saves a dependency.

[–] [email protected] 4 points 10 months ago

I started by writing small scripts to automate things, but really got into it after learning how fun it can be to make the computer do stuff. I also see it as a kind of creative outlet, but in general I just want to learn how to fix anything in software if I'm not satisfied with how it works.

[–] [email protected] 30 points 10 months ago (1 children)

I use LUKS-encrypted LVM volumes to store everything (and transfer via SSH or HTTPS), but would use GPG if I needed to encrypt individual files.

[–] [email protected] 3 points 11 months ago (1 children)

Ah good to know! Will try that if I ever run into issues, thanks

view more: ‹ prev next ›