Skip to content

Instantly share code, notes, and snippets.

View ShadOoW's full-sized avatar
😁
Looking for something to code.

Younes El Alami ShadOoW

😁
Looking for something to code.
View GitHub Profile
-- Multimedia Keys
awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer sset Master unmute") awful.util.spawn("amixer set Master 9%+") end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer sset Master unmute") awful.util.spawn("amixer set Master 9%-") end),
awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer sset Master toggle") end),
awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("mocp --toggle-pause") end),
awful.key({ }, "XF86AudioStop", function () awful.util.spawn("mocp --toggle-pause") end),
awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("mocp --previous") end),
awful.key({ }, "XF86AudioNext", function () awful.util.spawn("mocp --next") end),
battery_icons = {'', '', '', '', ''}
-- Create a battery widgets
batterywidget = wibox.widget.textbox()
batterywidget:set_text(" Battery | ")
batterywidgettimer = timer({ timeout = 5 })
batterywidgettimer:connect_signal("timeout",
function()
fh = assert(io.popen("acpi | cut -d, -f 2 -", "r"))
local num = tonumber(string.sub(fh:read("*l"),1,-2))
function wifi_menu ()
local wifis = {}
local terms = {}
local connected = false
local connected_network = ""
local connected_network_index = -1
local fh = io.popen("netctl list")
# Maintainer: Oleg Shparber <trollixx+aur@gmail.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Sébastien Luttringer
# Contributor: xduugu
# Contributor: Ronald van Haren <ronald.archlinux.org>
# Contributor: Vesa Kaihlavirta
# URL: https://github.com/trollixx/aur-packages
# Upstream:
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/awesome
function bindKey(boundKey, boundPressAction, boundReleaseAction, boundTick, boundDelay)
--default values
boundPressAction = boundPressAction or function() end
boundReleaseAction = boundReleaseAction or function() end
boundTick = boundTick or 100
boundDelay = boundDelay or 300
--helper functions
--Note: couldn't use lua os.time os.clock to achieve this so i used io.popen(date... i'm not ashamed :D
function getSystemTime()
@ShadOoW
ShadOoW / helper.lua
Last active December 19, 2015 18:16
ihasit
--For debugging
local naughty = require("naughty")
helper = {
inTable = function(tbl, item)
for key, value in pairs(tbl) do
if value == item then return key end
end
return false
end,
@ShadOoW
ShadOoW / index.html
Last active May 24, 2018 09:41
Leaflet custom HTML/JS in popup (TextBox)
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Web Map</title>
<!-- reference to Leaflet CSS -->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />