vilmibm feedbacks part 2: more shell cmds
parent
bcbb3f3bd4
commit
b5b9005427
18
app/shell.go
18
app/shell.go
|
@ -3,6 +3,7 @@ package app
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"os/user"
|
||||||
|
|
||||||
"git.sr.ht/~rockorager/vaxis"
|
"git.sr.ht/~rockorager/vaxis"
|
||||||
"git.sr.ht/~rockorager/vaxis/widgets/term"
|
"git.sr.ht/~rockorager/vaxis/widgets/term"
|
||||||
|
@ -15,6 +16,8 @@ type Shell struct {
|
||||||
|
|
||||||
func (view *Shell) Draw(state *ui.State) (row int) {
|
func (view *Shell) Draw(state *ui.State) (row int) {
|
||||||
win := state.Window().New(0, 0, 80, state.Window().Height)
|
win := state.Window().New(0, 0, 80, state.Window().Height)
|
||||||
|
user, _ := user.Current()
|
||||||
|
|
||||||
_, row = win.Wrap(vaxis.Segment{Text: `──── using the shell ────
|
_, row = win.Wrap(vaxis.Segment{Text: `──── using the shell ────
|
||||||
|
|
||||||
`, Style: vaxis.Style{Foreground: vaxis.IndexColor(5)}}, vaxis.Segment{Text: `as mentioned before, interaction with stuff on tilde town is done primarily via the `},
|
`, Style: vaxis.Style{Foreground: vaxis.IndexColor(5)}}, vaxis.Segment{Text: `as mentioned before, interaction with stuff on tilde town is done primarily via the `},
|
||||||
|
@ -27,11 +30,20 @@ the method of navigation between programs inside our shared computer, however, i
|
||||||
vaxis.Segment{Text: "bash", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
vaxis.Segment{Text: "bash", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
vaxis.Segment{Text: `, and while there are more, there's no reason to switch unless you're looking for something different.
|
vaxis.Segment{Text: `, and while there are more, there's no reason to switch unless you're looking for something different.
|
||||||
|
|
||||||
below is a terminal session. try typing `},
|
below is a terminal session. here are some commands for you to try out:
|
||||||
|
• `},
|
||||||
vaxis.Segment{Text: "ls", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
vaxis.Segment{Text: "ls", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
vaxis.Segment{Text: ` to list a folder, or `},
|
vaxis.Segment{Text: " lists the contents of a folder\n• "},
|
||||||
|
vaxis.Segment{Text: "cd", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
|
vaxis.Segment{Text: " goes into a folder\n• "},
|
||||||
|
vaxis.Segment{Text: "mkdir", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
|
vaxis.Segment{Text: " makes a new folder with a given name\n• "},
|
||||||
|
vaxis.Segment{Text: "cat", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
|
vaxis.Segment{Text: " outputs the contents of a file (try running "},
|
||||||
|
vaxis.Segment{Text: "cat welcome_" + user.Username + ".txt", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
|
vaxis.Segment{Text: "!)\n• "},
|
||||||
vaxis.Segment{Text: "echo", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
vaxis.Segment{Text: "echo", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
vaxis.Segment{Text: ` to make the shell say anything you want it to. run `},
|
vaxis.Segment{Text: " makes the shell repeat what you say to it\ntype "},
|
||||||
vaxis.Segment{Text: "exit", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
vaxis.Segment{Text: "exit", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
|
||||||
vaxis.Segment{Text: ` to continue the tutorial, whenever you're ready.`},
|
vaxis.Segment{Text: ` to continue the tutorial, whenever you're ready.`},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue