Compare commits

..

5 Commits

Author SHA1 Message Date
andonome 58f794d7b8 Remote into new sway session 2026-06-13 09:09:35 +02:00
andonome 49452db82d How to remote into sway 2026-06-13 08:59:32 +02:00
andonome a3ffdd8ae6 CMD: share directory locally 2026-06-13 07:38:04 +02:00
andonome fe1c524dc3 Example: RSS feed 2026-06-11 14:01:57 +02:00
andonome 668d605dcb CMD: get sway info 2026-06-11 11:36:47 +02:00
4 changed files with 130 additions and 11 deletions
+26
View File
@@ -582,3 +582,29 @@ bin: vipw
bin: sudo
tag: system
tag: groups
aim: Check current keyboard layout on sway
cmd: swaymsg -t get_inputs --raw | jq -r '.[0].xkb_active_layout_name'
bin: sway
bin: jq
tag: keyboard
tag: locale
shell: sh
aim: Show name of currently selected app in sway
cmd: swaymsg -t get_tree | jq -C '.. | select(.type?) | select(.focused==true)'
bin: sway
bin: jq
tag: bar
shell: sh
aim: Share a directory as a local website
cmd: python3 -m http.server
note: Anyone can go to your computer's IP address and access all files in the current directory.
shell: sh
bin: python3
tag: tip
tag: network
tag: share
cmd: qrencode -t ansi "$(ip route show | grep -Pom1 'src \K[\d.]+')"
+ sudo python -m http.server 80
+33 -11
View File
@@ -1,6 +1,5 @@
%rec: example
%key: name
%type: note line
name: Default systemd service file
filename: default.service
@@ -148,9 +147,7 @@ content: ### Variables
+
+ .PHONY: help
+ help:
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
+ sort | \
+ column -s ':' -t
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | + sort | + column -s ':' -t
+
+ .PHONY: check
+ check: ## Check you have the required dependencies
@@ -209,8 +206,7 @@ content: hdr = @printf "\n\033[37;1;4m%s\033[0m\n"
+ @printf "\033[36m%s\t" "done"
+ @printf "\033[0m %s " "Close $$(basename -s .md $(last_modified) | tr '_' ' ')"
+ @printf "\033[0m %s\n" "[$$(grep -Pom1 'title: \K.*' $(last_modified))]"
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
+ column -s ':' -t
+ @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | + column -s ':' -t
+
+ $(closed_issues): closed/%.md: open/%.md
+ @git add $<
@@ -249,8 +245,34 @@ content: hdr = @printf "\n\033[37;1;4m%s\033[0m\n"
+ .PHONY: rundown
+ rundown: ## Summarize events
+ @printf "\033[33;5m# %s\033[0m\n" "Outstanding Calamities"
+ @$(foreach bug, $(wildcard open/*.md), \
+ a="$$(lowdown -X responsible $(bug))" && \
+ n="$$(echo $(bug) | cut -d_ -f2 | cut -d. -f1)" && \
+ t="$$(lowdown -X title $(bug))" && echo "$$n: $$t ($$a)" ;\
+ )
+ @$(foreach bug, $(wildcard open/*.md), + a="$$(lowdown -X responsible $(bug))" && + n="$$(echo $(bug) | cut -d_ -f2 | cut -d. -f1)" && + t="$$(lowdown -X title $(bug))" && echo "$$n: $$t ($$a)" ;+ )
name: RSS feed
filename: rss.xml
note: Only 'description', 'link', and 'title' are required.
+
+ Extra fields include 'textInput' (for a paragraph about the feed), 'skipHours' (for the hours to wait before refreshing), and 'language'.
content: <?xml version="1.0" encoding="UTF-8" ?>
+ <rss version="2.0">
+
+ <channel>
+ <title>{{title}}</title>
+ <link>{{url}}</link>
+ <generator>Recutils</generator>
+ <docs>https://www.w3schools.com/XML/xml_rss.asp</docs>
+ <skipDays>{{frequency}}</skipDays>
+ <description>{{description}}</description>
note: Output the next content field separately to produce multiple post items.
content: <item>
+ <guid>{{post_id}}</guid>
+ <category>{{post_category}}</category>
+ <pubDate>{{post_date}}</pubDate>
+ <title>{{post_title}}</title>
+ <link>{{url}}/{{post_link}}</link>
+ <description>{{post_description}}</description>
+ <source>{{post_source}}</source>
+ </item>
note: The last content field closes the XML tags opened in the first content field.
content: </channel>
+
+ </rss>
+49
View File
@@ -0,0 +1,49 @@
---
title: Remote Desktop between Sway
tags:
- networking
requires:
- networking/ssh.md
---
# On the Host
Install and run `wayvnc`.
```sh
export WAYLAND_DISPLAY=wayland-1
wayvnc
```
Only the `localhost` can access this (highly insecure) desktop sharing, at port 5900.
# On the Client
You'll need to disable your main modifier key on the client while accessing the host.
Edit `~/.config/sway/config`, and create a new `passthrough` mode where the modifier key does nothing.
```config
mode passthrough {
bindsym $mod+c mode default
}
bindsym $mod+c mode passthrough
```
Reload sway to make the changes take effect.
```sh
swaymsg reload
```
Use `ssh` to grab the host's port 5900.
```sh
ssh -L 5900:localhost:5900 ${remote_username}@${remote_ip}
```
Leave that session running, and connect with `vncviewer`:
```sh
vncviewer localhost:5900
```
+22
View File
@@ -0,0 +1,22 @@
---
title: New Sway Remote Desktop
tags:
- networking
requires:
- networking/remote_sway.md
---
Check the host is using only one display:
```sh
test "$WAYLAND_DISPLAY" = "wayland-1"
```
Start a new sway session, and a `wayvnc` session:
```sh
WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 sway &
WAYLAND_DISPLAY=wayland-2 wayvnc
```
On the client, [connect as usual](networking/remote_sway.md).