Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

3 votes
3 answers
861 views
Installing the Lua scripting language
I want to write some scripts in lua, but is not installed on my `Trisquel 11` system (based on `Ubuntu 22.04`). I want to write scripts for my Ubuntu 22.04 tools. Have looked at `Synaptic Package Manager`. But entering `lua`, there are so many matches that I have no clue about what to install. Doing...
I want to write some scripts in lua, but is not installed on my Trisquel 11 system (based on Ubuntu 22.04). I want to write scripts for my Ubuntu 22.04 tools. Have looked at Synaptic Package Manager. But entering lua, there are so many matches that I have no clue about what to install. Doing search bin/lua gives me all this What is /usr/bin/luac5.4 exactly? What's the letter c for. hagbard@fuckup:~$ apt-file search bin/lua context: /usr/bin/luatools deets: /usr/bin/luau dh-lua: /usr/bin/lua-create-gitbuildpackage-layout dh-lua: /usr/bin/lua-create-svnbuildpackage-layout lua-any: /usr/bin/lua-any lua-check: /usr/bin/luacheck lua5.1: /usr/bin/lua5.1 lua5.1: /usr/bin/luac5.1 lua5.1-policy-dev: /usr/bin/lua5.1-policy-create-svnbuildpackage-layout lua5.2: /usr/bin/lua5.2 lua5.2: /usr/bin/luac5.2 lua5.3: /usr/bin/lua5.3 lua5.3: /usr/bin/luac5.3 lua5.4: /usr/bin/lua5.4 lua5.4: /usr/bin/luac5.4 luadoc: /usr/bin/luadoc luajit: /usr/bin/luajit luakit: /usr/bin/luakit luarocks: /usr/bin/luarocks luarocks: /usr/bin/luarocks-5.1 luarocks: /usr/bin/luarocks-5.2 luarocks: /usr/bin/luarocks-5.3 luarocks: /usr/bin/luarocks-5.4 luarocks: /usr/bin/luarocks-admin luarocks: /usr/bin/luarocks-admin-5.1 luarocks: /usr/bin/luarocks-admin-5.2 luarocks: /usr/bin/luarocks-admin-5.3 luarocks: /usr/bin/luarocks-admin-5.4 texlive-binaries: /usr/bin/luahbtex texlive-binaries: /usr/bin/luajithbtex texlive-binaries: /usr/bin/luajittex texlive-binaries: /usr/bin/luatex texlive-latex-base: /usr/bin/lualatex texlive-latex-extra: /usr/bin/lualatex-dev texlive-luatex: /usr/bin/luaotfload-tool hagbard@fuckup:~$
Heime (45 rep)
May 18, 2025, 11:34 AM • Last activity: May 19, 2025, 12:51 PM
1 votes
0 answers
44 views
Lua SMTP Script with STARTTLS Fails to Authenticate
🔍 Context I'm working on a Lua script that sends emails via SMTP with STARTTLS. The script successfully connects to the SMTP server, but authentication sometimes fails with the error: authentication not supported This happens after the STARTTLS handshake. I'm not sure if I'm sending the SMTP...
🔍 Context I'm working on a Lua script that sends emails via SMTP with STARTTLS. The script successfully connects to the SMTP server, but authentication sometimes fails with the error: authentication not supported This happens after the STARTTLS handshake. I'm not sure if I'm sending the SMTP commands in the correct order or if there's an issue with the authentication method. ✅ What the Script Does 📡 Connects to an SMTP server (supports both TLS and SSL) 🔒 Implements STARTTLS when using port 587 🔑 Authenticates using AUTH LOGIN 🛠 Includes a debugging function to log SMTP commands and responses ⚠️ Issue Description The script connects to the SMTP server (port 587 or 465). If using port 587, it sends EHLO, then STARTTLS. After TLS is enabled, it tries to authenticate, but the server rejects authentication. If using port 465, the script connects via SSL directly, but authentication still fails. 🛠 Debugging Log Sample Here’s an example of the log output when using port 587:
-bash
[SMTP DEBUG] Sent : EHLO localhost
[SMTP DEBUG] Received : 250-smtp.example.com
[SMTP DEBUG] Sent : STARTTLS
[SMTP DEBUG] Received : 220 Ready to start TLS
[SMTP DEBUG] Sent : EHLO localhost  >SMTP: Connect to SMTP (port 587 or 465)
    alt Port 587 (STARTTLS)
        SMTP->>Client: 220 Service Ready
        Client->>SMTP: EHLO localhost
        SMTP->>Client: 250-AUTH PLAIN LOGIN
        Client->>SMTP: STARTTLS
        SMTP->>Client: 220 Ready to start TLS
        Client->>Client: Upgrade to TLS Mode
        Client->>SMTP: EHLO localhost (again?)
    else Port 465 (SSL Direct)
        Client->>Client: Direct SSL/TLS Connection
    end

    Client->>SMTP: AUTH LOGIN
    SMTP->>Client: 334 Username Prompt
    Client->>SMTP: (Base64 Encoded Email)
    SMTP->>Client: 334 Password Prompt
    Client->>SMTP: (Base64 Encoded Password)
    SMTP->>Client: 235 Authentication Successful

    Client->>SMTP: MAIL FROM:
    SMTP->>Client: 250 OK
    Client->>SMTP: RCPT TO:
    SMTP->>Client: 250 OK
    Client->>SMTP: DATA
    SMTP->>Client: 354 Start mail input
    Client->>SMTP: (Email Content)
    Client->>SMTP: .
    SMTP->>Client: 250 Message Accepted

    Client->>SMTP: QUIT
    SMTP->>Client: 221 Bye
