Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tehaming #9

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions config/apps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ return {
},
-- List of apps to start once on start-up
run_on_start_up = {
'telegram-desktop',
'signal-desktop',
-- 'compton --config ' .. filesystem.get_configuration_dir() .. '/configuration/compton.conf',
'nm-applet --indicator', -- wifi
'pa-applet', -- shows an audiocontrol applet in systray when installed.
Expand All @@ -33,12 +35,15 @@ return {
-- 'scream -u -p 4011 -i virbr1', -- scream audio sink
'numlock on', -- enable numlock
'feh --randomize --bg-fill ~/.wallpapers/*',
-- '/usr/bin/variety', <-- mayby turn it on again
'/usr/bin/variety', --<-- mayby turn it on again
'kdeconnect-app',
-- 'echo keepassMasterPassword | keepassxc --pw-stdin ~/.config/.kp/Passwords.kdbx',
'gnome-keyring-query get keepass | keepassxc --pw-stdin ~/.config/.kp/Passwords.kdbx',

-- '/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager
--KDE '/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager
-- KDE '/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager
-- MATE'/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager
-- 'flameshot',
'flameshot',
-- 'synology-drive -minimized',
-- 'steam -silent',
-- 'telegram-desktop',
Expand Down
4 changes: 2 additions & 2 deletions config/keys/bindings/hotkeys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ local hotkeys = awful.util.table.join(
end,
{description = 'next background', group = group}
)
)
)

return hotkeys
2 changes: 1 addition & 1 deletion config/tags/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local gears = require('gears')
local beautiful = require('beautiful')
local defaultApp = require('config.apps')

local icons = require('theme.icons')
local icons = require('themes.icons')

_G.screens = {1}
-- checks if there are as many screens as I want to have.
Expand Down
3 changes: 3 additions & 0 deletions lain/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lain.wiki"]
path = wiki
url = https://github.com/lcpz/lain.wiki.git
33 changes: 33 additions & 0 deletions lain/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Please, read me!

So that I can help you quickly and without having to redirect you here.

# If you have an issue

**Please read the [wiki](https://github.com/lcpz/lain/wiki) and search the [Issues section](https://github.com/lcpz/lain/issues) first.**

If you can't find a solution there, then go ahead and provide:

* output of `awesome -v` and `lua -v`
* expected behavior and actual behavior
* steps to reproduce the problem
* X error log

# How to provide X error log

There are two ways:

* (Physically) Restart X like this:
```shell
startx -- -keeptty -nolisten tcp > $HOME/.xorg.log 2>&1
```
the error log will be output into `$HOME/.xorg.log`.

* (Virtually) Use [Xephyr](https://wikipedia.org/wiki/Xephyr):
```shell
# set screen size as you like
Xephyr :1 -screen 1280x800 2> stdout.txt & DISPLAY=:1 awesome
```
the error log will be output in the file `stdout.txt`.

Before reporting, read the log and see if you can solve it yourself.
339 changes: 339 additions & 0 deletions lain/LICENSE

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions lain/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Lain
====

-------------------------------------------------
Layouts, widgets and utilities for Awesome WM 4.x
-------------------------------------------------

:Author: Luca CPZ
:Version: git
:License: GNU-GPL2_
:Source: https://github.com/lcpz/lain

Description
-----------

Successor of awesome-vain_, this module provides alternative layouts, asynchronous widgets and utility functions for Awesome_. Read the wiki_ for all the info.

Contributions
-------------

Constructive criticism and suggestions are welcome.

If you want to create a pull request, make sure that:

- Your code fits with the general style of the module. In particular, you should use the same indentation pattern that the code uses, and also avoid adding space at the ends of lines.

- Your code its easy to understand, maintainable, and modularized. You should also avoid code duplication wherever possible by adding functions to or using lain.helpers_. If something is unclear, or you can't write it in such a way that it will be clear, explain it with a comment.

- You test your changes before submitting to make sure that you code works and does not break other parts of the module.

- You eventually update ``wiki`` submodule with a thorough section.

Contributed widgets have to be put in ``widget/contrib``.

.. _GNU-GPL2: http://www.gnu.org/licenses/gpl-2.0.html
.. _awesome-vain: https://github.com/vain/awesome-vain
.. _Awesome: https://github.com/awesomeWM/awesome
.. _wiki: https://github.com/lcpz/lain/wiki
.. _lain.helpers: https://github.com/lcpz/lain/blob/master/helpers.lua
203 changes: 203 additions & 0 deletions lain/helpers.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
--[[

Licensed under GNU General Public License v2
* (c) 2013, Luca CPZ

--]]

local spawn = require("awful.spawn")
local timer = require("gears.timer")
local debug = require("debug")
local io = { lines = io.lines,
open = io.open }
local pairs = pairs
local rawget = rawget
local table = { sort = table.sort }

-- Lain helper functions for internal use
-- lain.helpers
local helpers = {}

helpers.lain_dir = debug.getinfo(1, 'S').source:match[[^@(.*/).*$]]
helpers.icons_dir = helpers.lain_dir .. 'icons/'
helpers.scripts_dir = helpers.lain_dir .. 'scripts/'

-- {{{ Modules loader

function helpers.wrequire(table, key)
local module = rawget(table, key)
return module or require(table._NAME .. '.' .. key)
end

-- }}}

-- {{{ File operations

-- check if the file exists and is readable
function helpers.file_exists(path)
local file = io.open(path, "rb")
if file then file:close() end
return file ~= nil
end

-- get a table with all lines from a file
function helpers.lines_from(path)
local lines = {}
for line in io.lines(path) do
lines[#lines + 1] = line
end
return lines
end

-- get a table with all lines from a file matching regexp
function helpers.lines_match(regexp, path)
local lines = {}
for line in io.lines(path) do
if string.match(line, regexp) then
lines[#lines + 1] = line
end
end
return lines
end

-- get first line of a file
function helpers.first_line(path)
local file, first = io.open(path, "rb"), nil
if file then
first = file:read("*l")
file:close()
end
return first
end

-- get first non empty line from a file
function helpers.first_nonempty_line(path)
for line in io.lines(path) do
if #line then return line end
end
return nil
end

-- }}}

-- {{{ Timer maker

helpers.timer_table = {}

function helpers.newtimer(name, timeout, fun, nostart, stoppable)
if not name or #name == 0 then return end
name = (stoppable and name) or timeout
if not helpers.timer_table[name] then
helpers.timer_table[name] = timer({ timeout = timeout })
helpers.timer_table[name]:start()
end
helpers.timer_table[name]:connect_signal("timeout", fun)
if not nostart then
helpers.timer_table[name]:emit_signal("timeout")
end
return stoppable and helpers.timer_table[name]
end

-- }}}

-- {{{ Pipe operations

-- run a command and execute a function on its output (asynchronous pipe)
-- @param cmd the input command
-- @param callback function to execute on cmd output
-- @return cmd PID
function helpers.async(cmd, callback)
return spawn.easy_async(cmd,
function (stdout, stderr, reason, exit_code)
callback(stdout, exit_code)
end)
end

-- like above, but call spawn.easy_async with a shell
function helpers.async_with_shell(cmd, callback)
return spawn.easy_async_with_shell(cmd,
function (stdout, stderr, reason, exit_code)
callback(stdout, exit_code)
end)
end

-- run a command and execute a function on its output line by line
function helpers.line_callback(cmd, callback)
return spawn.with_line_callback(cmd, {
stdout = function (line)
callback(line)
end,
})
end

-- }}}

-- {{{ A map utility

helpers.map_table = {}

function helpers.set_map(element, value)
helpers.map_table[element] = value
end

function helpers.get_map(element)
return helpers.map_table[element]
end

-- }}}

-- {{{ Misc

-- check if an element exist on a table
function helpers.element_in_table(element, tbl)
for _, i in pairs(tbl) do
if i == element then
return true
end
end
return false
end

-- iterate over table of records sorted by keys
function helpers.spairs(t)
-- collect the keys
local keys = {}
for k in pairs(t) do keys[#keys+1] = k end

table.sort(keys)

-- return the iterator function
local i = 0
return function()
i = i + 1
if keys[i] then
return keys[i], t[keys[i]]
end
end
end

-- create the partition of singletons of a given set
-- example: the trivial partition set of {a, b, c}, is {{a}, {b}, {c}}
function helpers.trivial_partition_set(set)
local ss = {}
for _,e in pairs(set) do
ss[#ss+1] = {e}
end
return ss
end

-- creates the powerset of a given set
function helpers.powerset(s)
if not s then return {} end
local t = {{}}
for i = 1, #s do
for j = 1, #t do
t[#t+1] = {s[i],unpack(t[j])}
end
end
return t
end

-- }}}

return helpers
Binary file added lain/icons/cal/white/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/31.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lain/icons/cal/white/4.png
Binary file added lain/icons/cal/white/5.png
Binary file added lain/icons/cal/white/6.png
Binary file added lain/icons/cal/white/7.png
Binary file added lain/icons/cal/white/8.png
Binary file added lain/icons/cal/white/9.png
Binary file added lain/icons/layout/default/cascade.png
Binary file added lain/icons/layout/default/cascadetile.png
Binary file added lain/icons/layout/default/cascadetilew.png
Binary file added lain/icons/layout/default/cascadew.png
Binary file added lain/icons/layout/default/centerfair.png
Binary file added lain/icons/layout/default/centerfairw.png
Binary file added lain/icons/layout/default/centerwork.png
Binary file added lain/icons/layout/default/centerworkh.png
Binary file added lain/icons/layout/default/centerworkhw.png
Binary file added lain/icons/layout/default/centerworkw.png
Binary file added lain/icons/layout/default/termfair.png
Binary file added lain/icons/layout/default/termfairw.png
Binary file added lain/icons/layout/zenburn/cascade.png
Binary file added lain/icons/layout/zenburn/cascadetile.png
Binary file added lain/icons/layout/zenburn/centerfair.png
Binary file added lain/icons/layout/zenburn/centerwork.png
Binary file added lain/icons/layout/zenburn/centerworkh.png
Binary file added lain/icons/layout/zenburn/termfair.png
Binary file added lain/icons/mail.png
Binary file added lain/icons/no_net.png
Binary file added lain/icons/openweathermap/01d.png
Binary file added lain/icons/openweathermap/01n.png
Binary file added lain/icons/openweathermap/02d.png
Binary file added lain/icons/openweathermap/02n.png
Binary file added lain/icons/openweathermap/03d.png
Binary file added lain/icons/openweathermap/03n.png
Binary file added lain/icons/openweathermap/04d.png
Binary file added lain/icons/openweathermap/04n.png
Binary file added lain/icons/openweathermap/09d.png
Binary file added lain/icons/openweathermap/09n.png
Binary file added lain/icons/openweathermap/10d.png
Binary file added lain/icons/openweathermap/10n.png
Binary file added lain/icons/openweathermap/11d.png
Binary file added lain/icons/openweathermap/11n.png
Binary file added lain/icons/openweathermap/13d.png
Binary file added lain/icons/openweathermap/13n.png
Binary file added lain/icons/openweathermap/50d.png
Binary file added lain/icons/openweathermap/50n.png
3 changes: 3 additions & 0 deletions lain/icons/openweathermap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Plain Weather Icons](http://merlinthered.deviantart.com/art/plain-weather-icons-157162192), created by [MerlinTheRed](http://merlinthered.deviantart.com/).

<a href="http://creativecommons.org/licenses/by-nc-sa/2.5/"><img src="http://i.creativecommons.org/l/by-nc-sa/2.5/80x15.png" align="right"></a>
Binary file added lain/icons/openweathermap/na.png
Binary file added lain/icons/taskwarrior.png
15 changes: 15 additions & 0 deletions lain/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--[[

Lain
Layouts, widgets and utilities for Awesome WM

Licensed under GNU General Public License v2
* (c) 2013, Luca CPZ

--]]

return {
layout = require("lain.layout"),
util = require("lain.util"),
widget = require("lain.widget")
}
27 changes: 27 additions & 0 deletions lain/lain-git.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package = "lain"
version = "git"
source = {
url = "https://github.com/lcpz/lain",
tag = "git"
}
description = {
summary = "Layout, widgets and utilities for Awesome WM",
detailed = [[
Successor of awesome-vain, this module provides alternative layouts, asynchronous widgets and utility functions for Awesome WM.

Dependencies: curl (for IMAP, MPD and weather widgets); Glib >= 2.54 (for filesystems widget).
]],
homepage = "https://github.com/lcpz/lain",
license = "GPL-2.0"
}
dependencies = {
"lua >= 5.1",
"awesome >= 4.0",
"Glib >= 2.54",
"curl"
}
supported_platforms = { "linux" }
build = {
type = "builtin",
modules = { lain = "init.lua" }
}
Loading