Module: cwc
cwc lifecycle and low-level APIs.
Info:
- Copyright: 2024
- License: GPLv3
-
Originally authored by: Dwi Asmoro Bangun
(Full contributors list available on our github project)
Fields
| cwc.datadir | string |
Get cwc datadir location, it will search through $XDG_DATA_DIRS/share/cwc.
|
Read only |
| cwc.version | string | Get cwc version. | Read only |
| cwc.tasklist_show_all | boolean | Set to true to show all clients or false to show clients that on the current tag. |
Static module functions
| cwc.quit () | Quit cwc. | |
| cwc.reload () | Reload cwc lua configuration. | |
| cwc.commit () | Commit configuration change. | |
| cwc.spawn (vargs, io_cb, exited_cb) | Spawn program. | |
| cwc.spawn_with_shell (cmd, cmd, io_cb, exited_cb) | Spawn program with shell. | |
| cwc.is_nested () -> boolean | Check if the session is nested. | |
| cwc.is_startup () -> boolean | Check if the configuration is startup (not reload). | |
| cwc.setenv (key, val) | Wrapper of C setenv. | |
| cwc.unsetenv (key) | Wrapper of C unsetenv. | |
| cwc.chvt (n) | Change the vt (chvt). | |
| cwc.unlock_session () | Unlock the session in case the screen locker behaving weird/crashed. | |
| cwc.connect_signal (signame, func) | Add event listener. | |
| cwc.disconnect_signal (signame, func) | Remove event listener. | |
| cwc.emit_signal (signame, ...) | Notify event listener. |
Fields
- 🔗 cwc.datadir string · read only
-
Get cwc datadir location, it will search through
$XDG_DATA_DIRS/share/cwc. - 🔗 cwc.version string · read only
- Get cwc version.
- 🔗 cwc.tasklist_show_all boolean
-
Set to true to show all clients or false to show clients that on the current
tag.
only affect widget or bar that implement wlr foreign toplevel management.
Static module functions
- 🔗 cwc.quit ()
- Quit cwc.
- 🔗 cwc.reload ()
- Reload cwc lua configuration.
- 🔗 cwc.commit ()
- Commit configuration change.
- 🔗 cwc.spawn (vargs, io_cb, exited_cb)
-
Spawn program.
Parameters:
Name Type(s) Description vargs string[] Array of argument list io_cb Optional table Callback function when output of stdout or stderrs ready. stdout Optional string or nil Output from stdout of the process. stderr Optional string or nil Output from stderr of the process. pid Optional integer The process id. data Optional any Userdata. exited_cb Optional table Callback when the process exited. exit_code Optional integer Exit code of the process. pid Optional integer The process id. data Optional any Userdata. - 🔗 cwc.spawn_with_shell (cmd, cmd, io_cb, exited_cb)
-
Spawn program with shell.
Parameters:
Name Type(s) Description cmd Optional string Shell command cmd Optional string Shell command io_cb Optional table Callback function when output of stdout or stderrs ready. stdout Optional string or nil Output from stdout of the process. stderr Optional string or nil Output from stderr of the process. pid Optional integer The process id. data Optional any Userdata. exited_cb Optional table Callback when the process exited. exit_code Optional integer Exit code of the process. pid Optional integer The process id. data Optional any Userdata. - 🔗 cwc.is_nested () -> boolean
-
Check if the session is nested.
Returns:
-
boolean
- 🔗 cwc.is_startup () -> boolean
-
Check if the configuration is startup (not reload).
Returns:
-
boolean
- 🔗 cwc.setenv (key, val)
-
Wrapper of C setenv.
Parameters:
Name Type(s) Description key string Variable name. val string Value. - 🔗 cwc.unsetenv (key)
-
Wrapper of C unsetenv.
Parameters:
Name Type(s) Description key string Variable name. - 🔗 cwc.chvt (n)
-
Change the vt (chvt).
Parameters:
Name Type(s) Description n integer Index of the vt. - 🔗 cwc.unlock_session ()
- Unlock the session in case the screen locker behaving weird/crashed.
- 🔗 cwc.connect_signal (signame, func)
-
Add event listener.
Parameters:
Name Type(s) Description signame string The name of the signal. func function Callback function to run. - 🔗 cwc.disconnect_signal (signame, func)
-
Remove event listener.
Parameters:
Name Type(s) Description signame string The name of the signal. func function Attached callback function . - 🔗 cwc.emit_signal (signame, ...)
-
Notify event listener.
Parameters:
Name Type(s) Description signame string The name of the signal. ... The signal callback argument.