Questions -- Do I need to send EHLO again after STARTTLS? Are my SMTP commands correctly ordered? How can I further debug the authentication failure? Any help would be greatly appreciated! 🚀
white-wolf (11 rep)
Feb 10, 2025, 12:51 AM • Last activity: Feb 10, 2025, 12:53 AM
1 votes
2 answers
680 views
How to detect the linux distribution name in Neovim init.lua
How can I detect in my neovim `~/.config/nvim/init.lua` configuration which operating system distribution nvim is running? I want different Neovim configurations on debian servers as on my fedora linux workstation machines. - `vim.loop.os_uname()` only detects 'Linux'. - Is there some builtin like t...
How can I detect in my neovim ~/.config/nvim/init.lua configuration which operating system distribution nvim is running? I want different Neovim configurations on debian servers as on my fedora linux workstation machines. - vim.loop.os_uname() only detects 'Linux'. - Is there some builtin like the /etc/os-release file?
Simon Schürg (241 rep)
Feb 28, 2023, 07:56 PM • Last activity: Aug 13, 2024, 12:04 AM
3 votes
1 answers
2382 views
How to get subject of gmail letter with curl?
I use `curl` in my Lua program to get new mail list. I am trying to send request like this ```lua local head_command = "curl --connect-timeout 30 -fsm 30" local server = "imap.gmail.com" local mail = "***" local password = "***" local port = 993 local request = "-X 'FETCH 86 BODY.PEEK[HEADER.FIELDS...
I use curl in my Lua program to get new mail list. I am trying to send request like this
local head_command = "curl --connect-timeout 30 -fsm 30"
local server       = "imap.gmail.com"
local mail         = "***"
local password     = "***"
local port         = 993
local request      = "-X 'FETCH 86 BODY.PEEK[HEADER.FIELDS (SUBJECT)]'"
local curl = string.format("%s --url 'imaps://%s:%s/INBOX' -u %s:%q %s -k", head_command, server, port, mail, password, request)
helpers.async(curl, function(stdout, exit_code)
  naughty.notify { text = stdout, timeout = 0 }
end )
But only I get is
* 86 FETCH (BODY[HEADER.FIELDS (SUBJECT)] {54}
And I get response like this for any FETCH command. I can get message HEADER if specify UID in url directly like
imaps://%s:%s/INBOX;UID=86/;SECTION=HEADER
It outputs this
Delivered-To: bugaev.nsu@gmail.com

Received: by 10.140.91.106 with SMTP id y97csp1976911qgd; Mon, 25 May 2015
 18:50:08 -0700 (PDT)
X-Received: by 10.112.142.232 with SMTP id rz8mr19609586lbb.74.1432605008430;
 Mon, 25 May 2015 18:50:08 -0700 (PDT)
Return-Path: 
Received: from f342.i.mail.ru (f342.i.mail.ru. [217.69.140.238]) by
 mx.google.com with ESMTPS id b3si5030682lbd.117.2015.05.25.18.50.07 for
  (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256
 bits=128/128); Mon, 25 May 2015 18:50:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of bugaevamv@mail.ru designates
 217.69.140.238 as permitted sender) client-ip=217.69.140.238;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of
 bugaevamv@mail.ru designates 217.69.140.238 as permitted sender)
 smtp.mail=bugaevamv@mail.ru; dkim=pass header.i=@mail.ru; dmarc=pass (p=NONE
 dis=NONE) header.from=mail.ru
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru;
 s=mail2; h=Content-Type:Message-ID:Reply-To:Date:MIME-Version:To:From;
 bh=vOFnL58jZvcsH24k/6XvHT0DhLLtNvAaCxTAZUvggn4=;
 b=GJpRK8wJfOfrrlW6KycI6CDBUPTlQNBSNmAswE+5M67hdePFUeoHkakQdh8ziPtmOPsSWCwLs2spcqXjTkQ1Ny2raWBrbVaaFKPSxzdi7m6JGfwJ3Snkv1DMGBhGVCqBOIwVj7iCdnBEzYQhCMgZ6UvjDNv15PReV5MiJzECnG0=;
Received: from [194.125.255.143] (ident=mail) by f342.i.mail.ru with local
 (envelope-from ) id 1Yx40N-0001gA-0m for
 bugaev.nsu@gmail.com; Tue, 26 May 2015 04:50:07 +0300
Received: from [194.125.255.143] by e.mail.ru with HTTP; Tue, 26 May 2015
 04:50:06 +0300
From: =?UTF-8?B?0JzQsNGA0LjQvdCwINCR0YPQs9Cw0LXQstCw?= 
To: =?UTF-8?B?0JrQuNGA0LjQu9C7INCR0YPQs9Cw0LXQsg==?= 
MIME-Version: 1.0
X-Mailer: Mail.Ru Mailer 1.0
X-Originating-IP: [194.125.255.143]
Date: Tue, 26 May 2015 04:50:06 +0300
Reply-To: =?UTF-8?B?0JzQsNGA0LjQvdCwINCR0YPQs9Cw0LXQstCw?= 
X-Priority: 3 (Normal)
Message-ID: 
Content-Type: multipart/alternative;
 boundary="--ALT--rUEeoQugXy3WMzk9UAxdG7pumUrVItQl1432605006"
X-Mras: Ok
X-Spam: undefined
But how can I get message SUBJECT this way?
Kirill Bugaev (151 rep)
Aug 20, 2019, 06:22 AM • Last activity: Jun 15, 2024, 07:07 AM
0 votes
0 answers
1008 views
Setting indent blankline plugin in lua with custom options
I do not know how to write configs in lua. I am using neovim and my configartion is written in lua. I have few plugins and I use lazy nvim as my plugin manager. I have a seperate plugins directory which holds my plugins' lua files. I currently have the below as my indent-blankline.lua file: ``` loca...
I do not know how to write configs in lua. I am using neovim and my configartion is written in lua. I have few plugins and I use lazy nvim as my plugin manager. I have a seperate plugins directory which holds my plugins' lua files. I currently have the below as my indent-blankline.lua file:
local Plugin = {'lukas-reineke/indent-blankline.nvim'}

Plugin.name = 'indent_blankline'

Plugin.main = 'ibl'

Plugin.event = {'BufReadPost', 'BufNewFile'}

-- See :help ibl.setup()
Plugin.opts = {
  enabled = false,
  scope = {
    enabled = false,
  },
  indent = {
    char = '▏',
  },
}

return Plugin
I want to add the config below which I found in the github page of the plugin. It will apply colors to the lines:
local highlight = {
    "RainbowRed",
    "RainbowYellow",
    "RainbowBlue",
    "RainbowOrange",
    "RainbowGreen",
    "RainbowViolet",
    "RainbowCyan",
}

local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
    vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
    vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
    vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
    vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
    vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
    vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
    vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)

require("ibl").setup { indent = { highlight = highlight } }
I am not sure how/where to place the above. I wonder if someone can tell me how do I integrate this to my config.
Muzzamil (3 rep)
Oct 15, 2023, 07:09 AM
1 votes
0 answers
165 views
Conky: attempt to compare number with nil
I'm trying to make my own conky script, and I'm having some trouble with a script I'm using. The script is [this][1] one. This is the problematic part: { name="diskio_read", arg="/dev/nvme0n1", max=100, width=85, height=110, y=505, x=25, nb_values=100, bg_colour={{0,0x000000,0}}, fg_bd_colour = { {0...
I'm trying to make my own conky script, and I'm having some trouble with a script I'm using. The script is this one. This is the problematic part: { name="diskio_read", arg="/dev/nvme0n1", max=100, width=85, height=110, y=505, x=25, nb_values=100, bg_colour={{0,0x000000,0}}, fg_bd_colour = { {0,0x49a835,1}, }, foreground=false, fg_bd_size=0.7, bg_bd_size=0.5, }, The error it generates: conky: llua_do_call: function conky_main execution failed: attempt to compare number with nil The thing is that I have enabled format_human_readable = true, thus causing diskio_read to return a value with unit. Now, I have enabled format_human_readable because in I use ${mem} and ${memmax}. My question is if there is any way to convert any number or variable (for example, ${mem}) from a raw number to a human readable number. That way, I can keep format_human_readable = false and avoid having troubles with the lua scripts. The other way around would be to convert from a human readable number to a raw number, and instead leave format_human_readable = true and modify the value that I give to the scripts. Here are the scripts and configs: **conky.conf** **loadAll.lua** **bar.lua** **graph.lua** this is how the script looks as is: enter image description here
fpp (111 rep)
Mar 3, 2023, 07:40 PM
0 votes
1 answers
157 views
How do I configure a key binding to send a client to bling's scratch pad in awesome wm?
I want to make a shortcut that can send a client to bling's scratchpad. The part that initializes bling scratch pad: ```lua local bling = require("bling") local term_scratch = bling.module.scratchpad { command = "wezterm start --class spad", -- How to spawn the scratchpad rule = { instance = "spad"...
I want to make a shortcut that can send a client to bling's scratchpad. The part that initializes bling scratch pad:
local bling = require("bling")
local term_scratch = bling.module.scratchpad {
    command = "wezterm start --class spad",           -- How to spawn the scratchpad
    rule = { instance = "spad" },                     -- The rule that the scratchpad will be searched by
    sticky = true,                                    -- Whether the scratchpad should be sticky
    autoclose = true,                                 -- Whether it should hide itself when losing focus
    floating = true,                                  -- Whether it should be floating (MUST BE TRUE FOR ANIMATIONS)
    geometry = {x=360, y=90, height=900, width=1200}, -- The geometry in a floating state
    reapply = true,                                   -- Whether all those properties should be reapplied on every new opening of the scratchpad (MUST BE TRUE FOR ANIMATIONS)
    dont_focus_before_close  = false,                 -- When set to true, the scratchpad will be closed by the toggle function regardless of whether its focused or not. When set to false, the toggle function will first bring the scratchpad into focus and only close it on a second call
}
That key binding that failed to move the client into said scratch pad:
globalkeys = gears.table.join(
    awful.key({ modkey, "Shift" }, "h",
    function ()
        term_scratch:toggle()
    end ),
Documentation page that I didn't understand: https://blingcorp.github.io/bling/#/module/scratch How should I utilize the term_scratch:toggle() object/function? System: Arch linux, X11, awesome-wm, awesome-wm bling add on.
OutwardThinking (21 rep)
Feb 17, 2023, 07:30 PM • Last activity: Feb 21, 2023, 02:03 AM
5 votes
1 answers
1446 views
How to use neovim configuration systemwide
I am trying to make sure that my `neovim` configuration gets used for all users. Basically I want my `neovim` configuration at `~/.config/nvim` to be used on using the `nvim` command with `sudo`. Hence I copied `~/.config/nvim` to `/etc/xdg/nvim`. The problem is that I am using `astronvim` and it us...
I am trying to make sure that my neovim configuration gets used for all users. Basically I want my neovim configuration at ~/.config/nvim to be used on using the nvim command with sudo. Hence I copied ~/.config/nvim to /etc/xdg/nvim. The problem is that I am using astronvim and it uses an init.lua file and not init.vim. According to this I need a sysinit.vim file. Hence I created a sysinit.vim file but I am not sure about how I can import my Lua config file within sysinit.vim. How can make this happen?
Pranil Chitre (151 rep)
Feb 17, 2023, 05:01 AM • Last activity: Feb 17, 2023, 10:04 AM
0 votes
1 answers
67 views
Ubuntu package names which ends with "lua"
Searching through the Ubuntu package repositories (packages.ubuntu.com) i recently found packages which names ends with "lua" for example "Package: dnsmasq-base-lua" or "Package: weechat-lua". What are these packages?
Searching through the Ubuntu package repositories (packages.ubuntu.com) i recently found packages which names ends with "lua" for example "Package: dnsmasq-base-lua" or "Package: weechat-lua". What are these packages?
Arkadiusz (1 rep)
Aug 9, 2022, 12:34 PM • Last activity: Aug 9, 2022, 02:05 PM
10 votes
2 answers
4521 views
Conky - string formatting
I have conky the record: ${color lightblue} Down: ${downspeed wlan0} Up: ${upspeed wlan0} Conky prints link speed, but the text moves: Down: OB Up: OB Down: 60B Up: 60B Down: 148B Up: 148B Down: 1KiB Up: 1KiB Down: 1.8KiB Up: 1.8KiB Down: 1.08KiB Up: 1.08KiB Down: 31.8KiB Up: 31.8KiB Based on this t...
I have conky the record: ${color lightblue} Down: ${downspeed wlan0} Up: ${upspeed wlan0} Conky prints link speed, but the text moves: Down: OB Up: OB Down: 60B Up: 60B Down: 148B Up: 148B Down: 1KiB Up: 1KiB Down: 1.8KiB Up: 1.8KiB Down: 1.08KiB Up: 1.08KiB Down: 31.8KiB Up: 31.8KiB Based on this topic https://unix.stackexchange.com/questions/57789/creating-conky-text-variables-with-zero-padding I tried to format the output, but the text still moves. ${color lightblue} Down: ${lua_parse format %7s ${downspeed wlan0}} Up: ${lua_parse format %7s ${upspeed wlan0}} I want the printed output conky: Down: 0B Up: 0B Down: 60B Up: 60B Down: 148B Up: 148B Down: 1KiB Up: 1KiB Down: 1.8KiB Up: 1.8KiB Down: 1.08KiB Up: 1.08KiB Down: 31.8KiB Up: 31.8KiB
nowy1 (651 rep)
Jan 29, 2013, 11:20 AM • Last activity: Mar 10, 2022, 12:56 AM
1 votes
2 answers
532 views
How can I remove multi-line (Lua) comments in a bash script?
I'm writing a bash script where I need to strip comments from Lua files, which are formatted: ```lua --like this foo="bar" --or like this --[[ or like this ]] --[[ or like this ]] ``` I know I can use `sed 's/--.*$//' ${my_file}` to remove the single-line comments, but how can I address the multi-li...
I'm writing a bash script where I need to strip comments from Lua files, which are formatted:
--like this

foo="bar" --or like this

--[[ or like this ]]

--[[
    or
    like
    this
]]
I know I can use sed 's/--.*$//' ${my_file} to remove the single-line comments, but how can I address the multi-line one? Thanks!
ridgek (25 rep)
Nov 25, 2021, 10:07 AM • Last activity: Nov 25, 2021, 10:43 AM
0 votes
0 answers
626 views
Luci fails to start, openwrt_s905x3_k5.4.158_2021.11.12.1717
Fresh install of OpenWRT 21.02.1 on an X96 Air Android TV box. OpenWRT running on USB stick. Accessing the web interface gives a Bad Gateway error. Running `/www/cgi-bin-luci` over ssh results in the following: ```none root@OpenWrt:~# /www/cgi-bin/luci /usr/bin/lua: /www/cgi-bin/luci:4: attempt to i...
Fresh install of OpenWRT 21.02.1 on an X96 Air Android TV box. OpenWRT running on USB stick. Accessing the web interface gives a Bad Gateway error. Running /www/cgi-bin-luci over ssh results in the following:
root@OpenWrt:~# /www/cgi-bin/luci
/usr/bin/lua: /www/cgi-bin/luci:4: attempt to index field 'dispatcher' (a nil value)
stack traceback:
        /www/cgi-bin/luci:4: in main chunk
The luci script is simply:
root@OpenWrt:~# cat /www/cgi-bin/luci
#!/usr/bin/lua
require "luci.cacheloader"
require "luci.sgi.cgi"
luci.dispatcher.indexcache = "/tmp/luci-indexcache"
luci.sgi.cgi.run()
---------- I've tried creating an empty directory /tmp/luci-indexcache with no difference to the result. Deleting it again also makes no difference. I suspect there may be an issue with luci.cacheloader, but I don't know where to find it, or whether it is text or binary. I have *no* Lua experience. Googling doesn't return anything that looks like a solution. Is anyone able to help me out please?
Marty McSly (1 rep)
Nov 15, 2021, 01:20 AM • Last activity: Nov 15, 2021, 09:36 AM
2 votes
1 answers
464 views
Making Bash send this error to std error
While writing some Lua as a backend for my LuaTeX code I noticed the following. For background, here is the Lua code. This version is standard Lua. But you don't really need to understand Lua to understand what the function is doing. I needed a function that would return both standard output and err...
While writing some Lua as a backend for my LuaTeX code I noticed the following. For background, here is the Lua code. This version is standard Lua. But you don't really need to understand Lua to understand what the function is doing. I needed a function that would return both standard output and error to Lua, and hence to TeX. Since Lua doesn't have a library function that does this, I had to roll one myself. This version writes standard output to a file, and redirects standard error to standard output. Then it reads them both and returns them. This isn't particularly pretty, but better alternatives are not obvious. local function exec_cmd(command, stdout_message, stderr_message) local filename=os.tmpname() local cmd = string.format(command .. " 2>&1 1> %s", filename) local pipe = io.popen(cmd) local stderr = pipe:read("*all") pipe:close() local f = assert(io.open(filename, "r")) local stdout = f:read("*all") f:close() os.remove (filename) if stdout ~= nil and stdout ~= '' then print(string.format(stdout_message, stdout)) end if stderr ~= nil and stderr ~= '' then error(string.format(stderr_message, stderr)) end end Today, while in a state of momentary confusion, I wrote the following code as the argument command to the function above. "wkhtmltopdf searchpath(foo.html) foo.pdf" In terms of the Lua function given above, this would be something like exec_cmd("wkhtmltopdf searchpath(foo.html) foo.pdf", "STDOUT FROM WKHTMLTOPDF is %s", "STDERR FROM WKHTMLTOPDF IS %s") So this command gets passed to the shell as: wkhtmltopdf searchpath(foo.html) foo.pdf 2>&1 1> /tmp/lua_vyOiay for some suitable temporary file e.g. /tmp/lua_vyOiay. This gives the error, if typed directly on the shell (and forgetting about the Lua, which has served its explanatory purpose) > bash: syntax error near unexpected token `(' But the interesting thing about this is that this error doesn't appear to go to standard output. At least, the above command does not collect it, and I wasn't able to collect it any other way. So, in the interests of bullet-proofing my Lua function, here are my questions. 1. What is going on above with that nonsense command, and why isn't the error being sent to stderr? This is just for my information. 2. What can I do (if anything) to make sure that I collect the stderr string, and interrupt my TeX program as it should be interrupted? After further discussion, 2 could be accomplished in at least 2 ways. 2a. Since it seems that the Bash shell itself it giving that error, I'd need a way to trap the standard error of the Bash shell itself, within Bash. 2b. A Lua approach of getting at the standard error of the shell, which here is spawned by Lua.
Faheem Mitha (36008 rep)
Oct 14, 2021, 05:44 PM • Last activity: Oct 15, 2021, 03:56 PM
0 votes
1 answers
1409 views
How to use Conky variable with external command?
I'm trying to create a workaround for Conky's truncation of usernames with the `top user` function. Using `id -nu $uid`, I tried this: ${exec id -nu ${top uid \1}} which leads to "bad substitution" errors. Thinking that it may be because the top function is sending a string instead of an integer, I...
I'm trying to create a workaround for Conky's truncation of usernames with the top user function. Using id -nu $uid, I tried this: ${exec id -nu ${top uid \1}} which leads to "bad substitution" errors. Thinking that it may be because the top function is sending a string instead of an integer, I tried creating a lua function: function conky_uid_to_name(uid) num = tonumber(conky_parse(uid)) name = conky_parse('${exec id -nu ${num}}') return name end but this never works either as I can't get the parser to see my variable. How do I send a variable to the name variable to be properly parsed by Conky? I'm sure there's an easier way of doing this, but I'm not finding many lua examples and their docs are severely lacking.
ajgringo619 (3584 rep)
Aug 25, 2021, 06:23 PM • Last activity: Aug 27, 2021, 02:39 PM
1 votes
0 answers
104 views
What is the command in Awesome Window manager to let go of a key that has not been let go of?
My v key is locked up after I use the below snippet in my `rc.lua` file. ### Background Hotkey combinations are usually all pressed together at the same time. I am using the function key Fn which works as a key chain only because of the way it works with the firmware on my ThinkPad. Key chain means...
My v key is locked up after I use the below snippet in my rc.lua file. ### Background Hotkey combinations are usually all pressed together at the same time. I am using the function key Fn which works as a key chain only because of the way it works with the firmware on my ThinkPad. Key chain means you press the Fn key, release it, then press another key. In other words, key chain keys are not pressed together but sequentially, one after the other. ### Setup My Fn key is XF86WakeUp. The following below is part of my rc.lua -- open edit ".vimrc" awful.key({ "XF86WakeUp" }, "v", function () awful.util.spawn("termite -e 'nvim /home/Dropbox/.vimrc'") end, {description = "Edit .vimrc", group = "Code"}), This snippet works just fine; I press Fn, release it, then press v and vim opens. Just as intended. ### Problem After I have used this keychain, Awesome will not let go of the v key and every time after that when I press the v key, for whatever reason, vim opens. This is less than ideal. How to stop this behavior in Awesome?
Kes (909 rep)
Jul 18, 2021, 07:00 PM • Last activity: Aug 2, 2021, 05:17 PM
0 votes
1 answers
326 views
Override makefile precious variable
configure.ac has precious variables[1], which are supposed to be subbed-in when calling configure, e.g. configuring the location of the system Lua interpreter as a precious variable[2]: ``` configure.ac: ... dnl Make LUA a precious variable. AC_ARG_VAR([LUA], [The Lua interpreter, e.g. /usr/bin/lua5...
configure.ac has precious variables, which are supposed to be subbed-in when calling configure, e.g. configuring the location of the system Lua interpreter as a precious variable[2] :
configure.ac:
  ...
  dnl Make LUA a precious variable.
  AC_ARG_VAR([LUA], [The Lua interpreter, e.g. /usr/bin/lua5.1])
command line:

./configure LUA=lua-5.3.6/src/lua

OR

export LUA=lua-5.3.6/src/lua
./configure
However, I'd like to hard code the location of the Lua interpreter instead of having to ask users to add it as an environment variable every time. How can I hard code it into configure.ac? https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html
Donald (101 rep)
Jun 28, 2021, 01:11 AM • Last activity: Jun 28, 2021, 03:59 AM
0 votes
1 answers
1767 views
translating text in lua file
The thing is, I'm translating a game from English to Polish language. The text I'm trying to translate is in lua-files. I have most of the game translated, but I'm looking for a way to automatize replacing English text with Polish text. I have a few lua-files (which are very large), which contain co...
The thing is, I'm translating a game from English to Polish language. The text I'm trying to translate is in lua-files. I have most of the game translated, but I'm looking for a way to automatize replacing English text with Polish text. I have a few lua-files (which are very large), which contain code and text to translate, I have .txt files which contain sentences line-by-line in English language, which I want to have replaced in lua-files and I have same amount of other txt-files which contain sentences line-by-line (in the same order) in Polish language. I need help with a script which will take first line from english.txt, search for it in lua and, if found, replace it with first line from polish.txt, and then take 2nd line from english.txt, etc. I tried many applications, but none of them had this function. Someone advised me to use awk, grep or sed, but I didn't find out how to use them for my purpose. EDIT: Sorry. I forgot that the old files were .lua. Now it is .sjson
Jakub Grula (3 rep)
Nov 6, 2019, 07:34 PM • Last activity: May 12, 2021, 06:23 AM
0 votes
0 answers
340 views
Conky script not running after being converted
I am attempting to convert an older conky widget to the new syntax of 1.10+, but I can't for the life of me figure out why it won't run. I've ran through everything to make sure it was converted correctly but it still won't run the widget I want. Here is the code: ``` conky.config = { -- Conky setti...
I am attempting to convert an older conky widget to the new syntax of 1.10+, but I can't for the life of me figure out why it won't run. I've ran through everything to make sure it was converted correctly but it still won't run the widget I want. Here is the code:
conky.config = {
-- Conky settings
	background = false,
	update_interval = 1,

	cpu_avg_samples = 2,
	net_avg_samples = 2,

	override_utf8_locale = true,

	double_buffer = true,
	no_buffers = true,

	text_buffer_size = 2048,
		--imlib_cache_size = 0,

	temperature_unit = 'celsius',

-- With class override, gets images to display properly (black bg)
  own_window_argb_visual = true,
	own_window_argb_value = 0,

-- Window specifications
  own_window_class = override,
	own_window = true,
-- XFCE4 = desktop, sinon 'normal'
	own_window_type = 'normal',
	own_window_transparent = true,

-- XFCE4 - undecorate not working
	own_window_hints = 'sticky,skip_taskbar,skip_pager,below',

	border_inner_margin = 0,
	border_outer_margin = 0,

	minimum_width = 520,
    minimum_height = 600,
	maximum_width = 520,

	alignment = 'top_right',
	gap_x = 20,
	gap_y = 112,

-- Graphics settings #
	draw_shades = false,
	draw_outline = false,
	draw_borders = false,
	draw_graph_borders = false,

-- useless
	default_shade_color = 'red',
	default_outline_color = 'green',

-- Text settings #
	use_xft = true,
	override_utf8_locale = true,
    font = 'Play:normal:size=8',
	xftalpha = 0.9,
	uppercase = false,

-- TEXT color
	default_color = '333333',

    color0 = 'a992e6',
    color1 = '323232',

	lua_load = './rings-v2_gen.lua',
	lua_draw_hook_pre = 'conky_main',

    diskio_avg_samples = 2,
};

conky.text = [[
${voffset 12}${color1}${goto 106}${freq_g cpu0} Ghz${alignr 330}${hwmon 1 temp 1} °C
${voffset 16}${color1}${goto 106}${freq_g cpu0} Ghz${alignr 330}${acpitemp} °C

${voffset -3}${goto 120}${color1}CPU 1${alignr 330}${color1}${cpu cpu1}%
${voffset -3}${goto 120}${color1}CPU 2${alignr 330}${color1}${cpu cpu2}%
${voffset -3}${goto 120}${color1}CPU 3${alignr 330}${color1}${cpu cpu3}%
${voffset -3}${goto 120}${color1}CPU 4${alignr 330}${color1}${cpu cpu4}%
${voffset -3}${goto 120}${color1}CPU 5${alignr 330}${color1}${cpu cpu5}%
${voffset -3}${goto 120}${color1}CPU 6${alignr 330}${color1}${cpu cpu6}%
${goto 49}${voffset 12}${color1}${top name 1}${alignr 306}${top cpu 1}%
${goto 50}${color1}${top name 2}${alignr 306}${top cpu 2}%
${goto 50}${color1}${top name 3}${alignr 306}${top cpu 3}%
${font Michroma:size=10}${color0}${goto 80}${voffset 4}CPU

${voffset -130}${goto 378}${font}${color1}${top_io name 1}${alignr 30}${top_io io_write 1}%
${goto 378}${voffset -1}${color1}${top_io name 2}${alignr 30}${top_io io_write 2}%
${goto 378}${voffset -1}${color1}${top_io name 3}${alignr 30}${top_io io_write 3}%
${goto 370}${voffset 4}${color1}disk writes${alignr 30}${diskio_write}%
${goto 370}${color1}disk reads${alignr 30}${diskio_read}%
${font Michroma:size=10}${color0}${goto 418}${voffset 1}IO WAIT

${font Michroma:size=10}${color0}${goto 394}${voffset 59}MEMORY
${font}${goto 324}${voffset -4}${color1}${top_mem name 1}${alignr 40}${top_mem mem 1}%
${goto 324}${color1}${top_mem name 2}${alignr 40}${top_mem mem 2}%
${goto 324}${color1}${top_mem name 3}${alignr 40}${top_mem mem 3}%
${voffset 8}${goto 348}${color1}SWAP${alignr 40}${color1}${swap} / ${color1}${swapmax}
${voffset 1}${goto 348}${color1}RAM ${alignr 40}${color1}${mem} / ${color1}${memmax}

${goto 70}${voffset -81}/${color1}${alignr 310}${fs_used /} / ${fs_size /}
${goto 70}${voffset -1}/boot/efi${color1}${alignr 310}${fs_used /boot/efi} / ${fs_size /boot/efi}
${goto 70}${voffset -1}/mnt/nvme0n1p3${color1}${alignr 310}${fs_used /mnt/nvme0n1p3} / ${fs_size /mnt/nvme0n1p3}
${font Michroma:size=10}${color0}${goto 68}${voffset 8}FILESYSTEM

${font Michroma:size=10}${color0}${voffset 26}${goto 324}INTERNET INFO
${font}${color1}${alignr 54}${voffset -8}WiFi     ${color1}${wireless_essid wlan0}
${goto 298}${voffset 2}Up${goto 370}${color1}${totalup wlan0} / ${color1}${upspeed wlan0}
${goto 298}${color1}Down${goto 370}${color1}${totaldown wlan0} / ${color1}${downspeed wlan0}
${goto 300}${voffset 4}Local IP${goto 370}${addr wlan0}
${goto 300}${voffset 0}Public IP${goto 370}${execi 3600 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}
${voffset -24}

${font Michroma:size=10}${alignr 300}${voffset -50}${color0}${time %a} ${color0}${time %x}
${font Michroma:size=18}${alignr 318}${color1}${voffset -4}${time %H}:${time %M}

${font Michroma:bold:size=11}${color0}${voffset 90}${alignc}${execi 3600 awk -F '=' '/PRETTY_NAME/ { print $2 }' /etc/os-release | tr -d '"'}
]];
As well as the rings-v2_gen.lua file which the widget calls
--[[
Ring Meters by londonali1010 (2009)
Modified by La-Manoue (2016)
Automation template by popi (2017)

This script draws percentage meters as rings. It is fully customisable; all options are described in the script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
	lua_load ~/conky/rings-v2_local.lua
	lua_draw_hook_pre ring_stats
	
Changelog:
+ v2.1.1 -- addedd IO_WAIT ring
+ v2.1.0 -- templated for automation, 
+ v2.0.0 -- Changed some values for ArchLinux
+ v1.2.2 -- Added color change for near-limits values / modified placement
+ v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)

]]

normal="0xbb07d7"
warn="0xff7200"
crit="0xff000d"

-- seulement quand fond nécessaire
corner_r=35
bg_colour=0x3b3b3b
bg_alpha=0.2

-- blue     | 0xbb07d7
-- red      | 0xff1d2b
-- green    | 0x1dff22
-- pink     | 0xff1d9f
-- orange   | 0xff8523
-- skyblue  | 0x008cff
-- darkgray | 0x323232

settings_table_io = {
    {
        name='top_io io_perc 1',
        arg='',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.8,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=370, y=98,
        radius=55,
        thickness=12,
        start_angle=120,
        end_angle=360
    },
    {
        name='top_io io_perc 2',
        arg='',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.6,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=370, y=98,
        radius=42,
        thickness=11,
        start_angle=120,
        end_angle=360
    },
    {
        name='top_io io_perc 3',
        arg='',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.4,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=370, y=98,
        radius=30,
        thickness=10,
        start_angle=120,
        end_angle=360
    }
}

settings_table = {
    {
        name='hwmon',
        arg='1 temp 1',
        max=110,
        bg_colour=0x3b3b3b,
        bg_alpha=0.8,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=97,
        thickness=4,
        start_angle=0,
        end_angle=240
    },

    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.7,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=88,
        thickness=10,
        start_angle=0,
        end_angle=240
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.633333333333,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=77,
        thickness=9.5,
        start_angle=0,
        end_angle=240
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.566666666667,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=66.5,
        thickness=9.0,
        start_angle=0,
        end_angle=240
    },
    {
        name='cpu',
        arg='cpu4',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.5,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=56.5,
        thickness=8.5,
        start_angle=0,
        end_angle=240
    },
    {
        name='cpu',
        arg='cpu5',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.433333333333,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=47.0,
        thickness=8.0,
        start_angle=0,
        end_angle=240
    },
    {
        name='cpu',
        arg='cpu6',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.366666666667,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=200, y=120,
        radius=38.0,
        thickness=7.5,
        start_angle=0,
        end_angle=240
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.8,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=340, y=234,
        radius=60,
        thickness=15,
        start_angle=180,
        end_angle=420
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.4,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=340, y=234,
        radius=45,
        thickness=12,
        start_angle=180,
        end_angle=420
    },

    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.8,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=220, y=280,
        radius=40,
        thickness=10,
        start_angle=0,
        end_angle=240
    },
    {
        name='fs_used_perc',
        arg='/boot/efi',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.6,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=220, y=280,
        radius=29,
        thickness=9,
        start_angle=0,
        end_angle=240
    },
    {
        name='fs_used_perc',
        arg='/mnt/nvme0n1p3',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.4,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=220, y=280,
        radius=19,
        thickness=8,
        start_angle=0,
        end_angle=240
    },

    {
        name='downspeedf',
        arg='wlan0',
        max=125000,
        bg_colour=0x3b3b3b,
        bg_alpha=0.8,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=290, y=345,
        radius=30,
        thickness=12,
        start_angle=180,
        end_angle=420
    },
    {
        name='upspeedf',
        arg='wlan0',
        max=125000,
        bg_colour=0x3b3b3b,
        bg_alpha=0.6,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=290, y=345,
        radius=17,
        thickness=11,
        start_angle=180,
        end_angle=420
    },
    {
        name='time',
        arg='%H',
        max=24,
        bg_colour=0x3b3b3b,
        bg_alpha=0.4,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=230, y=406,
        radius=10,
        thickness=6,
        start_angle=0,
        end_angle=240
    },
    {
        name='time',
        arg='%M',
        max=60,
        bg_colour=0x3b3b3b,
        bg_alpha=0.6,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=230, y=406,
        radius=19,
        thickness=9,
        start_angle=0,
        end_angle=240
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0x3b3b3b,
        bg_alpha=0.8,
        fg_colour=0xbb07d7,
        fg_alpha=0.8,
        x=230, y=406,
        radius=31,
        thickness=12,
        start_angle=0,
        end_angle=240
    },
--{{ BATTERY }}
    {
        name='kernel', --just to avoid unknown viariable '$' in console
        arg='',
        max=100,
        bg_colour=0x3b3b3b,
        bg_alpha=0.6,
        fg_colour=0xbb07d7,
        fg_alpha=0.6,
        x=274, y=464,
        radius=5,
        thickness=13,
        start_angle=0,
        end_angle=360
    },
}

require 'cairo'

function rgb_to_r_g_b(colour,alpha)
	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)

	local w,h=conky_window.width,conky_window.height
	
	local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
	local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

	local angle_0=sa*(2*math.pi/360)-math.pi/2
	local angle_f=ea*(2*math.pi/360)-math.pi/2
	local t_arc=t*(angle_f-angle_0)

	-- Draw background ring

	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
	cairo_set_line_width(cr,ring_w)
	cairo_stroke(cr)
	
	-- Draw indicator ring

	cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
	cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
	cairo_stroke(cr)		
end

function conky_ring_stats()
    -- 20170715 IO_WAIT
	local function setup_rings_io(cr,pt)
		local str=''
		local value=0
		
        local warn_value=50
        local crit_value=70

		str=string.format('${%s %s}',pt['name'],pt['arg'])
        iowait=0
        ioused=tonumber(conky_parse(str))
        if ioused>0 then 
            iowait=100 - ioused
        end
		value=tonumber(iowait)

		if value == nil then value = 0 end
		pct=value/pt['max']
		draw_ring(cr,pct,pt)
	end

	local function setup_rings(cr,pt)
		local str=''
		local value=0
		
		str=string.format('${%s %s}',pt['name'],pt['arg'])
		str=conky_parse(str)
		
		value=tonumber(str)
		if value == nil then value = 0 end
		pct=value/pt['max']
		
		draw_ring(cr,pct,pt)
	end

	if conky_window==nil then return end
	local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
	
	local cr=cairo_create(cs)	
	
	local updates=conky_parse('${updates}')
	update_num=tonumber(updates)

	if update_num>5 then
	    for i in pairs(settings_table) do
                display_temp=temp_watch()
		setup_rings(cr,settings_table[i])
	    end
        -- IO_WAIT
	    for i in pairs(settings_table_io) do
		setup_rings_io(cr,settings_table_io[i])
        end
	end
   cairo_surface_destroy(cs)
  cairo_destroy(cr)
