Skip to content

Commit ca64310

Browse files
authored
Merge pull request #173 from FolkComputer/shortcuts
Introduce vp/keyboard-shortcuts.folk
2 parents 53b7cfe + 5003044 commit ca64310

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

hosts.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if {[info exists ::env(FOLK_SHARE_NODE)]} {
2222
if {$wifi eq "cynosure"} {
2323
set ::shareNode "folk-omar.local"
2424
} elseif {$wifi eq "Verizon_TWRHB4" || $wifi eq "nyu"} {
25-
set ::shareNode "folk-cwe.local"
25+
set ::shareNode "gadget-red.local"
2626
} elseif {$wifi eq "WONDERLAND"} {
2727
set ::shareNode "folk-haip.local"
2828
} elseif {$wifi eq "GETNEAR"} {

virtual-programs/esc-restart.folk

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# When sudo is removed in the exec commands below you get:
2+
# Error in virtual-programs/keyboard-shortcuts.folk, match m10029:6: Failed to restart folk.service: Interactive authentication required.
3+
#
4+
# TODO: Figure out how to do this with less powerful permissions than `sudo`. (@cwervo)
5+
6+
# Keyboard shortcuts
7+
# ---
8+
# Alt + Esc: Restart Folk
9+
# Alt + F1: Stop Folk completely (note: need to ssh to restart Folk)
10+
Claim keyboard debugger is off
11+
12+
When keyboard debugger is on & keyboard /keyboard/ claims key /key/ is down with timestamp /timestamp/ {
13+
puts "\[keyboard debugger:\] $key @ $timestamp"
14+
}
15+
16+
# Alt-Esc on most keyboards
17+
When keyboard /k/ claims key Meta_Escape is down with timestamp /any/ {
18+
puts "==== Folk restarting ... ===="
19+
exec sudo systemctl restart folk
20+
}
21+
22+
# Console_1 corresponds to Alt-F1 on most keyboards
23+
When keyboard /k/ claims key Console_1 is down with timestamp /any/ {
24+
puts "==== Stoping Folk. ===="
25+
puts "===="
26+
puts " Run `make sync-restart` on your laptop or SSH into [info hostname] to restart Folk ===="
27+
puts "===="
28+
exec sudo systemctl stop folk
29+
}

0 commit comments

Comments
 (0)