Advertisement
HangMan23

profile.lua

Feb 10th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. local shell = require("shell")
  2. local tty = require("tty")
  3. local fs = require("filesystem")
  4.  
  5. if tty.isAvailable() then
  6.   if io.stdout.tty then
  7.     io.write("\27[40m\27[37m")
  8.     tty.clear()
  9.   end
  10. end
  11. dofile("/etc/motd")
  12.  
  13. shell.setAlias("dir", "ls")
  14. shell.setAlias("move", "mv")
  15. shell.setAlias("rename", "mv")
  16. shell.setAlias("copy", "cp")
  17. shell.setAlias("del", "rm")
  18. shell.setAlias("md", "mkdir")
  19. shell.setAlias("cls", "clear")
  20. shell.setAlias("rs", "redstone")
  21. shell.setAlias("view", "edit -r")
  22. shell.setAlias("help", "man")
  23. shell.setAlias("cp", "cp -i")
  24. shell.setAlias("l", "ls -lhp")
  25. shell.setAlias("..", "cd ..")
  26. shell.setAlias("df", "df -h")
  27. shell.setAlias("grep", "grep --color")
  28.  
  29. os.setenv("EDITOR", "/bin/edit")
  30. os.setenv("HISTSIZE", "10")
  31. os.setenv("HOME", "/")
  32. os.setenv("IFS", " ")
  33. os.setenv("MANPATH", "/usr/man:.")
  34. os.setenv("PAGER", "/bin/more")
  35. os.setenv("PS1", "\27[40m\27[31m$HOSTNAME$HOSTNAME_SEPARATOR$PWD # \27[37m")
  36. os.setenv("LS_COLORS", "di=0;36:fi=0:ln=0;33:*.lua=0;32")
  37.  
  38. shell.setWorkingDirectory(os.getenv("HOME"))
  39.  
  40. local home_shrc = shell.resolve(".shrc")
  41. if fs.exists(home_shrc) then
  42.   loadfile(shell.resolve("source", "lua"))(home_shrc)
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement