Reno is the second iteration of the AWMTK-powered AwesomeWM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
7.0 KiB

2 years ago
2 years ago
  1. -- This file is part of Reno desktop.
  2. --
  3. -- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  4. --
  5. -- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  6. --
  7. -- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>.
  8. local parsers = require("parsers")
  9. function rprint(t,ident)
  10. ident = ident or 0
  11. for k,v in pairs(t) do
  12. print((" "):rep(ident)..k,v)
  13. if type(v) == "table" then
  14. rprint(v,ident+4)
  15. end
  16. end
  17. end
  18. -- Conf parser
  19. local data = [[
  20. # Global variables
  21. [global]
  22. terminal = "$HOME/.local/bin/st"
  23. browser = "prime-run librewolf"
  24. modkey = "Mod4"
  25. theme = "reno98"
  26. shell = "zsh"
  27. # Keybindings
  28. # Format: <modifier>(+<modifier>+...)+<key> = "<command or :internal.function>"
  29. # "modkey" as modifier will be substituted for modkey variable in [global]
  30. [keys]
  31. "modkey+Up" = ":root.client_next"
  32. "modkey+Down" = ":root.client_previous"
  33. "modkey+Control+Up" = ":root.screen_next"
  34. "modkey+Control+Down" = ":root.screen_previous"
  35. "modkey+Tab" = ":root.client_swap"
  36. "modkey+Return" = ":root.spawn_terminal"
  37. "modkey+Shift+Return" = ":root.spawn_browser"
  38. # Client keys only work if a focused client exists
  39. "modkey+Shift+c" = ":client.kill"
  40. "modkey+t" = ":client.cycle_screen"
  41. "modkey+o" = ":client.ontop"
  42. "modkey+b" = ":client.below"
  43. "modkey+f" = ":client.fullscreen"
  44. "modkey+n" = ":client.minimize"
  45. "modkey+m" = ":client.maximize"
  46. ]]
  47. for k,v in pairs(parsers.conf(data)) do
  48. print("Block: ["..k.."]")
  49. for kk,vv in pairs(v) do
  50. print(kk,vv)
  51. end
  52. end
  53. -- yaml-like (pactl) parser
  54. data = [[
  55. Sink Input #75
  56. Driver: PipeWire
  57. Owner Module: n/a
  58. Client: 58
  59. Sink: 46
  60. Sample Specification: float32le 2ch 44100Hz
  61. Channel Map: front-left,front-right
  62. Format: pcm, format.sample_format = "\"float32le\"" format.rate = "44100" format.channels = "2" format.channel_map = "\"front-left,front-right\""
  63. Corked: no
  64. Mute: no
  65. Volume: front-left: 38326 / 58% / -13.98 dB, front-right: 38326 / 58% / -13.98 dB
  66. balance 0.00
  67. Buffer Latency: 0 usec
  68. Sink Latency: 0 usec
  69. Resample method: PipeWire
  70. Properties:
  71. client.api = "pipewire-pulse"
  72. pulse.server.type = "unix"
  73. application.name = "LibreWolf"
  74. application.process.id = "1756"
  75. application.process.user = "yessiest"
  76. application.process.host = "architect"
  77. application.process.binary = "librewolf"
  78. application.language = "C.UTF-8"
  79. window.x11.display = ":0"
  80. application.process.machine_id = "a8099c2d12fe88c3df940ed562adbe8c"
  81. application.process.session_id = "1"
  82. media.name = "AudioStream"
  83. node.rate = "1/44100"
  84. node.latency = "3307/44100"
  85. stream.is-live = "true"
  86. node.name = "LibreWolf"
  87. node.autoconnect = "true"
  88. node.want-driver = "true"
  89. media.class = "Stream/Output/Audio"
  90. adapt.follower.spa-node = ""
  91. object.register = "false"
  92. factory.id = "6"
  93. clock.quantum-limit = "8192"
  94. factory.mode = "split"
  95. audio.adapt.follower = ""
  96. library.name = "audioconvert/libspa-audioconvert"
  97. client.id = "56"
  98. object.id = "57"
  99. object.serial = "75"
  100. pulse.attr.maxlength = "4194304"
  101. pulse.attr.tlength = "44104"
  102. pulse.attr.prebuf = "35296"
  103. pulse.attr.minreq = "8816"
  104. module-stream-restore.id = "sink-input-by-application-name:LibreWolf"
  105. ]]
  106. rprint(parsers.yaml_pseudo(data))
  107. -- Fast incomplete yaml parser
  108. data = [[
  109. Sink Input #73
  110. Driver: PipeWire
  111. Owner Module: n/a
  112. Client: 58
  113. Sink: 46
  114. Sample Specification: float32le 2ch 44100Hz
  115. Channel Map: front-left,front-right
  116. Format: pcm, format.sample_format = "\"float32le\"" format.rate = "44100" format.channels = "2" format.channel_map = "\"front-left,front-right\""
  117. Corked: no
  118. Mute: no
  119. Volume: front-left: 38326 / 58% / -13.98 dB, front-right: 38326 / 58% / -13.98 dB
  120. balance 0.00
  121. Buffer Latency: 0 usec
  122. Sink Latency: 0 usec
  123. Resample method: PipeWire
  124. Properties:
  125. client.api = "pipewire-pulse"
  126. pulse.server.type = "unix"
  127. application.name = "LibreWolf"
  128. application.process.id = "1756"
  129. application.process.user = "yessiest"
  130. application.process.host = "architect"
  131. application.process.binary = "librewolf"
  132. application.language = "C.UTF-8"
  133. window.x11.display = ":0"
  134. application.process.machine_id = "a8099c2d12fe88c3df940ed562adbe8c"
  135. application.process.session_id = "1"
  136. media.name = "AudioStream"
  137. node.rate = "1/44100"
  138. node.latency = "3307/44100"
  139. stream.is-live = "true"
  140. node.name = "LibreWolf"
  141. node.autoconnect = "true"
  142. node.want-driver = "true"
  143. media.class = "Stream/Output/Audio"
  144. adapt.follower.spa-node = ""
  145. object.register = "false"
  146. factory.id = "6"
  147. clock.quantum-limit = "8192"
  148. factory.mode = "split"
  149. audio.adapt.follower = ""
  150. library.name = "audioconvert/libspa-audioconvert"
  151. client.id = "56"
  152. object.id = "57"
  153. object.serial = "75"
  154. pulse.attr.maxlength = "4194304"
  155. pulse.attr.tlength = "44104"
  156. pulse.attr.prebuf = "35296"
  157. pulse.attr.minreq = "8816"
  158. module-stream-restore.id = "sink-input-by-application-name:LibreWolf"
  159. Sink Input #75
  160. Driver: PipeWire
  161. Owner Module: n/a
  162. Client: 58
  163. Sink: 46
  164. Sample Specification: float32le 2ch 44100Hz
  165. Channel Map: front-left,front-right
  166. Format: pcm, format.sample_format = "\"float32le\"" format.rate = "44100" format.channels = "2" format.channel_map = "\"front-left,front-right\""
  167. Corked: no
  168. Mute: no
  169. Volume: front-left: 38326 / 58% / -13.98 dB, front-right: 38326 / 58% / -13.98 dB
  170. balance 0.00
  171. Buffer Latency: 0 usec
  172. Sink Latency: 0 usec
  173. Resample method: PipeWire
  174. Properties:
  175. client.api = "pipewire-pulse"
  176. pulse.server.type = "unix"
  177. application.name = "LibreWolf"
  178. application.process.id = "1756"
  179. application.process.user = "yessiest"
  180. application.process.host = "architect"
  181. application.process.binary = "librewolf"
  182. application.language = "C.UTF-8"
  183. window.x11.display = ":0"
  184. application.process.machine_id = "a8099c2d12fe88c3df940ed562adbe8c"
  185. application.process.session_id = "1"
  186. media.name = "AudioStream"
  187. node.rate = "1/44100"
  188. node.latency = "3307/44100"
  189. stream.is-live = "true"
  190. node.name = "LibreWolf"
  191. node.autoconnect = "true"
  192. node.want-driver = "true"
  193. media.class = "Stream/Output/Audio"
  194. adapt.follower.spa-node = ""
  195. object.register = "false"
  196. factory.id = "6"
  197. clock.quantum-limit = "8192"
  198. factory.mode = "split"
  199. audio.adapt.follower = ""
  200. library.name = "audioconvert/libspa-audioconvert"
  201. client.id = "56"
  202. object.id = "57"
  203. object.serial = "75"
  204. pulse.attr.maxlength = "4194304"
  205. pulse.attr.tlength = "44104"
  206. pulse.attr.prebuf = "35296"
  207. pulse.attr.minreq = "8816"
  208. module-stream-restore.id = "sink-input-by-application-name:LibreWolf"
  209. ]]
  210. rprint(parsers.fast_split_yaml(data))