end

-- Contrôle de l'espace disque
function disk_watch()

    warn_disk=93
    crit_disk=98
    -- poser une boucle plus tard... pas simple

    disk=tonumber(conky_parse("${fs_used_perc /}"))
    if diskwarn_value then
        settings_table[index]['fg_colour']=normal
    elseif battery>crit_value then
        settings_table[index]['fg_colour']=warn
    else
        settings_table[index]['fg_colour']=crit
    end
end

-- Contrôle de l'interface active
-- choice to not probe network interface once conky is running. 
-- just call again create_conky.py to update if gateway interface has changed
--function iface_watch()
--
--    iface=conky_parse("${if_existing /proc/net/route enp1s0f2}enp1s0f2${else}wlan0${endif}")
--
--    settings_table['arg']=iface
--    settings_table['arg']=iface
--end

function conky_draw_bg()
    if conky_window==nil then return end
    local w=conky_window.width
    local h=conky_window.height
    local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    cr=cairo_create(cs)
    
    cairo_move_to(cr,corner_r,0)
    cairo_line_to(cr,w-corner_r,0)
    cairo_curve_to(cr,w,0,w,0,w,corner_r)
    cairo_line_to(cr,w,h-corner_r)
    cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    cairo_line_to(cr,corner_r,h)
    cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
    cairo_line_to(cr,0,corner_r)
    cairo_curve_to(cr,0,0,0,0,corner_r,0)
    cairo_close_path(cr)
    
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
    cairo_fill(cr)
