3 ms·
I just realized formatting is a bit broken. :( Fixed: #!/bin/bash swaymsg create_output OUTPUT=$(swaymsg -r -t get_outputs | jq '.[].name' | grep HEADLESS |
by tasn 2y ago
I just realized formatting is a bit broken. :(
Fixed:
#!/bin/bash
swaymsg create_output
OUTPUT=$(swaymsg -r -t get_outputs | jq '.[].name' | grep HEADLESS | tr -d '"')
# No need to reduce res, it defualts to 1080p
# swaymsg output "$OUTPUT" resolution 1280x720
wl-mirror "$OUTPUT"
swaymsg output "$OUTPUT" unplug
- craftkiller 2y agoYou can do code blocks on HN by prefixing your lines with four spaces. #!/bin/bash swaymsg create_output OUTPUT=$(swaymsg -r -t get_outputs | jq '.[].name' | grep HEADLESS | tr -d '"') # No need to reduce res, it defualts to 1080p # swaymsg output "$OUTPUT" resolution 1280x720 wl-mirror "$OUTPUT" swaymsg output "$OUTPUT" unplug
- deleted 2y ago[deleted]
- mmh0000 2y agoFour spaces!? Absurd! Think of how many bytes you're wasting! In just your last code block your flooded the internet with 28 needless bytes!?!?!?!! If this keeps up soon we'll all just be downloading whitespace. Only two spaces are needed: https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc function trim { sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' } /end sarcasm
- craftkiller 2y agoYou just cut my tedious space-bar-smashing time in half, thank you!
- tasn 2y agoOh, thanks! I remembered there was something, skimmed through https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc and completely missed it.
- djbusby 2y agoHN needs a dedicated pastebin (remember those?)
- yjftsjthsd-h 2y agoWhat "remember"? I'm in multiple Matrix channels right now that tell people to use them.