end


function conky_main()
    temp_watch()
    disk_watch()
    --iface_watch()
	-- if a battery is found
    --{{ BATTERY_ACTIVATE }}
    conky_ring_stats()
-- quand fond nécessaire
--    conky_draw_bg()
end
What do I need to edit to make this run properly?
FireballFoxtrot (1 rep)
Jan 19, 2021, 05:08 AM
0 votes
1 answers
314 views
How to set a toggle keybinding in Awesome's rc.lua
I'm running AwesomeWM on top of Ubuntu 20.04. I'd like to set a shortcut to disable the trackpad. My computer comes with built-in functionality to do that, but I'd like to change it from what it currently is. The current keybinding is set to F10. I've determined via `xmodmap` that the keycode is 76,...
I'm running AwesomeWM on top of Ubuntu 20.04. I'd like to set a shortcut to disable the trackpad. My computer comes with built-in functionality to do that, but I'd like to change it from what it currently is. The current keybinding is set to F10. I've determined via xmodmap that the keycode is 76, and that the functionality of the button (based on my understanding of xmodmap) is XF86Switch_VT_10 (or, more specifically, F10 F10 F10 F10 F10 F10 XF86Switch_VT_10 F10 F10 XF86Switch_VT_10, even though that seems insane and I don't know why it's like that). I've discovered that the way to toggle the trackpad from the command line is via xinput set-prop "Device Enabled" 0. So I know that I need to create some fuction in the rc.lua that looks something along the lines of awful.key({}, "", function() awful.util.spawn("") end. I just don't know precisely what to put there. Can someone please help me out on this?
Yehuda (331 rep)
Nov 11, 2020, 11:41 PM • Last activity: Jan 15, 2021, 01:33 PM
0 votes
2 answers
2172 views
Awesome WM - Launch a terminal based app with a shortcut
What I want is to have a shortcut to initiate things like vifm, cmus, htop etc. These apps require being initiate from a terminal. I know for create a shortcut in Awesome WM I should: awful.key({ modkey }, "my_hotkey", function () awful.util.spawn(...here goes the app) end, {description = "the_descr...
What I want is to have a shortcut to initiate things like vifm, cmus, htop etc. These apps require being initiate from a terminal. I know for create a shortcut in Awesome WM I should: awful.key({ modkey }, "my_hotkey", function () awful.util.spawn(...here goes the app) end, {description = "the_description", group = "my custom group"}), But I can't simply put there: awful.util.spawn("vifm") I doesn't work. So how could I make a shortcut that initiates let's say vifm, taking in consideration this code have to run a terminal first and then inside that terminal launch "vifm". Also, is there a more efficient way to do this? I mean maybe initiating directly vifm instead of having to rely on running first a terminal? PD: My shell is bash, my terminal is Konsole.
GhostOrder (181 rep)
Aug 6, 2020, 09:29 PM • Last activity: Sep 6, 2020, 05:35 AM
Showing page 1 of 20 total questions