-
---]]
-
-local helpers = require("lain.helpers")
-local shell = require("awful.util").shell
-local escape_f = require("awful.util").escape
-local focused = require("awful.screen").focused
-local naughty = require("naughty")
-local wibox = require("wibox")
-local os = os
-local string = string
-
--- MPD infos
--- lain.widget.mpd
-
-local function factory(args)
- local mpd = { widget = wibox.widget.textbox() }
- local args = args or {}
- local timeout = args.timeout or 2
- local password = (args.password and #args.password > 0 and string.format("password %s\\n", args.password)) or ""
- local host = args.host or os.getenv("MPD_HOST") or "127.0.0.1"
- local port = args.port or os.getenv("MPD_PORT") or "6600"
- local music_dir = args.music_dir or os.getenv("HOME") .. "/Music"
- local cover_pattern = args.cover_pattern or "*\\.(jpg|jpeg|png|gif)$"
- local cover_size = args.cover_size or 100
- local default_art = args.default_art
- local notify = args.notify or "on"
- local followtag = args.followtag or false
- local settings = args.settings or function() end
-
- local mpdh = string.format("telnet://%s:%s", host, port)
- local echo = string.format("printf \"%sstatus\\ncurrentsong\\nclose\\n\"", password)
- local cmd = string.format("%s | curl --connect-timeout 1 -fsm 3 %s", echo, mpdh)
-
- mpd_notification_preset = { title = "Now playing", timeout = 6 }
-
- helpers.set_map("current mpd track", nil)
-
- function mpd.update()
- helpers.async({ shell, "-c", cmd }, function(f)
- mpd_now = {
- random_mode = false,
- single_mode = false,
- repeat_mode = false,
- consume_mode = false,
- pls_pos = "N/A",
- pls_len = "N/A",
- state = "N/A",
- file = "N/A",
- name = "N/A",
- artist = "N/A",
- title = "N/A",
- album = "N/A",
- genre = "N/A",
- track = "N/A",
- date = "N/A",
- time = "N/A",
- elapsed = "N/A"
- }
-
- for line in string.gmatch(f, "[^\n]+") do
- for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do
- if k == "state" then mpd_now.state = v
- elseif k == "file" then mpd_now.file = v
- elseif k == "Name" then mpd_now.name = escape_f(v)
- elseif k == "Artist" then mpd_now.artist = escape_f(v)
- elseif k == "Title" then mpd_now.title = escape_f(v)
- elseif k == "Album" then mpd_now.album = escape_f(v)
- elseif k == "Genre" then mpd_now.genre = escape_f(v)
- elseif k == "Track" then mpd_now.track = escape_f(v)
- elseif k == "Date" then mpd_now.date = escape_f(v)
- elseif k == "Time" then mpd_now.time = v
- elseif k == "elapsed" then mpd_now.elapsed = string.match(v, "%d+")
- elseif k == "song" then mpd_now.pls_pos = v
- elseif k == "playlistlength" then mpd_now.pls_len = v
- elseif k == "repeat" then mpd_now.repeat_mode = v ~= "0"
- elseif k == "single" then mpd_now.single_mode = v ~= "0"
- elseif k == "random" then mpd_now.random_mode = v ~= "0"
- elseif k == "consume" then mpd_now.consume_mode = v ~= "0"
- end
- end
- end
-
- mpd_notification_preset.text = string.format("%s (%s) - %s\n%s", mpd_now.artist,
- mpd_now.album, mpd_now.date, mpd_now.title)
- widget = mpd.widget
- settings()
-
- if mpd_now.state == "play" then
- if notify == "on" and mpd_now.title ~= helpers.get_map("current mpd track") then
- helpers.set_map("current mpd track", mpd_now.title)
-
- if followtag then mpd_notification_preset.screen = focused() end
-
- local common = {
- preset = mpd_notification_preset,
- icon = default_art,
- icon_size = cover_size,
- replaces_id = mpd.id
- }
-
- if not string.match(mpd_now.file, "http.*://") then -- local file instead of http stream
- local path = string.format("%s/%s", music_dir, string.match(mpd_now.file, ".*/"))
- local cover = string.format("find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'",
- path:gsub("'", "'\\''"), cover_pattern)
- helpers.async({ shell, "-c", cover }, function(current_icon)
- common.icon = current_icon:gsub("\n", "")
- if #common.icon == 0 then common.icon = nil end
- mpd.id = naughty.notify(common).id
- end)
- else
- mpd.id = naughty.notify(common).id
- end
-
- end
- elseif mpd_now.state ~= "pause" then
- helpers.set_map("current mpd track", nil)
- end
- end)
- end
-
- mpd.timer = helpers.newtimer("mpd", timeout, mpd.update, true, true)
-
- return mpd
-end
-
-return factory
diff --git a/user/.config/awesome/lain/widget/net.lua b/user/.config/awesome/lain/widget/net.lua
deleted file mode 100755
index 805b5778f..000000000
--- a/user/.config/awesome/lain/widget/net.lua
+++ /dev/null
@@ -1,113 +0,0 @@
---[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luca CPZ
- * (c) 2010-2012, Peter Hofmann
-
---]]
-
-local helpers = require("lain.helpers")
-local naughty = require("naughty")
-local wibox = require("wibox")
-local string = string
-
--- Network infos
--- lain.widget.net
-
-local function factory(args)
- local net = { widget = wibox.widget.textbox(), devices = {} }
- local args = args or {}
- local timeout = args.timeout or 2
- local units = args.units or 1024 -- KB
- local notify = args.notify or "on"
- local wifi_state = args.wifi_state or "off"
- local eth_state = args.eth_state or "off"
- local screen = args.screen or 1
- local settings = args.settings or function() end
-
- -- Compatibility with old API where iface was a string corresponding to 1 interface
- net.iface = (args.iface and (type(args.iface) == "string" and {args.iface}) or
- (type(args.iface) == "table" and args.iface)) or {}
-
- function net.get_device()
- helpers.line_callback("ip link", function(line)
- net.iface[#net.iface + 1] = not string.match(line, "LOOPBACK") and string.match(line, "(%w+): <") or nil
- end)
- end
-
- if #net.iface == 0 then net.get_device() end
-
- function net.update()
- -- These are the totals over all specified interfaces
- net_now = {
- devices = {},
- -- Bytes since last iteration
- sent = 0,
- received = 0
- }
-
- for _, dev in ipairs(net.iface) do
- local dev_now = {}
- local dev_before = net.devices[dev] or { last_t = 0, last_r = 0 }
- local now_t = tonumber(helpers.first_line(string.format("/sys/class/net/%s/statistics/tx_bytes", dev)) or 0)
- local now_r = tonumber(helpers.first_line(string.format("/sys/class/net/%s/statistics/rx_bytes", dev)) or 0)
-
- dev_now.carrier = helpers.first_line(string.format("/sys/class/net/%s/carrier", dev)) or "0"
- dev_now.state = helpers.first_line(string.format("/sys/class/net/%s/operstate", dev)) or "down"
-
- dev_now.sent = (now_t - dev_before.last_t) / timeout / units
- dev_now.received = (now_r - dev_before.last_r) / timeout / units
-
- net_now.sent = net_now.sent + dev_now.sent
- net_now.received = net_now.received + dev_now.received
-
- dev_now.sent = string.format("%.1f", dev_now.sent)
- dev_now.received = string.format("%.1f", dev_now.received)
-
- dev_now.last_t = now_t
- dev_now.last_r = now_r
-
- if wifi_state == "on" and helpers.first_line(string.format("/sys/class/net/%s/uevent", dev)) == "DEVTYPE=wlan" and string.match(dev_now.carrier, "1") then
- dev_now.wifi = true
- dev_now.signal = tonumber(string.match(helpers.lines_from("/proc/net/wireless")[3], "(%-%d+%.)")) or nil
- end
-
- if eth_state == "on" and helpers.first_line(string.format("/sys/class/net/%s/uevent", dev)) ~= "DEVTYPE=wlan" and string.match(dev_now.carrier, "1") then
- dev_now.ethernet = true
- end
-
- net.devices[dev] = dev_now
-
- -- Notify only once when connection is lost
- if string.match(dev_now.carrier, "0") and notify == "on" and helpers.get_map(dev) then
- naughty.notify {
- title = dev,
- text = "No carrier",
- icon = helpers.icons_dir .. "no_net.png",
- screen = screen
- }
- helpers.set_map(dev, false)
- elseif string.match(dev_now.carrier, "1") then
- helpers.set_map(dev, true)
- end
-
- net_now.carrier = dev_now.carrier
- net_now.state = dev_now.state
- net_now.devices[dev] = dev_now
- -- net_now.sent and net_now.received will be
- -- the totals across all specified devices
- end
-
- net_now.sent = string.format("%.1f", net_now.sent)
- net_now.received = string.format("%.1f", net_now.received)
-
- widget = net.widget
- settings()
- end
-
- helpers.newtimer("network", timeout, net.update)
-
- return net
-end
-
-return factory
diff --git a/user/.config/awesome/lain/widget/pulse.lua b/user/.config/awesome/lain/widget/pulse.lua
deleted file mode 100755
index f63fe55c3..000000000
--- a/user/.config/awesome/lain/widget/pulse.lua
+++ /dev/null
@@ -1,57 +0,0 @@
---[[
-
- Licensed under GNU General Public License v2
- * (c) 2016, Luca CPZ
-
---]]
-
-local helpers = require("lain.helpers")
-local shell = require("awful.util").shell
-local wibox = require("wibox")
-local string = string
-local type = type
-
--- PulseAudio volume
--- lain.widget.pulse
-
-local function factory(args)
- local pulse = { widget = wibox.widget.textbox(), device = "N/A" }
- local args = args or {}
- local timeout = args.timeout or 5
- local settings = args.settings or function() end
-
- pulse.devicetype = args.devicetype or "sink"
- pulse.cmd = args.cmd or "pacmd list-" .. pulse.devicetype .. "s | sed -n -e '/*/,$!d' -e '/index/p' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'"
-
- function pulse.update()
- helpers.async({ shell, "-c", type(pulse.cmd) == "string" and pulse.cmd or pulse.cmd() },
- function(s)
- volume_now = {
- index = string.match(s, "index: (%S+)") or "N/A",
- device = string.match(s, "device.string = \"(%S+)\"") or "N/A",
- muted = string.match(s, "muted: (%S+)") or "N/A"
- }
-
- pulse.device = volume_now.index
-
- local ch = 1
- volume_now.channel = {}
- for v in string.gmatch(s, ":.-(%d+)%%") do
- volume_now.channel[ch] = v
- ch = ch + 1
- end
-
- volume_now.left = volume_now.channel[1] or "N/A"
- volume_now.right = volume_now.channel[2] or "N/A"
-
- widget = pulse.widget
- settings()
- end)
- end
-
- helpers.newtimer("pulse", timeout, pulse.update)
-
- return pulse
-end
-
-return factory
diff --git a/user/.config/awesome/lain/widget/pulsebar.lua b/user/.config/awesome/lain/widget/pulsebar.lua
deleted file mode 100755
index 317468f46..000000000
--- a/user/.config/awesome/lain/widget/pulsebar.lua
+++ /dev/null
@@ -1,162 +0,0 @@
---[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luca CPZ
- * (c) 2013, Rman
-
---]]
-
-local helpers = require("lain.helpers")
-local awful = require("awful")
-local naughty = require("naughty")
-local wibox = require("wibox")
-local math = math
-local string = string
-local type = type
-local tonumber = tonumber
-
--- PulseAudio volume bar
--- lain.widget.pulsebar
-
-local function factory(args)
- local pulsebar = {
- colors = {
- background = "#000000",
- mute = "#EB8F8F",
- unmute = "#A4CE8A"
- },
-
- _current_level = 0,
- _mute = "no",
- device = "N/A"
- }
-
- local args = args or {}
- local timeout = args.timeout or 5
- local settings = args.settings or function() end
- local width = args.width or 63
- local height = args.height or 1
- local margins = args.margins or 1
- local paddings = args.paddings or 1
- local ticks = args.ticks or false
- local ticks_size = args.ticks_size or 7
-
- pulsebar.colors = args.colors or pulsebar.colors
- pulsebar.followtag = args.followtag or false
- pulsebar.notification_preset = args.notification_preset
- pulsebar.devicetype = args.devicetype or "sink"
- pulsebar.cmd = args.cmd or "pacmd list-" .. pulsebar.devicetype .. "s | sed -n -e '/*/,$!d' -e '/index/p' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'"
-
- if not pulsebar.notification_preset then
- pulsebar.notification_preset = {
- font = "Monospace 10"
- }
- end
-
- pulsebar.bar = wibox.widget {
- color = pulsebar.colors.unmute,
- background_color = pulsebar.colors.background,
- forced_height = height,
- forced_width = width,
- margins = margins,
- paddings = paddings,
- ticks = ticks,
- ticks_size = ticks_size,
- widget = wibox.widget.progressbar,
- }
-
- pulsebar.tooltip = awful.tooltip({ objects = { pulsebar.bar } })
-
- function pulsebar.update(callback)
- helpers.async({ awful.util.shell, "-c", type(pulsebar.cmd) == "string" and pulsebar.cmd or pulsebar.cmd() },
- function(s)
- volume_now = {
- index = string.match(s, "index: (%S+)") or "N/A",
- device = string.match(s, "device.string = \"(%S+)\"") or "N/A",
- muted = string.match(s, "muted: (%S+)") or "N/A"
- }
-
- pulsebar.device = volume_now.index
-
- local ch = 1
- volume_now.channel = {}
- for v in string.gmatch(s, ":.-(%d+)%%") do
- volume_now.channel[ch] = v
- ch = ch + 1
- end
-
- volume_now.left = volume_now.channel[1] or "N/A"
- volume_now.right = volume_now.channel[2] or "N/A"
-
- local volu = volume_now.left
- local mute = volume_now.muted
-
- if volu:match("N/A") or mute:match("N/A") then return end
-
- if volu ~= pulsebar._current_level or mute ~= pulsebar._mute then
- pulsebar._current_level = tonumber(volu)
- pulsebar.bar:set_value(pulsebar._current_level / 100)
- if pulsebar._current_level == 0 or mute == "yes" then
- pulsebar._mute = mute
- pulsebar.tooltip:set_text ("[muted]")
- pulsebar.bar.color = pulsebar.colors.mute
- else
- pulsebar._mute = "no"
- pulsebar.tooltip:set_text(string.format("%s %s: %s", pulsebar.devicetype, pulsebar.device, volu))
- pulsebar.bar.color = pulsebar.colors.unmute
- end
-
- settings()
-
- if type(callback) == "function" then callback() end
- end
- end)
- end
-
- function pulsebar.notify()
- pulsebar.update(function()
- local preset = pulsebar.notification_preset
-
- preset.title = string.format("%s %s - %s%%", pulsebar.devicetype, pulsebar.device, pulsebar._current_level)
-
- if pulsebar._mute == "yes" then
- preset.title = preset.title .. " muted"
- end
-
- -- tot is the maximum number of ticks to display in the notification
- -- fallback: default horizontal wibox height
- local wib, tot = awful.screen.focused().mywibox, 20
-
- -- if we can grab mywibox, tot is defined as its height if
- -- horizontal, or width otherwise
- if wib then
- if wib.position == "left" or wib.position == "right" then
- tot = wib.width
- else
- tot = wib.height
- end
- end
-
- int = math.modf((pulsebar._current_level / 100) * tot)
- preset.text = string.format("[%s%s]", string.rep("|", int),
- string.rep(" ", tot - int))
-
- if pulsebar.followtag then preset.screen = awful.screen.focused() end
-
- if not pulsebar.notification then
- pulsebar.notification = naughty.notify {
- preset = preset,
- destroy = function() pulsebar.notification = nil end
- }
- else
- naughty.replace_text(pulsebar.notification, preset.title, preset.text)
- end
- end)
- end
-
- helpers.newtimer(string.format("pulsebar-%s", pulsebar.sink), timeout, pulsebar.update)
-
- return pulsebar
-end
-
-return factory
diff --git a/user/.config/awesome/lain/widget/sysload.lua b/user/.config/awesome/lain/widget/sysload.lua
deleted file mode 100755
index adf3e035b..000000000
--- a/user/.config/awesome/lain/widget/sysload.lua
+++ /dev/null
@@ -1,38 +0,0 @@
---[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luca CPZ
- * (c) 2010-2012, Peter Hofmann
-
---]]
-
-local helpers = require("lain.helpers")
-local wibox = require("wibox")
-local open, match = io.open, string.match
-
--- System load
--- lain.widget.sysload
-
-local function factory(args)
- local sysload = { widget = wibox.widget.textbox() }
- local args = args or {}
- local timeout = args.timeout or 2
- local settings = args.settings or function() end
-
- function sysload.update()
- local f = open("/proc/loadavg")
- local ret = f:read("*all")
- f:close()
-
- load_1, load_5, load_15 = match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
-
- widget = sysload.widget
- settings()
- end
-
- helpers.newtimer("sysload", timeout, sysload.update)
-
- return sysload
-end
-
-return factory
diff --git a/user/.config/awesome/lain/widget/temp.lua b/user/.config/awesome/lain/widget/temp.lua
deleted file mode 100755
index 3c93252b1..000000000
--- a/user/.config/awesome/lain/widget/temp.lua
+++ /dev/null
@@ -1,41 +0,0 @@
---[[
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luca CPZ
-
---]]
-
-local helpers = require("lain.helpers")
-local wibox = require("wibox")
-local open = io.open
-local tonumber = tonumber
-
--- coretemp
--- lain.widget.temp
-
-local function factory(args)
- local temp = { widget = wibox.widget.textbox() }
- local args = args or {}
- local timeout = args.timeout or 2
- local tempfile = args.tempfile or "/sys/class/thermal/thermal_zone0/temp"
- local settings = args.settings or function() end
-
- function temp.update()
- local f = open(tempfile)
- if f then
- coretemp_now = tonumber(f:read("*all")) / 1000
- f:close()
- else
- coretemp_now = "N/A"
- end
-
- widget = temp.widget
- settings()
- end
-
- helpers.newtimer("coretemp", timeout, temp.update)
-
- return temp
-end
-
-return factory
diff --git a/user/.config/awesome/lain/widget/weather.lua b/user/.config/awesome/lain/widget/weather.lua
deleted file mode 100755
index f35ca68b2..000000000
--- a/user/.config/awesome/lain/widget/weather.lua
+++ /dev/null
@@ -1,160 +0,0 @@
---[[
-
- Licensed under GNU General Public License v2
- * (c) 2015, Luca CPZ
-
---]]
-
-local helpers = require("lain.helpers")
-local json = require("lain.util").dkjson
-local focused = require("awful.screen").focused
-local naughty = require("naughty")
-local wibox = require("wibox")
-local math = math
-local os = os
-local string = string
-local tonumber = tonumber
-
--- OpenWeatherMap
--- current weather and X-days forecast
--- lain.widget.weather
-
-local function factory(args)
- local weather = { widget = wibox.widget.textbox() }
- local args = args or {}
- local APPID = args.APPID or "3e321f9414eaedbfab34983bda77a66e" -- lain's default
- local timeout = args.timeout or 60 * 15 -- 15 min
- local timeout_forecast = args.timeout or 60 * 60 * 24 -- 24 hrs
- local current_call = args.current_call or "curl -s 'http://api.openweathermap.org/data/2.5/weather?id=%s&units=%s&lang=%s&APPID=%s'"
- local forecast_call = args.forecast_call or "curl -s 'http://api.openweathermap.org/data/2.5/forecast/daily?id=%s&units=%s&lang=%s&cnt=%s&APPID=%s'"
- local city_id = args.city_id or 0 -- placeholder
- local units = args.units or "metric"
- local lang = args.lang or "en"
- local cnt = args.cnt or 5
- local date_cmd = args.date_cmd or "date -u -d @%d +'%%a %%d'"
- local icons_path = args.icons_path or helpers.icons_dir .. "openweathermap/"
- local notification_preset = args.notification_preset or {}
- local notification_text_fun = args.notification_text_fun or
- function (wn)
- local day = os.date("%a %d", wn["dt"])
- local tmin = math.floor(wn["temp"]["min"])
- local tmax = math.floor(wn["temp"]["max"])
- local desc = wn["weather"][1]["description"]
- return string.format("%s: %s, %d - %d ", day, desc, tmin, tmax)
- end
- local weather_na_markup = args.weather_na_markup or " N/A "
- local followtag = args.followtag or false
- local showpopup = args.showpopup or "on"
- local settings = args.settings or function() end
-
- weather.widget:set_markup(weather_na_markup)
- weather.icon_path = icons_path .. "na.png"
- weather.icon = wibox.widget.imagebox(weather.icon_path)
-
- function weather.show(t_out)
- weather.hide()
-
- if followtag then
- notification_preset.screen = focused()
- end
-
- if not weather.notification_text then
- weather.update()
- weather.forecast_update()
- end
-
- weather.notification = naughty.notify({
- text = weather.notification_text,
- icon = weather.icon_path,
- timeout = t_out,
- preset = notification_preset
- })
- end
-
- function weather.hide()
- if weather.notification then
- naughty.destroy(weather.notification)
- weather.notification = nil
- end
- end
-
- function weather.attach(obj)
- obj:connect_signal("mouse::enter", function()
- weather.show(0)
- end)
- obj:connect_signal("mouse::leave", function()
- weather.hide()
- end)
- end
-
- function weather.forecast_update()
- local cmd = string.format(forecast_call, city_id, units, lang, cnt, APPID)
- helpers.async(cmd, function(f)
- local pos, err
- weather_now, pos, err = json.decode(f, 1, nil)
-
- if not err and type(weather_now) == "table" and tonumber(weather_now["cod"]) == 200 then
- weather.notification_text = ""
- for i = 1, weather_now["cnt"] do
- weather.notification_text = weather.notification_text ..
- notification_text_fun(weather_now["list"][i])
- if i < weather_now["cnt"] then
- weather.notification_text = weather.notification_text .. "\n"
- end
- end
- end
- end)
- end
-
- function weather.update()
- local cmd = string.format(current_call, city_id, units, lang, APPID)
- helpers.async(cmd, function(f)
- local pos, err, icon
- weather_now, pos, err = json.decode(f, 1, nil)
-
- if not err and type(weather_now) == "table" and tonumber(weather_now["cod"]) == 200 then
- local sunrise = tonumber(weather_now["sys"]["sunrise"])
- local sunset = tonumber(weather_now["sys"]["sunset"])
- local icon = weather_now["weather"][1]["icon"]
- local loc_now = os.time() -- local time
- local loc_m = os.time { year = os.date("%Y"), month = os.date("%m"), day = os.date("%d"), hour = 0 } -- local time from midnight
- local loc_d = os.date("*t", loc_now) -- table YMDHMS for current local time (for TZ calculation)
- local utc_d = os.date("!*t", loc_now) -- table YMDHMS for current UTC time
- local utc_now = os.time(utc_d) -- UTC time now
- local offdt = (loc_d.isdst and 1 or 0) * 3600 + 100 * (loc_d.min - utc_d.min) / 60 -- DST offset
- local offset = os.difftime(loc_now, utc_now) + (loc_d.isdst and 1 or 0) * 3600 + 100 * (loc_d.min - utc_d.min) / 60 -- TZ offset (including DST)
- local offday = (offset < 0 and -86400) or 86400 -- 24 hour correction value (+86400 or -86400)
-
- -- if current UTC time is earlier then local midnight -> positive offset (negative otherwise)
- if offset * (loc_m - utc_now + offdt) > 0 then
- sunrise = sunrise + offday -- Shift sunset and sunrise times by 24 hours
- sunset = sunset + offday
- end
-
- if sunrise <= loc_now and loc_now <= sunset then
- icon = string.gsub(icon, "n", "d")
- else
- icon = string.gsub(icon, "d", "n")
- end
-
- weather.icon_path = icons_path .. icon .. ".png"
- widget = weather.widget
- settings()
- else
- weather.icon_path = icons_path .. "na.png"
- weather.widget:set_markup(weather_na_markup)
- end
-
- weather.icon:set_image(weather.icon_path)
- end)
- end
-
- if showpopup == "on" then weather.attach(weather.widget) end
-
- weather.timer = helpers.newtimer("weather-" .. city_id, timeout, weather.update, false, true)
- weather.timer_forecast = helpers.newtimer("weather_forecast-" .. city_id, timeout, weather.forecast_update, false, true)
-
- return weather
-end
-
-return factory
diff --git a/user/.config/awesome/lain/wiki/Home.md b/user/.config/awesome/lain/wiki/Home.md
deleted file mode 100755
index d098efe32..000000000
--- a/user/.config/awesome/lain/wiki/Home.md
+++ /dev/null
@@ -1,43 +0,0 @@
-Welcome to the Lain wiki!
-
-If you spot a typo or have a suggestion to improve these pages, please notify me opening an [issue](https://github.com/lcpz/lain/issues) format. Thank you.
-
-Dependencies
-------------
-
-Package | Requested by | Reasons of choice
---- | --- | ---
-[curl](https://curl.haxx.se) | `imap`, `mpd`, and `weather` widgets | 1. faster and simpler to use than [LuaSocket](https://github.com/diegonehab/luasocket); 2. it's in the core of almost every distro; 3. can be called [asynchronously](https://awesomewm.org/doc/api/libraries/awful.spawn.html#easy_async)
-GLib >= 2.54 | `fs` widget | Pure Awesome/Lua implementation.
-
-The second dependency will be removed once all major distros update their Gio/Glib versions.
-
-Installation
-------------
-
-### Arch Linux
-
-[AUR package](https://aur.archlinux.org/packages/lain-git/)
-
-### Other distributions
-
-```shell
-git clone https://github.com/lcpz/lain.git ~/.config/awesome/lain
-```
-
-Also available via [LuaRocks](https://luarocks.org/modules/aajjbb/lain).
-
-Usage
---------
-
-First, include it into your `rc.lua`:
-
-```lua
-local lain = require("lain")
-```
-
-Then check out the submodules you want:
-
-- [Layouts](https://github.com/lcpz/lain/wiki/Layouts)
-- [Widgets](https://github.com/lcpz/lain/wiki/Widgets)
-- [Utilities](https://github.com/lcpz/lain/wiki/Utilities)
diff --git a/user/.config/awesome/lain/wiki/Layouts.md b/user/.config/awesome/lain/wiki/Layouts.md
deleted file mode 100755
index 0286d4b51..000000000
--- a/user/.config/awesome/lain/wiki/Layouts.md
+++ /dev/null
@@ -1,255 +0,0 @@
-
- lain/layout
- .
- |-- termfair
- |-- termfair.center
- |-- cascade
- |-- cascade.tile
- |-- centerwork
- |-- centerwork.horizontal
-
-Usage
-=====
-
-As usual, specify your favourites in `awful.layout.layouts`, or set them on specific tags with [`awful.layout.set`](https://awesomewm.org/doc/api/libraries/awful.layout.html#set).
-
-```lua
-awful.layout.set(lain.layout.termfair, tag)
-```
-
-How do layouts work?
-====================
-
-`termfair`
---------
-
-This layout restricts the size of each window. Each window will have the
-same width but is variable in height. Furthermore, windows are
-left-aligned. The basic workflow is as follows (the number above the
-screen is the number of open windows, the number in a cell is the fixed
-number of a client):
-
- (1) (2) (3)
- +---+---+---+ +---+---+---+ +---+---+---+
- | | | | | | | | | | | |
- | 1 | | | -> | 2 | 1 | | -> | 3 | 2 | 1 | ->
- | | | | | | | | | | | |
- +---+---+---+ +---+---+---+ +---+---+---+
-
- (4) (5) (6)
- +---+---+---+ +---+---+---+ +---+---+---+
- | 4 | | | | 5 | 4 | | | 6 | 5 | 4 |
- +---+---+---+ -> +---+---+---+ -> +---+---+---+
- | 3 | 2 | 1 | | 3 | 2 | 1 | | 3 | 2 | 1 |
- +---+---+---+ +---+---+---+ +---+---+---+
-
-The first client will be located in the left column. When opening
-another window, this new window will be placed in the left column while
-moving the first window into the middle column. Once a row is full,
-another row above it will be created.
-
-Default number of columns and rows are respectively taken from `nmaster`
-and `ncol` values in `awful.tag`, but you can set your own.
-
-For example, this sets `termfair` to 3 columns and at least 1 row:
-
-```lua
-lain.layout.termfair.nmaster = 3
-lain.layout.termfair.ncol = 1
-```
-
-`termfair.center`
-----------
-
-Similar to `termfair`, but with fixed number of vertical columns. Cols are centerded until there are `nmaster` columns, then windows are stacked as slaves, with possibly `ncol` clients per column at most.
-
- (1) (2) (3)
- +---+---+---+ +-+---+---+-+ +---+---+---+
- | | | | | | | | | | | | |
- | | 1 | | -> | | 1 | 2 | | -> | 1 | 2 | 3 | ->
- | | | | | | | | | | | | |
- +---+---+---+ +-+---+---+-+ +---+---+---+
-
- (4) (5)
- +---+---+---+ +---+---+---+
- | | | 3 | | | 2 | 4 |
- + 1 + 2 +---+ -> + 1 +---+---+
- | | | 4 | | | 3 | 5 |
- +---+---+---+ +---+---+---+
-
-Like `termfair`, default number of columns and rows are respectively taken from `nmaster`
-and `ncol` values in `awful.tag`, but you can set your own.
-
-For example, this sets `termfair.center` to 3 columns and at least 1 row:
-
-```lua
-lain.layout.termfair.center.nmaster = 3
-lain.layout.termfair.center.ncol = 1
-```
-
-`cascade`
--------
-
-Cascade all windows of a tag.
-
-You can control the offsets by setting these two variables:
-
-```lua
-lain.layout.cascade.offset_x = 64
-lain.layout.cascade.offset_y = 16
-```
-
-The following reserves space for 5 windows:
-
-```lua
-lain.layout.cascade.nmaster = 5
-```
-
-That is, no window will get resized upon the creation of a new window,
-unless there's more than 5 windows.
-
-`cascade.tile`
------------
-
-Similar to `awful.layout.suit.tile` layout, however, clients in the slave
-column are cascaded instead of tiled.
-
-Left column size can be set, otherwise is controlled by `mwfact` of the
-tag. Additional windows will be opened in another column on the right.
-New windows are placed above old windows.
-
-Whether the slave column is placed on top of the master window or not is
-controlled by the value of `ncol`. A value of 1 means "overlapping slave column"
-and anything else means "don't overlap windows".
-
-Usage example:
-
-```lua
-lain.layout.cascade.tile.offset_x = 2
-lain.layout.cascade.tile.offset_y = 32
-lain.layout.cascade.tile.extra_padding = 5
-lain.layout.cascade.tile.nmaster = 5
-lain.layout.cascade.tile.ncol = 2
-```
-
-`extra_padding` reduces the size of the master window if "overlapping
-slave column" is activated. This allows you to see if there are any
-windows in your slave column.
-
-Setting `offset_x` to a very small value or even 0 is recommended to avoid wasting space.
-
-`centerwork`
-----------
-
-You start with one window, centered horizontally:
-
- +--------------------------+
- | +----------+ |
- | | | |
- | | | |
- | | | |
- | | MAIN | |
- | | | |
- | | | |
- | | | |
- | | | |
- | +----------+ |
- +--------------------------+
-
-This is your main working window. You do most of the work right here.
-Sometimes, you may want to open up additional windows. They're put on left and right, alternately.
-
- +--------------------------+
- | +---+ +----------+ +---+ |
- | | | | | | | |
- | | | | | | | |
- | | | | | | | |
- | +---+ | MAIN | +---+ |
- | +---+ | | +---+ |
- | | | | | | | |
- | | | | | | | |
- | | | | | | | |
- | +---+ +----------+ +---+ |
- +--------------------------+
-
-*Please note:* If you use Awesome's default configuration, navigation in
-this layout may be very confusing. How do you get from the main window
-to satellite ones depends on the order in which the windows are opened.
-Thus, use of `awful.client.focus.bydirection()` is suggested.
-Here's an example:
-
-```lua
-globalkeys = awful.util.table.join(
- -- [...]
- awful.key({ modkey }, "j",
- function()
- awful.client.focus.bydirection("down")
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey }, "k",
- function()
- awful.client.focus.bydirection("up")
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey }, "h",
- function()
- awful.client.focus.bydirection("left")
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey }, "l",
- function()
- awful.client.focus.bydirection("right")
- if client.focus then client.focus:raise() end
- end),
- -- [...]
-)
-```
-
-`centerwork.horizontal`
------------
-
-Same as `centerwork`, except that the main
-window expands horizontally, and the additional windows
-are put ontop/below it. Useful if you have a screen turned 90°.
-
-Pre 4.0 `uselesstile` patches
-=============================
-
-In branch 3.5, this module provided useless gaps layouts. Since useless gaps have been implemented in Awesome 4.0, those layouts have been removed.
-
-Following are a couple of `uselesstile` variants that were not part of lain. They are kept only for reference and are not supported.
-
-Xmonad-like
------------
-
-If you want to have `awful.layout.suit.tile` behave like xmonad, with internal gaps two times wider than external ones, download [this](https://gist.github.com/lcpz/9e56dcfbe66bfe14967c) as `lain/layout/uselesstile`.
-
-Inverted master
----------------
-
-Want to invert master window position? Use [this](https://gist.github.com/lcpz/c59dc59c9f99d98218eb) version. You can set `single_gap` with `width` and `height` in your `theme.lua`, in order to define the window geometry when there's only one client, otherwise it goes maximized. An example:
-
- theme.single_gap = { width = 600, height = 100 }
-
-What about layout icons?
-========================
-
-They are located in ``lain/icons/layout``.
-
-To use them, define new `layout_*` variables in your ``theme.lua``. For instance:
-
-```lua
-theme.lain_icons = os.getenv("HOME") ..
- "/.config/awesome/lain/icons/layout/default/"
-theme.layout_termfair = theme.lain_icons .. "termfair.png"
-theme.layout_centerfair = theme.lain_icons .. "centerfair.png" -- termfair.center
-theme.layout_cascade = theme.lain_icons .. "cascade.png"
-theme.layout_cascadetile = theme.lain_icons .. "cascadetile.png" -- cascade.tile
-theme.layout_centerwork = theme.lain_icons .. "centerwork.png"
-theme.layout_centerworkh = theme.lain_icons .. "centerworkh.png" -- centerwork.horizontal
-```
-
-Credit goes to [Nicolas Estibals](https://github.com/nestibal) for creating
-layout icons for default theme.
-
-You can use them as a template for your custom versions.
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/Utilities.md b/user/.config/awesome/lain/wiki/Utilities.md
deleted file mode 100755
index dd54056f0..000000000
--- a/user/.config/awesome/lain/wiki/Utilities.md
+++ /dev/null
@@ -1,338 +0,0 @@
-Quake
------
-
-A Quake-like dropdown container for your favourite application.
-
-**Usage**
-
-Define it globally to have a single instance for all screens:
-
-```lua
-local quake = lain.util.quake()
-```
-
-or define it in `connect_for_each_screen` to have one instance for each screen:
-
-```lua
-awful.screen.connect_for_each_screen(function(s)
- -- Quake application
- s.quake = lain.util.quake()
- -- [...]
-```
-
-**Keybinding example**
-
-If using a global instance:
-```lua
-awful.key({ modkey, }, "z", function () quake:toggle() end),
-```
-
-If using a per-screen instance:
-```lua
-awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end),
-```
-
-**Input table**
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`app` | client to spawn | string | "xterm"
-`name` | client name | string | "QuakeDD"
-`argname` | how to specify client name | string | "-name %s"
-`extra` | extra `app` arguments | string | empty string
-`border` | border width | integer | 1
-`visible` | initially visible | boolean | false
-`followtag` | always spawn on currently focused screen | boolean | false
-`overlap` | Overlap the wibox or not | boolean | false
-`settings` | Additional settings to make on the client | function | `nil`
-`screen` | screen where to spawn the client | integer | `awful.screen.focused()`
-`height` | dropdown client height | float in [0,1] or exact pixels number | 0.25
-`width` | dropdown client width | float in [0,1] or exact pixels number | 1
-`vert` | vertical position | string, possible values: "top", "bottom", "center" | "top"
-`horiz` | horizontal position | string, possible values: "left", "right", "center" | "left"
-
-`height` and `width` express a fraction of the workspace.
-
-`settings` is a function which takes the client as input, and can be used to customize its properties. For instance:
-
-```lua
--- set the client sticky
-s.quake = lain.util.quake { settings = function(c) c.sticky = true end }
-```
-
-Read [here](https://awesomewm.org/doc/api/classes/client.html#Object_properties) for the complete list of properties.
-
-**Notes**
-
-* [Does not work](https://github.com/lcpz/lain/issues/358) with `gnome-terminal`, `konsole`, or any other terminal which is strictly designed for a Desktop Environment. Just pick a better terminal, [there's plenty](https://wiki.archlinux.org/index.php/List_of_applications#Terminal_emulators).
-* Set `followtag = true` if [experiencing issues with multiple screens](https://github.com/lcpz/lain/issues/346).
-* If you have a `awful.client.setslave` rule for your application, ensure you use an exception for `QuakeDD` (or your defined `name`). Otherwise, you may run into problems with focus.
-* If you are using a VTE-based terminal like `termite`, be sure to set [`argname = "--name %s"`](https://github.com/lcpz/lain/issues/211).
-
-Separators
-----------
-
-Adds Cairo separators.
-
-```lua
-local separators = lain.util.separators
-```
-
-A separator function `separators.separator` takes two color arguments, defined as strings. `"alpha"` argument is allowed. Example:
-
-```lua
-arrl_dl = separators.arrow_left(beautiful.bg_focus, "alpha")
-arrl_ld = separators.arrow_left("alpha", beautiful.bg_focus)
-```
-
-You can customize height and width by setting `separators_height` and `separators_width` in your `theme.lua`. Default values are 0 and 9, respectively.
-
-List of functions:
-
- +-- separators
- |
- |`-- arrow_right() Draw a right arrow.
- `-- arrow_left() Draw a left arrow.
-
-markup
-------
-
-Mades markup easier.
-
-```lua
-local markup = lain.util.markup
-```
-
-List of functions:
-
- +-- markup
- |
- |`-- bold() Set bold.
- |`-- italic() Set italicized text.
- |`-- strike() Set strikethrough text.
- |`-- underline() Set underlined text.
- |`-- monospace() Set monospaced text.
- |`-- big() Set bigger text.
- |`-- small() Set smaller text.
- |`-- font() Set the font of the text.
- |`-- font() Set the font of the text.
- |`-- color() Set background and foreground color.
- |`-- fontfg() Set font and foreground color.
- |`-- fontbg() Set font and background color.
- `-- fontcolor() Set font, plus background and foreground colors.
- |
- |`--+ bg
- | |
- | `-- color() Set background color.
- |
- `--+ fg
- |
- `-- color() Set foreground color.
-
-they all take one argument, which is the text to markup, except the following:
-
-```lua
-markup.font(font, text)
-markup.color(fg, bg, text)
-markup.fontfg(font, fg, text)
-markup.fontbg(font, bg, text)
-markup.fontcolor(font, fg, bg, text)
-markup.fg.color(color, text)
-markup.bg.color(color, text)
-```
-
-Dynamic tagging
----------------
-
-That is:
-
-- add a new tag;
-- rename current tag;
-- move current tag;
-- delete current tag.
-
-If you delete a tag, any rule set on it shall be broken, so be careful.
-
-Use it with key bindings like these:
-
-```lua
-awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag(mylayout) end),
-awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end),
-awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(1) end), -- move to next tag
-awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(-1) end), -- move to previous tag
-awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end),
-```
-
-The argument in `lain.util.add_tag` represents the tag layout, and is optional: if not present, it will be defaulted to `awful.layout.suit.tile`.
-
-Useless gaps resize
----------------------
-
-Changes `beautiful.useless_gaps` on the fly.
-
-```lua
-lain.util.useless_gap_resize(thatmuch, s, t)
-```
-
-The argument `thatmuch` is the number of pixel to add to/substract from gaps (integer).
-
-The arguments `s` and `t` are the `awful.screen` and `awful.tag` in which you want to change the gap. They are optional.
-
-Following are example keybindings for changing client gaps on current screen and tag.
-
-Example 1:
-
-```lua
--- On the fly useless gaps change
-awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end),
-awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end),
-```
-
-where `altkey = Mod1`. Example 2:
-
-```lua
-mywidget:buttons(awful.util.table.join (
- awful.button({}, 4, function() lain.util.useless_gaps_resize(-1) end),
- awful.button({}, 5, function() lain.util.useless_gaps_resize(1) end)
- end)
-))
-```
-
-so when hovering the mouse over `mywidget`, you can adjust useless gaps size by scrolling with the mouse wheel.
-
-tag\_view\_nonempty
--------------------
-
-This function lets you jump to the next/previous non-empty tag.
-It takes two arguments:
-
-* `direction`: `1` for next non-empty tag, `-1` for previous.
-* `sc`: Screen which the taglist is in. Default is `mouse.screen` or `1`. This
- argument is optional.
-
-You can use it with key bindings like these:
-
-```lua
--- Non-empty tag browsing
-awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end),
-awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end),
-```
-
-where `altkey = "Mod1"`.
-
-magnify\_client
----------------
-
-Set a client to floating and resize it in the same way the "magnifier"
-layout does it. Place it on the "current" screen (derived from the mouse
-position). This allows you to magnify any client you wish, regardless of
-the currently used layout. Use it with a client keybinding like this:
-
-```lua
-clientkeys = awful.util.table.join(
- -- [...]
- awful.key({ modkey, "Control" }, "m", lain.util.magnify_client),
- -- [...]
-)
-```
-
-If you want to "de-magnify" it, just retype the keybinding.
-
-If you want magnified client to respond to `incmwfact`, read [here](https://github.com/lcpz/lain/issues/195).
-
-menu\_clients\_current\_tags
-----------------------------
-
-Similar to `awful.menu.clients`, but this menu only shows the clients
-of currently visible tags. Use it with a key binding like this:
-
-```lua
-awful.key({ "Mod1" }, "Tab", function()
- lain.util.menu_clients_current_tags({ width = 350 }, { keygrabber = true })
-end),
-```
-
-menu\_iterator
---------------
-
-A generic menu utility which enables iteration over lists of possible
-actions to execute. The perfect example is a menu for choosing what
-configuration to apply to X with `xrandr`, as suggested on the [Awesome wiki page](https://awesomewm.org/recipes/xrandr).
-
-
-
-
An example Synergy menu, courtesy of sim590
-
-
-You can either manually create a menu by defining a table in this format:
-
-```lua
-{ { "choice description 1", callbackFuction1 }, { "choice description 2", callbackFunction2 }, ... }
-```
-
-or use `util.menu_iterator.menu`. Once you have your menu, use it with `lain.menu_iterator.iterate`.
-
-### Input tables
-
-**lain.menu_iterator.iterate**
-
-| Argument | Description | Type
-|---|---| ---
-| `menu` | the menu to iterate on | table
-| `timeout` | time (in seconds) to wait on a choice before the choice is accepted | integer (default: 4)
-| `icon` | path to the icon to display in `naughty.notify` window | string
-
-**lain.menu_iterator.menu**
-
-| Argument | Description | Type
-|---|---| ---
-`choices` | list of choices (e.g., `{ "choice1", "choice2", ... }`) | array of strings
-`name` | name of the program related to this menu | string
-`selected_cb` | callback to execute for each selected choice, it takes one choice (string) as argument; can be `nil` (no action to execute) | function
-`rejected_cb` | callback to execute for all rejected choices (the remaining choices, once one is selected), it takes one choice (string) as argument; can be `nil` (no action to execute) | function
-`extra_choices` | more choices to be added to the menu; unlike `choices`, these ones won't trigger `rejected_cb` | array of `{ choice, callback }` pairs, where `choice` is a string and `callback` is a function
-`combination` | how choices have to be combined in the menu; possible values are: "single" (default), the set of possible choices will simply be the input set ; "powerset", the set of possible choices will be the [power set](https://en.wikipedia.org/wiki/Power_set) of the input set | string
-
-### Examples
-
-A simple example is:
-
-```lua
-local mymenu_iterable = lain.util.menu_iterator.menu {
- choices = {"My first choice", "My second choice"},
- name = "My awesome program",
- selected_cb = function(choice)
- -- do something with selected choice
- end,
- rejected_cb = function(choice)
- -- do something with every rejected choice
- end
-}
-```
-
-The variable `mymenu_iterable` is a menu compatible with the function `lain.util.menu_iterator.iterate`, which will iterate over it and displays notification with `naughty.notify` every time it is called. You can use it like this:
-
-```lua
-local confirm_timeout = 5 -- time to wait before confirming the menu selection
-local my_notify_icon = "/path/to/icon" -- the icon to display in the notification
-lain.util.menu_iterator.iterate(mymenu_iterable, confirm_timeout, my_notify_icon)
-```
-
-Once `confirm_timeout` has passed without anymore calls to `iterate`, the choice is made and the associated callbacks (both for selected and rejected choices) are spawned.
-
-A useful practice is to add a `Cancel` option as an extra choice for canceling a menu selection. Extending the above example:
-
-```lua
-local mymenu_iterable = lain.util.menu_iterator.menu {
- choices = {"My first choice", "My second choice"},
- name = "My awesome program",
- selected_cb = function(choice)
- -- do something with selected choice
- end,
- rejected_cb = function(choice)
- -- do something with every rejected choice
- end
- -- nil means no action to do
- extra_choices = { {"Cancel"}, nil }
-}
-```
diff --git a/user/.config/awesome/lain/wiki/Widgets.md b/user/.config/awesome/lain/wiki/Widgets.md
deleted file mode 100755
index 34f518df6..000000000
--- a/user/.config/awesome/lain/wiki/Widgets.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# Usage
-
-Every lain widget is a table.
-
-A lain widget is generated by a `function`.
-
-The `function` signature, input and output arguments can be found in the [related wiki entry](https://github.com/lcpz/lain/wiki/Widgets#index).
-
-Every lain widget contains a `wibox.widget`, which is updated by a timed function. To access the widget, use the field `widget`, while to access the timed function, use the field `update`. Some lain widgets may also have an `icon` field, which is a `wibox.widget.imagebox`, and/or a `timer` field, which is the `gears.timer` on `update`.
-
-Every `function` may take either a table or a list of variables as input.
-
-If the input is a table, you must define a function variable called `settings` in it. There you will be able to define `widget` appearance.
-
-For instance, if `widget` is a textbox, to markup it call `widget:set_markup(...)` within `settings`.
-
-In the scope of `settings` you can use predefined arguments, which are specified in the wiki entries.
-
-Example of a lain widget:
-
-```lua
-local cpu = lain.widget.cpu {
- settings = function()
- widget:set_markup("Cpu " .. cpu_now.usage)
- end
-}
--- to access the widget: cpu.widget
-```
-
-If you want to see some applications, check [awesome-copycats](https://github.com/lcpz/awesome-copycats).
-
-# Index
-
-- [alsa](https://github.com/lcpz/lain/wiki/alsa)
-- [alsabar](https://github.com/lcpz/lain/wiki/alsabar)
-- [bat](https://github.com/lcpz/lain/wiki/bat)
-- [cal](https://github.com/lcpz/lain/wiki/cal)
-- [cpu](https://github.com/lcpz/lain/wiki/cpu)
-- [fs](https://github.com/lcpz/lain/wiki/fs)
-- [imap](https://github.com/lcpz/lain/wiki/imap)
-- [mem](https://github.com/lcpz/lain/wiki/mem)
-- [mpd](https://github.com/lcpz/lain/wiki/mpd)
-- [net](https://github.com/lcpz/lain/wiki/net)
-- [pulse](https://github.com/lcpz/lain/wiki/pulse)
-- [pulsebar](https://github.com/lcpz/lain/wiki/pulsebar)
-- [sysload](https://github.com/lcpz/lain/wiki/sysload)
-- [temp](https://github.com/lcpz/lain/wiki/temp)
-- [weather](https://github.com/lcpz/lain/wiki/weather)
-
-## Users contributed
-
-- [moc](https://github.com/lcpz/lain/wiki/moc)
-- [redshift](https://github.com/lcpz/lain/wiki/redshift)
-- [task](https://github.com/lcpz/lain/wiki/task)
-- [tp_smapi](https://github.com/lcpz/lain/wiki/tp_smapi)
diff --git a/user/.config/awesome/lain/wiki/_Footer.md b/user/.config/awesome/lain/wiki/_Footer.md
deleted file mode 100755
index b64f13bfd..000000000
--- a/user/.config/awesome/lain/wiki/_Footer.md
+++ /dev/null
@@ -1 +0,0 @@
-[Home](https://github.com/lcpz/lain/wiki) • [Layouts](https://github.com/lcpz/lain/wiki/Layouts) • [Widgets](https://github.com/lcpz/lain/wiki/Widgets) • [Utilities](https://github.com/lcpz/lain/wiki/Utilities)
diff --git a/user/.config/awesome/lain/wiki/_Sidebar.md b/user/.config/awesome/lain/wiki/_Sidebar.md
deleted file mode 100755
index 0289783a8..000000000
--- a/user/.config/awesome/lain/wiki/_Sidebar.md
+++ /dev/null
@@ -1,26 +0,0 @@
-* [Home](https://github.com/lcpz/lain/wiki/Home)
-* [Layouts](https://github.com/lcpz/lain/wiki/Layouts)
- * [Usage](https://github.com/lcpz/lain/wiki/Layouts#Usage)
- * [How do layouts work?](https://github.com/lcpz/lain/wiki/Layouts#how-do-layouts-work)
- * [termfair](https://github.com/lcpz/lain/wiki/Layouts#termfair)
- * [centerfair](https://github.com/lcpz/lain/wiki/Layouts#termfaircenter)
- * [cascade](https://github.com/lcpz/lain/wiki/Layouts#cascade)
- * [cascadetile](https://github.com/lcpz/lain/wiki/Layouts#cascadetile)
- * [centerwork](https://github.com/lcpz/lain/wiki/Layouts#centerwork)
- * [centerworkh](https://github.com/lcpz/lain/wiki/Layouts#centerworkhorizontal)
- * [Pre 4.0 uselesstile patches](https://github.com/lcpz/lain/wiki/Layouts#pre-40-uselesstile-patches)
- * [What about layout icons?](https://github.com/lcpz/lain/wiki/Layouts#what-about-layout-icons)
-* [Widgets](https://github.com/lcpz/lain/wiki/Widgets)
- * [Usage](https://github.com/lcpz/lain/wiki/Widgets#usage)
- * [Index](https://github.com/lcpz/lain/wiki/Widgets#index)
- * [Users contributed](https://github.com/lcpz/lain/wiki/Widgets#users-contributed)
-* [Utilities](https://github.com/lcpz/lain/wiki/Utilities)
- * [quake](https://github.com/lcpz/lain/wiki/Utilities#quake)
- * [separators](https://github.com/lcpz/lain/wiki/Utilities#separators)
- * [markup](https://github.com/lcpz/lain/wiki/Utilities#markup)
- * [dynamic tagging](https://github.com/lcpz/lain/wiki/Utilities#dynamic-tagging)
- * [useless_gaps_resize](https://github.com/lcpz/lain/wiki/Utilities#useless-gaps-resize)
- * [tag_view_non_empty](https://github.com/lcpz/lain/wiki/Utilities#tag_view_nonempty)
- * [magnify_client](https://github.com/lcpz/lain/wiki/Utilities#magnify_client)
- * [menu_clients_current_tags](https://github.com/lcpz/lain/wiki/Utilities#menu_clients_current_tags)
- * [menu_iterator](https://github.com/lcpz/lain/wiki/Utilities#menu_iterator)
diff --git a/user/.config/awesome/lain/wiki/alsa.md b/user/.config/awesome/lain/wiki/alsa.md
deleted file mode 100755
index 6882fcb17..000000000
--- a/user/.config/awesome/lain/wiki/alsa.md
+++ /dev/null
@@ -1,136 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows ALSA volume.
-
-```lua
-local volume = lain.widget.alsa()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 5
-`cmd` | Alsa mixer command | string | "amixer"
-`channel` | Mixer channel | string | "Master"
-`togglechannel` | Toggle channel | string | `nil`
-`settings` | User settings | function | empty function
-
-`cmd` is useful if you need to pass additional arguments to amixer. For instance, you may want to define `cmd = "amixer -c X"` in order to set amixer with card `X`.
-
-`settings` can use the following variables:
-
-Variable | Meaning | Type | Values
---- | --- | --- | ---
-`volume_now.level` | Volume level | integer | 0-100
-`volume_now.status` | Device status | string | "on", "off"
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`channel` | ALSA channel | string
-`update` | Update `widget` | function
-
-## Toggle channel
-
-In case mute toggling can't be mapped to master channel (this happens, for instance, when you are using an HDMI output), define togglechannel as your S/PDIF device. You can get the device ID with `scontents` command.
-
-For instance, if card number is 1 and S/PDIF number is 3:
-
-```shell
-$ amixer -c 1 scontents
-Simple mixer control 'Master',0
- Capabilities: volume
- Playback channels: Front Left - Front Right
- Capture channels: Front Left - Front Right
- Limits: 0 - 255
- Front Left: 255 [100%]
- Front Right: 255 [100%]
-Simple mixer control 'IEC958',0
- Capabilities: pswitch pswitch-joined
- Playback channels: Mono
- Mono: Playback [on]
-Simple mixer control 'IEC958',1
- Capabilities: pswitch pswitch-joined
- Playback channels: Mono
- Mono: Playback [on]
-Simple mixer control 'IEC958',2
- Capabilities: pswitch pswitch-joined
- Playback channels: Mono
- Mono: Playback [on]
-Simple mixer control 'IEC958',3
- Capabilities: pswitch pswitch-joined
- Playback channels: Mono
- Mono: Playback [on]
-```
-
-you have to set `togglechannel = "IEC958,3"`.
-
-## Buttons
-
-If you want buttons, just add the following after your widget in `rc.lua`.
-
-```lua
-volume.widget:buttons(awful.util.table.join(
- awful.button({}, 1, function() -- left click
- awful.spawn(string.format("%s -e alsamixer", terminal))
- end),
- awful.button({}, 2, function() -- middle click
- os.execute(string.format("%s set %s 100%%", volume.cmd, volume.channel))
- volume.update()
- end),
- awful.button({}, 3, function() -- right click
- os.execute(string.format("%s set %s toggle", volume.cmd, volume.togglechannel or volume.channel))
- volume.update()
- end),
- awful.button({}, 4, function() -- scroll up
- os.execute(string.format("%s set %s 1%%+", volume.cmd, volume.channel))
- volume.update()
- end),
- awful.button({}, 5, function() -- scroll down
- os.execute(string.format("%s set %s 1%%-", volume.cmd, volume.channel))
- volume.update()
- end)
-))
-```
-
-## Keybindings
-
-You can control the widget with keybindings like these:
-
-```lua
--- ALSA volume control
-awful.key({ altkey }, "Up",
- function ()
- os.execute(string.format("amixer set %s 1%%+", volume.channel))
- volume.update()
- end),
-awful.key({ altkey }, "Down",
- function ()
- os.execute(string.format("amixer set %s 1%%-", volume.channel))
- volume.update()
- end),
-awful.key({ altkey }, "m",
- function ()
- os.execute(string.format("amixer set %s toggle", volume.togglechannel or volume.channel))
- volume.update()
- end),
-awful.key({ altkey, "Control" }, "m",
- function ()
- os.execute(string.format("amixer set %s 100%%", volume.channel))
- volume.update()
- end),
-awful.key({ altkey, "Control" }, "0",
- function ()
- os.execute(string.format("amixer set %s 0%%", volume.channel))
- volume.update()
- end),
-```
-
-where `altkey = "Mod1"`.
diff --git a/user/.config/awesome/lain/wiki/alsabar.md b/user/.config/awesome/lain/wiki/alsabar.md
deleted file mode 100755
index f16b14ffc..000000000
--- a/user/.config/awesome/lain/wiki/alsabar.md
+++ /dev/null
@@ -1,102 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows ALSA volume with a progressbar; provides tooltips and notifications.
-
-```lua
-local volume = lain.widget.alsabar()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 5
-`settings` | User settings | function | empty function
-`width` | Bar width | number | 63
-`height` | Bar height | number | 1
-`margins` | Bar margins | number | 1
-`paddings` | Bar paddings | number | 1
-`ticks` | Set bar ticks on | boolean | false
-`ticks_size` | Ticks size | integer | 7
-`cmd` | ALSA mixer command | string | "amixer"
-`channel` | Mixer channel | string | "Master"
-`togglechannel` | Toggle channel | string | `nil`
-`colors` | Bar colors | table | see [Default colors](https://github.com/lcpz/lain/wiki/alsabar#default-colors)
-`notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/alsabar#default-notification_preset)
-`followtag` | Display the notification on currently focused screen | boolean | false
-
-`cmd` is useful if you need to pass additional arguments to `amixer`. For instance, you may want to define `cmd = "amixer -c X"` in order to set amixer with card `X`.
-
-In case mute toggling can't be mapped to master channel (this happens, for instance, when you are using an HDMI output), define `togglechannel` as your S/PDIF device. Read [`alsa`](https://github.com/lcpz/lain/wiki/alsa#toggle-channel) page to know how.
-
-`settings` can use the following variables:
-
-Variable | Meaning | Type | Values
---- | --- | --- | ---
-`volume_now.level` | Volume level | integer | 0-100
-`volume_now.status` | Device status | string | "on", "off"
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-### Default colors
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`background` | Bar backgrund color | string | "#000000"
-`mute` | Bar mute color | string | "#EB8F8F"
-`unmute` | Bar unmute color | string | "#A4CE8A"
-
-### Default `notification_preset`
-
-```lua
-notification_preset = {
- font = "Monospace 10"
-}
-```
-
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`bar` | The widget | `wibox.widget.progressbar`
-`channel` | ALSA channel | string
-`notify` | The notification | function
-`update` | Update `bar` | function
-`tooltip` | The tooltip | `awful.tooltip`
-
-## Buttons
-
-If you want buttons, just add the following after your widget in `rc.lua`.
-
-```lua
-volume.bar:buttons(awful.util.table.join(
- awful.button({}, 1, function() -- left click
- awful.spawn(string.format("%s -e alsamixer", terminal))
- end),
- awful.button({}, 2, function() -- middle click
- os.execute(string.format("%s set %s 100%%", volume.cmd, volume.channel))
- volume.update()
- end),
- awful.button({}, 3, function() -- right click
- os.execute(string.format("%s set %s toggle", volume.cmd, volume.togglechannel or volume.channel))
- volume.update()
- end),
- awful.button({}, 4, function() -- scroll up
- os.execute(string.format("%s set %s 1%%+", volume.cmd, volume.channel))
- volume.update()
- end),
- awful.button({}, 5, function() -- scroll down
- os.execute(string.format("%s set %s 1%%-", volume.cmd, volume.channel))
- volume.update()
- end)
-))
-```
-
-## Keybindings
-
-Read [here](https://github.com/lcpz/lain/wiki/alsa#keybindings). If you want notifications, use `volume.notify()` instead of `volume.update()`.
diff --git a/user/.config/awesome/lain/wiki/bat.md b/user/.config/awesome/lain/wiki/bat.md
deleted file mode 100755
index b7d6cd1f0..000000000
--- a/user/.config/awesome/lain/wiki/bat.md
+++ /dev/null
@@ -1,99 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows the remaining time and percentage capacity of your laptop battery, as well
-as the current wattage. Multiple batteries are supported.
-
-Displays a notification when battery is fully charged, low, or critical.
-
-```lua
-local mybattery = lain.widget.bat()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 30
-`pspath` | Power supply directory path | string | "/sys/class/power_supply/"
-`battery` | Single battery id | string | autodetected
-`batteries` | Multiple batteries id table | table of strings | autodetected
-`ac` | AC | string | autodetected
-`notify` | Show notification popups | string | "on"
-`n_perc` | Percentages assumed for critical and low battery levels | table of integers | `{5, 15}`
-`settings` | User settings | function | empty function
-
-The widget will try to autodetect `battery`, `batteries` and `ac`. If something
-goes wrong, you will have to define them manually. In that case, you only have
-to define one between `battery` and `batteries`. If you have one battery, you
-can either use `args.battery = "BAT*"` or `args.batteries = {"BAT*"}`, where `BAT*`
-is the identifier of your battery in `pspath` (do not use it as a wildcard).
-Of course, if you have multiple batteries, you need to use the latter option.
-
-To disable notifications, set `notify` to `"off"`.
-
-If you define `pspath`, **be sure** to not forget the final slash (/).
-
-`settings` can use the `bat_now` table, which contains the following strings:
-
-- `status`, general status ("N/A", "Discharging", "Charging", "Full");
-- `n_status[i]`, i-th battery status (like above);
-- `ac_status`, AC-plug flag (0 if cable is unplugged, 1 if plugged, "N/A" otherwise);
-- `perc`, total charge percentage (integer between 0 and 100 or "N/A");
-- `n_perc[i]`, i-th battery charge percentage (like above);
-- `time`, time remaining until charge if charging, until discharge if discharging (HH:MM string or "N/A");
-- `watt`, battery watts (float with 2 decimals).
-
-and can modify the following three tables, which will be the preset for the naughty notifications:
-* `bat_notification_charged_preset` (used if battery is fully charged and connected to AC)
-* `bat_notification_low_preset` (used if battery charge level <= 15)
-* `bat_notification_critical_preset` (used if battery charge level <= 5)
-
-Check [here](https://awesomewm.org/doc/api/libraries/naughty.html#notify) for
-the list of variables they can contain. Default definitions:
-
-```lua
-bat_notification_charged_preset = {
- title = "Battery full",
- text = "You can unplug the cable",
- timeout = 15,
- fg = "#202020",
- bg = "#CDCDCD"
- }
-
-```
-
-```lua
-bat_notification_low_preset = {
- title = "Battery low",
- text = "Plug the cable!",
- timeout = 15,
- fg = "#202020",
- bg = "#CDCDCD"
-}
-```
-```lua
-bat_notification_critical_preset = {
- title = "Battery exhausted",
- text = "Shutdown imminent",
- timeout = 15,
- fg = "#000000",
- bg = "#FFFFFF"
-}
-```
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-
-The `update` function can be used to refresh the widget before `timeout` expires.
-
-## Note
-
-Alternatively, you can try the [`upower` recipe](https://awesomewm.org/recipes/watch).
diff --git a/user/.config/awesome/lain/wiki/cal.md b/user/.config/awesome/lain/wiki/cal.md
deleted file mode 100755
index 336b9297b..000000000
--- a/user/.config/awesome/lain/wiki/cal.md
+++ /dev/null
@@ -1,81 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Creates a calendar notification that can be attached to widgets.
-
-This is a simpler but [faster](https://github.com/awesomeWM/awesome/issues/1861)
-alternative to [`awful.widget.calendar_popup`](https://awesomewm.org/doc/api/classes/awful.widget.calendar_popup.html), which emulates UNIX's `cal`.
-
-```lua
-local mycal = lain.widget.cal()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`attach_to` | List of widgets | table | empty table
-`week_start` | First day of the week | integer | 2 (Monday)
-`three` | Display three months spanning the date | boolean | false
-`followtag` | Display the notification on currently focused screen | boolean | false
-`icons` | Path to calendar icons | string | [icons/cal/white/](https://github.com/lcpz/lain/tree/master/icons/cal/white)
-`notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/calendar#default-notification_preset)
-
-Set `attach_to` as the list of widgets to which you want to attach the calendar, like this:
-
-```lua
-local mycal = lain.widget.cal {
- attach_to = { mywidget1, mywidget2, ... },
- -- [...]
-}
-```
-
-For every widget in `attach_to`:
-
-- Left click / scroll down: switch to previous month.
-- Middle click show current month.
-- Right click / scroll up: switch to next month.
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-### Default `notification_preset`
-
-```lua
-notification_preset = {
- font = "Monospace 10",
- fg = "#FFFFFF",
- bg = "#000000"
-}
-```
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`attach` | Attach the calendar to an input widget | function
-`show` | Show calendar | function
-`hide` | Hide calendar | function
-
-`attach` takes as argument any widget you want to attach the calendar to, while
-`show` takes as optional argument an integer to indicate the seconds to timeout.
-
-## Keybinding
-
-```lua
-awful.key({ altkey }, "c", function () mycal.show(7) end)
-```
-
-Where `altkey = "Mod1"`.
-
-## Notes
-
-* Naughty notifications require `notification_preset.font` to be **monospaced**, in order to correctly display the output.
-* If you want to [disable notification icon](https://github.com/lcpz/lain/pull/351), set `icons = ""` in the input table.
-* If you want to localise the calendar, put `os.setlocale(os.getenv("LANG"))` in your `rc.lua`.
-* If you want to get notifications [only with mouse clicks](https://github.com/lcpz/lain/issues/320) on a given widget, use this code:
- ```lua
- yourwidget:disconnect_signal("mouse::enter", mycal.hover_on)
- ```
diff --git a/user/.config/awesome/lain/wiki/cpu.md b/user/.config/awesome/lain/wiki/cpu.md
deleted file mode 100755
index c13d05aa6..000000000
--- a/user/.config/awesome/lain/wiki/cpu.md
+++ /dev/null
@@ -1,30 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows the current CPU usage, both in general and per core.
-
-```lua
-local mycpu = lain.widget.cpu()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 2
-`settings` | User settings | function | empty function
-
-`settings` can use these strings:
-
-* `cpu_now.usage`, the general use percentage;
-* `cpu_now[i].usage`, the i-th core use percentage, with `i` starting from 1.
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/fs.md b/user/.config/awesome/lain/wiki/fs.md
deleted file mode 100755
index 47d6bb28d..000000000
--- a/user/.config/awesome/lain/wiki/fs.md
+++ /dev/null
@@ -1,82 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows file systems informations.
-
-If a partition is given in input, a notification will be displayed when it is almost full.
-
-```lua
-local mypartition = lain.widget.fs()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 600
-`partition` | (Optional) Partition to watch: a notification will be displayed when full | string | `nil`
-`threshold` | Percentage threshold at which the notification is triggered | integer | 99
-`notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/fs#default-notification_preset)
-`followtag` | Display the notification on currently focused screen | boolean | false
-`showpopup` | Display popups with mouse hovering | string, possible values: "on", "off" | "on"
-`settings` | User settings | function | empty function
-
-`settings` can use the table `fs_now`, which contains a string entry for each file system path available. For instance, root infos are located in the variable `fs_now["/"]`. Every entry in this table have the following variables:
-
-Variable | Meaning | Type
---- | --- | ---
-`units` | (multiple of) units used | string ("Kb", "Mb", "Gb", and so on)
-`percentage` | the used percentage | integer
-`size` | size in `units` of the given fs | float
-`used` | amount of space used in the given fs, expressed in `units` | float
-`free` | amount of free space in the given fs, expressed in `units` | float
-
-Usage example:
-
-```lua
--- shows used (percentage) and remaining space in home partition
-local fsroothome = lain.widget.fs({
- settings = function()
- widget:set_text("/home: " .. fs_now["/home"].percentage .. "% (" ..
- fs_now["/home"].free .. " " .. fs_now["/home"].units .. " left)")
- end
-})
--- output example: "/home: 37% (239.4 Gb left)"
-```
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-### Default `notification_preset`
-
-```lua
-notification_preset = {
- font = "Monospace 10",
- fg = "#FFFFFF",
- bg = "#000000"
-}
-```
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`show` | The notification | function
-
-You can display the notification with a key binding like this:
-
-```lua
-awful.key({ altkey }, "h", function () mypartition.show(seconds, scr) end),
-```
-
-where ``altkey = "Mod1"`` and ``show`` arguments, both optionals, are:
-
-* `seconds`, notification time in seconds
-* `scr`, screen which to display the notification in
-
-## Note
-
-Naughty notifications require `notification_preset.font` to be **monospaced**, in order to correctly display the output.
diff --git a/user/.config/awesome/lain/wiki/imap.md b/user/.config/awesome/lain/wiki/imap.md
deleted file mode 100755
index 683777ec3..000000000
--- a/user/.config/awesome/lain/wiki/imap.md
+++ /dev/null
@@ -1,115 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows mails count fetching over IMAP.
-
-```lua
-local myimap = lain.widget.imap(args)
-```
-
-New mails are notified like this:
-
- +--------------------------------------------+
- | +---+ |
- | |\ /| donald@disney.org has 3 new messages |
- | +---+ |
- +--------------------------------------------+
-
-## Input table
-
-Required parameters are:
-
-Variable | Meaning | Type
---- | --- | ---
-`server` | Mail server | string
-`mail` | User mail | string
-`password` | User password | string
-
-while the optional are:
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`port` | IMAP port | integer | 993
-`timeout` | Refresh timeout (in seconds) | integer | 60
-`pwdtimeout` | Timeout for password retrieval function (see [here](https://github.com/lcpz/lain/wiki/imap#password-security)) | integer | 10
-`is_plain` | Define whether `password` is a plain password (true) or a command that retrieves it (false) | boolean | false
-`followtag` | Notification behaviour | boolean | false
-`notify` | Show notification popups | string | "on"
-`settings` | User settings | function | empty function
-
-`settings` can use `imap_now` table, which contains the following non negative integers:
-
-- `["MESSAGES"]`
-- `["RECENT"]`
-- `["UNSEEN"]`
-
-example of fetch: `total = imap_now["MESSAGES"]`. For backwards compatibility, `settings` can also use `mailcount`, a pointer to `imap_now["UNSEEN"]`.
-
-Also, `settings` can modify `mail_notification_preset` table, which will be the preset for the naughty notifications. Check [here](https://awesomewm.org/apidoc/libraries/naughty.html#notify) for the list of variables it can contain. Default definition:
-
-```lua
-mail_notification _preset = {
- icon = "lain/icons/mail.png",
- position = "top_left"
-}
-```
-
-Note that `mailcount` and `imap_now` elements are equals to 0 either if there are no new mails or credentials are invalid, so make sure that your settings are correct.
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-You can have multiple instances of this widget at the same time.
-
-## Password security
-
-The reason why `is_plain` is false by default is to discourage the habit of storing passwords in plain.
-
-In general, when `is_plain == false`, `password` can be either a string, a table or a function: the widget will execute it asynchronously in the first two cases.
-
-### Using plain passwords
-
-You can set your password in plain like this:
-
-```lua
-myimapcheck = lain.widget.imap {
- is_plain = true,
- password = "mymailpassword",
- -- [...]
-}
-```
-
-and you will have the same security provided by `~/.netrc`.
-
-### Using a password manager
-
-I recommend to use [spm](https://notabug.org/kl3/spm) or [pass](https://www.passwordstore.org). In this case, `password` has to be a function. Example stub:
-
-```lua
-myimapcheck = lain.widget.imap {
- password = function()
- -- do your retrieval
- return retrieved_password, try_again
- end,
- -- [...]
-}
-```
-
-Where `retrieved_password` is the password retrieved from the manager, and `try_again` supports [DBus Secret Service](https://specifications.freedesktop.org/secret-service).
-
-The process flow is that the first `password()` call spawns the unlock prompt, then the second call retrieves the password. [Here](https://gist.github.com/lcpz/1854fc4320f4701957cd5309c8eed4a6) is an example of `password` function.
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-`timer` | The widget timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-`pwdtimer` | Password retrieval timer (available only if `password` is a function)| [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-
-The `update` function can be used to refresh the widget before `timeout` expires.
-
-You can use `timer` to start/stop the widget as you like.
diff --git a/user/.config/awesome/lain/wiki/mem.md b/user/.config/awesome/lain/wiki/mem.md
deleted file mode 100755
index 205d535f8..000000000
--- a/user/.config/awesome/lain/wiki/mem.md
+++ /dev/null
@@ -1,33 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows memory status in MiB, [like `top` and `free -h`](https://github.com/lcpz/lain/issues/271).
-
-```lua
-local mymem = lain.widget.mem()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 2
-`settings` | User settings | function | empty function
-
-in `settings` you can use the following variables:
-
-Variable | Meaning | Type
---- | --- | ---
-`mem_now.used` | Memory used (MiB) | string
-`mem_now.swapused` | Swap memory used (MiB) | string
-`mem_now.perc` | Memory percentage | int
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/moc.md b/user/.config/awesome/lain/wiki/moc.md
deleted file mode 100755
index 130bccbbd..000000000
--- a/user/.config/awesome/lain/wiki/moc.md
+++ /dev/null
@@ -1,122 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-A widget for showing the current song track's information from MOC (Music On Console).
-
-```lua
-local mymoc = lain.widget.contrib.moc()
-```
-
-Now playing songs are notified like this:
-
- +--------------------------------------------------------+
- | +-------+ |
- | |/^\_/^\| Now playing |
- | |\ O O /| Cannibal Corpse (Hammer Smashed Face) - 1993 |
- | | '.o.' | Hammer Smashed Face (Radio Disney Version) |
- | +-------+ |
- +--------------------------------------------------------+
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 1
-`music_dir` | Music directory | string | "~/Music"
-`cover_size` | Album art notification size (both height and width) | integer | 100
-`cover_pattern` | Pattern for the album art file | string | `*\\.(jpg|jpeg|png|gif)`*
-`default_art` | Default art | string | ""
-`followtag` | Display the notification on currently focused screen | boolean | false
-`settings` | User settings | function | empty function
-
-\* In Lua, "\\\\" means "\" escaped.
-
-Default `cover_pattern` definition will made the widget set the first jpg, jpeg, png or gif file found in the directory as the album art.
-
-Pay attention to case sensitivity when defining `music_dir`.
-
-`settings` can use `moc_now` table, which contains the following string values:
-
-- state (possible values: "PLAY", "PAUSE", "STOP")
-- file
-- artist
-- title
-- album
-- elapsed (Time elapsed for the current track)
-- total (The current track's total time)
-
-and can modify `moc_notification_preset` table, which will be the preset for the naughty notifications. Check [here](https://awesomewm.org/apidoc/libraries/naughty.html#notify) for the list of variables it can contain. Default definition:
-
-```lua
-moc_notification_preset = {
- title = "Now playing",
- timeout = 6,
- text = string.format("%s (%s) - %s\n%s", moc_now.artist,
- moc_now.album, moc_now.elapsed, moc_now.title)
-}
-```
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-`timer` | The widget timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-
-The `update` function can be used to refresh the widget before `timeout` expires.
-
-You can use `timer` to start/stop the widget as you like.
-
-## Keybindings
-
-You can control the widget with key bindings like these:
-
-```lua
--- MOC control
-awful.key({ altkey, "Control" }, "Up",
- function ()
- os.execute("mocp -G") -- toggle
- moc.update()
- end),
-awful.key({ altkey, "Control" }, "Down",
- function ()
- os.execute("mocp -s") -- stop
- moc.update()
- end),
-awful.key({ altkey, "Control" }, "Left",
- function ()
- os.execute("mocp -r") -- previous
- moc.update()
- end),
-awful.key({ altkey, "Control" }, "Right",
- function ()
- os.execute("mocp -f") -- next
- moc.update()
- end),
-```
-
-where `altkey = "Mod1"`.
-
-If you don't use the widget for long periods and wish to spare CPU, you can toggle it with a keybinding like this:
-
-```lua
--- toggle MOC widget
-awful.key({ altkey }, "0",
- function ()
- local common = { text = "MOC widget ", position = "top_middle", timeout = 2 }
- if moc.timer.started then
- moc.timer:stop()
- common.text = common.text .. markup.bold("OFF")
- else
- moc.timer:start()
- common.text = common.text .. markup.bold("ON")
- end
- naughty.notify(common)
- end),
-```
diff --git a/user/.config/awesome/lain/wiki/mpd.md b/user/.config/awesome/lain/wiki/mpd.md
deleted file mode 100755
index cd114a583..000000000
--- a/user/.config/awesome/lain/wiki/mpd.md
+++ /dev/null
@@ -1,180 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows MPD status.
-
-```lua
-local mympd = lain.widget.mpd()
-```
-
-Now playing songs are notified like this:
-
- +--------------------------------------------------------+
- | +-------+ |
- | |/^\_/^\| Now playing |
- | |\ O O /| Cannibal Corpse (Hammer Smashed Face) - 1993 |
- | | '.o.' | Hammer Smashed Face (Radio Disney Version) |
- | +-------+ |
- +--------------------------------------------------------+
-
-**Note:** if MPD is turned off or not set correctly, the widget will constantly display "N/A" values.
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 2
-`password` | MPD password | string | ""
-`host` | MPD server | string | "127.0.0.1"
-`port` | MPD port | string | "6600"
-`music_dir` | Music directory | string | "~/Music"
-`cover_size` | Album art notification size (both height and width) | integer | 100
-`cover_pattern` | Pattern for the album art file | string | `*.(jpg\|jpeg\|png\|gif)$`
-`default_art` | Default art | string | `nil`
-`notify` | Show notification popups | string | "on"
-`followtag` | Notification behaviour | boolean | false
-`settings` | User settings | function | empty function
-
-\* In Lua, "\\\\" means "\" escaped.
-
-Default `cover_pattern` definition will made the widget set the first jpg, jpeg, png or gif file found in the directory as the album art.
-
-Pay attention to case sensitivity when defining `music_dir`.
-
-`settings` can use `mpd_now` table, which contains the following values:
-
-(**note:** the first four are boolean [flags](https://github.com/lcpz/lain/pull/205), the remaining are all strings)
-
-- random_mode
-- single_mode
-- repeat_mode
-- consume_mode
-- pls_pos (playlist position)
-- pls_len (playlist length)
-- state (possible values: "play", "pause", "stop")
-- file
-- artist
-- title
-- name
-- album
-- track
-- genre
-- date
-- [time](https://github.com/lcpz/lain/pull/90) (length of current song, in seconds)
-- [elapsed](https://github.com/lcpz/lain/pull/90) (elapsed time of current song, in seconds)
-
-and can modify `mpd_notification_preset` table, which will be the preset for the naughty notifications. Check [here](https://awesomewm.org/doc/api/libraries/naughty.html#notify) for the list of variables it can contain. Default definition:
-
-```lua
-mpd_notification_preset = {
- title = "Now playing",
- timeout = 6,
- text = string.format("%s (%s) - %s\n%s", mpd_now.artist,
- mpd_now.album, mpd_now.date, mpd_now.title)
-}
-```
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The textbox | `wibox.widget.textbox`
-`update` | Update `widget` | function
-`timer` | The widget timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-
-The `update` function can be used to refresh the widget before `timeout` expires.
-
-You can use `timer` to start/stop the widget as you like.
-
-## Keybindings
-
-You can control the widget with keybindings like these:
-
-```lua
--- MPD control
-awful.key({ altkey, "Control" }, "Up",
- function ()
- awful.spawn.with_shell("mpc toggle || ncmpc toggle || pms toggle")
- mympd.update()
- end),
-awful.key({ altkey, "Control" }, "Down",
- function ()
- awful.spawn.with_shell("mpc stop || ncmpc stop || pms stop")
- mympd.update()
- end),
-awful.key({ altkey, "Control" }, "Left",
- function ()
- awful.spawn.with_shell("mpc prev || ncmpc prev || pms prev")
- mympd.update()
- end),
-awful.key({ altkey, "Control" }, "Right",
- function ()
- awful.spawn.with_shell("mpc next || ncmpc next || pms next")
- mympd.update()
- end),
-```
-
-where `altkey = "Mod1"`.
-
-If you don't use the widget for long periods and wish to spare CPU, you can toggle it with a keybinding like this:
-
-```lua
--- disable MPD widget
-awful.key({ altkey }, "0",
- function ()
- local common = {
- text = "MPD widget ",
- position = "top_middle",
- timeout = 2
- }
- if mympd.timer.started then
- mympd.timer:stop()
- common.text = common.text .. markup.bold("OFF")
- else
- mympd.timer:start()
- common.text = common.text .. markup.bold("ON")
- end
- naughty.notify(common)
- end),
-```
-
-## Notes
-
-### Cover not showing in notifications
-
-If the cover file is existent but not showed in notifications, [try](https://github.com/lcpz/lain/issues/393) setting `music_dir` to a symlink of your music folder, rather than to a physical path. This can be easily done through
-```shell
-ln -s /the/real_path_to_your_music/ /home/username/Music
-```
-However, this only applies if the music is stored outside your user-specific folder, for instance in an external partition.
-
-### Always use `set_markup`
-
-In `settings`, if you use `widget:set_text`, [it will ignore Pango markup](https://github.com/lcpz/lain/issues/258), so be sure to always use `widget:set_markup`.
-
-### Volume fade in toggling MPD
-
-If you want a fade in/out in toggling MPD, you can put [this script](https://gist.github.com/lcpz/76e315bc27c6cdf7edd5021964b88df1) in your local `bin` directory:
-
-```shell
-$ curl https://gist.githubusercontent.com/lcpz/76e315bc27c6cdf7edd5021964b88df1/raw/97f7ba586418a4e07637cfbc91d2974278dfa623/mpd-fade -o ~/bin/mpc-fade
-$ chmod +x ~/bin/mpc-fade
-```
-
-Set your 1% decrease/increase commands [here](https://gist.github.com/lcpz/76e315bc27c6cdf7edd5021964b88df1#file-mpd-fade-L8-L9), then use a keybinding like this:
-
-```lua
--- MPD toggle with volume fading
-awful.key({ "Shift" }, "Pause",
- function()
- awful.spawn.easy_async("mpc-fade 20 4", -- mpc-fade
- function(stdout, stderr, reason, exit_code)
- mympd.update()
- end)
- end),
-```
diff --git a/user/.config/awesome/lain/wiki/net.md b/user/.config/awesome/lain/wiki/net.md
deleted file mode 100755
index 252399ea7..000000000
--- a/user/.config/awesome/lain/wiki/net.md
+++ /dev/null
@@ -1,115 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Monitors network interfaces and shows current traffic.
-
-```lua
-local mynet = lain.widget.net()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 2
-`iface` | Network device(s) | string (single interface) or table of strings (multiple interfaces) | autodetected
-`units` | Units | integer | 1024 (kilobytes)
-`notify` | Display "no carrier" notifications | string | "on"
-`wifi_state` | Get wifi connection status | string | "off"
-`eth_state` | Get ethernet connection status | string | "off"
-`screen` | Notifications screen | integer | 1
-`settings` | User settings | function | empty function
-
-`iface` can be a string or an table of the form `{ "eth0", "eth1", ... }` containing a list of the devices to collect data on.
-
-If more than one device is included, `net_now.sent` and `net_now.received` will contain cumulative values over all given devices.
-Use `net_now.devices["eth0"]` to access `sent`, `received`, `state` or `carrier` per device.
-
-Possible alternative values for `units` are 1 (byte) or multiple of 1024: 1024^2 (mb), 1024^3 (gb), and so on.
-
-If `notify = "off"` is set, the widget won't display a notification when there's no carrier.
-
-`settings` can use the following `iface` related strings:
-
-- `net_now.carrier` ("0", "1");
-- `net_now.state` ("up", "down");
-- `net_now.sent` and `net_now.received` (numbers) will be the sum across all specified interfaces;
-- `net_now.devices["interface"]` contains the same attributes as the old api for each interface. More on this in the "Multiple devices" section below.
-
-If `wifi_state = "on"` is set, `settings` can use the following extra strings attached to `net_now.devices["wireless interface"]`:
-- `wifi` (true, false) indicates if the interface is connected to a network;
-- `signal` (number) is the connection signal strength in dBm;
-
-If `eth_state = "on"` is set, `settings` can use the following extra string: `net_now.devices["ethernet interface"].ethernet`, which is a boolean indicating if an ethernet connection's active.
-
-For compatibility reasons, if multiple devices are given, `net_now.carrier` and `net_now.state` correspond to the last interface in the iface table and should not be relied upon (deprecated).
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-
-## Notes
-
-### Setting `iface` manually
-
-If the widget [spawns a "no carrier" notification and you are sure to have an active network device](https://github.com/lcpz/lain/issues/102), then autodetection is probably not working. This may due to [your user privileges](https://github.com/lcpz/lain/issues/102#issuecomment-246470526). In this case you can set `iface` manually. You can see which device is **UP,LOWER_UP** with the following command:
-
-```shell
-ip link show
-```
-## Usage examples
-### Two widgets for upload/download rates from the same `iface`
-
-```lua
-local mynetdown = wibox.widget.textbox()
-local mynetup = lain.widget.net {
- settings = function()
- widget:set_markup(net_now.sent)
- netdowninfo:set_markup(net_now.received)
- end
-}
-```
-### Wifi connection + signal strength indicator and ethernet connection indicator
-```lua
-local wifi_icon = wibox.widget.imagebox()
-local eth_icon = wibox.widget.imagebox()
-local net = lain.widget.net {
- notify = "off",
- wifi_state = "on",
- eth_state = "on",
- settings = function()
- local eth0 = net_now.devices.eth0
- if eth0 then
- if eth0.ethernet then
- eth_icon:set_image(ethernet_icon_filename)
- else
- eth_icon:set_image()
- end
- end
-
- local wlan0 = net_now.devices.wlan0
- if wlan0 then
- if wlan0.wifi then
- local signal = wlan0.signal
- if signal < -83 then
- wifi_icon:set_image(wifi_weak_filename)
- elseif signal < -70 then
- wifi_icon:set_image(wifi_mid_filename)
- elseif signal < -53 then
- wifi_icon:set_image(wifi_good_filename)
- elseif signal >= -53 then
- wifi_icon:set_image(wifi_great_filename)
- end
- else
- wifi_icon:set_image()
- end
- end
- end
-}
-```
diff --git a/user/.config/awesome/lain/wiki/pulse.md b/user/.config/awesome/lain/wiki/pulse.md
deleted file mode 100755
index 311b4743b..000000000
--- a/user/.config/awesome/lain/wiki/pulse.md
+++ /dev/null
@@ -1,135 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows and controls PulseAudio volume.
-
-```lua
-local volume = lain.widget.pulse()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 5
-`devicetype` | PulseAudio device type | string ("sink", "source") | "sink"
-`cmd` | PulseAudio command | string or function | see [here](https://github.com/lcpz/lain/blob/master/widget/pulse.lua#L26)
-`settings` | User settings | function | empty function
-
-`cmd` is a terminal command to catch infos from current default device. You can redefine it, being sure that the ouput is something like this:
-
-```shell
-* index: 0
- volume: front-left: 18340 / 28% / -33.18 dB, front-right: 18340 / 28% / -33.18 dB
- muted: no
- device.string = "front:1"
-```
-
-If your devices change dynamically, you can define it as a function which returns a command string.
-
-If sed doesn't work, you can try with a grep variant:
-
-```lua
-cmd = "pacmd list-" .. pulse.devicetype .. "s | grep -e $(pactl info | grep -e 'ink' | cut -d' ' -f3) -e 'volume: front' -e 'muted'"
-```
-
-### `settings` variables
-
-`settings` can use the following variables:
-
-Variable | Meaning | Type | Values
---- | --- | --- | ---
-`volume_now.device` | Device name | string | device name or "N/A"
-`volume_now.index` | Device index | string | >= "0"
-`volume_now.muted` | Device mute status | string | "yes", "no", "N/A"
-`volume_now.channel` | Device channels | table of string integers | `volume_now.channel[i]`, where `i >= 1`
-`volume_now.left` | Front left sink level or first source | string | "0"-"100"
-`volume_now.right` | Front right sink level or second source | string | "0"-"100"
-
-`volume_now.channel` is a table of your PulseAudio devices. Fetch a channel level like this: `volume_now.channel[i]`, where `i >= 1`.
-
-`volume_now.{left,right}` are pointers for `volume_now.{channel[1], channel[2]}` (stereo).
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-
-## Buttons
-
-```lua
-volume.widget:buttons(awful.util.table.join(
- awful.button({}, 1, function() -- left click
- awful.spawn("pavucontrol")
- end),
- awful.button({}, 2, function() -- middle click
- os.execute(string.format("pactl set-sink-volume %d 100%%", volume.device))
- volume.update()
- end),
- awful.button({}, 3, function() -- right click
- os.execute(string.format("pactl set-sink-mute %d toggle", volume.device))
- volume.update()
- end),
- awful.button({}, 4, function() -- scroll up
- os.execute(string.format("pactl set-sink-volume %d +1%%", volume.device))
- volume.update()
- end),
- awful.button({}, 5, function() -- scroll down
- os.execute(string.format("pactl set-sink-volume %d -1%%", volume.device))
- volume.update()
- end)
-))
-```
-
-## Keybindings
-
-```lua
--- PulseAudio volume control
-awful.key({ altkey }, "Up",
- function ()
- os.execute(string.format("pactl set-sink-volume %d +1%%", volume.device))
- volume.update()
- end),
-awful.key({ altkey }, "Down",
- function ()
- os.execute(string.format("pactl set-sink-volume %d -1%%", volume.device))
- volume.update()
- end),
-awful.key({ altkey }, "m",
- function ()
- os.execute(string.format("pactl set-sink-mute %d toggle", volume.device))
- volume.update()
- end),
-awful.key({ altkey, "Control" }, "m",
- function ()
- os.execute(string.format("pactl set-sink-volume %d 100%%", volume.device))
- volume.update()
- end),
-awful.key({ altkey, "Control" }, "0",
- function ()
- os.execute(string.format("pactl set-sink-volume %d 0%%", volume.device))
- volume.update()
- end),
-```
-
-where `altkey = "Mod1"`.
-
-## Example
-
-```lua
--- PulseAudio volume (based on multicolor theme)
-local volume = lain.widget.pulse {
- settings = function()
- vlevel = volume_now.left .. "-" .. volume_now.right .. "% | " .. volume_now.device
- if volume_now.muted == "yes" then
- vlevel = vlevel .. " M"
- end
- widget:set_markup(lain.util.markup("#7493d2", vlevel))
- end
-}
-```
diff --git a/user/.config/awesome/lain/wiki/pulseaudio.md b/user/.config/awesome/lain/wiki/pulseaudio.md
deleted file mode 100755
index 6c11cb4ee..000000000
--- a/user/.config/awesome/lain/wiki/pulseaudio.md
+++ /dev/null
@@ -1,150 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows and controls PulseAudio volume.
-
-```lua
-local volume = lain.widget.pulseaudio()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout seconds | number | 5
-`devicetype | PulseAudio device type | string ("sink", "source") | "sink"
-`cmd` | PulseAudio command | string | [link](https://github.com/lcpz/lain/blob/master/widget/pulseaudio.lua#L28)
-`scallback` | PulseAudio sink callback | function | `nil`
-`settings` | User settings | function | empty function
-
-`cmd` catch infos from current default sink. You can redefine it, being sure that the ouput is something like this:
-
-```shell
-* index: 0
- volume: front-left: 18340 / 28% / -33.18 dB, front-right: 18340 / 28% / -33.18 dB
- muted: no
- device.string = "front:1"
-```
-
-**Note:** you can set PulseAudio default sink like this: `pacmd set-default-sink #sink`.
-
-If [`sed`](https://github.com/lcpz/lain/blob/master/widget/pulseaudio.lua#L28) doesn't work, you can try with `grep`:
-
-```shell
-pacmd list-sinks | grep -e $(pactl info | grep -e 'ink' | cut -d' ' -f3) -e 'volume: front' -e 'muted'
-```
-
-`scallback` is a callback function to update `cmd`, in case you switch between audio channels and therefore PulseAudio sink changes. If default `cmd` works for you, you can tell `scallback` to work in the same way:
-
-```lua
-scallback = function()
- devicetype = "sink"
- return "pacmd list-" .. devicetype .. "s | sed -n -e '0,/*/d' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'"
-end
-```
-
-### `settings` variables
-
-`settings` can use the following variables:
-
-Variable | Meaning | Type | Values
---- | --- | --- | ---
-`volume_now.index` | Sink index | string | >= "0"
-`volume_now.sink` | Sink name | string | sink name or "N/A"
-`volume_now.muted` | Sink mute status | string | "yes", "no", "N/A"
-`volume_now.channel` | Sink channels | table of string integers | `volume_now.channel[i]`, where `i >= 1`
-`volume_now.left` | Front left level | string | "0"-"100"
-`volume_now.right` | Front right level | string | "0"-"100"
-
-`volume_now.channel` is a table of your pulseaudio sink channels. Fetch a channel level like this: `volume_now.channel[i]`, where `i >= 1`.
-
-`volume_now.{left,right}` are pointers for `volume_now.{channel[1], channel[2]}` (stereo).
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-
-## Buttons
-
-If you want buttons, just add the following after your widget in `rc.lua`.
-
-```lua
-volume.widget:buttons(awful.util.table.join(
- awful.button({}, 1, function() -- left click
- awful.spawn("pavucontrol")
- end),
- awful.button({}, 2, function() -- middle click
- awful.spawn(string.format("pactl set-sink-volume %d 100%%", volume.sink))
- volume.update()
- end),
- awful.button({}, 3, function() -- right click
- awful.spawn(string.format("pactl set-sink-mute %d toggle", volume.sink))
- volume.update()
- end),
- awful.button({}, 4, function() -- scroll up
- awful.spawn(string.format("pactl set-sink-volume %d +1%%", volume.sink))
- volume.update()
- end),
- awful.button({}, 5, function() -- scroll down
- awful.spawn(string.format("pactl set-sink-volume %d -1%%", volume.sink))
- volume.update()
- end)
-))
-```
-
-## Keybindings
-
-You can control the widget with key bindings like these:
-
-```lua
--- PulseAudio volume control
-awful.key({ altkey }, "Up",
- function ()
- os.execute(string.format("pactl set-sink-volume %d +1%%", volumewidget.sink))
- volume.update()
- end),
-awful.key({ altkey }, "Down",
- function ()
- os.execute(string.format("pactl set-sink-volume %d -1%%", volumewidget.sink))
- volume.update()
- end),
-awful.key({ altkey }, "m",
- function ()
- os.execute(string.format("pactl set-sink-mute %d toggle", volumewidget.sink))
- volume.update()
- end),
-awful.key({ altkey, "Control" }, "m",
- function ()
- os.execute(string.format("pactl set-sink-volume %d 100%%", volume.sink))
- volume.update()
- end),
-awful.key({ altkey, "Control" }, "0",
- function ()
- os.execute(string.format("pactl set-sink-volume %d 0%%", volume.sink))
- volume.update()
- end),
-```
-
-where `altkey = "Mod1"`.
-
-## Example
-
-```lua
--- PulseAudio volume (based on multicolor theme)
-local volume = lain.widget.pulseaudio({
- settings = function()
- vlevel = volume_now.left .. "-" .. volume_now.right .. "% | " .. volume_now.sink
- if volume_now.muted == "yes" then
- vlevel = vlevel .. " M"
- end
-
- widget:set_markup(lain.util.markup("#7493d2", vlevel))
- end
-})
-```
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/pulsebar.md b/user/.config/awesome/lain/wiki/pulsebar.md
deleted file mode 100755
index 61a86cdd4..000000000
--- a/user/.config/awesome/lain/wiki/pulsebar.md
+++ /dev/null
@@ -1,94 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows PulseAudio volume with a progressbar; provides tooltips and notifications.
-
-```lua
-local volume = lain.widget.pulsebar()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 5
-`settings` | User settings | function | empty function
-`width` | Bar width | number | 63
-`height` | Bar height | number | 1
-`margins` | Bar margins | number | 1
-`paddings` | Bar paddings | number | 1
-`ticks` | Set bar ticks on | boolean | false
-`ticks_size` | Ticks size | number | 7
-`scallback` | [PulseAudio sink callback](https://github.com/lcpz/lain/wiki/pulseaudio/) | function | `nil`
-`sink` | Mixer sink | number | 0
-`colors` | Bar colors | table | see [Default colors](https://github.com/lcpz/lain/wiki/pulsebar#default-colors)
-`notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/pulsebar#default-notification_preset)
-`followtag` | Display the notification on currently focused screen | boolean | false
-`notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/pulsebar#default-notification_preset)
-`devicetype` | PulseAudio device type | string ("sink", "source") | "sink"
-`cmd` | PulseAudio command | string or function | see [here](https://github.com/lcpz/lain/blob/master/widget/pulsebar.lua#L48)
-
-Read [pulse](https://github.com/lcpz/lain/wiki/pulse) page for `cmd` settings.
-
-`settings` can use [these variables](https://github.com/lcpz/lain/wiki/pulse#settings-variables).
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-### Default colors
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`background` | Bar backgrund color | string | "#000000"
-`mute` | Bar mute color | string | "#EB8F8F"
-`unmute` | Bar unmute color | string | "#A4CE8A"
-
-### Default `notification_preset`
-
-```lua
-notification_preset = {
- font = "Monospace 10"
-}
-```
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`bar` | The widget | `wibox.widget.progressbar`
-`device` | PulseAudio device | string
-`notify` | The notification | function
-`update` | Update state | function
-`tooltip` | The tooltip | `awful.tooltip`
-
-## Buttons
-
-```lua
-volume.bar:buttons(awful.util.table.join(
- awful.button({}, 1, function() -- left click
- awful.spawn("pavucontrol")
- end),
- awful.button({}, 2, function() -- middle click
- os.execute(string.format("pactl set-sink-volume %d 100%%", volume.device))
- volume.update()
- end),
- awful.button({}, 3, function() -- right click
- os.execute(string.format("pactl set-sink-mute %d toggle", volume.device))
- volume.update()
- end),
- awful.button({}, 4, function() -- scroll up
- os.execute(string.format("pactl set-sink-volume %d +1%%", volume.device))
- volume.update()
- end),
- awful.button({}, 5, function() -- scroll down
- os.execute(string.format("pactl set-sink-volume %d -1%%", volume.device))
- volume.update()
- end)
-))
-```
-
-## Keybindings
-
-Same as [here](https://github.com/lcpz/lain/wiki/pulse#keybindings). If you want notifications, use `volume.notify()` instead of `volume.update()`.
diff --git a/user/.config/awesome/lain/wiki/redshift.md b/user/.config/awesome/lain/wiki/redshift.md
deleted file mode 100755
index b83ad3a75..000000000
--- a/user/.config/awesome/lain/wiki/redshift.md
+++ /dev/null
@@ -1,100 +0,0 @@
-### What is Redshift? #
-
-[**Project homepage**](http://jonls.dk/redshift/)
-
->**Redshift** is an application that adjusts the computer display's color temperature based upon the Sun's apparent position in relation to the user's location on Earth.
->
->The program is free software, inspired by the proprietary f.lux, and can be used to reduce eye strain as well as insomnia and delayed sleep phase syndrome.
->
->The computer display's color temperature transitions evenly from night to daytime temperature to allow the user's eyes to slowly adapt. At night, the color temperature is low and is typically 3000–4000 K (default is 3500 K), preferably matching the room's lighting temperature. Typical color temperature during the daytime is 5500–6500 K (default is 5500 K).
-
-**Source:** [Wikipedia](https://en.wikipedia.org/wiki/Redshift_%28software%29)
-
-### Preparations
-
-**Redshift must be installed** on your system if you want to use this widget.
-
-Packages should be available for most distributions. Source code and build instructions can be found on Github [here](https://github.com/jonls/redshift).
-
-You also need a valid config file. Please see the [project homepage](http://jonls.dk/redshift/) for details. An example: [`~/.config/redshift.conf`](https://github.com/jonls/redshift/blob/master/redshift.conf.sample).
-
-You have to match the location settings to your personal situation: you can adjust the `lat` and `lon` variables using a [web service](https://encrypted.google.com/search?q=get+latitude+and+longitude).
-
-You might also want to modify the color temperatures to fit your preferences.
-
-### Using the widget
-
-This widget provides the following functions:
-
-| function | meaning |
-| --- | --- |
-| `redshift:toggle()` | Toggles Redshift adjustments on or off, and also restarts it if terminates. |
-| `redshift:attach(widget, update_function)` | Attach to a widget. Click on the widget to toggle redshift on or off. `update_function` is a callback function which will be triggered each time Redshift changes its status. (See the examples below.) |
-
-### Usage examples
-
-#### Textbox status widget
-
-```lua
-myredshift = wibox.widget.textbox()
-lain.widget.contrib.redshift:attach(
- myredshift,
- function (active)
- if active then
- myredshift:set_text("RS on")
- else
- myredshift:set_text("RS off")
- end
- end
-)
-```
-
-Then add `myredshift.widget` to your wibox.
-
-#### Checkbox status widget
-
-```lua
-local markup = lain.util.markup
-
-local myredshift = wibox.widget{
- checked = false,
- check_color = "#EB8F8F",
- border_color = "#EB8F8F",
- border_width = 1,
- shape = gears.shape.square,
- widget = wibox.widget.checkbox
-}
-
-local myredshift_text = wibox.widget{
- align = "center",
- widget = wibox.widget.textbox,
-}
-
-local myredshift_stack = wibox.widget{
- myredshift,
- myredshift_text,
- layout = wibox.layout.stack
-}
-
-lain.widget.contrib.redshift:attach(
- myredshift,
- function (active)
- if active then
- myredshift_text:set_markup(markup(beautiful.bg_normal, "R"))
- else
- myredshift_text:set_markup(markup(beautiful.fg_normal, "R"))
- end
- myredshift.checked = active
- end
-)
-```
-
-Then add the `myredshift_stack` widget to your wibox.
-
-#### Keybinding
-
-Add this to the keybindings in your `rc.lua`:
-```lua
--- Toggle redshift with Mod+Shift+t
-awful.key({ modkey, "Shift" }, "t", function () lain.widget.contrib.redshift:toggle() end),
-```
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/sysload.md b/user/.config/awesome/lain/wiki/sysload.md
deleted file mode 100755
index 6fb1c04fd..000000000
--- a/user/.config/awesome/lain/wiki/sysload.md
+++ /dev/null
@@ -1,27 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows the current system load.
-
-```lua
-mysysload = lain.widget.sysload()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 2
-`settings` | User settings | function | empty function
-
-`settings` can use strings `load_1`, `load_5` and `load_15`, which are the load averages over 1, 5, and 15 minutes.
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/task.md b/user/.config/awesome/lain/wiki/task.md
deleted file mode 100755
index af53a6a3a..000000000
--- a/user/.config/awesome/lain/wiki/task.md
+++ /dev/null
@@ -1,51 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Attaches a [taskwarrior](http://taskwarrior.org) notifications to a widget, and lets you execute `task` commands from the promptbox.
-
-```lua
-lain.widget.contrib.task.attach(widget, args)
-```
-
-`args` is an optional table which can contain:
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`show_cmd` | Taskwarrior command to show in the popup | string | "task next"
-`prompt_text` | Prompt text | string | "Enter task command: "
-`followtag` | Display the notification on currently focused screen | boolean | false
-`notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/task#default-notification_preset)
-
-The tasks are shown in a notification popup when the mouse is moved over the attached `widget`, and the popup is hidden when the mouse is moved away. By default, the notification will show the output of `task next`. With `show_cmd`, the `task` popup command can be customized, for example if you want to [filter the tasks](https://taskwarrior.org/docs/filter.html) or show a [custom report](https://github.com/lcpz/lain/pull/213).
-
-With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-You can call the notification with a keybinding like this:
-
-```lua
-awful.key({ modkey, altkey }, "t", function () lain.widget.contrib.task.show(scr) end),
-```
-
-where ``altkey = "Mod1"`` and `scr` (optional) indicates the screen which you want the notification in.
-
-And you can prompt to input a `task` command with a keybinding like this:
-
-```lua
-awful.key({ altkey }, "t", lain.widget.contrib.task.prompt),
-```
-
-### Default `notification_preset`
-
-```lua
-notification_preset = {
- font = "Monospace 10",
- icon = helpers.icons_dir .. "/taskwarrior.png"
-}
-```
-
-## Note
-
-* If your widget does not display `task next` output, try changing Taskwarrior verbose, for instance: `show_cmd = 'task rc.verbose:label'` or `show_cmd = 'task rc.verbose:nothing'`.
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/temp.md b/user/.config/awesome/lain/wiki/temp.md
deleted file mode 100755
index 3857d927b..000000000
--- a/user/.config/awesome/lain/wiki/temp.md
+++ /dev/null
@@ -1,32 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Shows the current CPU temperature.
-
-```lua
-local mytemp = lain.widget.temp()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout (in seconds) | integer | 2
-`tempfile` | Path of file which stores core temperature value | string | "/sys/class/thermal/thermal_zone0/temp"
-`settings` | User settings | function | empty function
-
-`settings` can use the string `coretemp_now`, which means current core temperature, expressed in Celsius (linux standard).
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`update` | Update `widget` | function
-
-## Note
-
-Depending on the architecture, note that your temp files location [might vary](https://github.com/lcpz/lain/issues/84#issuecomment-72751763).
\ No newline at end of file
diff --git a/user/.config/awesome/lain/wiki/tp_smapi.md b/user/.config/awesome/lain/wiki/tp_smapi.md
deleted file mode 100755
index edb108faf..000000000
--- a/user/.config/awesome/lain/wiki/tp_smapi.md
+++ /dev/null
@@ -1,103 +0,0 @@
-# Description
-
-[`tp_smapi`](http://www.thinkwiki.org/wiki/Tp_smapi) interface and widget creator.
-
-```lua
-local tp_smapi = lain.widget.contrib.tp_smapi(apipath)
-```
-
-The argument `apipath` is an optional string which defines the API path. Its default value is `"/sys/devices/platform/smapi"`.
-
-# Functions
-
-## tp_smapi.get(batid, feature)
-
-Gets the `feature` of battery `batid`. Returns a string. The list of available features is available at [this page](https://www.thinkwiki.org/wiki/Tp_smapi#Battery_status_features).
-
-## tp_smapi.installed(batid)
-
-Checks if battery `batid` is installed. Returns a boolean.
-
-## tp_smapi.status(batid)
-
-Gets the status of battery `batid`. Returns a string ("charging", "discharging", or "full").
-
-## tp_smapi.percentage(batid)
-
-Gets the percentage of battery `batid`. Returns a numeric string.
-
-## tp_smapi.time(batid)
-
-Gets the time of battery `batid`. Depending on the current status, it can be either running or charging time. Returns a string of the format `HH:MM`.
-
-## tp_smapi.hide()
-
-Removes any notification spawned by `tp_smapi.show`.
-
-## tp_smapi.show(batid, seconds, scr)
-
-Notifies the current information of battery `batid` for `seconds` seconds on screen `scr`.
-The argument `scr` is optional, and if missing, the notification will be displayed on the currently focused screen.
-
-## tp_smapi.create_widget(args)
-
-Creates a [lain widget](https://github.com/lcpz/lain/wiki/Widgets#usage) of the available ThinkPad batteries.
-
-```lua
-local tpbat = tp_smapi.create_widget()
-```
-
-### Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`widget` | The widget type to use | [`wibox.widget`](https://awesomewm.org/doc/api/classes/wibox.widget.html) | [`wibox.widget.textbox`](https://awesomewm.org/doc/api/classes/wibox.widget.textbox.html)
-`timeout` | Refresh timeout (in seconds) | integer | 30
-`pspath` | Power supply directory path | string | "/sys/class/power_supply/"
-`battery` | Single battery id | string | autodetected
-`batteries` | Multiple batteries id table | table of strings | autodetected
-`settings` | User settings | function | empty function
-
-The widget will try to autodetect `battery` and `batteries`. If something
-goes wrong, you will have to define them manually. In that case, you only have
-to define one between `battery` and `batteries`. If you have one battery, you
-can either use `args.battery = "BAT*"` or `args.batteries = {"BAT*"}`, where `BAT*`
-is the identifier of your battery in `pspath` (do not use it as a wildcard).
-Of course, if you have multiple batteries, you need to use the latter option.
-
-If you define `pspath`, **be sure** to not forget the final slash (/).
-
-`settings` can use the `tpbat_now` table, which contains the following strings:
-
-- `status`, general status ("N/A", "discharging", "charging", "full");
-- `n_status[i]`, i-th battery status (like above);
-- `n_perc[i]`, i-th battery charge percentage (like above);
-- `n_time[i]`, i-th battery running or charging time (HH:MM string or "N/A");
-
-`n_time[i]` is the running time of battery `i` when it is discharging, and the charging time otherwise.
-
-### Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | [`wibox.widget`](https://awesomewm.org/doc/api/classes/wibox.widget.html) | [textbox](https://awesomewm.org/doc/api/classes/wibox.widget.textbox.html)
-`batteries` | Battery identifiers | Table of strings
-`update` | Update `widget` | function
-`timer` | The widget timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-
-The `update` function can be used to refresh the widget before `timeout` expires.
-
-### Usage example
-
-```lua
-local tp_smapi = lain.widget.contrib.tp_smapi()
-local bat = tp_smapi.create_widget {
- battery = "BAT0",
- settings = function()
- widget:set_markup(tpbat_now.n_perc[1] .. "%")
- end
-}
-
-bat.widget:connect_signal("mouse::enter", function () tp_smapi.show("BAT0") end)
-bat.widget:connect_signal("mouse::leave", function () tp_smapi.hide() end)
-```
diff --git a/user/.config/awesome/lain/wiki/watch.md b/user/.config/awesome/lain/wiki/watch.md
deleted file mode 100755
index ff18a5ca9..000000000
--- a/user/.config/awesome/lain/wiki/watch.md
+++ /dev/null
@@ -1,222 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Template for asynchronous watcher widgets.
-
-Executes an input command and makes the user feed a `wibox.widget` with the output.
-
-```lua
-local mywatch = lain.widget.watch()
-```
-
-This has been implemented in Awesome 4.0 as [`awful.widget.watch`](https://awesomewm.org/doc/api/classes/awful.widget.watch.html). But while Awesome `watch` returns only the widget, Lain one returns a table including its timer and internal update function too.
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`widget` | Widget to feed | `wibox.widget` | `wibox.widget.textbox`
-`timeout` | Refresh timeout seconds | number | 5
-`cmd` | The command to execute | string **or** table | `nil`
-`nostart` | Widget timer doesn't start immediately | boolean | false
-`stoppable` | Widget timer is stoppable | boolean | false
-`settings` | User settings | function | see [Default `settings` function](https://github.com/lcpz/lain/wiki/watch#default-settings-function)
-
-If your command needs a shell, you need to set `cmd` as an array of 3 strings, where the first contains the shell, the second contains `-c`, and the third contains the actual command. Example:
-
-```lua
-cmd = { awful.util.shell, "-c", "myactualcommand" }
-```
-
-`settings` can use the string `output`, which is the output of `cmd`.
-
-### Default `settings` function
-
-```lua
-settings = function() widget:set_text(output) end
-```
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | input widget type or `wibox.widget.textbox`
-`update` | Update `widget` | function
-`timer` | The widget timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html) or `nil`
-
-The `update` function can be used to refresh the widget before `timeout` expires.
-
-If `stoppable == true`, the widget will have an ad-hoc timer, which you can control though `timer` variable.
-
-## Use case examples
-
-### bitcoin
-
-```lua
--- Bitcoin to USD current price, using Coinbase V1 API
-local bitcoin = lain.widget.watch({
- timeout = 43200, -- half day
- stoppable = true,
- cmd = "curl -m5 -s 'https://coinbase.com/api/v1/prices/buy'",
- settings = function()
- local btc, pos, err = require("lain.util").dkjson.decode(output, 1, nil)
- local btc_price = (not err and btc and btc["subtotal"]["amount"]) or "N/A"
-
- -- customize here
- widget:set_text(btc_price)
- end
-})
-```
-
-### btrfs
-
-```lua
--- btrfs root df
-local myrootfs = lain.widget.watch({
- timeout = 600,
- cmd = "btrfs filesystem df -g /",
- settings = function()
- local total, used = string.match(output, "Data.-total=(%d+%.%d+)GiB.-used=(%d+%.%d+)GiB")
- local percent_used = math.ceil((tonumber(used) / tonumber(total)) * 100)
-
- -- customize here
- widget:set_text(" [/: " .. percent_used .. "%] ")
- end
-})
-```
-
-### cmus
-
-```lua
--- cmus audio player
-local cmus = lain.widget.watch({
- timeout = 2,
- stoppable = true,
- cmd = "cmus-remote -Q",
- settings = function()
- local cmus_now = {
- state = "N/A",
- artist = "N/A",
- title = "N/A",
- album = "N/A"
- }
-
- for w in string.gmatch(output, "(.-)tag") do
- a, b = w:match("(%w+) (.-)\n")
- cmus_now[a] = b
- end
-
- -- customize here
- widget:set_text(cmus_now.artist .. " - " .. cmus_now.title)
- end
-})
-```
-
-### maildir
-
-```lua
--- checks whether there are files in the "new" directories of a mail dirtree
-local mailpath = "~/Mail"
-local mymaildir = lain.widget.watch({
- timeout = 60,
- stoppable = true,
- cmd = { awful.util.shell, "-c", string.format("ls -1dr %s/*/new/*", mailpath) },
- settings = function()
- local inbox_now = { digest = "" }
-
- for dir in output:gmatch(".-/(%w+)/new") do
- inbox_now[dir] = 1
- for _ in output:gmatch(dir) do
- inbox_now[dir] = inbox_now[dir] + 1
- end
- if #inbox_now.digest > 0 then inbox_now.digest = inbox_now.digest .. ", " end
- inbox_now.digest = inbox_now.digest .. string.format("%s (%d)", dir, inbox_now[dir])
- end
-
- -- customize here
- widget:set_text("mail: " .. inbox_now.digest)
- end
-})
-```
-
-### mpris
-
-```lua
--- infos from mpris clients such as spotify and VLC
--- based on https://github.com/acrisci/playerctl
-local mpris = lain.widget.watch({
- cmd = "playerctl status && playerctl metadata",
- timeout = 2,
- stoppable = true,
- settings = function()
- local escape_f = require("awful.util").escape
- local mpris_now = {
- state = "N/A",
- artist = "N/A",
- title = "N/A",
- art_url = "N/A",
- album = "N/A",
- album_artist = "N/A"
- }
-
- mpris_now.state = string.match(output, "Playing") or
- string.match(output, "Paused") or "N/A"
-
- for k, v in string.gmatch(output, "'[^:]+:([^']+)':[%s]<%[?'([^']+)'%]?>")
- do
- if k == "artUrl" then mpris_now.art_url = v
- elseif k == "artist" then mpris_now.artist = escape_f(v)
- elseif k == "title" then mpris_now.title = escape_f(v)
- elseif k == "album" then mpris_now.album = escape_f(v)
- elseif k == "albumArtist" then mpris_now.album_artist = escape_f(v)
- end
- end
-
- -- customize here
- widget:set_text(mpris_now.artist .. " - " .. mpris_now.title)
- end
-})
-```
-
-### upower
-
-```lua
--- battery infos from freedesktop upower
-local mybattery = lain.widget.watch({
- timeout = 30,
- cmd = { awful.util.shell, "-c", "upower -i /org/freedesktop/UPower/devices/battery_BAT | sed -n '/present/,/icon-name/p'" },
- settings = function()
- local bat_now = {
- present = "N/A",
- state = "N/A",
- warninglevel = "N/A",
- energy = "N/A",
- energyfull = "N/A",
- energyrate = "N/A",
- voltage = "N/A",
- percentage = "N/A",
- capacity = "N/A",
- icon = "N/A"
- }
-
- for k, v in string.gmatch(output, '([%a]+[%a|-]+):%s*([%a|%d]+[,|%a|%d]-)') do
- if k == "present" then bat_now.present = v
- elseif k == "state" then bat_now.state = v
- elseif k == "warning-level" then bat_now.warninglevel = v
- elseif k == "energy" then bat_now.energy = string.gsub(v, ",", ".") -- Wh
- elseif k == "energy-full" then bat_now.energyfull = string.gsub(v, ",", ".") -- Wh
- elseif k == "energy-rate" then bat_now.energyrate = string.gsub(v, ",", ".") -- W
- elseif k == "voltage" then bat_now.voltage = string.gsub(v, ",", ".") -- V
- elseif k == "percentage" then bat_now.percentage = tonumber(v) -- %
- elseif k == "capacity" then bat_now.capacity = string.gsub(v, ",", ".") -- %
- elseif k == "icon-name" then bat_now.icon = v
- end
- end
-
- -- customize here
- widget:set_text("Bat: " .. bat_now.percentage .. " " .. bat_now.state)
- end
-})
-```
diff --git a/user/.config/awesome/lain/wiki/weather.md b/user/.config/awesome/lain/wiki/weather.md
deleted file mode 100755
index 1875965c0..000000000
--- a/user/.config/awesome/lain/wiki/weather.md
+++ /dev/null
@@ -1,150 +0,0 @@
-## Usage
-
-[Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
-
-### Description
-
-Provides current weather status widgets and X-days forecast popup notifications.
-
-Powered by [OpenWeatherMap](http://openweathermap.org/api) API.
-
-By default, it uses [current](http://openweathermap.org/current) for current weather data and [forecast16](http://openweathermap.org/forecast16) for forecasts.
-
-```lua
-local myweather = lain.widget.weather()
-```
-
-## Input table
-
-Variable | Meaning | Type | Default
---- | --- | --- | ---
-`timeout` | Refresh timeout seconds for current weather status | number | 900 (15 min)
-`timeout_forecast` | Refresh timeout seconds for forecast notification | number | 86400 (24 hrs)
-`current_call` | Command to fetch weather status data from the API | string | see `default_current_call`
-`forecast_call` | Command to fetch forecast data from the API | string | see `default_forecast_call`
-`city_id` | API city code | number | not set
-`utc_offset` | UTC time offset | function | see [here](https://github.com/lcpz/lain/blob/master/widget/weather.lua#L35-L39)
-`units` | Temperature units system | string | "metric"
-`lang` | API data localization | string | "en"
-`cnt` | Forecast days interval | integer | 5
-`date_cmd` | Forecast notification format style | string | "date -u -d @%d +'%%a %%d'"
-`icons_path` | Icons path | string | `lain/icons/openweathermap`
-`notification_preset` | Preset for notifications | table | empty table
-`notification_text_fun` | Function to format forecast notifications | function | see `notification_text_fun` below
-`weather_na_markup` | Markup to be used when weather textbox is not available | text | " N/A "
-`followtag` | Display the notification on currently focused screen | boolean | false
-`showpopup` | Display popups with mouse hovering | string, possible values: "on", "off" | "on"
-`settings` | User settings | function | empty function
-
-- ``default_current_call``
-
- `"curl -s 'http://api.openweathermap.org/data/2.5/weather?id=%s&units=%s&lang=%s'"`
-
- You can rewrite it using any fetcher solution you like, or you can modify it in order to fetch data by city name, instead of ID: just replace `id` with `q`:
-
- `"curl -s 'http://api.openweathermap.org/data/2.5/weather?q=%s&units=%s&lang=%s'"`
-
- and set `city_id` with your city name, for instance `city_id = "London,UK"`.
-
-- ``default_forecast_call``
-
- `"curl -s 'http://api.openweathermap.org/data/2.5/forecast/daily?id=%s&units=%s&lang=%s&cnt=%s'"`
-
- Like above.
- If you want to use [forecast5](http://openweathermap.org/forecast5), use this API call string:
- `http://api.openweathermap.org/data/2.5/forecast?id=%s&units=%s&lang=%s&cnt=%s`
-
-- ``city_id``
-
- An integer that defines the OpenWeatherMap ID code of your city.
- To obtain it go to [OpenWeatherMap](http://openweathermap.org/) and query for your city in the top search bar. The link will look like this:
-
- http://openweathermap.org/city/2643743
-
- your `city_id` is the number at the end.
-
-- ``units``
-
- - For temperature in Fahrenheit use `units = "imperial"`
- - For temperature in Celsius use `units = "metric"` (Lain default)
- - For temperature in Kelvin use `units = "standard"` (OpenWeatherMap default)
-
-- ``lang``
-
- See *Multilingual Support* section [here](http://openweathermap.org/current).
-
-- ``cnt``
-
- Determines how many days to show in the forecast notification. Up to 16 if you use [forecast16](http://openweathermap.org/forecast16) (default), and up to 5 if you use [forecast5](http://openweathermap.org/forecast5).
-
-- ``date_cmd``
-
- OpenWeatherMap time is in UNIX format, so this variable uses `date` to determine how each line in the forecast notification is formatted. Default looks like this:
-
- day #daynumber: forecast, temp_min - temp_max
-
- see `man date` for your customizations.
-
-- ``icons_path``
-
- You can set your own icons path if you don't wish to use `lain/icons/openweathermap`. Just be sure that your icons are PNGs and named exactly like [OpenWeatherMap ones](http://openweathermap.org/weather-conditions).
-
-- ``notification_preset``
-
- Notifications preset table. See [here](https://awesomewm.org/doc/api/libraries/naughty.html#notify) for the details.
-
-- ``notification_text_fun``
- ```lua
- function (wn)
- local day = string.gsub(read_pipe(string.format(date_cmd, wn["dt"])), "\n", "")
- local tmin = math.floor(wn["temp"]["min"])
- local tmax = math.floor(wn["temp"]["max"])
- local desc = wn["weather"][1]["description"]
-
- return string.format("%s: %s, %d - %d ", day, desc, tmin, tmax)
- end
- ```
- See [here](https://github.com/lcpz/lain/issues/186#issuecomment-203400918) for a complete customization example.
-
-- ``followtag``
-
- With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
-
-- ``settings``
-
- In your `settings` function, you can use `widget` variable to refer to the textbox, and the dictionary `weather_now` to refer to data retrieved by `current_call`. The dictionary is built with [dkjson library](http://dkolf.de/src/dkjson-lua.fsl/home), and its structure is defined [here](http://openweathermap.org/weather-data).
- For instance, you can retrieve current weather status and temperature in this way:
- ```lua
- descr = weather_now["weather"][1]["description"]:lower()
- units = math.floor(weather_now["main"]["temp"])
- ```
-
-## Output table
-
-Variable | Meaning | Type
---- | --- | ---
-`widget` | The widget | `wibox.widget.textbox`
-`icon` | The icon | `wibox.widget.imagebox`
-`update` | Update `widget` | function
-`timer` | The widget timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-`timer_forecast` | The forecast notification timer | [`gears.timer`](https://awesomewm.org/doc/api/classes/gears.timer.html)
-
-## Functions
-
-You can attach the forecast notification to any widget like this:
-
-```lua
-myweather.attach(obj)
-```
-
-Hovering over ``obj`` will display the notification.
-
-## Keybindings
-
-You can create a keybinding for the weather popup like this:
-
-```lua
-awful.key( { "Mod1" }, "w", function () myweather.show(5) end )
-```
-
-where ``show`` argument is an integer defining timeout seconds.
diff --git a/user/.config/awesome/rc.lua b/user/.config/awesome/rc.lua
index 4159d4c0e..b8b545665 100644
--- a/user/.config/awesome/rc.lua
+++ b/user/.config/awesome/rc.lua
@@ -1,508 +1,10 @@
--- ____ __
--- / __ \_________ _/ /_____
--- / / / / ___/ __ `/ //_/ _ \
--- / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
--- /_____/_/ \__,_/_/|_|\___/ My custom awesome window manager config
---
-
---[[ LIBRARIES ]]--
-local awful = require("awful") --Everything related to window managment
-local beautiful = require("beautiful")
-local gears = require("gears") --Utilities such as color parsing and objects
-local lain = require("lain")
-local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
-local hotkeys_popup = require("awful.hotkeys_popup").widget
-require("awful.hotkeys_popup.keys")
-require("awful.autofocus")
-local wibox = require("wibox")
-local naughty = require("naughty")
-naughty.config.defaults['icon_size'] = 100
-
---[[ ERROR HANDLING ]]--
-if awesome.startup_errors then
- naughty.notify({ preset = naughty.config.presets.critical,
- title = "Oops, there were errors during startup!",
- text = awesome.startup_errors }) end
-do
- local in_error = false
- awesome.connect_signal("debug::error", function (err)
- -- Make sure we don't go into an endless error loop
- if in_error then return end
- in_error = true
- naughty.notify({ preset = naughty.config.presets.critical,
- title = "Oops, an error happened!",
- text = tostring(err) })
- in_error = false
- end)
-end
-local function run_once(cmd_arr)
- for _, cmd in ipairs(cmd_arr) do
- awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
- end
-end
-run_once({ "unclutter -root" }) -- entries must be comma-separated
-
---[[ THEMES ]]--
-local themes = { "gruvbox-dark" }
-local chosen_theme = themes[1]
-local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
-beautiful.init(theme_path)
-beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
-
---[[ LAYOUTS ]]--
-awful.layout.suit.tile.left.mirror = true
-awful.layout.layouts = {
- awful.layout.suit.tile,
- awful.layout.suit.tile.left,
- awful.layout.suit.tile.bottom,
- awful.layout.suit.tile.top,
- awful.layout.suit.fair,
- awful.layout.suit.fair.horizontal,
- --awful.layout.suit.spiral,
- --awful.layout.suit.spiral.dwindle,
- awful.layout.suit.max,
- --awful.layout.suit.max.fullscreen,
- --awful.layout.suit.magnifier,
- awful.layout.suit.floating,
- --awful.layout.suit.corner.nw,
- --awful.layout.suit.corner.ne,
- --awful.layout.suit.corner.sw,
- --awful.layout.suit.corner.se,
- --lain.layout.cascade,
- --lain.layout.cascade.tile,
- --lain.layout.centerwork,
- --lain.layout.centerwork.horizontal,
- --lain.layout.termfair,
- --lain.layout.termfair.center,
-}
-lain.layout.termfair.nmaster = 3
-lain.layout.termfair.ncol = 1
-lain.layout.termfair.center.nmaster = 3
-lain.layout.termfair.center.ncol = 1
-lain.layout.cascade.tile.offset_x = 2
-lain.layout.cascade.tile.offset_y = 32
-lain.layout.cascade.tile.extra_padding = 5
-lain.layout.cascade.tile.nmaster = 5
-lain.layout.cascade.tile.ncol = 2
-
---[[ VARIABLES ]]--
-awful.util.terminal = terminal -- do not remove/edit this
-local terminal = "alacritty"
-edit = "emacsclient -c -a emacs"
-file = "alacritty -e ./.config/vifm/scripts/vifmrun"
-web = "qutebrowser"
-chat = "alacritty -e gomuks"
-music = "alacritty -e cmus"
-games = "retroarch"
-screenlocker = "betterlockscreen -l"
-local modkey = "Mod4"
-local altkey = "Mod1"
-local modkey1 = "Control"
-
---[[ TAG NAMES ]]--
-awful.util.tagnames =
-{
-" EDIT ", -- F1
-" FILE ", -- F2
-" WEB ", -- F3
-" CHAT ", -- F4
-" MUSIC ", -- F5
-" WORK ", -- XX
-" MISC ", -- XX
-" GAMES " -- F8
-}
-
---[[ WIBOX & MISC STUFF ]]--
-awful.util.taglist_buttons = my_table.join(
- awful.button({ }, 1, function(t) t:view_only() end),
- awful.button({ modkey }, 1, function(t)
- if client.focus then
- client.focus:move_to_tag(t)
- end
- end),
- awful.button({ }, 3, awful.tag.viewtoggle),
- awful.button({ modkey }, 3, function(t)
- if client.focus then
- client.focus:toggle_tag(t)
- end
- end),
- awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
- awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
-)
-awful.util.tasklist_buttons = my_table.join(
- awful.button({ }, 1, function (c)
- if c == client.focus then
- c.minimized = true
- else
- c:emit_signal("request::activate", "tasklist", {raise = true})
- end
- end),
- awful.button({ }, 3, function ()
- local instance = nil
-
- return function ()
- if instance and instance.wibox.visible then
- instance:hide()
- instance = nil
- else
- instance = awful.menu.clients({theme = {width = 250}})
- end
- end
- end),
- awful.button({ }, 4, function () awful.client.focus.byidx(1) end),
- awful.button({ }, 5, function () awful.client.focus.byidx(-1) end)
-)
-screen.connect_signal("property::geometry", function(s)
- if beautiful.wallpaper then
- local wallpaper = beautiful.wallpaper
- if type(wallpaper) == "function" then
- wallpaper = wallpaper(s)
- end
- gears.wallpaper.maximized(wallpaper, s, true)
- end
-end)
-awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
-
--- Rounded Corners
-client.connect_signal("manage", function (c)
- c.shape = function(cr,w,h)
- gears.shape.rounded_rect(cr,w,h,8)
- end
-end)
-
---[[ KEY BINDINGS ]]--
--- Awesome things
-globalkeys = my_table.join(
- awful.key({ modkey, }, "s", hotkeys_popup.show_help,
- {description="Show this help menu", group="Quick Actions"}),
- awful.key({ modkey, "Control" }, "r", awesome.restart,
- {description = "Reload WM", group = "Quick Actions"}),
--- awful.key({ modkey, "Shift" }, "q", awesome.quit,
--- {description = "Log Out", group = "Quick Actions"}),
--- Tag browsing arrow keys and escape
- awful.key({ modkey, }, "Left", awful.tag.viewprev,
- {description = "view previous", group = "Tag"}),
- awful.key({ modkey, }, "Right", awful.tag.viewnext,
- {description = "view next", group = "Tag"}),
- awful.key({ modkey, }, "Escape", awful.tag.history.restore,
- {description = "go back", group = "Tag"}),
--- Tag browsing alt + tab
- awful.key({ altkey, }, "Tab", awful.tag.viewnext,
- {description = "view next", group = "Tag"}),
- awful.key({ altkey, "Shift" }, "Tab", awful.tag.viewprev,
- {description = "view previous", group = "Tag"}),
--- Copy primary to clipboard (terminals to gtk)
- awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end,
- {description = "Copy terminal to gtk", group = "Hotkeys"}),
--- Copy clipboard to primary (gtk to terminals)
- awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end,
- {description = "Copy gtk to terminal", group = "Hotkeys"}),
--- Client focus
- awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end,
- {description = "Focus next by index", group = "Client"}),
- awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end,
- {description = "Focus previous by index", group = "Client"}),
--- Layout manipulation
- awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
- {description = "Swap with next client by index", group = "Client"}),
- awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
- {description = "Swap with previous client by index", group = "Client"}),
- awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
- {description = "Focus the next screen", group = "Screen"}),
- awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
- {description = "Focus the previous screen", group = "Screen"}),
- awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
- {description = "Jump to urgent client", group = "Client"}),
- awful.key({ modkey, }, "Tab",
- function ()
- awful.client.focus.history.previous()
- if client.focus then
- client.focus:raise()
- end
- end,
- {description = "Go back", group = "Client"}),
- awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
- {description = "Increase master width factor", group = "Layout"}),
- awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
- {description = "Decrease master width factor", group = "Layout"}),
- awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
- {description = "Increase the number of master clients", group = "Layout"}),
- awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
- {description = "Decrease the number of master clients", group = "Layout"}),
- awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
- {description = "Increase the number of columns", group = "Layout"}),
- awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
- {description = "Decrease the number of columns", group = "Layout"}),
- awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
- {description = "Select next", group = "Layout"}),
- awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
- {description = "Select previous", group = "Layout"}),
--- Terminal
- awful.key({ modkey }, "Return", function() awful.spawn(terminal) end,
- {description = "Launch a terminal", group = "Hotkeys"}),
--- Dmenu
- awful.key({ modkey, "Shift" }, "r", function () awful.util.spawn_with_shell("dmenu_run -l 10 -b -i -p Launch:") end,
- {description = "Show run Launcher", group = "Hotkeys"}),
- awful.key({ modkey, "Shift" }, "d", function () awful.util.spawn_with_shell("dmenu_drun") end,
- {description = "Show app Launcher", group = "Hotkeys"}),
- awful.key({ modkey, "Shift" }, "w", function () awful.util.spawn_with_shell("dmenu_wifi") end,
- {description = "Configure wiFi", group = "Hotkeys"}),
- awful.key({ modkey, "Shift" }, "q", function () awful.util.spawn_with_shell("dmenu_power") end,
- {description = "Show logout menu", group = "Hotkeys"}),
- awful.key({ modkey, "Shift" }, "b", function () awful.util.spawn_with_shell("dmenu_wall") end,
- {description = "Show wallpaper menu", group = "Hotkeys"}),
- awful.key({}, "Print", function () awful.util.spawn_with_shell("dmenu_scrot") end,
- {description = "Take screenshots", group = "Hotkeys"}),
--- Keyboard Layouts
- awful.key({ modkey, "Shift" }, "e", function () awful.util.spawn("setxkbmap -layout es") end,
- {description = "Switch to ES keyboard layout", group = "Quick Actions"}),
- awful.key({ modkey, "Shift" }, "u", function () awful.util.spawn("setxkbmap -layout us") end,
- {description = "Switch to US keyboard layout", group = "Quick Actions"}),
--- Apps
- -- edit
- awful.key({ modkey }, "F1", function () awful.spawn(edit) end,
- {description = "Launch text editor", group = "Apps"}),
- -- file
- awful.key({ modkey }, "F2", function () awful.spawn(file) end,
- {description = "Launch file manager", group = "Apps"}),
- -- web
- awful.key({ modkey }, "F3", function () awful.spawn(web) end,
- {description = "Launch web browser", group = "Apps"}),
- -- chat
- awful.key({ modkey }, "F4", function () awful.spawn(chat) end,
- {description = "Launch matrix client (chat)", group = "Apps"}),
- -- music
- awful.key({ modkey }, "F5", function () awful.spawn(music) end,
- {description = "Launch music player", group = "Apps"}),
- -- games
- awful.key({ modkey }, "F8", function () awful.util.spawn(games) end,
- {description = "Launch gaming app", group = "Apps"}),
--- Volume
- awful.key({}, "XF86AudioRaiseVolume", function() awful.spawn("pamixer -i 5") end,
- {description = "Increase volume", group = "Quick Actions"}),
- awful.key({}, "XF86AudioLowerVolume", function() awful.spawn("pamixer -d 5") end,
- {description = "Decrease volume", group = "Quick Actions"}),
- awful.key({}, "XF86AudioMute", function() awful.spawn("pamixer -t") end,
- {description = "Mute volume", group = "Quick Actions"}),
--- Brightness
- awful.key({}, "XF86MonBrightnessUp", function () awful.spawn("xbacklight -inc 10") end,
- {description = "Increase brightness", group = "Quick Actions"}),
- awful.key({}, "XF86MonBrightnessDown", function () awful.spawn("xbacklight -dec 10") end,
- {description = "Decrease brightness", group = "Quick Actions"}),
--- Screenlocker
- awful.key({ modkey, modkey1 }, "l", function() awful.spawn(screenlocker) end,
- {description = "Lock the screen", group = "Quick Actions"}),
--- Show/Hide Wibox
- awful.key({ modkey }, "b", function ()
- for s in screen do
- s.mywibox.visible = not s.mywibox.visible
- if s.mybottomwibox then
- s.mybottomwibox.visible = not s.mybottomwibox.visible
- end
- end
- end,
- {description = "Toggle wibox", group = "Quick Actions"}),
--- On the fly useless gaps change
- awful.key({ modkey, modkey1, altkey }, "j", function () lain.util.useless_gaps_resize(1) end,
- {description = "Increment gaps", group = "Tag"}),
- awful.key({ modkey, modkey1, altkey }, "l", function () lain.util.useless_gaps_resize(-1) end,
- {description = "Decrement gaps", group = "Tag"}),
--- Dynamic tagging
- awful.key({ modkey, modkey1, altkey }, "n", function () lain.util.add_tag() end,
- {description = "Add new tag", group = "Tag"}),
- awful.key({ modkey, modkey1, altkey }, "r", function () lain.util.rename_tag() end,
- {description = "Rename tag", group = "Tag"}),
- awful.key({ modkey, modkey1, altkey }, "Left", function () lain.util.move_tag(-1) end,
- {description = "Move tag to the left", group = "Tag"}),
- awful.key({ modkey, modkey1, altkey }, "Right", function () lain.util.move_tag(1) end,
- {description = "Move tag to the right", group = "Tag"}),
- awful.key({ modkey, modkey1, altkey }, "d", function () lain.util.delete_tag() end,
- {description = "Delete tag", group = "Tag"}),
--- Minimize, maximize, moving clients, fullscreen, etc
- awful.key({ modkey, "Control" }, "n",
- function ()
- local c = awful.client.restore()
- if c then
- client.focus = c
- c:raise()
- end
- end,
- {description = "Restore minimized", group = "Client"})
-)
-clientkeys = gears.table.join(
- awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end,
- {description = "Toggle fullscreen", group = "Client"}),
- awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
- {description = "Close window", group = "Client"}),
- awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
- {description = "Toggle floating", group = "Client"}),
- awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
- {description = "Move to master", group = "Client"}),
- awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
- {description = "Move to screen", group = "Client"}),
- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
- {description = "Toggle keep on top", group = "Client"}),
- awful.key({ modkey, }, "n",
- function (c)
- c.minimized = true
- end ,
- {description = "Minimize", group = "Client"}),
- awful.key({ modkey, }, "m",
- function (c)
- c.maximized = not c.maximized
- c:raise()
- end ,
- {description = "(Un)maximize", group = "Client"}),
- awful.key({ modkey, "Control" }, "m",
- function (c)
- c.maximized_vertical = not c.maximized_vertical
- c:raise()
- end ,
- {description = "(Un)maximize vertically", group = "Client"}),
- awful.key({ modkey, "Shift" }, "m",
- function (c)
- c.maximized_horizontal = not c.maximized_horizontal
- c:raise()
- end ,
- {description = "(Un)maximize horizontally", group = "Client"})
-)
--- Bind all key numbers to tags.
--- Be careful: we use keycodes to make it works on any keyboard layout.
--- This should map on the top row of your keyboard, usually 1 to 9.
-for i = 1, 9 do
- -- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
- local descr_view, descr_toggle, descr_move, descr_toggle_focus
- if i == 1 or i == 9 then
- descr_view = {description = "Wiew tag #", group = "Tag"}
- descr_toggle = {description = "Toggle tag #", group = "Tag"}
- descr_move = {description = "Move focused client to tag #", group = "Tag"}
- descr_toggle_focus = {description = "Toggle focused client on tag #", group = "Tag"}
- end
- globalkeys = my_table.join(globalkeys,
- -- View tag only.
- awful.key({ modkey }, "#" .. i + 9,
- function ()
- local screen = awful.screen.focused()
- local tag = screen.tags[i]
- if tag then
- tag:view_only()
- end
- end,
- descr_view),
- -- Toggle tag display.
- awful.key({ modkey, "Control" }, "#" .. i + 9,
- function ()
- local screen = awful.screen.focused()
- local tag = screen.tags[i]
- if tag then
- awful.tag.viewtoggle(tag)
- end
- end,
- descr_toggle),
- -- Move client to tag.
- awful.key({ modkey, "Shift" }, "#" .. i + 9,
- function ()
- if client.focus then
- local tag = client.focus.screen.tags[i]
- if tag then
- client.focus:move_to_tag(tag)
- end
- end
- end,
- descr_move),
- -- Toggle tag on focused client.
- awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
- function ()
- if client.focus then
- local tag = client.focus.screen.tags[i]
- if tag then
- client.focus:toggle_tag(tag)
- end
- end
- end,
- descr_toggle_focus)
- )
-end
--- Mouse bindings
-clientbuttons = gears.table.join(
- awful.button({ }, 1, function (c)
- c:emit_signal("request::activate", "mouse_click", {raise = true})
- end),
- awful.button({ modkey }, 1, function (c)
- c:emit_signal("request::activate", "mouse_click", {raise = true})
- awful.mouse.client.move(c)
- end),
- awful.button({ modkey }, 3, function (c)
- c:emit_signal("request::activate", "mouse_click", {raise = true})
- awful.mouse.client.resize(c)
- end)
-)
-root.keys(globalkeys)
-
---[[ RULES ]]--
-awful.rules.rules = {
- -- All clients will match this rule.
- { rule = { },
- properties = { border_width = beautiful.border_width,
- border_color = beautiful.border_normal,
- focus = awful.client.focus.filter,
- raise = true,
- keys = clientkeys,
- buttons = clientbuttons,
- screen = awful.screen.preferred,
- placement = awful.placement.no_overlap+awful.placement.no_offscreen,
- callback = awful.client.setslave
- }
-},
- -- Floating clients.
- { rule_any = {
- instance = {
- "DTA", -- Firefox addon DownThemAll.
- "copyq", -- Includes session name in class.
- "pinentry",
- },
- class = {
- "Arandr",
- "Blueman-manager",
- "Gpick",
- "Kruler",
- "MessageWin", -- kalarm.
- -- "Sxiv",
- "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
- "Wpa_gui",
- "veromix",
- "xtightvncviewer"},
- -- Note that the name property shown in xprop might be set slightly after creation of the client
- -- and the name shown there might not match defined rules here.
- name = {
- "Event Tester", -- xev.
- },
- role = {
- "AlarmWindow", -- Thunderbird's calendar.
- "ConfigManager", -- Thunderbird's about:config.
- "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
- }
- }, properties = { floating = true }},
-}
-
---[[ SIGNALS ]]--
-client.connect_signal("manage", function (c)
- if awesome.startup and
- not c.size_hints.user_position
- and not c.size_hints.program_position then
- awful.placement.no_offscreen(c)
- end
-end)
-
--- [[ MOUSE FOCUS ]]--
-client.connect_signal("mouse::enter", function(c)
- c:emit_signal("request::activate", "mouse_enter", {raise = false})
-end)
-client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
-client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-
---[[ AUTOSTART ]]--
-awful.util.spawn_with_shell("sh $HOME/.fehbg &")
-awful.util.spawn_with_shell("lxpolkit &")
-awful.util.spawn_with_shell("picom --config $HOME/.config/picom/picom.conf &")
-awful.util.spawn_with_shell("dunst -c $HOME/.config/dunst/dunstrc &")
+require("core.error_handling")
+require("core.apps")
+require("theme.init")
+require("core.layouts")
+require("core.bar.bar")
+require("core.bindings")
+require("core.rules")
+require("core.notif")
+require("core.autostart")
+require("core.focus")
diff --git a/user/.config/awesome/theme/gruvbox/archlinux.png b/user/.config/awesome/theme/gruvbox/archlinux.png
new file mode 100644
index 000000000..0e660a7d5
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/archlinux.png differ
diff --git a/user/.config/awesome/theme/gruvbox/awesome.png b/user/.config/awesome/theme/gruvbox/awesome.png
new file mode 100644
index 000000000..ffb105e64
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/awesome.png differ
diff --git a/user/.config/awesome/theme/gruvbox/background.jpg b/user/.config/awesome/theme/gruvbox/background.jpg
new file mode 100644
index 000000000..74bc1ceb7
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/background.jpg differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/cornerne.png b/user/.config/awesome/theme/gruvbox/layouts/cornerne.png
new file mode 100644
index 000000000..5a05c7f68
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/cornerne.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/cornernw.png b/user/.config/awesome/theme/gruvbox/layouts/cornernw.png
new file mode 100644
index 000000000..39438cbd0
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/cornernw.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/cornerse.png b/user/.config/awesome/theme/gruvbox/layouts/cornerse.png
new file mode 100644
index 000000000..f2c1859f7
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/cornerse.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/cornersw.png b/user/.config/awesome/theme/gruvbox/layouts/cornersw.png
new file mode 100644
index 000000000..974844b90
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/cornersw.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/dwindle.png b/user/.config/awesome/theme/gruvbox/layouts/dwindle.png
new file mode 100644
index 000000000..85ade6ca0
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/dwindle.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/fairh.png b/user/.config/awesome/theme/gruvbox/layouts/fairh.png
new file mode 100644
index 000000000..6eb2b6446
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/fairh.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/fairv.png b/user/.config/awesome/theme/gruvbox/layouts/fairv.png
new file mode 100644
index 000000000..d1360b52d
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/fairv.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/floating.png b/user/.config/awesome/theme/gruvbox/layouts/floating.png
new file mode 100644
index 000000000..b35f331db
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/floating.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/fullscreen.png b/user/.config/awesome/theme/gruvbox/layouts/fullscreen.png
new file mode 100644
index 000000000..66722a3fa
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/fullscreen.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/magnifier.png b/user/.config/awesome/theme/gruvbox/layouts/magnifier.png
new file mode 100644
index 000000000..cf541cabc
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/magnifier.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/max.png b/user/.config/awesome/theme/gruvbox/layouts/max.png
new file mode 100644
index 000000000..943077d1d
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/max.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/spiral.png b/user/.config/awesome/theme/gruvbox/layouts/spiral.png
new file mode 100644
index 000000000..d9133621d
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/spiral.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/tile.png b/user/.config/awesome/theme/gruvbox/layouts/tile.png
new file mode 100644
index 000000000..b1e8da2cc
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/tile.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/tilebottom.png b/user/.config/awesome/theme/gruvbox/layouts/tilebottom.png
new file mode 100644
index 000000000..b5360f2e0
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/tilebottom.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/tileleft.png b/user/.config/awesome/theme/gruvbox/layouts/tileleft.png
new file mode 100644
index 000000000..487dad2a5
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/tileleft.png differ
diff --git a/user/.config/awesome/theme/gruvbox/layouts/tiletop.png b/user/.config/awesome/theme/gruvbox/layouts/tiletop.png
new file mode 100644
index 000000000..6c1fa04fc
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/layouts/tiletop.png differ
diff --git a/user/.config/awesome/theme/gruvbox/screenshot.png b/user/.config/awesome/theme/gruvbox/screenshot.png
new file mode 100644
index 000000000..0e062b997
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/screenshot.png differ
diff --git a/user/.config/awesome/theme/gruvbox/submenu.png b/user/.config/awesome/theme/gruvbox/submenu.png
new file mode 100644
index 000000000..b2778e2eb
Binary files /dev/null and b/user/.config/awesome/theme/gruvbox/submenu.png differ
diff --git a/user/.config/awesome/theme/gruvbox/theme.lua b/user/.config/awesome/theme/gruvbox/theme.lua
new file mode 100644
index 000000000..b7aa6ebe9
--- /dev/null
+++ b/user/.config/awesome/theme/gruvbox/theme.lua
@@ -0,0 +1,96 @@
+-- {{{ Imports
+local gears = require("gears")
+local awful = require("awful")
+local wibox = require("wibox")
+local dpi = require("beautiful.xresources").apply_dpi
+-- }}}
+
+local themes_path = string.format("%s/.config/awesome/theme/", os.getenv("HOME"))
+
+-- {{{ Main
+local theme = {}
+-- }}}
+
+-- {{{ theme font
+theme.font = "mononoki Nerd Font 9"
+--- }}}
+
+-- {{{ bar colors
+theme.bar_bg_one = "#427b58"
+theme.bar_bg_two = "#076678"
+theme.bar_bg_tre = "#b57614"
+theme.bar_bg_for = "#9d0006"
+theme.bar_clock = "#504945"
+--- }}}
+
+
+-- {{{ Colors
+theme.fg_normal = "#ebdbb2"
+theme.fg_focus = "#dfc4a1"
+theme.fg_urgent = "#fbf1c7"
+theme.bg_normal = "#1d2021"
+theme.bg_focus = "#3c3836"
+theme.bg_urgent = "#cc241d"
+-- }}}
+
+-- {{{ Borders
+theme.useless_gap = dpi(0)
+theme.border_width = dpi(0.5)
+theme.border_normal = "#665c54"
+theme.border_focus = "#9d0006"
+theme.border_marked = "#9d0006"
+-- }}}
+
+-- {{{ Taglist
+theme.taglist_font = "mononoki Nerd Font 9"
+theme.taglist_fg_focus = "#fb4934"
+theme.taglist_fg_occupied = "#8ec07c"
+theme.taglist_fg_urgent = "#458588"
+theme.taglist_fg_empty = "#a89984"
+theme.taglist_spacing = 5
+-- }}}
+
+-- {{{ Notifications
+theme.notification_font = "mononoki Nerd Font 9"
+theme.notification_bg = "#282828"
+theme.notification_fg = "#fbf1c7"
+theme.notification_shape = gears.shape.rounded_rect
+-- }}}
+
+-- {{{ Hotkeys Popup
+theme.hotkeys_bg = "#282828"
+theme.hotkeys_fg = "#ebdbb2"
+theme.hotkeys_modifiers_fg = "#458588"
+theme.hotkeys_label_bg = "#fabd2f"
+theme.hotkeys_label_fg = "#1d2021"
+theme.hotkeys_group_margin = dpi(20)
+theme.hotkeys_description_font = "mononoki Nerd Font 9"
+theme.hotkeys_font = "mononoki Nerd Font 9"
+-- }}}
+
+-- {{{ Mouse finder
+theme.mouse_finder_color = "#cc241d"
+theme.mouse_finder_radius = dpi(5)
+theme.mouse_finder_timeout = 10
+-- }}}
+
+-- {{{ Layout
+theme.layout_tile = themes_path .. "gruvbox/layouts/tile.png"
+theme.layout_tileleft = themes_path .. "gruvbox/layouts/tileleft.png"
+theme.layout_tilebottom = themes_path .. "gruvbox/layouts/tilebottom.png"
+theme.layout_tiletop = themes_path .. "gruvbox/layouts/tiletop.png"
+theme.layout_fairv = themes_path .. "gruvbox/layouts/fairv.png"
+theme.layout_fairh = themes_path .. "gruvbox/layouts/fairh.png"
+theme.layout_spiral = themes_path .. "gruvbox/layouts/spiral.png"
+theme.layout_dwindle = themes_path .. "gruvbox/layouts/dwindle.png"
+theme.layout_max = themes_path .. "gruvbox/layouts/max.png"
+theme.layout_fullscreen = themes_path .. "gruvbox/layouts/fullscreen.png"
+theme.layout_magnifier = themes_path .. "gruvbox/layouts/magnifier.png"
+theme.layout_floating = themes_path .. "gruvbox/layouts/floating.png"
+theme.layout_cornernw = themes_path .. "gruvbox/layouts/cornernw.png"
+theme.layout_cornerne = themes_path .. "gruvbox/layouts/cornerne.png"
+theme.layout_cornersw = themes_path .. "gruvbox/layouts/cornersw.png"
+theme.layout_cornerse = themes_path .. "gruvbox/layouts/cornerse.png"
+-- }}}
+
+return theme
diff --git a/user/.config/awesome/theme/init.lua b/user/.config/awesome/theme/init.lua
new file mode 100644
index 000000000..2bc6d2088
--- /dev/null
+++ b/user/.config/awesome/theme/init.lua
@@ -0,0 +1,4 @@
+local beautiful = require("beautiful")
+local gears = require("gears")
+-- Selected theme
+beautiful.init(string.format("%s/.config/awesome/theme/gruvbox/theme.lua", os.getenv("HOME")))
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/ac.png b/user/.config/awesome/themes/gruvbox-dark/icons/ac.png
deleted file mode 100644
index 96efcb4e6..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/ac.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/battery.png b/user/.config/awesome/themes/gruvbox-dark/icons/battery.png
deleted file mode 100644
index 8c85596da..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/battery.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/battery_empty.png b/user/.config/awesome/themes/gruvbox-dark/icons/battery_empty.png
deleted file mode 100644
index 00821c91e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/battery_empty.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/battery_low.png b/user/.config/awesome/themes/gruvbox-dark/icons/battery_low.png
deleted file mode 100644
index 29f3fc587..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/battery_low.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/centerfair.png b/user/.config/awesome/themes/gruvbox-dark/icons/centerfair.png
deleted file mode 100644
index c4f64b0f1..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/centerfair.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/centerwork.png b/user/.config/awesome/themes/gruvbox-dark/icons/centerwork.png
deleted file mode 100644
index 90715169a..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/centerwork.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/centerworkh.png b/user/.config/awesome/themes/gruvbox-dark/icons/centerworkh.png
deleted file mode 100644
index b1d13793f..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/centerworkh.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/cpu.png b/user/.config/awesome/themes/gruvbox-dark/icons/cpu.png
deleted file mode 100644
index 35af1c39c..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/cpu.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/dwindle.png b/user/.config/awesome/themes/gruvbox-dark/icons/dwindle.png
deleted file mode 100644
index 649ea993e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/dwindle.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/fairh.png b/user/.config/awesome/themes/gruvbox-dark/icons/fairh.png
deleted file mode 100644
index 62d3d99eb..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/fairh.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/fairv.png b/user/.config/awesome/themes/gruvbox-dark/icons/fairv.png
deleted file mode 100644
index 131dd0f91..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/fairv.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/floating.png b/user/.config/awesome/themes/gruvbox-dark/icons/floating.png
deleted file mode 100644
index d25c47b96..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/floating.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/hdd.png b/user/.config/awesome/themes/gruvbox-dark/icons/hdd.png
deleted file mode 100644
index 0fb683399..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/hdd.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/internet.png b/user/.config/awesome/themes/gruvbox-dark/icons/internet.png
deleted file mode 100644
index fdd9ae84e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/internet.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/internet_na.png b/user/.config/awesome/themes/gruvbox-dark/icons/internet_na.png
deleted file mode 100644
index 67157278d..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/internet_na.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/magnifier.png b/user/.config/awesome/themes/gruvbox-dark/icons/magnifier.png
deleted file mode 100644
index 60d3e0d85..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/magnifier.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/mail.png b/user/.config/awesome/themes/gruvbox-dark/icons/mail.png
deleted file mode 100644
index 474e60204..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/mail.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/mail_on.png b/user/.config/awesome/themes/gruvbox-dark/icons/mail_on.png
deleted file mode 100644
index 19106d7bb..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/mail_on.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/max.png b/user/.config/awesome/themes/gruvbox-dark/icons/max.png
deleted file mode 100644
index 5b0a5b711..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/max.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/mem.png b/user/.config/awesome/themes/gruvbox-dark/icons/mem.png
deleted file mode 100644
index 7860a1a0e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/mem.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/net.png b/user/.config/awesome/themes/gruvbox-dark/icons/net.png
deleted file mode 100644
index bc42fdc3e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/net.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/net_wired.png b/user/.config/awesome/themes/gruvbox-dark/icons/net_wired.png
deleted file mode 100644
index e8cc2bded..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/net_wired.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/note.png b/user/.config/awesome/themes/gruvbox-dark/icons/note.png
deleted file mode 100644
index baa29c325..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/note.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/note_on.png b/user/.config/awesome/themes/gruvbox-dark/icons/note_on.png
deleted file mode 100644
index 1a7ab9476..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/note_on.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/scissors.png b/user/.config/awesome/themes/gruvbox-dark/icons/scissors.png
deleted file mode 100644
index f8c700de3..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/scissors.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/spiral.png b/user/.config/awesome/themes/gruvbox-dark/icons/spiral.png
deleted file mode 100644
index d9ee0f6b1..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/spiral.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/square_sel.png b/user/.config/awesome/themes/gruvbox-dark/icons/square_sel.png
deleted file mode 100644
index 1102a9f1c..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/square_sel.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/square_unsel.png b/user/.config/awesome/themes/gruvbox-dark/icons/square_unsel.png
deleted file mode 100644
index 7386b85f6..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/square_unsel.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/submenu.png b/user/.config/awesome/themes/gruvbox-dark/icons/submenu.png
deleted file mode 100644
index b55ebced8..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/submenu.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/task.png b/user/.config/awesome/themes/gruvbox-dark/icons/task.png
deleted file mode 100644
index 9701b6848..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/task.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/temp.png b/user/.config/awesome/themes/gruvbox-dark/icons/temp.png
deleted file mode 100644
index 6793a9fba..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/temp.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/termfair.png b/user/.config/awesome/themes/gruvbox-dark/icons/termfair.png
deleted file mode 100644
index 3e060236f..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/termfair.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/tile.png b/user/.config/awesome/themes/gruvbox-dark/icons/tile.png
deleted file mode 100644
index 922c05caf..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/tile.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/tilebottom.png b/user/.config/awesome/themes/gruvbox-dark/icons/tilebottom.png
deleted file mode 100644
index 6ec9cb873..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/tilebottom.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/tileleft.png b/user/.config/awesome/themes/gruvbox-dark/icons/tileleft.png
deleted file mode 100644
index 8e3d2d62e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/tileleft.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/tiletop.png b/user/.config/awesome/themes/gruvbox-dark/icons/tiletop.png
deleted file mode 100644
index 3da75a195..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/tiletop.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/close_focus.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/close_focus.png
deleted file mode 100644
index b2051b02e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/close_focus.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/close_normal.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/close_normal.png
deleted file mode 100644
index da6028c16..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/close_normal.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_focus_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_focus_active.png
deleted file mode 100644
index 5fe84c0db..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_focus_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_focus_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_focus_inactive.png
deleted file mode 100644
index 47f19f6da..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_focus_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_normal_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_normal_active.png
deleted file mode 100644
index 576fa3679..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_normal_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_normal_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_normal_inactive.png
deleted file mode 100644
index 4adc5e9dd..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/floating_normal_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_focus_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_focus_active.png
deleted file mode 100644
index 7d9a11a12..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_focus_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_focus_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_focus_inactive.png
deleted file mode 100644
index bce1d0005..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_focus_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_normal_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_normal_active.png
deleted file mode 100644
index 9f24945b9..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_normal_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_normal_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_normal_inactive.png
deleted file mode 100644
index 2e56d327b..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/maximized_normal_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_focus_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_focus_active.png
deleted file mode 100644
index 41a69e27b..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_focus_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_focus_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_focus_inactive.png
deleted file mode 100644
index 2f3a2be2a..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_focus_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_normal_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_normal_active.png
deleted file mode 100644
index 0f937b7cb..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_normal_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_normal_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_normal_inactive.png
deleted file mode 100644
index a9a320684..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/ontop_normal_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_focus_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_focus_active.png
deleted file mode 100644
index a9bc8a214..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_focus_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_focus_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_focus_inactive.png
deleted file mode 100644
index 5493d8ec2..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_focus_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_normal_active.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_normal_active.png
deleted file mode 100644
index 1e150f585..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_normal_active.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_normal_inactive.png b/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_normal_inactive.png
deleted file mode 100644
index 7e6c99b66..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/titlebar/sticky_normal_inactive.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/vol.png b/user/.config/awesome/themes/gruvbox-dark/icons/vol.png
deleted file mode 100644
index bbf33d424..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/vol.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/vol_low.png b/user/.config/awesome/themes/gruvbox-dark/icons/vol_low.png
deleted file mode 100644
index aa3ce4dc8..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/vol_low.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/vol_mute.png b/user/.config/awesome/themes/gruvbox-dark/icons/vol_mute.png
deleted file mode 100644
index e855fd24f..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/vol_mute.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/vol_no.png b/user/.config/awesome/themes/gruvbox-dark/icons/vol_no.png
deleted file mode 100644
index bbe917bdd..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/vol_no.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wired.png b/user/.config/awesome/themes/gruvbox-dark/icons/wired.png
deleted file mode 100644
index e8cc2bded..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wired.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wired_na.png b/user/.config/awesome/themes/gruvbox-dark/icons/wired_na.png
deleted file mode 100644
index e5c197ed9..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wired_na.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_0.png b/user/.config/awesome/themes/gruvbox-dark/icons/wireless_0.png
deleted file mode 100644
index fcd877128..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_0.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_1.png b/user/.config/awesome/themes/gruvbox-dark/icons/wireless_1.png
deleted file mode 100644
index 0af2040c5..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_1.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_2.png b/user/.config/awesome/themes/gruvbox-dark/icons/wireless_2.png
deleted file mode 100644
index 654e3ba9f..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_2.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_3.png b/user/.config/awesome/themes/gruvbox-dark/icons/wireless_3.png
deleted file mode 100644
index bc42fdc3e..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_3.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_na.png b/user/.config/awesome/themes/gruvbox-dark/icons/wireless_na.png
deleted file mode 100644
index 7201fb2c1..000000000
Binary files a/user/.config/awesome/themes/gruvbox-dark/icons/wireless_na.png and /dev/null differ
diff --git a/user/.config/awesome/themes/gruvbox-dark/theme.lua b/user/.config/awesome/themes/gruvbox-dark/theme.lua
deleted file mode 100644
index afc529ee3..000000000
--- a/user/.config/awesome/themes/gruvbox-dark/theme.lua
+++ /dev/null
@@ -1,271 +0,0 @@
--- ____ __
--- / __ \_________ _/ /_____
--- / / / / ___/ __ `/ //_/ _ \
--- / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
--- /_____/_/ \__,_/_/|_|\___/ My custom awesome window manager gruvbox theme
---
-
-local gears = require("gears")
-local lain = require("lain")
-local lain_helpers = require("lain.helpers")
-local awful = require("awful")
-local wibox = require("wibox")
-local lgi = require("lgi")
-local dpi = require("beautiful.xresources").apply_dpi
-local os = os
-local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
-local theme = {}
-theme.machine_name = lain_helpers.first_line("/sys/class/dmi/id/product_name")
-theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/gruvbox-dark"
-
--- fonts
-local theme_font_type = "mononoki Nerd Font"
-local theme_font_size = "9"
-local hotkeys_font_type = "mononoki Nerd Font"
-local hotkeys_font_size = "9"
-theme.font = theme_font_type .. " " .. theme_font_size
-theme.hotkeys_font = hotkeys_font_type .. " " .. hotkeys_font_size
-theme.hotkeys_description_font = theme.font
-theme.fg_normal = "#ebdbb2"
-theme.fg_focus = "#fb4934"
-theme.fg_urgent = "#cc241d"
-theme.bg_normal = "#1d2021"
-theme.bg_focus = "#32302f"
-theme.bg_urgent = theme.bg_normal
-theme.border_width = dpi(2)
-theme.border_normal = "#7c6f64"
-theme.border_focus = "#cc241d"
-theme.border_marked = "#cc241d"
-theme.tasklist_bg_focus = theme.bg_normal
-theme.titlebar_bg_focus = theme.bg_focus
-theme.titlebar_bg_normal = theme.bg_normal
-theme.titlebar_fg_focus = "#d79921" -- gruvbox yellow
-theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
-theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
-theme.layout_tile = theme.dir .. "/icons/tile.png"
-theme.layout_tileleft = theme.dir .. "/icons/tileleft.png"
-theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png"
-theme.layout_tiletop = theme.dir .. "/icons/tiletop.png"
-theme.layout_fairv = theme.dir .. "/icons/fairv.png"
-theme.layout_fairh = theme.dir .. "/icons/fairh.png"
-theme.layout_spiral = theme.dir .. "/icons/spiral.png"
-theme.layout_dwindle = theme.dir .. "/icons/dwindle.png"
-theme.layout_max = theme.dir .. "/icons/max.png"
-theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png"
-theme.layout_magnifier = theme.dir .. "/icons/magnifier.png"
-theme.layout_floating = theme.dir .. "/icons/floating.png"
-theme.widget_ac = theme.dir .. "/icons/ac.png"
-theme.widget_battery = theme.dir .. "/icons/battery.png"
-theme.widget_battery_low = theme.dir .. "/icons/battery_low.png"
-theme.widget_battery_empty = theme.dir .. "/icons/battery_empty.png"
-theme.widget_mem = theme.dir .. "/icons/mem.png"
-theme.widget_cpu = theme.dir .. "/icons/cpu.png"
-theme.widget_temp = theme.dir .. "/icons/temp.png"
-theme.widget_wireless_0 = theme.dir .. "/icons/wireless_0.png"
-theme.widget_wireless_1 = theme.dir .. "/icons/wireless_1.png"
-theme.widget_wireless_2 = theme.dir .. "/icons/wireless_2.png"
-theme.widget_wireless_3 = theme.dir .. "/icons/wireless_3.png"
-theme.widget_wireless_na = theme.dir .. "/icons/wireless_na.png"
-theme.widget_wired = theme.dir .. "/icons/wired.png"
-theme.widget_wired_na = theme.dir .. "/icons/wired_na.png"
-theme.widget_hdd = theme.dir .. "/icons/hdd.png"
-theme.widget_music = theme.dir .. "/icons/note.png"
-theme.widget_music_on = theme.dir .. "/icons/note_on.png"
-theme.widget_vol = theme.dir .. "/icons/vol.png"
-theme.widget_vol_low = theme.dir .. "/icons/vol_low.png"
-theme.widget_vol_no = theme.dir .. "/icons/vol_no.png"
-theme.widget_vol_mute = theme.dir .. "/icons/vol_mute.png"
-theme.widget_mail = theme.dir .. "/icons/mail.png"
-theme.widget_mail_on = theme.dir .. "/icons/mail_on.png"
-theme.tasklist_plain_task_name = true
-theme.tasklist_disable_icon = true
-theme.useless_gap = dpi(5)
-theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png"
-theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png"
-theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png"
-theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png"
-theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png"
-theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png"
-theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png"
-theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png"
-theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png"
-theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png"
-theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png"
-theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png"
-theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png"
-theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png"
-theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png"
-theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png"
-theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
-theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
-
-local markup = lain.util.markup
-local separators = lain.util.separators
-
--- Textclock
-local clockicon = wibox.widget.imagebox(theme.widget_clock)
-local clock = awful.widget.watch(
- "date +'%a %d %b %I:%M '", 60,
- function(widget, stdout)
- widget:set_markup(" " .. markup.font(theme.font, stdout))
- end
-)
-
--- Battery
-local baticon = wibox.widget.imagebox(theme.widget_battery)
-local bat = lain.widget.bat({
- settings = function()
- if bat_now.status and bat_now.status ~= "N/A" then
- if bat_now.ac_status == 1 then
- baticon:set_image(theme.widget_ac)
- elseif not bat_now.perc and tonumber(bat_now.perc) <= 5 then
- baticon:set_image(theme.widget_battery_empty)
- elseif not bat_now.perc and tonumber(bat_now.perc) <= 15 then
- baticon:set_image(theme.widget_battery_low)
- else
- baticon:set_image(theme.widget_battery)
- end
- widget:set_markup(markup.font(theme.font, " " .. bat_now.perc .. "% "))
- else
- widget:set_markup(markup.font(theme.font, " AC "))
- baticon:set_image(theme.widget_ac)
- end
- end
-})
-
--- CPU
-local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
-local cpu = lain.widget.cpu({
- settings = function()
- widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% "))
- end
-})
-
--- MEM
-local memicon = wibox.widget.imagebox(theme.widget_mem)
-local mem = lain.widget.mem({
- settings = function()
- widget:set_markup(markup.font(theme.font, " " .. mem_now.used .. "MB "))
- end
-})
-
--- Net
-local neticon = wibox.widget.imagebox(theme.widget_net)
-local net = lain.widget.net({
- settings = function()
- widget:set_markup(markup.font(theme.font,
- markup("#8ec07c", "DN: " .. string.format("%2.fK", net_now.received))
- .. " | " ..
- markup("#458588", "UP: " .. string.format("%2.fK", net_now.sent) .. " ")))
- end
-})
-
--- ALSA volume
-local volicon = wibox.widget.imagebox(theme.widget_vol)
-theme.volume = lain.widget.alsa({
- settings = function()
- if volume_now.status == "off" then
- volicon:set_image(theme.widget_vol_mute)
- elseif tonumber(volume_now.level) == 0 then
- volicon:set_image(theme.widget_vol_no)
- elseif tonumber(volume_now.level) <= 50 then
- volicon:set_image(theme.widget_vol_low)
- else
- volicon:set_image(theme.widget_vol)
- end
-
- widget:set_markup(markup.font(theme.font, " " .. volume_now.level .. "% "))
- end
-})
-theme.volume.widget:buttons(awful.util.table.join(
- awful.button({}, 4, function ()
- awful.util.spawn("pamixer -i 1")
- theme.volume.update()
- end),
- awful.button({}, 5, function ()
- awful.util.spawn("pamixer -d 1")
- theme.volume.update()
- end)
-))
-
--- Separators
-local spr = wibox.widget.textbox(' ')
-local arrl_dl = separators.arrow_left(theme.bg_focus, "alpha")
-local arrl_ld = separators.arrow_left("alpha", theme.bg_focus)
-
-function theme.at_screen_connect(s)
- -- Tags
- awful.tag(awful.util.tagnames,
- s, awful.layout.layouts[1] -- Use first defined layout as default for initialized tags
- )
-
- -- Create a promptbox for each screen
- s.mypromptbox = awful.widget.prompt()
- -- Create an imagebox widget which will contains an icon indicating which layout we're using.
- -- We need one layoutbox per screen.
- s.mylayoutbox = awful.widget.layoutbox(s)
- s.mylayoutbox:buttons(my_table.join(
- awful.button({}, 1, function () awful.layout.inc( 1) end),
- awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
- awful.button({}, 3, function () awful.layout.inc(-1) end),
- awful.button({}, 4, function () awful.layout.inc( 1) end),
- awful.button({}, 5, function () awful.layout.inc(-1) end)))
-
- -- Keyboard map indicator and switcher
- mykeyboardlayout = awful.widget.keyboardlayout()
- -- Create a taglist widget
- s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
-
- -- Create a tasklist widget
- s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
-
- -- Create the wibox
- s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(20), bg = theme.bg_normal, fg = theme.fg_normal })
-
- -- Add widgets to the wibox
- s.mywibox:setup {
- layout = wibox.layout.stack,
- {
- layout = wibox.layout.align.horizontal,
- { -- Left widgets
- layout = wibox.layout.fixed.horizontal,
- wibox.container.background(s.mylayoutbox, theme.bg_focus),
- spr,
- s.mytaglist,
- },
- nil,
- { -- Right widgets.
- layout = wibox.layout.fixed.horizontal,
- arrl_ld,
- wibox.container.background(mykeyboardlayout, theme.bg_focus),
- arrl_dl,
- arrl_ld,
- wibox.container.background(volicon, theme.bg_focus),
- wibox.container.background(theme.volume.widget, theme.bg_focus),
- arrl_dl,
- arrl_ld,
- wibox.container.background(baticon, theme.bg_focus),
- wibox.container.background(bat.widget, theme.bg_focus),
- arrl_dl,
- arrl_ld,
- wibox.container.background(cpuicon, theme.bg_focus),
- wibox.container.background(cpu.widget, theme.bg_focus),
- arrl_dl,
- arrl_ld,
- wibox.container.background(memicon, theme.bg_focus),
- wibox.container.background(mem.widget, theme.bg_focus),
- arrl_dl,
- arrl_ld,
- wibox.container.background(neticon, theme.bg_focus),
- wibox.container.background(net.widget, theme.bg_focus),
- },
- },
- {
- wibox.container.background(clock, theme.bg_normal),
- valign = "center",
- halign = "center",
- layout = wibox.container.place
- },
-}
- end
-return theme
diff --git a/user/.config/rofi/config.rasi b/user/.config/rofi/config.rasi
new file mode 100644
index 000000000..15f8ff088
--- /dev/null
+++ b/user/.config/rofi/config.rasi
@@ -0,0 +1 @@
+@theme "/usr/share/rofi/themes/gruvbox-dark-hard.rasi"
diff --git a/user/.config/suckless/dmenu/Makefile b/user/.config/suckless/dmenu/Makefile
deleted file mode 100644
index f4be9d180..000000000
--- a/user/.config/suckless/dmenu/Makefile
+++ /dev/null
@@ -1,67 +0,0 @@
-# dmenu - dynamic menu
-# See LICENSE file for copyright and license details.
-
-include config.mk
-
-SRC = drw.c dmenu.c stest.c util.c
-OBJ = $(SRC:.c=.o)
-
-all: options dmenu stest
-
-options:
- @echo dmenu build options:
- @echo "CFLAGS = $(CFLAGS)"
- @echo "LDFLAGS = $(LDFLAGS)"
- @echo "CC = $(CC)"
-
-.c.o:
- $(CC) -c $(CFLAGS) $<
-
-config.h:
- cp config.def.h $@
-
-patches.h:
- cp patches.def.h $@
-
-$(OBJ): arg.h config.h config.mk drw.h patches.h
-
-dmenu: dmenu.o drw.o util.o
- $(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
-
-stest: stest.o
- $(CC) -o $@ stest.o $(LDFLAGS)
-
-clean:
- rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
-
-dist: clean
- mkdir -p dmenu-$(VERSION)
- cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
- drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
- dmenu-$(VERSION)
- tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
- gzip dmenu-$(VERSION).tar
- rm -rf dmenu-$(VERSION)
-
-install: all
- mkdir -p $(DESTDIR)$(PREFIX)/bin
- cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
- chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
- chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
- chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
- chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
- mkdir -p $(DESTDIR)$(MANPREFIX)/man1
- sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
- sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
- chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
- chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
-
-uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
- $(DESTDIR)$(PREFIX)/bin/dmenu_path\
- $(DESTDIR)$(PREFIX)/bin/dmenu_run\
- $(DESTDIR)$(PREFIX)/bin/stest\
- $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
- $(DESTDIR)$(MANPREFIX)/man1/stest.1
-
-.PHONY: all options clean dist install uninstall
diff --git a/user/.config/suckless/dmenu/arg.h b/user/.config/suckless/dmenu/arg.h
deleted file mode 100644
index e94e02bba..000000000
--- a/user/.config/suckless/dmenu/arg.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copy me if you can.
- * by 20h
- */
-
-#ifndef ARG_H__
-#define ARG_H__
-
-extern char *argv0;
-
-/* use main(int argc, char *argv[]) */
-#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
- argv[0] && argv[0][0] == '-'\
- && argv[0][1];\
- argc--, argv++) {\
- char argc_;\
- char **argv_;\
- int brk_;\
- if (argv[0][1] == '-' && argv[0][2] == '\0') {\
- argv++;\
- argc--;\
- break;\
- }\
- for (brk_ = 0, argv[0]++, argv_ = argv;\
- argv[0][0] && !brk_;\
- argv[0]++) {\
- if (argv_ != argv)\
- break;\
- argc_ = argv[0][0];\
- switch (argc_)
-
-#define ARGEND }\
- }
-
-#define ARGC() argc_
-
-#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
- ((x), abort(), (char *)0) :\
- (brk_ = 1, (argv[0][1] != '\0')?\
- (&argv[0][1]) :\
- (argc--, argv++, argv[0])))
-
-#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
- (char *)0 :\
- (brk_ = 1, (argv[0][1] != '\0')?\
- (&argv[0][1]) :\
- (argc--, argv++, argv[0])))
-
-#endif
diff --git a/user/.config/suckless/dmenu/colors/doom-one.h b/user/.config/suckless/dmenu/colors/doom-one.h
deleted file mode 100644
index 94042cda1..000000000
--- a/user/.config/suckless/dmenu/colors/doom-one.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#cccccc", "#282c34" },
- [SchemeSel] = { "#1c1f24", "#c678dd" },
- [SchemeSelHighlight] = { "#98be65", "#000000" },
- [SchemeNormHighlight] = { "#98be65", "#000000" },
- [SchemeOut] = { "#000000", "#51afef" },
- [SchemeMid] = { "#d7d7d7", "#1c1f24" },
-};
diff --git a/user/.config/suckless/dmenu/colors/dracula.h b/user/.config/suckless/dmenu/colors/dracula.h
deleted file mode 100644
index 02ce8be40..000000000
--- a/user/.config/suckless/dmenu/colors/dracula.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#f8f8f2", "#282a36" },
- [SchemeSel] = { "#000000", "#ff79c6" },
- [SchemeSelHighlight] = { "#50fa7b", "#000000" },
- [SchemeNormHighlight] = { "#507a7b", "#000000" },
- [SchemeOut] = { "#000000", "#8be9fd" },
- [SchemeMid] = { "#d7d7d7", "#1c1f24" },
-};
diff --git a/user/.config/suckless/dmenu/colors/gruvbox-dark.h b/user/.config/suckless/dmenu/colors/gruvbox-dark.h
deleted file mode 100644
index 7fe0cdaa1..000000000
--- a/user/.config/suckless/dmenu/colors/gruvbox-dark.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#fbf1c7", "#1d2021" },
- [SchemeSel] = { "#fbf1c7", "#cc241d" },
- [SchemeSelHighlight] = { "#fbf1c7", "#282828" },
- [SchemeNormHighlight] = { "#fbf1c7", "#282828" },
- [SchemeOut] = { "#fbf1c7", "#cc241d" },
- [SchemeMid] = { "#fbf1c7", "#282828" },
-};
diff --git a/user/.config/suckless/dmenu/colors/monokai-pro.h b/user/.config/suckless/dmenu/colors/monokai-pro.h
deleted file mode 100644
index 7b57079ce..000000000
--- a/user/.config/suckless/dmenu/colors/monokai-pro.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#FCFCFA", "#2D2A2E" },
- [SchemeSel] = { "#000000", "#AB9DF2" },
- [SchemeSelHighlight] = { "#A9DC76", "#000000" },
- [SchemeNormHighlight] = { "#A9Dc76", "#000000" },
- [SchemeOut] = { "#2D2A2E", "#78DCE8" },
- [SchemeMid] = { "#FCFCFA", "#000000" },
-};
diff --git a/user/.config/suckless/dmenu/colors/nord.h b/user/.config/suckless/dmenu/colors/nord.h
deleted file mode 100644
index 27ce0839b..000000000
--- a/user/.config/suckless/dmenu/colors/nord.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#D8DEE9", "#2E3440" },
- [SchemeSel] = { "#000000", "#B48EAD" },
- [SchemeSelHighlight] = { "#A3BE8C", "#000000" },
- [SchemeNormHighlight] = { "#A3BE8C", "#000000" },
- [SchemeOut] = { "#2E3440", "#88C0D0" },
- [SchemeMid] = { "#D8DEE9", "#000000" },
-};
diff --git a/user/.config/suckless/dmenu/colors/oceanic-next.h b/user/.config/suckless/dmenu/colors/oceanic-next.h
deleted file mode 100644
index d9822e67e..000000000
--- a/user/.config/suckless/dmenu/colors/oceanic-next.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#d8dee9", "#1b2b34" },
- [SchemeSel] = { "#000000", "#c594c5" },
- [SchemeSelHighlight] = { "#99C794", "#000000" },
- [SchemeNormHighlight] = { "#99C794", "#000000" },
- [SchemeOut] = { "#ffffff", "#6699cc" },
- [SchemeMid] = { "#d8dee9", "#000000" },
-};
diff --git a/user/.config/suckless/dmenu/colors/palenight.h b/user/.config/suckless/dmenu/colors/palenight.h
deleted file mode 100644
index 26976efda..000000000
--- a/user/.config/suckless/dmenu/colors/palenight.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#d0d0d0", "#292d3e" },
- [SchemeSel] = { "#1c1f24", "#c792ea" },
- [SchemeSelHighlight] = { "#c3e88d", "#000000" },
- [SchemeNormHighlight] = { "#c3e88d", "#000000" },
- [SchemeOut] = { "#000000", "#82aaff" },
- [SchemeMid] = { "#d7d7d7", "#1c1f24" },
-};
diff --git a/user/.config/suckless/dmenu/colors/solarized-dark.h b/user/.config/suckless/dmenu/colors/solarized-dark.h
deleted file mode 100644
index c00611e2f..000000000
--- a/user/.config/suckless/dmenu/colors/solarized-dark.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#eee8d5", "#002b36" },
- [SchemeSel] = { "#ffffff", "#d33682" },
- [SchemeSelHighlight] = { "#2aa198", "#000000" },
- [SchemeNormHighlight] = { "#2aa198", "#000000" },
- [SchemeOut] = { "#ffffff", "#268bd2" },
- [SchemeMid] = { "#eee8d5", "#000000" },
-};
diff --git a/user/.config/suckless/dmenu/colors/solarized-light.h b/user/.config/suckless/dmenu/colors/solarized-light.h
deleted file mode 100644
index fe56f2882..000000000
--- a/user/.config/suckless/dmenu/colors/solarized-light.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#657b83", "#fdf6e3" },
- [SchemeSel] = { "#ffffff", "#d33682" },
- [SchemeSelHighlight] = { "#2aa198", "#000000" },
- [SchemeNormHighlight] = { "#2aa198", "#000000" },
- [SchemeOut] = { "#ffffff", "#268bd2" },
- [SchemeMid] = { "#073642", "#eee8d5" },
-};
diff --git a/user/.config/suckless/dmenu/colors/tomorrow-night.h b/user/.config/suckless/dmenu/colors/tomorrow-night.h
deleted file mode 100644
index af5ec8c6d..000000000
--- a/user/.config/suckless/dmenu/colors/tomorrow-night.h
+++ /dev/null
@@ -1,9 +0,0 @@
-static const char *colors[SchemeLast][2] = {
- /* fg bg */
- [SchemeNorm] = { "#c5c8c6", "#1d1f21" },
- [SchemeSel] = { "#000000", "#b77ee0" },
- [SchemeSelHighlight] = { "#9ec400", "#000000" },
- [SchemeNormHighlight] = { "#9ec400", "#000000" },
- [SchemeOut] = { "#000000", "#54ced6" },
- [SchemeMid] = { "#c5c8c6", "#000000" },
-};
diff --git a/user/.config/suckless/dmenu/config.def.h b/user/.config/suckless/dmenu/config.def.h
deleted file mode 100644
index 0d2f5462b..000000000
--- a/user/.config/suckless/dmenu/config.def.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* ____ __ */
-/* / __ \_________ _/ /_____ */
-/* / / / / ___/ __ `/ //_/ _ \ */
-/* / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake) */
-/* /_____/_/ \__,_/_/|_|\___/ My custom dmenu build */
-
-/* See LICENSE file for copyright and license details. */
-/* Default settings; can be overriden by command line. */
-/* Config was built with dmenu-flexipatch: */
-/* https://github.com/bakkeby/dmenu-flexipatch */
-
-/* The patches I have enabled are:
-* - alpha
-* - border
-* - center
-* - fuzzyhighlight
-* - fuzzymatch
-* - grid
-* - lineheight
-* - morecolor
-* - mousesupport
-* - numbers
-* - XYW */
-
-static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
-
-#if ALPHA_PATCH
-static int opacity = 0; /* -o option; if 0, then alpha is disabled */
-#endif // ALPHA_PATCH
-
-#if FUZZYMATCH_PATCH
-static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
-#endif // FUZZYMATCH_PATCH
-
-#if INCREMENTAL_PATCH
-static int incremental = 0; /* -r option; if 1, outputs text each time a key is pressed */
-#endif // INCREMENTAL_PATCH
-
-#if INSTANT_PATCH
-static int instant = 0; /* -n option; if 1, selects matching item without the need to press enter */
-#endif // INSTANT_PATCH
-
-#if CENTER_PATCH
-static int center = 0; /* -c option; if 0, dmenu won't be centered on the screen */
-static int min_width = 680; /* minimum width when centered */
-#endif // CENTER_PATCH
-
-#if RESTRICT_RETURN_PATCH
-static int restrict_return = 0; /* -1 option; if 1, disables shift-return and ctrl-return */
-#endif // RESTRICT_RETURN_PATCH
-
-/* -fn option overrides fonts[0]; default X11 font or font set */
-#if PANGO_PATCH
-static char font[] = "monospace 10";
-#else
-#if XRESOURCES_PATCH
-static char *fonts[] =
-#else
-static const char *fonts[] =
-#endif // XRESOURCES_PATCH
-{
- "mononoki Nerd Font:pixelsize=11:antialias=true:autohint=true",
-};
-#endif // PANGO_PATCH
-
-
-#if MANAGED_PATCH
-static char *prompt = NULL; /* -p option; prompt to the left of input field */
-#else
-static const char *prompt = NULL; /* -p option; prompt to the left of input field */
-#endif // MANAGED_PATCH
-
-#if DYNAMIC_OPTIONS_PATCH
-static const char *dynamic = NULL; /* -dy option; dynamic command to run on input change */
-#endif // DYNAMIC_OPTIONS_PATCH
-
-#if SYMBOLS_PATCH
-static const char *symbol_1 = "<";
-static const char *symbol_2 = ">";
-#endif // SYMBOLS_PATCH
-
-#if ALPHA_PATCH
-static const unsigned int baralpha = 0xd0;
-static const unsigned int borderalpha = OPAQUE;
-static const unsigned int alphas[][3] = {
- /* fg bg border */
- [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
- [SchemeSel] = { OPAQUE, baralpha, borderalpha },
-};
-
-#endif // ALPHA_PATCH
-
-
-/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
-static unsigned int lines = 0;
-
-/*
- * SELECT YOUR COLOR SCHEME
- * Available themes are:
- * 1. doom-one.h
- * 2. dracula.h
- * 3. gruvbox-dark.h
- * 4. monokai-pro.h
- * 5. nord.h
- * 6. oceanic-next.h
- * 7. solarized-dark.h
- * 8. solarized-light.h
- * 9. tomorrow-night.h
- */
-#include "colors/gruvbox-dark.h"
-
-#if GRID_PATCH
-/* -g option; if nonzero, dmenu uses a grid comprised of columns and lines */
-static unsigned int columns = 0;
-#endif // GRID_PATCH
-
-#if LINE_HEIGHT_PATCH
-static unsigned int lineheight = 22; /* -h option; minimum height of a menu line */
-static unsigned int min_lineheight = 8;
-#endif // LINE_HEIGHT_PATCH
-
-#if NAVHISTORY_PATCH
-static unsigned int maxhist = 15;
-static int histnodup = 1; /* if 0, record repeated histories */
-#endif // NAVHISTORY_PATCH
-
-/*
- * Characters not considered part of a word while deleting words
- * for example: " /?\"&[]"
- */
-#if PIPEOUT_PATCH
-static const char startpipe[] = "#";
-#endif // PIPEOUT_PATCH
-static const char worddelimiters[] = " ";
-
-#if BORDER_PATCH
-/* Size of the window border */
-static unsigned int border_width = 0;
-#endif // BORDER_PATCH
-
-#if PREFIXCOMPLETION_PATCH
-/*
- * Use prefix matching by default; can be inverted with the -x flag.
- */
-static int use_prefix = 1;
-#endif // PREFIXCOMPLETION_PATCH
diff --git a/user/.config/suckless/dmenu/config.mk b/user/.config/suckless/dmenu/config.mk
deleted file mode 100644
index a8208ce2e..000000000
--- a/user/.config/suckless/dmenu/config.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# dmenu version
-VERSION = 5.1
-
-# paths
-PREFIX = /usr
-MANPREFIX = $(PREFIX)/share/man
-
-X11INC = /usr/X11R6/include
-X11LIB = /usr/X11R6/lib
-
-# Xinerama, comment if you don't want it
-XINERAMALIBS = -lXinerama
-XINERAMAFLAGS = -DXINERAMA
-
-# freetype
-FREETYPELIBS = -lfontconfig -lXft
-FREETYPEINC = /usr/include/freetype2
-# OpenBSD (uncomment)
-#FREETYPEINC = $(X11INC)/freetype2
-
-# Uncomment this for the json patch / JSON_PATCH
-#JANSSONINC = `pkg-config --cflags jansson`
-#JANSSONLIBS = `pkg-config --libs jansson`
-# uncomment on RHEL for strcasecmp
-#EXTRAFLAGS=-D_GNU_SOURCE
-
-# Uncomment this for the alpha patch / ALPHA_PATCH
-XRENDER = -lXrender
-
-# Uncomment for the pango patch / PANGO_PATCH
-#PANGOINC = `pkg-config --cflags xft pango pangoxft`
-#PANGOLIB = `pkg-config --libs xft pango pangoxft`
-
-# includes and libs
-INCS = -I$(X11INC) -I$(FREETYPEINC) $(JANSSONINC) ${PANGOINC}
-LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) $(JANSSONLIBS) -lm $(XRENDER) ${PANGOLIB}
-
-# flags
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) $(EXTRAFLAGS)
-CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
-LDFLAGS = $(LIBS)
-
-# compiler and linker
-CC = cc
diff --git a/user/.config/suckless/dmenu/dmenu.1 b/user/.config/suckless/dmenu/dmenu.1
deleted file mode 100644
index 323f93cf8..000000000
--- a/user/.config/suckless/dmenu/dmenu.1
+++ /dev/null
@@ -1,194 +0,0 @@
-.TH DMENU 1 dmenu\-VERSION
-.SH NAME
-dmenu \- dynamic menu
-.SH SYNOPSIS
-.B dmenu
-.RB [ \-bfiv ]
-.RB [ \-l
-.IR lines ]
-.RB [ \-m
-.IR monitor ]
-.RB [ \-p
-.IR prompt ]
-.RB [ \-fn
-.IR font ]
-.RB [ \-nb
-.IR color ]
-.RB [ \-nf
-.IR color ]
-.RB [ \-sb
-.IR color ]
-.RB [ \-sf
-.IR color ]
-.RB [ \-w
-.IR windowid ]
-.P
-.BR dmenu_run " ..."
-.SH DESCRIPTION
-.B dmenu
-is a dynamic menu for X, which reads a list of newline\-separated items from
-stdin. When the user selects an item and presses Return, their choice is printed
-to stdout and dmenu terminates. Entering text will narrow the items to those
-matching the tokens in the input.
-.P
-.B dmenu_run
-is a script used by
-.IR dwm (1)
-which lists programs in the user's $PATH and runs the result in their $SHELL.
-.SH OPTIONS
-.TP
-.B \-b
-dmenu appears at the bottom of the screen.
-.TP
-.B \-f
-dmenu grabs the keyboard before reading stdin if not reading from a tty. This
-is faster, but will lock up X until stdin reaches end\-of\-file.
-.TP
-.B \-i
-dmenu matches menu items case insensitively.
-.TP
-.BI \-l " lines"
-dmenu lists items vertically, with the given number of lines.
-.TP
-.BI \-m " monitor"
-dmenu is displayed on the monitor number supplied. Monitor numbers are starting
-from 0.
-.TP
-.BI \-p " prompt"
-defines the prompt to be displayed to the left of the input field.
-.TP
-.BI \-fn " font"
-defines the font or font set used.
-.TP
-.BI \-nb " color"
-defines the normal background color.
-.IR #RGB ,
-.IR #RRGGBB ,
-and X color names are supported.
-.TP
-.BI \-nf " color"
-defines the normal foreground color.
-.TP
-.BI \-sb " color"
-defines the selected background color.
-.TP
-.BI \-sf " color"
-defines the selected foreground color.
-.TP
-.B \-v
-prints version information to stdout, then exits.
-.TP
-.BI \-w " windowid"
-embed into windowid.
-.SH USAGE
-dmenu is completely controlled by the keyboard. Items are selected using the
-arrow keys, page up, page down, home, and end.
-.TP
-.B Tab
-Copy the selected item to the input field.
-.TP
-.B Return
-Confirm selection. Prints the selected item to stdout and exits, returning
-success.
-.TP
-.B Ctrl-Return
-Confirm selection. Prints the selected item to stdout and continues.
-.TP
-.B Shift\-Return
-Confirm input. Prints the input text to stdout and exits, returning success.
-.TP
-.B Escape
-Exit without selecting an item, returning failure.
-.TP
-.B Ctrl-Left
-Move cursor to the start of the current word
-.TP
-.B Ctrl-Right
-Move cursor to the end of the current word
-.TP
-.B C\-a
-Home
-.TP
-.B C\-b
-Left
-.TP
-.B C\-c
-Escape
-.TP
-.B C\-d
-Delete
-.TP
-.B C\-e
-End
-.TP
-.B C\-f
-Right
-.TP
-.B C\-g
-Escape
-.TP
-.B C\-h
-Backspace
-.TP
-.B C\-i
-Tab
-.TP
-.B C\-j
-Return
-.TP
-.B C\-J
-Shift-Return
-.TP
-.B C\-k
-Delete line right
-.TP
-.B C\-m
-Return
-.TP
-.B C\-M
-Shift-Return
-.TP
-.B C\-n
-Down
-.TP
-.B C\-p
-Up
-.TP
-.B C\-u
-Delete line left
-.TP
-.B C\-w
-Delete word left
-.TP
-.B C\-y
-Paste from primary X selection
-.TP
-.B C\-Y
-Paste from X clipboard
-.TP
-.B M\-b
-Move cursor to the start of the current word
-.TP
-.B M\-f
-Move cursor to the end of the current word
-.TP
-.B M\-g
-Home
-.TP
-.B M\-G
-End
-.TP
-.B M\-h
-Up
-.TP
-.B M\-j
-Page down
-.TP
-.B M\-k
-Page up
-.TP
-.B M\-l
-Down
-.SH SEE ALSO
-.IR dwm (1),
-.IR stest (1)
diff --git a/user/.config/suckless/dmenu/dmenu.c b/user/.config/suckless/dmenu/dmenu.c
deleted file mode 100644
index 2f0c88153..000000000
--- a/user/.config/suckless/dmenu/dmenu.c
+++ /dev/null
@@ -1,2120 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#ifdef XINERAMA
-#include
-#endif
-#include
-
-#include "patches.h"
-/* Patch incompatibility overrides */
-#if MULTI_SELECTION_PATCH
-#undef NON_BLOCKING_STDIN_PATCH
-#undef PIPEOUT_PATCH
-#undef JSON_PATCH
-#undef PRINTINPUTTEXT_PATCH
-#endif // MULTI_SELECTION_PATCH
-#if JSON_PATCH
-#undef NON_BLOCKING_STDIN_PATCH
-#undef PRINTINPUTTEXT_PATCH
-#undef PIPEOUT_PATCH
-#endif // JSON_PATCH
-
-#include "drw.h"
-#include "util.h"
-#if GRIDNAV_PATCH
-#include
-#endif // GRIDNAV_PATCH
-#if JSON_PATCH
-#include
-#endif // JSON_PATCH
-
-/* macros */
-#define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \
- * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
-#define LENGTH(X) (sizeof X / sizeof X[0])
-#if PANGO_PATCH
-#define TEXTW(X) (drw_font_getwidth(drw, (X), False) + lrpad)
-#define TEXTWM(X) (drw_font_getwidth(drw, (X), True) + lrpad)
-#else
-#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
-#endif // PANGO_PATCH
-#if ALPHA_PATCH
-#define OPAQUE 0xffU
-#define OPACITY "_NET_WM_WINDOW_OPACITY"
-#endif // ALPHA_PATCH
-
-/* enums */
-enum {
- SchemeNorm,
- SchemeSel,
- SchemeOut,
- #if MORECOLOR_PATCH
- SchemeMid,
- #endif // MORECOLOR_PATCH
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- SchemeNormHighlight,
- SchemeSelHighlight,
- #endif // HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- #if HIGHPRIORITY_PATCH
- SchemeHp,
- #endif // HIGHPRIORITY_PATCH
- #if EMOJI_HIGHLIGHT_PATCH
- SchemeHover,
- SchemeGreen,
- SchemeYellow,
- SchemeBlue,
- SchemePurple,
- SchemeRed,
- #endif // EMOJI_HIGHLIGHT_PATCH
- SchemeLast,
-}; /* color schemes */
-
-struct item {
- char *text;
- #if TSV_PATCH
- char *stext;
- #endif // TSV_PATCH
- struct item *left, *right;
- #if NON_BLOCKING_STDIN_PATCH
- struct item *next;
- #endif // NON_BLOCKING_STDIN_PATCH
- #if MULTI_SELECTION_PATCH
- int id; /* for multiselect */
- #else
- int out;
- #endif // MULTI_SELECTION_PATCH
- #if HIGHPRIORITY_PATCH
- int hp;
- #endif // HIGHPRIORITY_PATCH
- #if JSON_PATCH
- json_t *json;
- #endif // JSON_PATCH
- #if FUZZYMATCH_PATCH
- double distance;
- #endif // FUZZYMATCH_PATCH
- #if PRINTINDEX_PATCH
- int index;
- #endif // PRINTINDEX_PATCH
-};
-
-static char text[BUFSIZ] = "";
-#if PIPEOUT_PATCH
-static char pipeout[8] = " | dmenu";
-#endif // PIPEOUT_PATCH
-static char *embed;
-static int bh, mw, mh;
-#if XYW_PATCH
-static int dmx = 0, dmy = 0; /* put dmenu at these x and y offsets */
-static unsigned int dmw = 0; /* make dmenu this wide */
-#endif // XYW_PATCH
-static int inputw = 0, promptw;
-#if PASSWORD_PATCH
-static int passwd = 0;
-#endif // PASSWORD_PATCH
-static int lrpad; /* sum of left and right padding */
-#if REJECTNOMATCH_PATCH
-static int reject_no_match = 0;
-#endif // REJECTNOMATCH_PATCH
-static size_t cursor;
-static struct item *items = NULL;
-static struct item *matches, *matchend;
-static struct item *prev, *curr, *next, *sel;
-static int mon = -1, screen;
-#if PRINTINDEX_PATCH
-static int print_index = 0;
-#endif // PRINTINDEX_PATCH
-#if MANAGED_PATCH
-static int managed = 0;
-#endif // MANAGED_PATCH
-#if MULTI_SELECTION_PATCH
-static int *selid = NULL;
-static unsigned int selidsize = 0;
-#endif // MULTI_SELECTION_PATCH
-#if NO_SORT_PATCH
-static unsigned int sortmatches = 1;
-#endif // NO_SORT_PATCH
-#if PRINTINPUTTEXT_PATCH
-static int use_text_input = 0;
-#endif // PRINTINPUTTEXT_PATCH
-#if PRESELECT_PATCH
-static unsigned int preselected = 0;
-#endif // PRESELECT_PATCH
-#if EMOJI_HIGHLIGHT_PATCH
-static int commented = 0;
-static int animated = 0;
-#endif // EMOJI_HIGHLIGHT_PATCH
-
-static Atom clip, utf8;
-#if WMTYPE_PATCH
-static Atom type, dock;
-#endif // WMTYPE_PATCH
-static Display *dpy;
-static Window root, parentwin, win;
-static XIC xic;
-
-#if ALPHA_PATCH
-static int useargb = 0;
-static Visual *visual;
-static int depth;
-static Colormap cmap;
-#endif // ALPHA_PATCH
-
-static Drw *drw;
-static Clr *scheme[SchemeLast];
-
-#include "patch/include.h"
-
-#include "config.h"
-
-#if CASEINSENSITIVE_PATCH
-static char * cistrstr(const char *s, const char *sub);
-static int (*fstrncmp)(const char *, const char *, size_t) = strncasecmp;
-static char *(*fstrstr)(const char *, const char *) = cistrstr;
-#else
-static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
-static char *(*fstrstr)(const char *, const char *) = strstr;
-#endif // CASEINSENSITIVE_PATCH
-
-static void appenditem(struct item *item, struct item **list, struct item **last);
-static void calcoffsets(void);
-static void cleanup(void);
-static char * cistrstr(const char *s, const char *sub);
-static int drawitem(struct item *item, int x, int y, int w);
-static void drawmenu(void);
-static void grabfocus(void);
-static void grabkeyboard(void);
-static void match(void);
-static void insert(const char *str, ssize_t n);
-static size_t nextrune(int inc);
-static void movewordedge(int dir);
-static void keypress(XKeyEvent *ev);
-static void paste(void);
-#if ALPHA_PATCH
-static void xinitvisual(void);
-#endif // ALPHA_PATCH
-static void readstdin(void);
-static void run(void);
-static void setup(void);
-static void usage(void);
-
-#include "patch/include.c"
-
-static void
-appenditem(struct item *item, struct item **list, struct item **last)
-{
- if (*last)
- (*last)->right = item;
- else
- *list = item;
-
- item->left = *last;
- item->right = NULL;
- *last = item;
-}
-
-static void
-calcoffsets(void)
-{
- int i, n;
-
- if (lines > 0)
- #if GRID_PATCH
- if (columns)
- n = lines * columns * bh;
- else
- n = lines * bh;
- #else
- n = lines * bh;
- #endif // GRID_PATCH
- else
- #if SYMBOLS_PATCH
- n = mw - (promptw + inputw + TEXTW(symbol_1) + TEXTW(symbol_2));
- #else
- n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
- #endif // SYMBOLS_PATCH
- /* calculate which items will begin the next page and previous page */
- for (i = 0, next = curr; next; next = next->right)
- #if PANGO_PATCH
- if ((i += (lines > 0) ? bh : MIN(TEXTWM(next->text), n)) > n)
- #else
- if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n)
- #endif // PANGO_PATCH
- break;
- for (i = 0, prev = curr; prev && prev->left; prev = prev->left)
- #if PANGO_PATCH
- if ((i += (lines > 0) ? bh : MIN(TEXTWM(prev->left->text), n)) > n)
- #else
- if ((i += (lines > 0) ? bh : MIN(TEXTW(prev->left->text), n)) > n)
- #endif // PANGO_PATCH
- break;
-}
-
-static void
-cleanup(void)
-{
- size_t i;
-
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- for (i = 0; i < SchemeLast; i++)
- free(scheme[i]);
- drw_free(drw);
- XSync(dpy, False);
- XCloseDisplay(dpy);
- #if MULTI_SELECTION_PATCH
- free(selid);
- #endif // MULTI_SELECTION_PATCH
-}
-
-static char *
-cistrstr(const char *s, const char *sub)
-{
- size_t len;
-
- for (len = strlen(sub); *s; s++)
- if (!strncasecmp(s, sub, len))
- return (char *)s;
- return NULL;
-}
-
-static int
-drawitem(struct item *item, int x, int y, int w)
-{
- int r;
- #if TSV_PATCH
- char *text = item->stext;
- #else
- char *text = item->text;
- #endif // TSV_PATCH
-
- #if EMOJI_HIGHLIGHT_PATCH
- int iscomment = 0;
- if (text[0] == '>') {
- if (text[1] == '>') {
- iscomment = 3;
- switch (text[2]) {
- case 'r':
- drw_setscheme(drw, scheme[SchemeRed]);
- break;
- case 'g':
- drw_setscheme(drw, scheme[SchemeGreen]);
- break;
- case 'y':
- drw_setscheme(drw, scheme[SchemeYellow]);
- break;
- case 'b':
- drw_setscheme(drw, scheme[SchemeBlue]);
- break;
- case 'p':
- drw_setscheme(drw, scheme[SchemePurple]);
- break;
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- case 'h':
- drw_setscheme(drw, scheme[SchemeNormHighlight]);
- break;
- #endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
- case 's':
- drw_setscheme(drw, scheme[SchemeSel]);
- break;
- default:
- iscomment = 1;
- drw_setscheme(drw, scheme[SchemeNorm]);
- break;
- }
- } else {
- drw_setscheme(drw, scheme[SchemeNorm]);
- iscomment = 1;
- }
- } else if (text[0] == ':') {
- iscomment = 2;
- if (item == sel) {
- switch (text[1]) {
- case 'r':
- drw_setscheme(drw, scheme[SchemeRed]);
- break;
- case 'g':
- drw_setscheme(drw, scheme[SchemeGreen]);
- break;
- case 'y':
- drw_setscheme(drw, scheme[SchemeYellow]);
- break;
- case 'b':
- drw_setscheme(drw, scheme[SchemeBlue]);
- break;
- case 'p':
- drw_setscheme(drw, scheme[SchemePurple]);
- break;
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- case 'h':
- drw_setscheme(drw, scheme[SchemeNormHighlight]);
- break;
- #endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
- case 's':
- drw_setscheme(drw, scheme[SchemeSel]);
- break;
- default:
- drw_setscheme(drw, scheme[SchemeSel]);
- iscomment = 0;
- break;
- }
- } else {
- drw_setscheme(drw, scheme[SchemeNorm]);
- }
- }
- #endif // EMOJI_HIGHLIGHT_PATCH
-
- #if EMOJI_HIGHLIGHT_PATCH
- int temppadding = 0;
- if (iscomment == 2) {
- if (text[2] == ' ') {
- #if PANGO_PATCH
- temppadding = drw->font->h * 3;
- #else
- temppadding = drw->fonts->h * 3;
- #endif // PANGO_PATCH
- animated = 1;
- char dest[1000];
- strcpy(dest, text);
- dest[6] = '\0';
- drw_text(drw, x, y
- , temppadding
- #if LINE_HEIGHT_PATCH
- , MAX(lineheight, bh)
- #else
- , bh
- #endif // LINE_HEIGHT_PATCH
- , temppadding / 2.6
- , dest + 3
- , 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- iscomment = 6;
- drw_setscheme(drw, sel == item ? scheme[SchemeHover] : scheme[SchemeNorm]);
- }
- }
-
- char *output;
- if (commented) {
- static char onestr[2];
- onestr[0] = text[0];
- onestr[1] = '\0';
- output = onestr;
- } else {
- output = text;
- }
- #endif // EMOJI_HIGHLIGHT_PATCH
-
- if (item == sel)
- drw_setscheme(drw, scheme[SchemeSel]);
- #if HIGHPRIORITY_PATCH
- else if (item->hp)
- drw_setscheme(drw, scheme[SchemeHp]);
- #endif // HIGHPRIORITY_PATCH
- #if MORECOLOR_PATCH
- else if (item->left == sel || item->right == sel)
- drw_setscheme(drw, scheme[SchemeMid]);
- #endif // MORECOLOR_PATCH
- #if MULTI_SELECTION_PATCH
- else if (issel(item->id))
- #else
- else if (item->out)
- #endif // MULTI_SELECTION_PATCH
- drw_setscheme(drw, scheme[SchemeOut]);
- else
- drw_setscheme(drw, scheme[SchemeNorm]);
-
- r = drw_text(drw
- #if EMOJI_HIGHLIGHT_PATCH
- , x + ((iscomment == 6) ? temppadding : 0)
- #else
- , x
- #endif // EMOJI_HIGHLIGHT_PATCH
- , y
- , w
- , bh
- #if EMOJI_HIGHLIGHT_PATCH
- , commented ? (bh - TEXTW(output) - lrpad) / 2 : lrpad / 2
- #else
- , lrpad / 2
- #endif // EMOJI_HIGHLIGHT_PATCH
- #if EMOJI_HIGHLIGHT_PATCH
- , output + iscomment
- #else
- , text
- #endif // EMOJI_HIGHLIGHT_PATCH
- , 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- #if EMOJI_HIGHLIGHT_PATCH
- drawhighlights(item, output + iscomment, x + ((iscomment == 6) ? temppadding : 0), y, w);
- #else
- drawhighlights(item, x, y, w);
- #endif // EMOJI_HIGHLIGHT_PATCH
- #endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
- return r;
-}
-
-static void
-drawmenu(void)
-{
- #if SCROLL_PATCH
- static int curpos, oldcurlen;
- int curlen, rcurlen;
- #else
- unsigned int curpos;
- #endif // SCROLL_PATCH
- struct item *item;
- int x = 0, y = 0, w, rpad = 0, itw = 0, stw = 0;
- #if LINE_HEIGHT_PATCH && PANGO_PATCH
- int fh = drw->font->h;
- #elif LINE_HEIGHT_PATCH
- int fh = drw->fonts->h;
- #endif // LINE_HEIGHT_PATCH
- #if PASSWORD_PATCH
- char *censort;
- #endif // PASSWORD_PATCH
-
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_rect(drw, 0, 0, mw, mh, 1, 1);
-
- if (prompt && *prompt) {
- #if !PLAIN_PROMPT_PATCH
- drw_setscheme(drw, scheme[SchemeSel]);
- #endif // PLAIN_PROMPT_PATCH
- x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- }
- /* draw input field */
- w = (lines > 0 || !matches) ? mw - x : inputw;
-
- #if SCROLL_PATCH
- w -= lrpad / 2;
- x += lrpad / 2;
- rcurlen = TEXTW(text + cursor) - lrpad;
- curlen = TEXTW(text) - lrpad - rcurlen;
- curpos += curlen - oldcurlen;
- curpos = MIN(w, MAX(0, curpos));
- curpos = MAX(curpos, w - rcurlen);
- curpos = MIN(curpos, curlen);
- oldcurlen = curlen;
-
- drw_setscheme(drw, scheme[SchemeNorm]);
- #if PASSWORD_PATCH
- if (passwd) {
- censort = ecalloc(1, sizeof(text));
- memset(censort, '.', strlen(text));
- drw_text_align(drw, x, 0, curpos, bh, censort, cursor, AlignR);
- drw_text_align(drw, x + curpos, 0, w - curpos, bh, censort + cursor, strlen(censort) - cursor, AlignL);
- free(censort);
- } else {
- drw_text_align(drw, x, 0, curpos, bh, text, cursor, AlignR);
- drw_text_align(drw, x + curpos, 0, w - curpos, bh, text + cursor, strlen(text) - cursor, AlignL);
- }
- #else
- drw_text_align(drw, x, 0, curpos, bh, text, cursor, AlignR);
- drw_text_align(drw, x + curpos, 0, w - curpos, bh, text + cursor, strlen(text) - cursor, AlignL);
- #endif // PASSWORD_PATCH
- #if LINE_HEIGHT_PATCH
- drw_rect(drw, x + curpos - 1, 2 + (bh-fh)/2, 2, fh - 4, 1, 0);
- #else
- drw_rect(drw, x + curpos - 1, 2, 2, bh - 4, 1, 0);
- #endif // LINE_HEIGHT_PATCH
- #else // !SCROLL_PATCH
- drw_setscheme(drw, scheme[SchemeNorm]);
- #if PASSWORD_PATCH
- if (passwd) {
- censort = ecalloc(1, sizeof(text));
- memset(censort, '.', strlen(text));
- drw_text(drw, x, 0, w, bh, lrpad / 2, censort, 0
- #if PANGO_PATCH
- , False
- #endif // PANGO_PATCH
- );
- drw_text(drw, x, 0, w, bh, lrpad / 2, censort, 0
- #if PANGO_PATCH
- , False
- #endif // PANGO_PATCH
- );
- free(censort);
- } else
- drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0
- #if PANGO_PATCH
- , False
- #endif // PANGO_PATCH
- );
- #else
- drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0
- #if PANGO_PATCH
- , False
- #endif // PANGO_PATCH
- );
- #endif // PASSWORD_PATCH
-
- curpos = TEXTW(text) - TEXTW(&text[cursor]);
- if ((curpos += lrpad / 2 - 1) < w) {
- drw_setscheme(drw, scheme[SchemeNorm]);
- #if LINE_HEIGHT_PATCH
- drw_rect(drw, x + curpos, 2 + (bh-fh)/2, 2, fh - 4, 1, 0);
- #else
- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
- #endif // LINE_HEIGHT_PATCH
- }
- #endif // SCROLL_PATCH
-
- #if NUMBERS_PATCH
- recalculatenumbers();
- rpad = TEXTW(numbers);
- #endif // NUMBERS_PATCH
- if (lines > 0) {
- #if GRID_PATCH
- /* draw grid */
- int i = 0;
- for (item = curr; item != next; item = item->right, i++)
- if (columns)
- #if VERTFULL_PATCH
- drawitem(
- item,
- 0 + ((i / lines) * (mw / columns)),
- y + (((i % lines) + 1) * bh),
- mw / columns
- );
- #else
- drawitem(
- item,
- x + ((i / lines) * ((mw - x) / columns)),
- y + (((i % lines) + 1) * bh),
- (mw - x) / columns
- );
- #endif // VERTFULL_PATCH
- else
- #if VERTFULL_PATCH
- drawitem(item, 0, y += bh, mw);
- #else
- drawitem(item, x, y += bh, mw - x);
- #endif // VERTFULL_PATCH
- #else
- /* draw vertical list */
- for (item = curr; item != next; item = item->right)
- #if VERTFULL_PATCH
- drawitem(item, 0, y += bh, mw);
- #else
- drawitem(item, x, y += bh, mw - x);
- #endif // VERTFULL_PATCH
- #endif // GRID_PATCH
- } else if (matches) {
- /* draw horizontal list */
- x += inputw;
- w = TEXTW("<");
- if (curr->left) {
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, "<", 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- }
- x += w;
- for (item = curr; item != next; item = item->right) {
- #if PANGO_PATCH && TSV_PATCH
- itw = TEXTWM(item->stext);
- #elif PANGO_PATCH
- itw = TEXTWM(item->text);
- #elif TSV_PATCH
- itw = TEXTW(item->stext);
- #else
- itw = TEXTW(item->text);
- #endif // PANGO_PATCH | TSV_PATCH
- #if SYMBOLS_PATCH
- stw = TEXTW(symbol_2);
- #else
- stw = TEXTW(">");
- #endif // SYMBOLS_PATCH
- x = drawitem(item, x, 0, MIN(itw, mw - x - stw - rpad));
- }
- if (next) {
- #if SYMBOLS_PATCH
- w = TEXTW(symbol_2);
- #else
- w = TEXTW(">");
- #endif // SYMBOLS_PATCH
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_text(drw, mw - w - rpad, 0, w, bh, lrpad / 2
- #if SYMBOLS_PATCH
- , symbol_2
- #else
- , ">"
- #endif // SYMBOLS_PATCH
- , 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- }
- }
- #if NUMBERS_PATCH
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_text(drw, mw - TEXTW(numbers), 0, TEXTW(numbers), bh, lrpad / 2, numbers, 0);
- #else
- #endif // NUMBERS_PATCH
- drw_map(drw, win, 0, 0, mw, mh);
- #if NON_BLOCKING_STDIN_PATCH
- XFlush(dpy);
- #endif // NON_BLOCKING_STDIN_PATCH
-}
-
-static void
-grabfocus(void)
-{
- struct timespec ts = { .tv_sec = 0, .tv_nsec = 10000000 };
- Window focuswin;
- int i, revertwin;
-
- for (i = 0; i < 100; ++i) {
- XGetInputFocus(dpy, &focuswin, &revertwin);
- if (focuswin == win)
- return;
- #if !MANAGED_PATCH
- XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
- #endif // MANAGED_PATCH
- nanosleep(&ts, NULL);
- }
- die("cannot grab focus");
-}
-
-static void
-grabkeyboard(void)
-{
- struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 };
- int i;
-
- #if MANAGED_PATCH
- if (embed || managed)
- #else
- if (embed)
- #endif // MANAGED_PATCH
- return;
- /* try to grab keyboard, we may have to wait for another process to ungrab */
- for (i = 0; i < 1000; i++) {
- if (XGrabKeyboard(dpy, DefaultRootWindow(dpy), True, GrabModeAsync,
- GrabModeAsync, CurrentTime) == GrabSuccess)
- return;
- nanosleep(&ts, NULL);
- }
- die("cannot grab keyboard");
-}
-
-static void
-match(void)
-{
- #if DYNAMIC_OPTIONS_PATCH
- if (dynamic && *dynamic)
- refreshoptions();
- #endif // DYNAMIC_OPTIONS_PATCH
-
- #if FUZZYMATCH_PATCH
- if (fuzzy) {
- fuzzymatch();
- return;
- }
- #endif
- static char **tokv = NULL;
- static int tokn = 0;
-
- char buf[sizeof text], *s;
- int i, tokc = 0;
- size_t len, textsize;
- struct item *item, *lprefix, *lsubstr, *prefixend, *substrend;
- #if HIGHPRIORITY_PATCH
- struct item *lhpprefix, *hpprefixend;
- #endif // HIGHPRIORITY_PATCH
- #if NON_BLOCKING_STDIN_PATCH
- int preserve = 0;
- #endif // NON_BLOCKING_STDIN_PATCH
- #if JSON_PATCH
- if (json)
- fstrstr = strcasestr;
- #endif // JSON_PATCH
-
- strcpy(buf, text);
- /* separate input text into tokens to be matched individually */
- for (s = strtok(buf, " "); s; tokv[tokc - 1] = s, s = strtok(NULL, " "))
- if (++tokc > tokn && !(tokv = realloc(tokv, ++tokn * sizeof *tokv)))
- die("cannot realloc %u bytes:", tokn * sizeof *tokv);
- len = tokc ? strlen(tokv[0]) : 0;
-
- #if PREFIXCOMPLETION_PATCH
- if (use_prefix) {
- matches = lprefix = matchend = prefixend = NULL;
- textsize = strlen(text);
- } else {
- matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
- textsize = strlen(text) + 1;
- }
- #else
- matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
- textsize = strlen(text) + 1;
- #endif // PREFIXCOMPLETION_PATCH
- #if HIGHPRIORITY_PATCH
- lhpprefix = hpprefixend = NULL;
- #endif // HIGHPRIORITY_PATCH
- #if NON_BLOCKING_STDIN_PATCH && DYNAMIC_OPTIONS_PATCH
- for (item = items; item && (!(dynamic && *dynamic) || item->text); item = (dynamic && *dynamic) ? item + 1 : item->next)
- #elif NON_BLOCKING_STDIN_PATCH
- for (item = items; item; item = item->next)
- #else
- for (item = items; item && item->text; item++)
- #endif
- {
- for (i = 0; i < tokc; i++)
- if (!fstrstr(item->text, tokv[i]))
- break;
- #if DYNAMIC_OPTIONS_PATCH
- if (i != tokc && !(dynamic && *dynamic)) /* not all tokens match */
- continue;
- #else
- if (i != tokc) /* not all tokens match */
- continue;
- #endif // DYNAMIC_OPTIONS_PATCH
- #if HIGHPRIORITY_PATCH
- /* exact matches go first, then prefixes with high priority, then prefixes, then substrings */
- #else
- /* exact matches go first, then prefixes, then substrings */
- #endif // HIGHPRIORITY_PATCH
- #if NO_SORT_PATCH
- if (!sortmatches)
- appenditem(item, &matches, &matchend);
- else
- #endif // NO_SORT_PATCH
- if (!tokc || !fstrncmp(text, item->text, textsize))
- appenditem(item, &matches, &matchend);
- #if HIGHPRIORITY_PATCH
- else if (item->hp && !fstrncmp(tokv[0], item->text, len))
- appenditem(item, &lhpprefix, &hpprefixend);
- #endif // HIGHPRIORITY_PATCH
- else if (!fstrncmp(tokv[0], item->text, len))
- appenditem(item, &lprefix, &prefixend);
- #if PREFIXCOMPLETION_PATCH
- else if (!use_prefix)
- #else
- else
- #endif // PREFIXCOMPLETION_PATCH
- appenditem(item, &lsubstr, &substrend);
- #if NON_BLOCKING_STDIN_PATCH
- if (sel == item)
- preserve = 1;
- #endif // NON_BLOCKING_STDIN_PATCH
- }
- #if HIGHPRIORITY_PATCH
- if (lhpprefix) {
- if (matches) {
- matchend->right = lhpprefix;
- lhpprefix->left = matchend;
- } else
- matches = lhpprefix;
- matchend = hpprefixend;
- }
- #endif // HIGHPRIORITY_PATCH
- if (lprefix) {
- if (matches) {
- matchend->right = lprefix;
- lprefix->left = matchend;
- } else
- matches = lprefix;
- matchend = prefixend;
- }
- #if PREFIXCOMPLETION_PATCH
- if (!use_prefix && lsubstr)
- #else
- if (lsubstr)
- #endif // PREFIXCOMPLETION_PATCH
- {
- if (matches) {
- matchend->right = lsubstr;
- lsubstr->left = matchend;
- } else
- matches = lsubstr;
- matchend = substrend;
- }
- #if NON_BLOCKING_STDIN_PATCH
- if (!preserve)
- #endif // NON_BLOCKING_STDIN_PATCH
- curr = sel = matches;
-
- #if INSTANT_PATCH
- if (instant && matches && matches==matchend && !lsubstr) {
- puts(matches->text);
- cleanup();
- exit(0);
- }
- #endif // INSTANT_PATCH
-
- calcoffsets();
-}
-
-static void
-insert(const char *str, ssize_t n)
-{
- if (strlen(text) + n > sizeof text - 1)
- return;
-
- #if REJECTNOMATCH_PATCH
- static char last[BUFSIZ] = "";
- if (reject_no_match) {
- /* store last text value in case we need to revert it */
- memcpy(last, text, BUFSIZ);
- }
- #endif // REJECTNOMATCH_PATCH
-
- /* move existing text out of the way, insert new text, and update cursor */
- memmove(&text[cursor + n], &text[cursor], sizeof text - cursor - MAX(n, 0));
- if (n > 0)
- memcpy(&text[cursor], str, n);
- cursor += n;
- match();
-
- #if REJECTNOMATCH_PATCH
- if (!matches && reject_no_match) {
- /* revert to last text value if theres no match */
- memcpy(text, last, BUFSIZ);
- cursor -= n;
- match();
- }
- #endif // REJECTNOMATCH_PATCH
-}
-
-static size_t
-nextrune(int inc)
-{
- ssize_t n;
-
- /* return location of next utf8 rune in the given direction (+1 or -1) */
- for (n = cursor + inc; n + inc >= 0 && (text[n] & 0xc0) == 0x80; n += inc)
- ;
- return n;
-}
-
-static void
-movewordedge(int dir)
-{
- if (dir < 0) { /* move cursor to the start of the word*/
- while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
- cursor = nextrune(-1);
- while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
- cursor = nextrune(-1);
- } else { /* move cursor to the end of the word */
- while (text[cursor] && strchr(worddelimiters, text[cursor]))
- cursor = nextrune(+1);
- while (text[cursor] && !strchr(worddelimiters, text[cursor]))
- cursor = nextrune(+1);
- }
-}
-
-static void
-keypress(XKeyEvent *ev)
-{
- char buf[32];
- int len;
- #if PREFIXCOMPLETION_PATCH
- struct item * item;
- #endif // PREFIXCOMPLETION_PATCH
- KeySym ksym;
- Status status;
- #if GRID_PATCH && GRIDNAV_PATCH
- int i;
- struct item *tmpsel;
- bool offscreen = false;
- #endif // GRIDNAV_PATCH
-
- len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
- switch (status) {
- default: /* XLookupNone, XBufferOverflow */
- return;
- case XLookupChars:
- goto insert;
- case XLookupKeySym:
- case XLookupBoth:
- break;
- }
-
- if (ev->state & ControlMask) {
- switch(ksym) {
- case XK_a: ksym = XK_Home; break;
- case XK_b: ksym = XK_Left; break;
- case XK_c: ksym = XK_Escape; break;
- case XK_d: ksym = XK_Delete; break;
- case XK_e: ksym = XK_End; break;
- case XK_f: ksym = XK_Right; break;
- case XK_g: ksym = XK_Escape; break;
- case XK_h: ksym = XK_BackSpace; break;
- case XK_i: ksym = XK_Tab; break;
- case XK_j: /* fallthrough */
- case XK_J: /* fallthrough */
- case XK_m: /* fallthrough */
- case XK_M: ksym = XK_Return; ev->state &= ~ControlMask; break;
- case XK_n: ksym = XK_Down; break;
- case XK_p: ksym = XK_Up; break;
-
- case XK_k: /* delete right */
- text[cursor] = '\0';
- match();
- break;
- case XK_u: /* delete left */
- insert(NULL, 0 - cursor);
- break;
- case XK_w: /* delete word */
- while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
- insert(NULL, nextrune(-1) - cursor);
- while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
- insert(NULL, nextrune(-1) - cursor);
- break;
- case XK_y: /* paste selection */
- case XK_Y:
- #if CTRL_V_TO_PASTE_PATCH
- case XK_v:
- case XK_V:
- #endif // CTRL_V_TO_PASTE_PATCH
- XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
- utf8, utf8, win, CurrentTime);
- return;
- case XK_Left:
- case XK_KP_Left:
- movewordedge(-1);
- goto draw;
- case XK_Right:
- case XK_KP_Right:
- movewordedge(+1);
- goto draw;
- case XK_Return:
- case XK_KP_Enter:
- #if MULTI_SELECTION_PATCH
- selsel();
- #endif // MULTI_SELECTION_PATCH
- break;
- case XK_bracketleft:
- cleanup();
- exit(1);
- default:
- return;
- }
- } else if (ev->state & Mod1Mask) {
- switch(ksym) {
- case XK_b:
- movewordedge(-1);
- goto draw;
- case XK_f:
- movewordedge(+1);
- goto draw;
- case XK_g: ksym = XK_Home; break;
- case XK_G: ksym = XK_End; break;
- case XK_h: ksym = XK_Up; break;
- case XK_j: ksym = XK_Next; break;
- case XK_k: ksym = XK_Prior; break;
- case XK_l: ksym = XK_Down; break;
- #if NAVHISTORY_PATCH
- case XK_p:
- navhistory(-1);
- buf[0]=0;
- break;
- case XK_n:
- navhistory(1);
- buf[0]=0;
- break;
- #endif // NAVHISTORY_PATCH
- default:
- return;
- }
- }
-
- switch(ksym) {
- default:
-insert:
- if (!iscntrl(*buf))
- insert(buf, len);
- break;
- case XK_Delete:
- case XK_KP_Delete:
- if (text[cursor] == '\0')
- return;
- cursor = nextrune(+1);
- /* fallthrough */
- case XK_BackSpace:
- if (cursor == 0)
- return;
- insert(NULL, nextrune(-1) - cursor);
- break;
- case XK_End:
- case XK_KP_End:
- if (text[cursor] != '\0') {
- cursor = strlen(text);
- break;
- }
- if (next) {
- /* jump to end of list and position items in reverse */
- curr = matchend;
- calcoffsets();
- curr = prev;
- calcoffsets();
- while (next && (curr = curr->right))
- calcoffsets();
- }
- sel = matchend;
- break;
- case XK_Escape:
- cleanup();
- exit(1);
- case XK_Home:
- case XK_KP_Home:
- if (sel == matches) {
- cursor = 0;
- break;
- }
- sel = curr = matches;
- calcoffsets();
- break;
- case XK_Left:
- case XK_KP_Left:
- #if GRID_PATCH && GRIDNAV_PATCH
- if (columns > 1) {
- if (!sel)
- return;
- tmpsel = sel;
- for (i = 0; i < lines; i++) {
- if (!tmpsel->left || tmpsel->left->right != tmpsel)
- return;
- if (tmpsel == curr)
- offscreen = true;
- tmpsel = tmpsel->left;
- }
- sel = tmpsel;
- if (offscreen) {
- curr = prev;
- calcoffsets();
- }
- break;
- }
- #endif // GRIDNAV_PATCH
- if (cursor > 0 && (!sel || !sel->left || lines > 0)) {
- cursor = nextrune(-1);
- break;
- }
- if (lines > 0)
- return;
- /* fallthrough */
- case XK_Up:
- case XK_KP_Up:
- if (sel && sel->left && (sel = sel->left)->right == curr) {
- curr = prev;
- calcoffsets();
- }
- break;
- case XK_Next:
- case XK_KP_Next:
- if (!next)
- return;
- sel = curr = next;
- calcoffsets();
- break;
- case XK_Prior:
- case XK_KP_Prior:
- if (!prev)
- return;
- sel = curr = prev;
- calcoffsets();
- break;
- case XK_Return:
- case XK_KP_Enter:
- #if RESTRICT_RETURN_PATCH
- if (restrict_return && (!sel || ev->state & (ShiftMask | ControlMask)))
- break;
- #endif // RESTRICT_RETURN_PATCH
- #if !MULTI_SELECTION_PATCH
- #if JSON_PATCH
- if (!printjsonssel(ev->state))
- break;
- #elif PIPEOUT_PATCH
- #if PRINTINPUTTEXT_PATCH
- if (sel && (
- (use_text_input && (ev->state & ShiftMask)) ||
- (!use_text_input && !(ev->state & ShiftMask))
- ))
- #else
- if (sel && !(ev->state & ShiftMask))
- #endif // PRINTINPUTTEXT_PATCH
- {
- if (sel->text[0] == startpipe[0]) {
- strncpy(sel->text + strlen(sel->text),pipeout,8);
- puts(sel->text+1);
- }
- #if PRINTINDEX_PATCH
- if (print_index)
- printf("%d\n", sel->index);
- else
- #endif // PRINTINDEX_PATCH
- puts(sel->text);
- } else {
- if (text[0] == startpipe[0]) {
- strncpy(text + strlen(text),pipeout,8);
- puts(text+1);
- }
- puts(text);
- }
- #elif PRINTINPUTTEXT_PATCH
- if (use_text_input)
- puts((sel && (ev->state & ShiftMask)) ? sel->text : text);
- #if PRINTINDEX_PATCH
- else if (print_index)
- printf("%d\n", (sel && !(ev->state & ShiftMask)) ? sel->index : -1);
- #endif // PRINTINDEX_PATCH
- else
- puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
- #elif PRINTINDEX_PATCH
- if (print_index)
- printf("%d\n", (sel && !(ev->state & ShiftMask)) ? sel->index : -1);
- else
- puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
- #else
- puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
- #endif // PIPEOUT_PATCH | PRINTINPUTTEXT_PATCH | PRINTINDEX_PATCH
- #endif // MULTI_SELECTION_PATCH
- if (!(ev->state & ControlMask)) {
- #if NAVHISTORY_PATCH
- savehistory((sel && !(ev->state & ShiftMask))
- ? sel->text : text);
- #endif // NAVHISTORY_PATCH
- #if MULTI_SELECTION_PATCH
- printsel(ev->state);
- #endif // MULTI_SELECTION_PATCH
- cleanup();
- exit(0);
- }
- #if !MULTI_SELECTION_PATCH
- if (sel)
- sel->out = 1;
- #endif // MULTI_SELECTION_PATCH
- break;
- case XK_Right:
- case XK_KP_Right:
- #if GRID_PATCH && GRIDNAV_PATCH
- if (columns > 1) {
- if (!sel)
- return;
- tmpsel = sel;
- for (i = 0; i < lines; i++) {
- if (!tmpsel->right || tmpsel->right->left != tmpsel)
- return;
- tmpsel = tmpsel->right;
- if (tmpsel == next)
- offscreen = true;
- }
- sel = tmpsel;
- if (offscreen) {
- curr = next;
- calcoffsets();
- }
- break;
- }
- #endif // GRIDNAV_PATCH
- if (text[cursor] != '\0') {
- cursor = nextrune(+1);
- break;
- }
- if (lines > 0)
- return;
- /* fallthrough */
- case XK_Down:
- case XK_KP_Down:
- if (sel && sel->right && (sel = sel->right) == next) {
- curr = next;
- calcoffsets();
- }
- break;
- case XK_Tab:
- #if PREFIXCOMPLETION_PATCH
- if (!matches)
- break; /* cannot complete no matches */
- #if FUZZYMATCH_PATCH
- /* only do tab completion if all matches start with prefix */
- for (item = matches; item && item->text; item = item->right)
- if (item->text[0] != text[0])
- goto draw;
- #endif // FUZZYMATCH_PATCH
- strncpy(text, matches->text, sizeof text - 1);
- text[sizeof text - 1] = '\0';
- len = cursor = strlen(text); /* length of longest common prefix */
- for (item = matches; item && item->text; item = item->right) {
- cursor = 0;
- while (cursor < len && text[cursor] == item->text[cursor])
- cursor++;
- len = cursor;
- }
- memset(text + len, '\0', strlen(text) - len);
- #else
- if (!sel)
- return;
- strncpy(text, sel->text, sizeof text - 1);
- text[sizeof text - 1] = '\0';
- cursor = strlen(text);
- match();
- #endif //
- break;
- }
-
-draw:
- #if INCREMENTAL_PATCH
- if (incremental) {
- puts(text);
- fflush(stdout);
- }
- #endif // INCREMENTAL_PATCH
- drawmenu();
-}
-
-static void
-paste(void)
-{
- char *p, *q;
- int di;
- unsigned long dl;
- Atom da;
-
- /* we have been given the current selection, now insert it into input */
- if (XGetWindowProperty(dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
- utf8, &da, &di, &dl, &dl, (unsigned char **)&p)
- == Success && p) {
- insert(p, (q = strchr(p, '\n')) ? q - p : (ssize_t)strlen(p));
- XFree(p);
- }
- drawmenu();
-}
-
-#if ALPHA_PATCH
-static void
-xinitvisual()
-{
- XVisualInfo *infos;
- XRenderPictFormat *fmt;
- int nitems;
- int i;
-
- XVisualInfo tpl = {
- .screen = screen,
- .depth = 32,
- .class = TrueColor
- };
- long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
-
- infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
- visual = NULL;
- for(i = 0; i < nitems; i ++) {
- fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
- if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
- visual = infos[i].visual;
- depth = infos[i].depth;
- cmap = XCreateColormap(dpy, root, visual, AllocNone);
- useargb = 1;
- break;
- }
- }
-
- XFree(infos);
-
- if (!visual || !opacity) {
- visual = DefaultVisual(dpy, screen);
- depth = DefaultDepth(dpy, screen);
- cmap = DefaultColormap(dpy, screen);
- }
-}
-#endif // ALPHA_PATCH
-
-#if !NON_BLOCKING_STDIN_PATCH
-static void
-readstdin(void)
-{
- char buf[sizeof text], *p;
- #if JSON_PATCH
- size_t i;
- unsigned int imax = 0;
- struct item *item;
- #else
- size_t i, imax = 0, size = 0;
- #endif // JSON_PATCH
- unsigned int tmpmax = 0;
-
- #if PASSWORD_PATCH
- if (passwd) {
- inputw = lines = 0;
- return;
- }
- #endif // PASSWORD_PATCH
-
- /* read each line from stdin and add it to the item list */
- for (i = 0; fgets(buf, sizeof buf, stdin); i++) {
- #if JSON_PATCH
- item = itemnew();
- #else
- if (i + 1 >= size / sizeof *items)
- if (!(items = realloc(items, (size += BUFSIZ))))
- die("cannot realloc %u bytes:", size);
- #endif // JSON_PATCH
- if ((p = strchr(buf, '\n')))
- *p = '\0';
- #if JSON_PATCH
- if (!(item->text = strdup(buf)))
- #else
- if (!(items[i].text = strdup(buf)))
- #endif // JSON_PATCH
- die("cannot strdup %u bytes:", strlen(buf) + 1);
- #if TSV_PATCH
- if ((p = strchr(buf, '\t')))
- *p = '\0';
- if (!(items[i].stext = strdup(buf)))
- die("cannot strdup %u bytes:", strlen(buf) + 1);
- #endif // TSV_PATCH
- #if MULTI_SELECTION_PATCH
- items[i].id = i; /* for multiselect */
- #if PRINTINDEX_PATCH
- items[i].index = i;
- #endif // PRINTINDEX_PATCH
- #elif JSON_PATCH
- item->json = NULL;
- item->out = 0;
- #if PRINTINDEX_PATCH
- item->index = i;
- #endif // PRINTINDEX_PATCH
- #elif PRINTINDEX_PATCH
- items[i].index = i;
- #else
- items[i].out = 0;
- #endif // MULTI_SELECTION_PATCH | JSON_PATCH | PRINTINDEX_PATCH
-
- #if HIGHPRIORITY_PATCH
- items[i].hp = arrayhas(hpitems, hplength, items[i].text);
- #endif // HIGHPRIORITY_PATCH
- #if PANGO_PATCH
- drw_font_getexts(drw->font, buf, strlen(buf), &tmpmax, NULL, True);
- #else
- drw_font_getexts(drw->fonts, buf, strlen(buf), &tmpmax, NULL);
- #endif // PANGO_PATCH
- if (tmpmax > inputw) {
- inputw = tmpmax;
- #if JSON_PATCH
- imax = items_ln - 1;
- #else
- imax = i;
- #endif // JSON_PATCH
- }
- }
- if (items)
- #if JSON_PATCH
- items[items_ln].text = NULL;
- #else
- items[i].text = NULL;
- #endif // JSON_PATCH
- #if PANGO_PATCH
- inputw = items ? TEXTWM(items[imax].text) : 0;
- #else
- inputw = items ? TEXTW(items[imax].text) : 0;
- #endif // PANGO_PATCH
- #if JSON_PATCH
- lines = MIN(lines, items_ln);
- #else
- lines = MIN(lines, i);
- #endif // JSON_PATCH
-}
-#endif // NON_BLOCKING_STDIN_PATCH
-
-static void
-#if NON_BLOCKING_STDIN_PATCH
-readevent(void)
-#else
-run(void)
-#endif // NON_BLOCKING_STDIN_PATCH
-{
- XEvent ev;
- #if PRESELECT_PATCH
- int i;
- #endif // PRESELECT_PATCH
-
- while (!XNextEvent(dpy, &ev)) {
- #if PRESELECT_PATCH
- if (preselected) {
- for (i = 0; i < preselected; i++) {
- if (sel && sel->right && (sel = sel->right) == next) {
- curr = next;
- calcoffsets();
- }
- }
- drawmenu();
- preselected = 0;
- }
- #endif // PRESELECT_PATCH
- if (XFilterEvent(&ev, win))
- continue;
- switch(ev.type) {
- #if MOUSE_SUPPORT_PATCH
- case ButtonPress:
- buttonpress(&ev);
- break;
- #endif // MOUSE_SUPPORT_PATCH
- case DestroyNotify:
- if (ev.xdestroywindow.window != win)
- break;
- cleanup();
- exit(1);
- case Expose:
- if (ev.xexpose.count == 0)
- drw_map(drw, win, 0, 0, mw, mh);
- break;
- case FocusIn:
- /* regrab focus from parent window */
- if (ev.xfocus.window != win)
- grabfocus();
- break;
- case KeyPress:
- keypress(&ev.xkey);
- break;
- case SelectionNotify:
- if (ev.xselection.property == utf8)
- paste();
- break;
- case VisibilityNotify:
- if (ev.xvisibility.state != VisibilityUnobscured)
- XRaiseWindow(dpy, win);
- break;
- }
- }
-}
-
-static void
-setup(void)
-{
- int x, y, i, j;
- unsigned int du;
- XSetWindowAttributes swa;
- XIM xim;
- Window w, dw, *dws;
- XWindowAttributes wa;
- XClassHint ch = {"dmenu", "dmenu"};
-#ifdef XINERAMA
- XineramaScreenInfo *info;
- Window pw;
- int a, di, n, area = 0;
-#endif
- /* init appearance */
- #if XRESOURCES_PATCH
- for (j = 0; j < SchemeLast; j++)
- #if ALPHA_PATCH
- scheme[j] = drw_scm_create(drw, (const char**)colors[j], alphas[j], 2);
- #else
- scheme[j] = drw_scm_create(drw, (const char**)colors[j], 2);
- #endif // ALPHA_PATCH
- #else
- for (j = 0; j < SchemeLast; j++)
- #if ALPHA_PATCH
- scheme[j] = drw_scm_create(drw, colors[j], alphas[j], 2);
- #else
- scheme[j] = drw_scm_create(drw, colors[j], 2);
- #endif // ALPHA_PATCH
- #endif // XRESOURCES_PATCH
-
- clip = XInternAtom(dpy, "CLIPBOARD", False);
- utf8 = XInternAtom(dpy, "UTF8_STRING", False);
- #if WMTYPE_PATCH
- type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
- dock = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False);
- #endif // WMTYPE_PATCH
-
- /* calculate menu geometry */
- #if PANGO_PATCH
- bh = drw->font->h + 2;
- #else
- bh = drw->fonts->h + 2;
- #endif // PANGO_PATCH
- #if LINE_HEIGHT_PATCH
- bh = MAX(bh,lineheight); /* make a menu line AT LEAST 'lineheight' tall */
- #endif // LINE_HEIGHT_PATCH
- lines = MAX(lines, 0);
- mh = (lines + 1) * bh;
- #if CENTER_PATCH && PANGO_PATCH
- promptw = (prompt && *prompt) ? TEXTWM(prompt) - lrpad / 4 : 0;
- #elif CENTER_PATCH
- promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
- #endif // CENTER_PATCH
-#ifdef XINERAMA
- i = 0;
- if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
- XGetInputFocus(dpy, &w, &di);
- if (mon >= 0 && mon < n)
- i = mon;
- else if (w != root && w != PointerRoot && w != None) {
- /* find top-level window containing current input focus */
- do {
- if (XQueryTree(dpy, (pw = w), &dw, &w, &dws, &du) && dws)
- XFree(dws);
- } while (w != root && w != pw);
- /* find xinerama screen with which the window intersects most */
- if (XGetWindowAttributes(dpy, pw, &wa))
- for (j = 0; j < n; j++)
- if ((a = INTERSECT(wa.x, wa.y, wa.width, wa.height, info[j])) > area) {
- area = a;
- i = j;
- }
- }
- /* no focused window is on screen, so use pointer location instead */
- if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
- for (i = 0; i < n; i++)
- if (INTERSECT(x, y, 1, 1, info[i]) != 0)
- break;
-
- #if CENTER_PATCH
- if (center) {
- mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
- x = info[i].x_org + ((info[i].width - mw) / 2);
- y = info[i].y_org + ((info[i].height - mh) / 2);
- } else {
- #if XYW_PATCH
- x = info[i].x_org + dmx;
- y = info[i].y_org + (topbar ? dmy : info[i].height - mh - dmy);
- mw = (dmw>0 ? dmw : info[i].width);
- #else
- x = info[i].x_org;
- y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
- mw = info[i].width;
- #endif // XYW_PATCH
- }
- #elif XYW_PATCH
- x = info[i].x_org + dmx;
- y = info[i].y_org + (topbar ? dmy : info[i].height - mh - dmy);
- mw = (dmw>0 ? dmw : info[i].width);
- #else
- x = info[i].x_org;
- y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
- mw = info[i].width;
- #endif // CENTER_PATCH / XYW_PATCH
- XFree(info);
- } else
-#endif
- {
- if (!XGetWindowAttributes(dpy, parentwin, &wa))
- die("could not get embedding window attributes: 0x%lx",
- parentwin);
- #if CENTER_PATCH
- if (center) {
- mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
- x = (wa.width - mw) / 2;
- y = (wa.height - mh) / 2;
- } else {
- #if XYW_PATCH
- x = dmx;
- y = topbar ? dmy : wa.height - mh - dmy;
- mw = (dmw>0 ? dmw : wa.width);
- #else
- x = 0;
- y = topbar ? 0 : wa.height - mh;
- mw = wa.width;
- #endif // XYW_PATCH
- }
- #elif XYW_PATCH
- x = dmx;
- y = topbar ? dmy : wa.height - mh - dmy;
- mw = (dmw>0 ? dmw : wa.width);
- #else
- x = 0;
- y = topbar ? 0 : wa.height - mh;
- mw = wa.width;
- #endif // CENTER_PATCH / XYW_PATCH
- }
- #if !CENTER_PATCH
- #if PANGO_PATCH
- promptw = (prompt && *prompt) ? TEXTWM(prompt) - lrpad / 4 : 0;
- #else
- promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
- #endif // PANGO_PATCH
- #endif // CENTER_PATCH
- inputw = MIN(inputw, mw/3);
- match();
-
- /* create menu window */
- #if MANAGED_PATCH
- swa.override_redirect = managed ? False : True;
- #else
- swa.override_redirect = True;
- #endif // MANAGED_PATCH
- #if ALPHA_PATCH
- swa.background_pixel = 0;
- swa.colormap = cmap;
- #else
- swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
- #endif // ALPHA_PATCH
- swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask
- #if MOUSE_SUPPORT_PATCH
- | ButtonPressMask
- #endif // MOUSE_SUPPORT_PATCH
- ;
- #if BORDER_PATCH
- win = XCreateWindow(dpy, parentwin, x, y - (topbar ? 0 : border_width * 2), mw - border_width * 2, mh, border_width,
- #else
- win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
- #endif // BORDER_PATCH
- #if ALPHA_PATCH
- depth, InputOutput, visual,
- CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa
- #else
- CopyFromParent, CopyFromParent, CopyFromParent,
- CWOverrideRedirect | CWBackPixel | CWEventMask, &swa
- #endif // ALPHA_PATCH
- );
- #if BORDER_PATCH
- if (border_width)
- XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
- #endif // BORDER_PATCH
- XSetClassHint(dpy, win, &ch);
- #if WMTYPE_PATCH
- XChangeProperty(dpy, win, type, XA_ATOM, 32, PropModeReplace,
- (unsigned char *) &dock, 1);
- #endif // WMTYPE_PATCH
-
-
- /* input methods */
- if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
- die("XOpenIM failed: could not open input device");
-
- xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNClientWindow, win, XNFocusWindow, win, NULL);
-
- #if MANAGED_PATCH
- if (managed) {
- XTextProperty prop;
- char *windowtitle = prompt != NULL ? prompt : "dmenu";
- Xutf8TextListToTextProperty(dpy, &windowtitle, 1, XUTF8StringStyle, &prop);
- XSetWMName(dpy, win, &prop);
- XSetTextProperty(dpy, win, &prop, XInternAtom(dpy, "_NET_WM_NAME", False));
- XFree(prop.value);
- }
- #endif // MANAGED_PATCH
-
- XMapRaised(dpy, win);
- if (embed) {
- XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
- if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
- for (i = 0; i < du && dws[i] != win; ++i)
- XSelectInput(dpy, dws[i], FocusChangeMask);
- XFree(dws);
- }
- grabfocus();
- }
- drw_resize(drw, mw, mh);
- drawmenu();
-}
-
-static void
-usage(void)
-{
- fputs("usage: dmenu [-bv"
- #if CENTER_PATCH
- "c"
- #endif
- #if !NON_BLOCKING_STDIN_PATCH
- "f"
- #endif // NON_BLOCKING_STDIN_PATCH
- #if INCREMENTAL_PATCH
- "r"
- #endif // INCREMENTAL_PATCH
- #if CASEINSENSITIVE_PATCH
- "s"
- #else
- "i"
- #endif // CASEINSENSITIVE_PATCH
- #if INSTANT_PATCH
- "n"
- #endif // INSTANT_PATCH
- #if PRINTINPUTTEXT_PATCH
- "t"
- #endif // PRINTINPUTTEXT_PATCH
- #if PREFIXCOMPLETION_PATCH
- "x"
- #endif // PREFIXCOMPLETION_PATCH
- #if FUZZYMATCH_PATCH
- "F"
- #endif // FUZZYMATCH_PATCH
- #if PASSWORD_PATCH
- "P"
- #endif // PASSWORD_PATCH
- #if NO_SORT_PATCH
- "S"
- #endif // NO_SORT_PATCH
- #if REJECTNOMATCH_PATCH
- "R" // (changed from r to R due to conflict with INCREMENTAL_PATCH)
- #endif // REJECTNOMATCH_PATCH
- #if RESTRICT_RETURN_PATCH
- "1"
- #endif // RESTRICT_RETURN_PATCH
- "] "
- #if MANAGED_PATCH
- "[-wm] "
- #endif // MANAGED_PATCH
- #if GRID_PATCH
- "[-g columns] "
- #endif // GRID_PATCH
- "[-l lines] [-p prompt] [-fn font] [-m monitor]"
- "\n [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]"
- #if ALPHA_PATCH || BORDER_PATCH || HIGHPRIORITY_PATCH || INITIALTEXT_PATCH || LINE_HEIGHT_PATCH || NAVHISTORY_PATCH || XYW_PATCH || DYNAMIC_OPTIONS_PATCH || JSON_PATCH
- "\n "
- #endif
- #if JSON_PATCH
- " [ -j json-file]"
- #endif // JSON_PATCH
- #if DYNAMIC_OPTIONS_PATCH
- " [ -dy command]"
- #endif // DYNAMIC_OPTIONS_PATCH
- #if ALPHA_PATCH
- " [ -o opacity]"
- #endif // ALPHA_PATCH
- #if BORDER_PATCH
- " [-bw width]"
- #endif // BORDER_PATCH
- #if HIGHPRIORITY_PATCH
- " [-hb color] [-hf color] [-hp items]"
- #endif // HIGHPRIORITY_PATCH
- #if INITIALTEXT_PATCH
- " [-it text]"
- #endif // INITIALTEXT_PATCH
- #if LINE_HEIGHT_PATCH
- " [-h height]"
- #endif // LINE_HEIGHT_PATCH
- #if PRESELECT_PATCH
- " [-ps index]"
- #endif // PRESELECT_PATCH
- #if NAVHISTORY_PATCH
- " [-H histfile]"
- #endif // NAVHISTORY_PATCH
- #if XYW_PATCH
- " [-X xoffset] [-Y yoffset] [-W width]" // (arguments made upper case due to conflicts)
- #endif // XYW_PATCH
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- "\n [-nhb color] [-nhf color] [-shb color] [-shf color]" // highlight colors
- #endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
- "\n", stderr);
- exit(1);
-}
-
-int
-main(int argc, char *argv[])
-{
- XWindowAttributes wa;
- int i;
- #if !NON_BLOCKING_STDIN_PATCH
- int fast = 0;
- #endif // NON_BLOCKING_STDIN_PATCH
-
- #if XRESOURCES_PATCH
- if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
- fputs("warning: no locale support\n", stderr);
- if (!(dpy = XOpenDisplay(NULL)))
- die("cannot open display");
- screen = DefaultScreen(dpy);
- root = RootWindow(dpy, screen);
- if (!embed || !(parentwin = strtol(embed, NULL, 0)))
- parentwin = root;
- if (!XGetWindowAttributes(dpy, parentwin, &wa))
- die("could not get embedding window attributes: 0x%lx",
- parentwin);
-
- #if ALPHA_PATCH
- xinitvisual();
- drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap);
- #else
- drw = drw_create(dpy, screen, root, wa.width, wa.height);
- #endif // ALPHA_PATCH
- readxresources();
- #endif // XRESOURCES_PATCH
-
- for (i = 1; i < argc; i++)
- /* these options take no arguments */
- if (!strcmp(argv[i], "-v")) { /* prints version information */
- puts("dmenu-"VERSION);
- exit(0);
- } else if (!strcmp(argv[i], "-b")) { /* appears at the bottom of the screen */
- topbar = 0;
- #if CENTER_PATCH
- } else if (!strcmp(argv[i], "-c")) { /* toggles centering of dmenu window on screen */
- center = !center;
- #endif // CENTER_PATCH
- #if !NON_BLOCKING_STDIN_PATCH
- } else if (!strcmp(argv[i], "-f")) { /* grabs keyboard before reading stdin */
- fast = 1;
- #endif // NON_BLOCKING_STDIN_PATCH
- #if INCREMENTAL_PATCH
- } else if (!strcmp(argv[i], "-r")) { /* incremental */
- incremental = !incremental;
- #endif // INCREMENTAL_PATCH
- #if CASEINSENSITIVE_PATCH
- } else if (!strcmp(argv[i], "-s")) { /* case-sensitive item matching */
- fstrncmp = strncmp;
- fstrstr = strstr;
- #else
- } else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
- fstrncmp = strncasecmp;
- fstrstr = cistrstr;
- #endif // CASEINSENSITIVE_PATCH
- #if MANAGED_PATCH
- } else if (!strcmp(argv[i], "-wm")) { /* display as managed wm window */
- managed = 1;
- #endif // MANAGED_PATCH
- #if INSTANT_PATCH
- } else if (!strcmp(argv[i], "-n")) { /* instant select only match */
- instant = !instant;
- #endif // INSTANT_PATCH
- #if PRINTINPUTTEXT_PATCH
- } else if (!strcmp(argv[i], "-t")) { /* favors text input over selection */
- use_text_input = 1;
- #endif // PRINTINPUTTEXT_PATCH
- #if PREFIXCOMPLETION_PATCH
- } else if (!strcmp(argv[i], "-x")) { /* invert use_prefix */
- use_prefix = !use_prefix;
- #endif // PREFIXCOMPLETION_PATCH
- #if FUZZYMATCH_PATCH
- } else if (!strcmp(argv[i], "-F")) { /* disable/enable fuzzy matching, depends on default */
- fuzzy = !fuzzy;
- #endif // FUZZYMATCH_PATCH
- #if PASSWORD_PATCH
- } else if (!strcmp(argv[i], "-P")) { /* is the input a password */
- passwd = 1;
- #endif // PASSWORD_PATCH
- #if REJECTNOMATCH_PATCH
- } else if (!strcmp(argv[i], "-R")) { /* reject input which results in no match */
- reject_no_match = 1;
- #endif // REJECTNOMATCH_PATCH
- #if NO_SORT_PATCH
- } else if (!strcmp(argv[i], "-S")) { /* do not sort matches */
- sortmatches = 0;
- #endif // NO_SORT_PATCH
- #if PRINTINDEX_PATCH
- } else if (!strcmp(argv[i], "-ix")) { /* adds ability to return index in list */
- print_index = 1;
- #endif // PRINTINDEX_PATCH
- #if RESTRICT_RETURN_PATCH
- } else if (!strcmp(argv[i], "-1")) {
- restrict_return = 1;
- #endif // RESTRICT_RETURN_PATCH
- } else if (i + 1 == argc)
- usage();
- /* these options take one argument */
- #if NAVHISTORY_PATCH
- else if (!strcmp(argv[i], "-H"))
- histfile = argv[++i];
- #endif // NAVHISTORY_PATCH
- #if GRID_PATCH
- else if (!strcmp(argv[i], "-g")) { /* number of columns in grid */
- columns = atoi(argv[++i]);
- if (columns && lines == 0)
- lines = 1;
- }
- #endif // GRID_PATCH
- #if JSON_PATCH
- else if (!strcmp(argv[i], "-j"))
- readjson(argv[++i]);
- #endif // JSON_PATCH
- else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */
- lines = atoi(argv[++i]);
- #if XYW_PATCH
- else if (!strcmp(argv[i], "-X")) /* window x offset */
- dmx = atoi(argv[++i]);
- else if (!strcmp(argv[i], "-Y")) /* window y offset (from bottom up if -b) */
- dmy = atoi(argv[++i]);
- else if (!strcmp(argv[i], "-W")) /* make dmenu this wide */
- dmw = atoi(argv[++i]);
- #endif // XYW_PATCH
- else if (!strcmp(argv[i], "-m"))
- mon = atoi(argv[++i]);
- #if ALPHA_PATCH
- else if (!strcmp(argv[i], "-o")) /* opacity, pass -o 0 to disable alpha */
- opacity = atoi(argv[++i]);
- #endif // ALPHA_PATCH
- else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
- prompt = argv[++i];
- else if (!strcmp(argv[i], "-fn")) /* font or font set */
- #if PANGO_PATCH
- strcpy(font, argv[++i]);
- #else
- fonts[0] = argv[++i];
- #endif // PANGO_PATCH
- #if LINE_HEIGHT_PATCH
- else if(!strcmp(argv[i], "-h")) { /* minimum height of one menu line */
- lineheight = atoi(argv[++i]);
- lineheight = MAX(lineheight, min_lineheight); /* reasonable default in case of value too small/negative */
- }
- #endif // LINE_HEIGHT_PATCH
- else if (!strcmp(argv[i], "-nb")) /* normal background color */
- colors[SchemeNorm][ColBg] = argv[++i];
- else if (!strcmp(argv[i], "-nf")) /* normal foreground color */
- colors[SchemeNorm][ColFg] = argv[++i];
- else if (!strcmp(argv[i], "-sb")) /* selected background color */
- colors[SchemeSel][ColBg] = argv[++i];
- else if (!strcmp(argv[i], "-sf")) /* selected foreground color */
- colors[SchemeSel][ColFg] = argv[++i];
- #if HIGHPRIORITY_PATCH
- else if (!strcmp(argv[i], "-hb")) /* high priority background color */
- colors[SchemeHp][ColBg] = argv[++i];
- else if (!strcmp(argv[i], "-hf")) /* low priority background color */
- colors[SchemeHp][ColFg] = argv[++i];
- else if (!strcmp(argv[i], "-hp"))
- hpitems = tokenize(argv[++i], ",", &hplength);
- #endif // HIGHPRIORITY_PATCH
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- else if (!strcmp(argv[i], "-nhb")) /* normal hi background color */
- colors[SchemeNormHighlight][ColBg] = argv[++i];
- else if (!strcmp(argv[i], "-nhf")) /* normal hi foreground color */
- colors[SchemeNormHighlight][ColFg] = argv[++i];
- else if (!strcmp(argv[i], "-shb")) /* selected hi background color */
- colors[SchemeSelHighlight][ColBg] = argv[++i];
- else if (!strcmp(argv[i], "-shf")) /* selected hi foreground color */
- colors[SchemeSelHighlight][ColFg] = argv[++i];
- #endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
- else if (!strcmp(argv[i], "-w")) /* embedding window id */
- embed = argv[++i];
- #if PRESELECT_PATCH
- else if (!strcmp(argv[i], "-ps")) /* preselected item */
- preselected = atoi(argv[++i]);
- #endif // PRESELECT_PATCH
- #if DYNAMIC_OPTIONS_PATCH
- else if (!strcmp(argv[i], "-dy")) /* dynamic command to run */
- dynamic = argv[++i];
- #endif // DYNAMIC_OPTIONS_PATCH
- #if BORDER_PATCH
- else if (!strcmp(argv[i], "-bw")) /* border width around dmenu */
- border_width = atoi(argv[++i]);
- #endif // BORDER_PATCH
- #if INITIALTEXT_PATCH
- else if (!strcmp(argv[i], "-it")) { /* adds initial text */
- const char * text = argv[++i];
- insert(text, strlen(text));
- }
- #endif // INITIALTEXT_PATCH
- else
- usage();
-
- #if XRESOURCES_PATCH
- #if PANGO_PATCH
- if (!drw_font_create(drw, font))
- die("no fonts could be loaded.");
- #else
- if (!drw_fontset_create(drw, (const char**)fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- #endif // PANGO_PATCH
- #else // !XRESOURCES_PATCH
- if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
- fputs("warning: no locale support\n", stderr);
- if (!(dpy = XOpenDisplay(NULL)))
- die("cannot open display");
- screen = DefaultScreen(dpy);
- root = RootWindow(dpy, screen);
- if (!embed || !(parentwin = strtol(embed, NULL, 0)))
- parentwin = root;
- if (!XGetWindowAttributes(dpy, parentwin, &wa))
- die("could not get embedding window attributes: 0x%lx",
- parentwin);
-
- #if ALPHA_PATCH
- xinitvisual();
- drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap);
- #else
- drw = drw_create(dpy, screen, root, wa.width, wa.height);
- #endif // ALPHA_PATCH
-
- #if PANGO_PATCH
- if (!drw_font_create(drw, font))
- die("no fonts could be loaded.");
- #else
- if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- #endif // PANGO_PATCH
- #endif // XRESOURCES_PATCH
-
- #if PANGO_PATCH
- lrpad = drw->font->h;
- #else
- lrpad = drw->fonts->h;
- #endif // PANGO_PATCH
-
- #if LINE_HEIGHT_PATCH
- if (lineheight == -1)
- #if PANGO_PATCH
- lineheight = drw->font->h * 2.5;
- #else
- lineheight = drw->fonts->h * 2.5;
- #endif // PANGO_PATCH
- #endif // LINE_HEIGHT_PATCH
-
-#ifdef __OpenBSD__
- if (pledge("stdio rpath", NULL) == -1)
- die("pledge");
-#endif
- #if NAVHISTORY_PATCH
- loadhistory();
- #endif // NAVHISTORY_PATCH
-
- #if NON_BLOCKING_STDIN_PATCH
- grabkeyboard();
- #else
- if (fast && !isatty(0)) {
- grabkeyboard();
- #if JSON_PATCH
- if (json)
- listjson(json);
- #if DYNAMIC_OPTIONS_PATCH
- else if (!(dynamic && *dynamic))
- readstdin();
- #else
- else
- readstdin();
- #endif // DYNAMIC_OPTIONS_PATCH
- #elif DYNAMIC_OPTIONS_PATCH
- if (!(dynamic && *dynamic))
- readstdin();
- #else
- readstdin();
- #endif // JSON_PATCH | DYNAMIC_OPTIONS_PATCH
- } else {
- #if JSON_PATCH
- if (json)
- listjson(json);
- #if DYNAMIC_OPTIONS_PATCH
- else if (!(dynamic && *dynamic))
- readstdin();
- #else
- else
- readstdin();
- #endif // DYNAMIC_OPTIONS_PATCH
- #elif DYNAMIC_OPTIONS_PATCH
- if (!(dynamic && *dynamic))
- readstdin();
- #else
- readstdin();
- #endif // JSON_PATCH | DYNAMIC_OPTIONS_PATCH
- grabkeyboard();
- }
- #endif // NON_BLOCKING_STDIN_PATCH
- setup();
- run();
-
- return 1; /* unreachable */
-}
diff --git a/user/.config/suckless/dmenu/dmenu_path b/user/.config/suckless/dmenu/dmenu_path
deleted file mode 100644
index 3a7cda792..000000000
--- a/user/.config/suckless/dmenu/dmenu_path
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
-cache="$cachedir/dmenu_run"
-
-[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
-
-IFS=:
-if stest -dqr -n "$cache" $PATH; then
- stest -flx $PATH | sort -u | tee "$cache"
-else
- cat "$cache"
-fi
diff --git a/user/.config/suckless/dmenu/dmenu_run b/user/.config/suckless/dmenu/dmenu_run
deleted file mode 100644
index cc05de47f..000000000
--- a/user/.config/suckless/dmenu/dmenu_run
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-export _JAVA_AWT_WM_NONREPARENTING=1
-exec $(dmenu_path | dmenu "$@")
-
-# Uncomment for the NAVHISTORY patch (and remove the exec above)
-#dmenu_path | dmenu -H "${XDG_CACHE_HOME:-$HOME/.cache/}/dmenu_run.hist" "$@" | ${SHELL:-"/bin/sh"} &
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/drw.c b/user/.config/suckless/dmenu/drw.c
deleted file mode 100644
index 60199b505..000000000
--- a/user/.config/suckless/dmenu/drw.c
+++ /dev/null
@@ -1,656 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-#include
-
-#include "patches.h"
-#include "drw.h"
-#include "util.h"
-
-#if !PANGO_PATCH
-#define UTF_INVALID 0xFFFD
-#define UTF_SIZ 4
-
-static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
-static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
-static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000};
-static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
-
-static long
-utf8decodebyte(const char c, size_t *i)
-{
- for (*i = 0; *i < (UTF_SIZ + 1); ++(*i))
- if (((unsigned char)c & utfmask[*i]) == utfbyte[*i])
- return (unsigned char)c & ~utfmask[*i];
- return 0;
-}
-
-static size_t
-utf8validate(long *u, size_t i)
-{
- if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF))
- *u = UTF_INVALID;
- for (i = 1; *u > utfmax[i]; ++i)
- ;
- return i;
-}
-
-static size_t
-utf8decode(const char *c, long *u, size_t clen)
-{
- size_t i, j, len, type;
- long udecoded;
-
- *u = UTF_INVALID;
- if (!clen)
- return 0;
- udecoded = utf8decodebyte(c[0], &len);
- if (!BETWEEN(len, 1, UTF_SIZ))
- return 1;
- for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
- udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type);
- if (type)
- return j;
- }
- if (j < len)
- return 0;
- *u = udecoded;
- utf8validate(u, len);
-
- return len;
-}
-#endif // PANGO_PATCH
-
-Drw *
-#if ALPHA_PATCH
-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
-#else
-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
-#endif // ALPHA_PATCH
-{
- Drw *drw = ecalloc(1, sizeof(Drw));
-
- drw->dpy = dpy;
- drw->screen = screen;
- drw->root = root;
- drw->w = w;
- drw->h = h;
- #if ALPHA_PATCH
- drw->visual = visual;
- drw->depth = depth;
- drw->cmap = cmap;
- drw->drawable = XCreatePixmap(dpy, root, w, h, depth);
- drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL);
- #else
- drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
- drw->gc = XCreateGC(dpy, root, 0, NULL);
- #endif // ALPHA_PATCH
- XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
-
- return drw;
-}
-
-void
-drw_resize(Drw *drw, unsigned int w, unsigned int h)
-{
- if (!drw)
- return;
-
- drw->w = w;
- drw->h = h;
- if (drw->drawable)
- XFreePixmap(drw->dpy, drw->drawable);
- #if ALPHA_PATCH
- drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
- #else
- drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
- #endif // ALPHA_PATCH
-}
-
-void
-drw_free(Drw *drw)
-{
- XFreePixmap(drw->dpy, drw->drawable);
- XFreeGC(drw->dpy, drw->gc);
- #if PANGO_PATCH
- drw_font_free(drw->font);
- #else
- drw_fontset_free(drw->fonts);
- #endif // PANGO_PATCH
- free(drw);
-}
-
-#if PANGO_PATCH
-/* This function is an implementation detail. Library users should use
- * drw_font_create instead.
- */
-static Fnt *
-xfont_create(Drw *drw, const char *fontname)
-{
- Fnt *font;
- PangoFontMap *fontmap;
- PangoContext *context;
- PangoFontDescription *desc;
- PangoFontMetrics *metrics;
-
- if (!fontname) {
- die("no font specified.");
- }
-
- font = ecalloc(1, sizeof(Fnt));
- font->dpy = drw->dpy;
-
- fontmap = pango_xft_get_font_map(drw->dpy, drw->screen);
- context = pango_font_map_create_context(fontmap);
- desc = pango_font_description_from_string(fontname);
- font->layout = pango_layout_new(context);
- pango_layout_set_font_description(font->layout, desc);
-
- metrics = pango_context_get_metrics(context, desc, pango_language_from_string ("en-us"));
- font->h = pango_font_metrics_get_height(metrics) / PANGO_SCALE;
-
- pango_font_metrics_unref(metrics);
- g_object_unref(context);
-
- return font;
-}
-#else
-/* This function is an implementation detail. Library users should use
- * drw_fontset_create instead.
- */
-static Fnt *
-xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
-{
- Fnt *font;
- XftFont *xfont = NULL;
- FcPattern *pattern = NULL;
-
- if (fontname) {
- /* Using the pattern found at font->xfont->pattern does not yield the
- * same substitution results as using the pattern returned by
- * FcNameParse; using the latter results in the desired fallback
- * behaviour whereas the former just results in missing-character
- * rectangles being drawn, at least with some fonts. */
- if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
- fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
- return NULL;
- }
- if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
- fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
- XftFontClose(drw->dpy, xfont);
- return NULL;
- }
- } else if (fontpattern) {
- if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
- fprintf(stderr, "error, cannot load font from pattern.\n");
- return NULL;
- }
- } else {
- die("no font specified.");
- }
-
- #if !COLOR_EMOJI_PATCH
- /* Do not allow using color fonts. This is a workaround for a BadLength
- * error from Xft with color glyphs. Modelled on the Xterm workaround. See
- * https://bugzilla.redhat.com/show_bug.cgi?id=1498269
- * https://lists.suckless.org/dev/1701/30932.html
- * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
- * and lots more all over the internet.
- */
- FcBool iscol;
- if (FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
- XftFontClose(drw->dpy, xfont);
- return NULL;
- }
- #endif // COLOR_EMOJI_PATCH
-
- font = ecalloc(1, sizeof(Fnt));
- font->xfont = xfont;
- font->pattern = pattern;
- font->h = xfont->ascent + xfont->descent;
- font->dpy = drw->dpy;
-
- return font;
-}
-#endif // PANGO_PATCH
-
-static void
-xfont_free(Fnt *font)
-{
- if (!font)
- return;
- #if PANGO_PATCH
- if (font->layout)
- g_object_unref(font->layout);
- #else
- if (font->pattern)
- FcPatternDestroy(font->pattern);
- XftFontClose(font->dpy, font->xfont);
- #endif // PANGO_PATCH
- free(font);
-}
-
-#if PANGO_PATCH
-Fnt*
-drw_font_create(Drw* drw, const char font[])
-{
- Fnt *fnt = NULL;
-
- if (!drw || !font)
- return NULL;
-
- fnt = xfont_create(drw, font);
-
- return (drw->font = fnt);
-}
-#else
-Fnt*
-drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
-{
- Fnt *cur, *ret = NULL;
- size_t i;
-
- if (!drw || !fonts)
- return NULL;
-
- for (i = 1; i <= fontcount; i++) {
- if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
- cur->next = ret;
- ret = cur;
- }
- }
- return (drw->fonts = ret);
-}
-#endif // PANGO_PATCH
-
-#if PANGO_PATCH
-void
-drw_font_free(Fnt *font)
-{
- if (font)
- xfont_free(font);
-}
-#else
-void
-drw_fontset_free(Fnt *font)
-{
- if (font) {
- drw_fontset_free(font->next);
- xfont_free(font);
- }
-}
-#endif // PANGO_PATCH
-
-void
-#if ALPHA_PATCH
-drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
-#else
-drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
-#endif // ALPHA_PATCH
-{
- if (!drw || !dest || !clrname)
- return;
-
- #if ALPHA_PATCH
- if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
- clrname, dest))
- die("error, cannot allocate color '%s'", clrname);
-
- dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
- #else
- if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen),
- clrname, dest))
- die("error, cannot allocate color '%s'", clrname);
- #endif // ALPHA_PATCH
-}
-
-/* Wrapper to create color schemes. The caller has to call free(3) on the
- * returned color scheme when done using it. */
-Clr *
-#if ALPHA_PATCH
-drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
-#else
-drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
-#endif // ALPHA_PATCH
-{
- size_t i;
- Clr *ret;
-
- /* need at least two colors for a scheme */
- if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
- return NULL;
-
- for (i = 0; i < clrcount; i++)
- #if ALPHA_PATCH
- drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
- #else
- drw_clr_create(drw, &ret[i], clrnames[i]);
- #endif // ALPHA_PATCH
- return ret;
-}
-
-#if !PANGO_PATCH
-void
-drw_setfontset(Drw *drw, Fnt *set)
-{
- if (drw)
- drw->fonts = set;
-}
-#endif // PANGO_PATCH
-
-void
-drw_setscheme(Drw *drw, Clr *scm)
-{
- if (drw)
- drw->scheme = scm;
-}
-
-void
-drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
-{
- if (!drw || !drw->scheme)
- return;
- XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
- if (filled)
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- else
- XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
-}
-
-#if PANGO_PATCH
-int
-drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup)
-{
- char buf[1024];
- int ty;
- unsigned int ew;
- XftDraw *d = NULL;
- size_t i, len;
- int render = x || y || w || h;
-
- if (!drw || (render && !drw->scheme) || !text || !drw->font)
- return 0;
-
- if (!render) {
- w = ~w;
- } else {
- XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- #if ALPHA_PATCH
- d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
- #else
- d = XftDrawCreate(drw->dpy, drw->drawable,
- DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen));
- #endif // ALPHA_PATCH
- x += lpad;
- w -= lpad;
- }
-
- len = strlen(text);
-
- if (len) {
- drw_font_getexts(drw->font, text, len, &ew, NULL, markup);
- /* shorten text if necessary */
- for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--)
- drw_font_getexts(drw->font, text, len, &ew, NULL, markup);
-
- if (len) {
- memcpy(buf, text, len);
- buf[len] = '\0';
- if (len < strlen(text))
- for (i = len; i && i > len - 3; buf[--i] = '.')
- ; /* NOP */
-
- if (render) {
- ty = y + (h - drw->font->h) / 2;
- if (markup)
- pango_layout_set_markup(drw->font->layout, buf, len);
- else
- pango_layout_set_text(drw->font->layout, buf, len);
- pango_xft_render_layout(d, &drw->scheme[invert ? ColBg : ColFg],
- drw->font->layout, x * PANGO_SCALE, ty * PANGO_SCALE);
- if (markup) /* clear markup attributes */
- pango_layout_set_attributes(drw->font->layout, NULL);
- }
- x += ew;
- w -= ew;
- }
- }
-
- if (d)
- XftDrawDestroy(d);
-
- return x + (render ? w : 0);
-}
-#else
-int
-drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert)
-{
- char buf[1024];
- int ty;
- unsigned int ew;
- XftDraw *d = NULL;
- Fnt *usedfont, *curfont, *nextfont;
- size_t i, len;
- int utf8strlen, utf8charlen, render = x || y || w || h;
- long utf8codepoint = 0;
- const char *utf8str;
- FcCharSet *fccharset;
- FcPattern *fcpattern;
- FcPattern *match;
- XftResult result;
- int charexists = 0;
-
- if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
- return 0;
-
- if (!render) {
- w = ~w;
- } else {
- XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- #if ALPHA_PATCH
- d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
- #else
- d = XftDrawCreate(drw->dpy, drw->drawable,
- DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen));
- #endif // ALPHA_PATCH
- x += lpad;
- w -= lpad;
- }
-
- usedfont = drw->fonts;
- while (1) {
- utf8strlen = 0;
- utf8str = text;
- nextfont = NULL;
- while (*text) {
- utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
- for (curfont = drw->fonts; curfont; curfont = curfont->next) {
- charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
- if (charexists) {
- if (curfont == usedfont) {
- utf8strlen += utf8charlen;
- text += utf8charlen;
- } else {
- nextfont = curfont;
- }
- break;
- }
- }
-
- if (!charexists || nextfont)
- break;
- else
- charexists = 0;
- }
-
- if (utf8strlen) {
- drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL);
- /* shorten text if necessary */
- for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--)
- drw_font_getexts(usedfont, utf8str, len, &ew, NULL);
-
- if (len) {
- memcpy(buf, utf8str, len);
- buf[len] = '\0';
- if (len < utf8strlen)
- for (i = len; i && i > len - 3; buf[--i] = '.')
- ; /* NOP */
-
- if (render) {
- ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
- XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg],
- usedfont->xfont, x, ty, (XftChar8 *)buf, len);
- }
- x += ew;
- w -= ew;
- }
- }
-
- if (!*text) {
- break;
- } else if (nextfont) {
- charexists = 0;
- usedfont = nextfont;
- } else {
- /* Regardless of whether or not a fallback font is found, the
- * character must be drawn. */
- charexists = 1;
-
- fccharset = FcCharSetCreate();
- FcCharSetAddChar(fccharset, utf8codepoint);
-
- if (!drw->fonts->pattern) {
- /* Refer to the comment in xfont_create for more information. */
- die("the first font in the cache must be loaded from a font string.");
- }
-
- fcpattern = FcPatternDuplicate(drw->fonts->pattern);
- FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
- FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
- FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
-
- FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
- FcDefaultSubstitute(fcpattern);
- match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
-
- FcCharSetDestroy(fccharset);
- FcPatternDestroy(fcpattern);
-
- if (match) {
- usedfont = xfont_create(drw, NULL, match);
- if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
- for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
- ; /* NOP */
- curfont->next = usedfont;
- } else {
- xfont_free(usedfont);
- usedfont = drw->fonts;
- }
- }
- }
- }
- if (d)
- XftDrawDestroy(d);
-
- return x + (render ? w : 0);
-}
-#endif // PANGO_PATCH
-
-void
-drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
-{
- if (!drw)
- return;
-
- XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
- XSync(drw->dpy, False);
-}
-
-#if PANGO_PATCH
-unsigned int
-drw_font_getwidth(Drw *drw, const char *text, Bool markup)
-{
- if (!drw || !drw->font || !text)
- return 0;
- return drw_text(drw, 0, 0, 0, 0, 0, text, 0, markup);
-}
-#else
-unsigned int
-drw_fontset_getwidth(Drw *drw, const char *text)
-{
- if (!drw || !drw->fonts || !text)
- return 0;
- return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
-}
-#endif // PANGO_PATCH
-
-#if PANGO_PATCH
-void
-drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup)
-{
- if (!font || !text)
- return;
-
- PangoRectangle r;
- if (markup)
- pango_layout_set_markup(font->layout, text, len);
- else
- pango_layout_set_text(font->layout, text, len);
- pango_layout_get_extents(font->layout, 0, &r);
- if (markup) /* clear markup attributes */
- pango_layout_set_attributes(font->layout, NULL);
- if (w)
- *w = r.width / PANGO_SCALE;
- if (h)
- *h = font->h;
-}
-#else
-void
-drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h)
-{
- XGlyphInfo ext;
-
- if (!font || !text)
- return;
-
- XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
- if (w)
- *w = ext.xOff;
- if (h)
- *h = font->h;
-}
-#endif // PANGO_PATCH
-
-Cur *
-drw_cur_create(Drw *drw, int shape)
-{
- Cur *cur;
-
- if (!drw || !(cur = ecalloc(1, sizeof(Cur))))
- return NULL;
-
- cur->cursor = XCreateFontCursor(drw->dpy, shape);
-
- return cur;
-}
-
-void
-drw_cur_free(Drw *drw, Cur *cursor)
-{
- if (!cursor)
- return;
-
- XFreeCursor(drw->dpy, cursor->cursor);
- free(cursor);
-}
-
-#if SCROLL_PATCH
-#include "patch/scroll.c"
-#endif
diff --git a/user/.config/suckless/dmenu/drw.h b/user/.config/suckless/dmenu/drw.h
deleted file mode 100644
index a51e6e3a1..000000000
--- a/user/.config/suckless/dmenu/drw.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#if PANGO_PATCH
-#include
-#include
-#endif // PANGO_PATCH
-
-typedef struct {
- Cursor cursor;
-} Cur;
-
-typedef struct Fnt {
- Display *dpy;
- unsigned int h;
- #if PANGO_PATCH
- PangoLayout *layout;
- #else
- XftFont *xfont;
- FcPattern *pattern;
- struct Fnt *next;
- #endif // PANGO_PATCH
-} Fnt;
-
-enum { ColFg, ColBg }; /* Clr scheme index */
-typedef XftColor Clr;
-
-typedef struct {
- unsigned int w, h;
- Display *dpy;
- int screen;
- Window root;
- #if ALPHA_PATCH
- Visual *visual;
- unsigned int depth;
- Colormap cmap;
- #endif // ALPHA_PATCH
- Drawable drawable;
- GC gc;
- Clr *scheme;
- #if PANGO_PATCH
- Fnt *font;
- #else
- Fnt *fonts;
- #endif // PANGO_PATCH
-} Drw;
-
-/* Drawable abstraction */
-#if ALPHA_PATCH
-Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap);
-#else
-Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
-#endif // ALPHA_PATCH
-void drw_resize(Drw *drw, unsigned int w, unsigned int h);
-void drw_free(Drw *drw);
-
-/* Fnt abstraction */
-#if PANGO_PATCH
-Fnt *drw_font_create(Drw* drw, const char font[]);
-void drw_font_free(Fnt* set);
-unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup);
-void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup);
-#else
-Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
-void drw_fontset_free(Fnt* set);
-unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
-void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
-#endif // PANGO_PATCH
-
-/* Colorscheme abstraction */
-#if ALPHA_PATCH
-void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
-Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
-#else
-void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
-Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
-#endif // ALPHA_PATCH
-
-/* Cursor abstraction */
-Cur *drw_cur_create(Drw *drw, int shape);
-void drw_cur_free(Drw *drw, Cur *cursor);
-
-/* Drawing context manipulation */
-#if !PANGO_PATCH
-void drw_setfontset(Drw *drw, Fnt *set);
-#endif // PANGO_PATCH
-void drw_setscheme(Drw *drw, Clr *scm);
-
-/* Drawing functions */
-void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
-#if PANGO_PATCH
-int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup);
-#else
-int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
-#endif // PANGO_PATCH
-
-/* Map functions */
-void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
-
-#if SCROLL_PATCH
-#include "patch/scroll.h"
-#endif
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/center.c b/user/.config/suckless/dmenu/patch/center.c
deleted file mode 100644
index 9682bfbb4..000000000
--- a/user/.config/suckless/dmenu/patch/center.c
+++ /dev/null
@@ -1,8 +0,0 @@
-static int
-max_textw(void)
-{
- int len = 0;
- for (struct item *item = items; item && item->text; item++)
- len = MAX(TEXTW(item->text), len);
- return len;
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/dynamicoptions.c b/user/.config/suckless/dmenu/patch/dynamicoptions.c
deleted file mode 100644
index c3cb64755..000000000
--- a/user/.config/suckless/dmenu/patch/dynamicoptions.c
+++ /dev/null
@@ -1,78 +0,0 @@
-static void
-refreshoptions()
-{
- int dynlen = strlen(dynamic);
- char* cmd= malloc(dynlen + strlen(text) + 2);
- if (cmd == NULL)
- die("malloc:");
- sprintf(cmd, "%s %s", dynamic, text);
- FILE *stream = popen(cmd, "r");
- if (!stream)
- die("popen(%s):", cmd);
- readstream(stream);
- int pc = pclose(stream);
- if (pc == -1)
- die("pclose:");
- free(cmd);
- curr = sel = items;
-}
-
-static void
-readstream(FILE* stream)
-{
- char buf[sizeof text], *p;
- size_t i, imax = 0, size = 0;
- unsigned int tmpmax = 0;
-
- /* read each line from stdin and add it to the item list */
- for (i = 0; fgets(buf, sizeof buf, stream); i++) {
- if (i + 1 >= size / sizeof *items)
- if (!(items = realloc(items, (size += BUFSIZ))))
- die("cannot realloc %u bytes:", size);
- if ((p = strchr(buf, '\n')))
- *p = '\0';
- if (!(items[i].text = strdup(buf)))
- die("cannot strdup %u bytes:", strlen(buf) + 1);
- #if TSV_PATCH
- if ((p = strchr(buf, '\t')))
- *p = '\0';
- if (!(items[i].stext = strdup(buf)))
- die("cannot strdup %u bytes:", strlen(buf) + 1);
- #endif // TSV_PATCH
- #if MULTI_SELECTION_PATCH
- items[i].id = i;
- #else
- items[i].out = 0;
- #endif // MULTI_SELECTION_PATCH
- #if HIGHPRIORITY_PATCH
- items[i].hp = arrayhas(hpitems, hplength, items[i].text);
- #endif // HIGHPRIORITY_PATCH
- #if PANGO_PATCH
- drw_font_getexts(drw->font, buf, strlen(buf), &tmpmax, NULL, True);
- #else
- drw_font_getexts(drw->fonts, buf, strlen(buf), &tmpmax, NULL);
- #endif // PANGO_PATCH
- if (tmpmax > inputw) {
- inputw = tmpmax;
- imax = i;
- }
- }
-
- /* If the command did not give any output at all, then do not clear the existing items */
- if (!i)
- return;
-
- if (items)
- items[i].text = NULL;
- #if PANGO_PATCH
- inputw = items ? TEXTWM(items[imax].text) : 0;
- #else
- inputw = items ? TEXTW(items[imax].text) : 0;
- #endif // PANGO_PATCH
- if (!dynamic || !*dynamic)
- lines = MIN(lines, i);
- else {
- text[0] = '\0';
- cursor = 0;
- }
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/dynamicoptions.h b/user/.config/suckless/dmenu/patch/dynamicoptions.h
deleted file mode 100644
index eba9fb0d4..000000000
--- a/user/.config/suckless/dmenu/patch/dynamicoptions.h
+++ /dev/null
@@ -1,2 +0,0 @@
-static void refreshoptions();
-static void readstream(FILE* stream);
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/fuzzyhighlight.c b/user/.config/suckless/dmenu/patch/fuzzyhighlight.c
deleted file mode 100644
index 737b5d923..000000000
--- a/user/.config/suckless/dmenu/patch/fuzzyhighlight.c
+++ /dev/null
@@ -1,57 +0,0 @@
-static void
-#if EMOJI_HIGHLIGHT_PATCH
-drawhighlights(struct item *item, char *output, int x, int y, int maxw)
-#else
-drawhighlights(struct item *item, int x, int y, int maxw)
-#endif // EMOJI_HIGHLIGHT_PATCH
-{
- int i, indent;
- char *highlight;
- char c;
-
- #if EMOJI_HIGHLIGHT_PATCH
- char *itemtext = output;
- #elif TSV_PATCH
- char *itemtext = item->stext;
- #else
- char *itemtext = item->text;
- #endif // TSV_PATCH
-
- if (!(strlen(itemtext) && strlen(text)))
- return;
-
- drw_setscheme(drw, scheme[item == sel
- ? SchemeSelHighlight
- : SchemeNormHighlight]);
- for (i = 0, highlight = itemtext; *highlight && text[i];) {
- #if FUZZYMATCH_PATCH
- if (!fstrncmp(&(*highlight), &text[i], 1))
- #else
- if (*highlight == text[i])
- #endif // FUZZYMATCH_PATCH
- {
- /* get indentation */
- c = *highlight;
- *highlight = '\0';
- indent = TEXTW(itemtext);
- *highlight = c;
-
- /* highlight character */
- c = highlight[1];
- highlight[1] = '\0';
- drw_text(
- drw,
- x + indent - (lrpad / 2),
- y,
- MIN(maxw - indent, TEXTW(highlight) - lrpad),
- bh, 0, highlight, 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- highlight[1] = c;
- i++;
- }
- highlight++;
- }
-}
diff --git a/user/.config/suckless/dmenu/patch/fuzzymatch.c b/user/.config/suckless/dmenu/patch/fuzzymatch.c
deleted file mode 100644
index 49811faca..000000000
--- a/user/.config/suckless/dmenu/patch/fuzzymatch.c
+++ /dev/null
@@ -1,82 +0,0 @@
-#include
-
-int
-compare_distance(const void *a, const void *b)
-{
- struct item *da = *(struct item **) a;
- struct item *db = *(struct item **) b;
-
- if (!db)
- return 1;
- if (!da)
- return -1;
-
- return da->distance == db->distance ? 0 : da->distance < db->distance ? -1 : 1;
-}
-
-void
-fuzzymatch(void)
-{
- /* bang - we have so much memory */
- struct item *it;
- struct item **fuzzymatches = NULL;
- char c;
- int number_of_matches = 0, i, pidx, sidx, eidx;
- int text_len = strlen(text), itext_len;
-
- matches = matchend = NULL;
-
- /* walk through all items */
- for (it = items; it && it->text; it++) {
- if (text_len) {
- itext_len = strlen(it->text);
- pidx = 0; /* pointer */
- sidx = eidx = -1; /* start of match, end of match */
- /* walk through item text */
- for (i = 0; i < itext_len && (c = it->text[i]); i++) {
- /* fuzzy match pattern */
- if (!fstrncmp(&text[pidx], &c, 1)) {
- if (sidx == -1)
- sidx = i;
- pidx++;
- if (pidx == text_len) {
- eidx = i;
- break;
- }
- }
- }
- /* build list of matches */
- if (eidx != -1) {
- /* compute distance */
- /* add penalty if match starts late (log(sidx+2))
- * add penalty for long a match without many matching characters */
- it->distance = log(sidx + 2) + (double)(eidx - sidx - text_len);
- /* fprintf(stderr, "distance %s %f\n", it->text, it->distance); */
- appenditem(it, &matches, &matchend);
- number_of_matches++;
- }
- } else {
- appenditem(it, &matches, &matchend);
- }
- }
-
- if (number_of_matches) {
- /* initialize array with matches */
- if (!(fuzzymatches = realloc(fuzzymatches, number_of_matches * sizeof(struct item*))))
- die("cannot realloc %u bytes:", number_of_matches * sizeof(struct item*));
- for (i = 0, it = matches; it && i < number_of_matches; i++, it = it->right) {
- fuzzymatches[i] = it;
- }
- /* sort matches according to distance */
- qsort(fuzzymatches, number_of_matches, sizeof(struct item*), compare_distance);
- /* rebuild list of matches */
- matches = matchend = NULL;
- for (i = 0, it = fuzzymatches[i]; i < number_of_matches && it && \
- it->text; i++, it = fuzzymatches[i]) {
- appenditem(it, &matches, &matchend);
- }
- free(fuzzymatches);
- }
- curr = sel = matches;
- calcoffsets();
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/highlight.c b/user/.config/suckless/dmenu/patch/highlight.c
deleted file mode 100644
index 57087a93e..000000000
--- a/user/.config/suckless/dmenu/patch/highlight.c
+++ /dev/null
@@ -1,51 +0,0 @@
-static void
-#if EMOJI_HIGHLIGHT_PATCH
-drawhighlights(struct item *item, char *output, int x, int y, int maxw)
-#else
-drawhighlights(struct item *item, int x, int y, int maxw)
-#endif // EMOJI_HIGHLIGHT_PATCH
-{
- char restorechar, tokens[sizeof text], *highlight, *token;
- int indentx, highlightlen;
- #if EMOJI_HIGHLIGHT_PATCH
- char *itemtext = output;
- #elif TSV_PATCH
- char *itemtext = item->stext;
- #else
- char *itemtext = item->text;
- #endif // TSV_PATCH
-
- drw_setscheme(drw, scheme[item == sel ? SchemeSelHighlight : SchemeNormHighlight]);
- strcpy(tokens, text);
- for (token = strtok(tokens, " "); token; token = strtok(NULL, " ")) {
- highlight = fstrstr(itemtext, token);
- while (highlight) {
- // Move item str end, calc width for highlight indent, & restore
- highlightlen = highlight - itemtext;
- restorechar = *highlight;
- itemtext[highlightlen] = '\0';
- indentx = TEXTW(itemtext);
- itemtext[highlightlen] = restorechar;
-
- // Move highlight str end, draw highlight, & restore
- restorechar = highlight[strlen(token)];
- highlight[strlen(token)] = '\0';
- if (indentx - (lrpad / 2) - 1 < maxw)
- drw_text(
- drw,
- x + indentx - (lrpad / 2) - 1,
- y,
- MIN(maxw - indentx, TEXTW(highlight) - lrpad),
- bh, 0, highlight, 0
- #if PANGO_PATCH
- , True
- #endif // PANGO_PATCH
- );
- highlight[strlen(token)] = restorechar;
-
- if (strlen(highlight) - strlen(token) < strlen(token))
- break;
- highlight = fstrstr(highlight + strlen(token), token);
- }
- }
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/highpriority.c b/user/.config/suckless/dmenu/patch/highpriority.c
deleted file mode 100644
index 568c705a5..000000000
--- a/user/.config/suckless/dmenu/patch/highpriority.c
+++ /dev/null
@@ -1,32 +0,0 @@
-static char **hpitems = NULL;
-static int hplength = 0;
-
-static char**
-tokenize(char *source, const char *delim, int *llen) {
- int listlength = 0;
- char **list = malloc(1 * sizeof(char*));
- char *token = strtok(source, delim);
-
- while (token) {
- if (!(list = realloc(list, sizeof(char*) * (listlength + 1))))
- die("Unable to realloc %d bytes\n", sizeof(char*) * (listlength + 1));
- if (!(list[listlength] = strdup(token)))
- die("Unable to strdup %d bytes\n", strlen(token) + 1);
- token = strtok(NULL, delim);
- listlength++;
- }
-
- *llen = listlength;
- return list;
-}
-
-static int
-arrayhas(char **list, int length, char *item) {
- for (int i = 0; i < length; i++) {
- int len1 = strlen(list[i]);
- int len2 = strlen(item);
- if (fstrncmp(list[i], item, len1 > len2 ? len2 : len1) == 0)
- return 1;
- }
- return 0;
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/include.c b/user/.config/suckless/dmenu/patch/include.c
deleted file mode 100644
index 84f353b3f..000000000
--- a/user/.config/suckless/dmenu/patch/include.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#if CENTER_PATCH
-#include "center.c"
-#endif
-#if DYNAMIC_OPTIONS_PATCH
-#include "dynamicoptions.c"
-#endif
-#if FUZZYHIGHLIGHT_PATCH
-#include "fuzzyhighlight.c"
-#elif HIGHLIGHT_PATCH
-#include "highlight.c"
-#endif
-#if FUZZYMATCH_PATCH
-#include "fuzzymatch.c"
-#endif
-#if HIGHPRIORITY_PATCH
-#include "highpriority.c"
-#endif
-#if MULTI_SELECTION_PATCH
-#include "multiselect.c"
-#endif
-#if JSON_PATCH
-#include "json.c"
-#endif
-#if MOUSE_SUPPORT_PATCH
-#include "mousesupport.c"
-#endif
-#if NAVHISTORY_PATCH
-#include "navhistory.c"
-#endif
-#if NON_BLOCKING_STDIN_PATCH
-#include "nonblockingstdin.c"
-#endif
-#if NUMBERS_PATCH
-#include "numbers.c"
-#endif
-#if XRESOURCES_PATCH
-#include "xresources.c"
-#endif
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/include.h b/user/.config/suckless/dmenu/patch/include.h
deleted file mode 100644
index 1aebc525a..000000000
--- a/user/.config/suckless/dmenu/patch/include.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#if DYNAMIC_OPTIONS_PATCH
-#include "dynamicoptions.h"
-#endif
-#if JSON_PATCH
-#include "json.h"
-#endif
-#if NON_BLOCKING_STDIN_PATCH
-#include "nonblockingstdin.h"
-#endif
-#if NUMBERS_PATCH
-#include "numbers.h"
-#endif
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/json.c b/user/.config/suckless/dmenu/patch/json.c
deleted file mode 100644
index bbd110ae0..000000000
--- a/user/.config/suckless/dmenu/patch/json.c
+++ /dev/null
@@ -1,80 +0,0 @@
-#include
-
-static size_t items_sz = 0;
-static size_t items_ln = 0;
-static json_t *json = NULL;
-
-static struct item *
-itemnew(void)
-{
- if (items_ln + 1 >= (items_sz / sizeof *items))
- if (!(items = realloc(items, (items_sz += BUFSIZ))))
- die("cannot realloc %u bytes:", items_sz);
- return &items[items_ln++];
-}
-
-static void
-readjson(const char *path)
-{
- json_error_t jerr;
-
- if (!(json = json_load_file(path, 0, &jerr)))
- die("%s @ line: %i - %s", jerr.text, jerr.line, path);
-}
-
-static void
-listjson(json_t *obj)
-{
- void *iter;
- unsigned imax = 0;
- unsigned tmpmax = 0;
- struct item *item;
-
- items_ln = 0;
- iter = json_object_iter(obj);
- while (iter) {
- item = itemnew();
- item->text = (char*) json_object_iter_key(iter);
- item->json = json_object_iter_value(iter);
- #if !MULTI_SELECTION_PATCH
- item->out = 0;
- #endif // MULTI_SELECTION_PATCH
- drw_font_getexts(drw->fonts, item->text, strlen(item->text),
- &tmpmax, NULL);
- if (tmpmax > inputw) {
- inputw = tmpmax;
- imax = items_ln - 1;
- }
- iter = json_object_iter_next(obj, iter);
- }
- if (items)
- items[items_ln].text = NULL;
- inputw = items ? TEXTW(items[imax].text) : 0;
- lines = MIN(lines, items_ln - 1);
-}
-
-static int
-printjsonssel(unsigned int state)
-{
- if (sel && sel->json) {
- if (json_is_object(sel->json)) {
- listjson(sel->json);
- text[0] = '\0';
- match();
- drawmenu();
- return 0;
- } else {
- puts(json_string_value(sel->json));
- }
- } else {
- #if PRINTINDEX_PATCH
- if (print_index)
- printf("%d\n", (sel && !(state & ShiftMask)) ? sel->index : -1);
- else
- puts((sel && !(state & ShiftMask)) ? sel->text : text);
- #else
- puts((sel && !(state & ShiftMask)) ? sel->text : text);
- #endif // PRINTINDEX_PATCH
- }
- return 1;
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/json.h b/user/.config/suckless/dmenu/patch/json.h
deleted file mode 100644
index 0c9f69e93..000000000
--- a/user/.config/suckless/dmenu/patch/json.h
+++ /dev/null
@@ -1 +0,0 @@
-static void listjson(json_t *obj);
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/mousesupport.c b/user/.config/suckless/dmenu/patch/mousesupport.c
deleted file mode 100644
index d040e8690..000000000
--- a/user/.config/suckless/dmenu/patch/mousesupport.c
+++ /dev/null
@@ -1,159 +0,0 @@
-static void
-buttonpress(XEvent *e)
-{
- struct item *item;
- XButtonPressedEvent *ev = &e->xbutton;
- int x = 0, y = 0, h = bh, w;
-
- if (ev->window != win)
- return;
-
- /* right-click: exit */
- if (ev->button == Button3)
- exit(1);
-
- if (prompt && *prompt)
- x += promptw;
-
- /* input field */
- w = (lines > 0 || !matches) ? mw - x : inputw;
-
- /* left-click on input: clear input,
- * NOTE: if there is no left-arrow the space for < is reserved so
- * add that to the input width */
- #if SYMBOLS_PATCH
- if (ev->button == Button1 &&
- ((lines <= 0 && ev->x >= 0 && ev->x <= x + w +
- ((!prev || !curr->left) ? TEXTW(symbol_1) : 0)) ||
- (lines > 0 && ev->y >= y && ev->y <= y + h))) {
- insert(NULL, -cursor);
- drawmenu();
- return;
- }
- #else
- if (ev->button == Button1 &&
- ((lines <= 0 && ev->x >= 0 && ev->x <= x + w +
- ((!prev || !curr->left) ? TEXTW("<") : 0)) ||
- (lines > 0 && ev->y >= y && ev->y <= y + h))) {
- insert(NULL, -cursor);
- drawmenu();
- return;
- }
- #endif // SYMBOLS_PATCH
- /* middle-mouse click: paste selection */
- if (ev->button == Button2) {
- XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
- utf8, utf8, win, CurrentTime);
- drawmenu();
- return;
- }
- /* scroll up */
- if (ev->button == Button4 && prev) {
- sel = curr = prev;
- calcoffsets();
- drawmenu();
- return;
- }
- /* scroll down */
- if (ev->button == Button5 && next) {
- sel = curr = next;
- calcoffsets();
- drawmenu();
- return;
- }
- if (ev->button != Button1)
- return;
- if (ev->state & ~ControlMask)
- return;
- if (lines > 0) {
- /* vertical list: (ctrl)left-click on item */
- w = mw - x;
- for (item = curr; item != next; item = item->right) {
- y += h;
- if (ev->y >= y && ev->y <= (y + h)) {
- #if !MULTI_SELECTION_PATCH
- puts(item->text);
- #endif // MULTI_SELECTION_PATCH
- if (!(ev->state & ControlMask)) {
- #if MULTI_SELECTION_PATCH
- sel = item;
- selsel();
- printsel(ev->state);
- #endif // MULTI_SELECTION_PATCH
- exit(0);
- }
- sel = item;
- if (sel) {
- #if MULTI_SELECTION_PATCH
- selsel();
- #else
- sel->out = 1;
- #endif // MULTI_SELECTION_PATCH
- drawmenu();
- }
- return;
- }
- }
- } else if (matches) {
- /* left-click on left arrow */
- x += inputw;
- #if SYMBOLS_PATCH
- w = TEXTW(symbol_1);
- #else
- w = TEXTW("<");
- #endif // SYMBOLS_PATCH
- if (prev && curr->left) {
- if (ev->x >= x && ev->x <= x + w) {
- sel = curr = prev;
- calcoffsets();
- drawmenu();
- return;
- }
- }
- /* horizontal list: (ctrl)left-click on item */
- for (item = curr; item != next; item = item->right) {
- x += w;
- #if SYMBOLS_PATCH
- w = MIN(TEXTW(item->text), mw - x - TEXTW(symbol_2));
- #else
- w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
- #endif // SYMBOLS_PATCH
- if (ev->x >= x && ev->x <= x + w) {
- #if !MULTI_SELECTION_PATCH
- puts(item->text);
- #endif // MULTI_SELECTION_PATCH
- if (!(ev->state & ControlMask)) {
- #if MULTI_SELECTION_PATCH
- sel = item;
- selsel();
- printsel(ev->state);
- #endif // MULTI_SELECTION_PATCH
- exit(0);
- }
- sel = item;
- if (sel) {
- #if MULTI_SELECTION_PATCH
- selsel();
- #else
- sel->out = 1;
- #endif // MULTI_SELECTION_PATCH
- drawmenu();
- }
- return;
- }
- }
- /* left-click on right arrow */
- #if SYMBOLS_PATCH
- w = TEXTW(symbol_2);
- #else
- w = TEXTW(">");
- #endif // SYMBOLS_PATCH
- x = mw - w;
- if (next && ev->x >= x && ev->x <= x + w) {
- sel = curr = next;
- calcoffsets();
- drawmenu();
- return;
- }
- }
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/multiselect.c b/user/.config/suckless/dmenu/patch/multiselect.c
deleted file mode 100644
index 94825b543..000000000
--- a/user/.config/suckless/dmenu/patch/multiselect.c
+++ /dev/null
@@ -1,49 +0,0 @@
-static int
-issel(size_t id)
-{
- for (int i = 0;i < selidsize;i++)
- if (selid[i] == id)
- return 1;
- return 0;
-}
-
-static void
-printsel(unsigned int state)
-{
- for (int i = 0;i < selidsize;i++)
- if (selid[i] != -1 && (!sel || sel->id != selid[i]))
- #if PRINTINDEX_PATCH
- printf("%d\n", selid[i]);
- #else
- puts(items[selid[i]].text);
- #endif // PRINTINDEX_PATCH
- if (sel && !(state & ShiftMask))
- #if PRINTINDEX_PATCH
- printf("%d\n", sel->index);
- #else
- puts(sel->text);
- #endif // PRINTINDEX_PATCH
- else
- puts(text);
-}
-
-static void
-selsel()
-{
- if (!sel)
- return;
- if (issel(sel->id)) {
- for (int i = 0; i < selidsize; i++)
- if (selid[i] == sel->id)
- selid[i] = -1;
- } else {
- for (int i = 0; i < selidsize; i++)
- if (selid[i] == -1) {
- selid[i] = sel->id;
- return;
- }
- selidsize++;
- selid = realloc(selid, (selidsize + 1) * sizeof(int));
- selid[selidsize - 1] = sel->id;
- }
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/navhistory.c b/user/.config/suckless/dmenu/patch/navhistory.c
deleted file mode 100644
index 7d10ee462..000000000
--- a/user/.config/suckless/dmenu/patch/navhistory.c
+++ /dev/null
@@ -1,126 +0,0 @@
-static char *histfile;
-static char **history;
-static size_t histsz, histpos;
-
-static void
-loadhistory(void)
-{
- FILE *fp = NULL;
- static size_t cap = 0;
- size_t llen;
- char *line;
-
- if (!histfile) {
- return;
- }
-
- fp = fopen(histfile, "r");
- if (!fp) {
- return;
- }
-
- for (;;) {
- line = NULL;
- llen = 0;
- if (-1 == getline(&line, &llen, fp)) {
- if (ferror(fp)) {
- die("failed to read history");
- }
- free(line);
- break;
- }
-
- if (cap == histsz) {
- cap += 64 * sizeof(char*);
- history = realloc(history, cap);
- if (!history) {
- die("failed to realloc memory");
- }
- }
- strtok(line, "\n");
- history[histsz] = line;
- histsz++;
- }
- histpos = histsz;
-
- if (fclose(fp)) {
- die("failed to close file %s", histfile);
- }
-}
-
-static void
-navhistory(int dir)
-{
- static char def[BUFSIZ];
- char *p = NULL;
- size_t len = 0;
-
- if (!history || histpos + 1 == 0)
- return;
-
- if (histsz == histpos) {
- strncpy(def, text, sizeof(def));
- }
-
- switch(dir) {
- case 1:
- if (histpos < histsz - 1) {
- p = history[++histpos];
- } else if (histpos == histsz - 1) {
- p = def;
- histpos++;
- }
- break;
- case -1:
- if (histpos > 0) {
- p = history[--histpos];
- }
- break;
- }
- if (p == NULL) {
- return;
- }
-
- len = MIN(strlen(p), BUFSIZ - 1);
- strncpy(text, p, len);
- text[len] = '\0';
- cursor = len;
- match();
-}
-
-static void
-savehistory(char *input)
-{
- unsigned int i;
- FILE *fp;
-
- if (!histfile ||
- 0 == maxhist ||
- 0 == strlen(input)) {
- goto out;
- }
-
- fp = fopen(histfile, "w");
- if (!fp) {
- die("failed to open %s", histfile);
- }
- for (i = histsz < maxhist ? 0 : histsz - maxhist; i < histsz; i++) {
- if (0 >= fprintf(fp, "%s\n", history[i])) {
- die("failed to write to %s", histfile);
- }
- }
- if (histsz == 0 || !histnodup || (histsz > 0 && strcmp(input, history[histsz-1]) != 0)) { /* TODO */
- if (0 >= fputs(input, fp)) {
- die("failed to write to %s", histfile);
- }
- }
- if (fclose(fp)) {
- die("failed to close file %s", histfile);
- }
-
-out:
- for (i = 0; i < histsz; i++) {
- free(history[i]);
- }
- free(history);
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/nonblockingstdin.c b/user/.config/suckless/dmenu/patch/nonblockingstdin.c
deleted file mode 100644
index eb7013fa1..000000000
--- a/user/.config/suckless/dmenu/patch/nonblockingstdin.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#include
-#include
-#include
-
-static void
-readstdin(void)
-{
- static size_t max = 0;
- static struct item **end = &items;
-
- char buf[sizeof text], *p, *maxstr;
- struct item *item;
-
- #if PASSWORD_PATCH
- if (passwd) {
- inputw = lines = 0;
- return;
- }
- #endif // PASSWORD_PATCH
-
- /* read each line from stdin and add it to the item list */
- while (fgets(buf, sizeof buf, stdin)) {
- if (!(item = malloc(sizeof *item)))
- die("cannot malloc %u bytes:", sizeof *item);
- if ((p = strchr(buf, '\n')))
- *p = '\0';
- if (!(item->text = strdup(buf)))
- die("cannot strdup %u bytes:", strlen(buf)+1);
- if (strlen(item->text) > max) {
- max = strlen(maxstr = item->text);
- #if PANGO_PATCH
- inputw = maxstr ? TEXTWM(maxstr) : 0;
- #else
- inputw = maxstr ? TEXTW(maxstr) : 0;
- #endif // PANGO_PATCH
- }
- *end = item;
- end = &item->next;
- item->next = NULL;
- item->out = 0;
- }
- match();
- drawmenu();
-}
-
-static void
-run(void)
-{
- fd_set fds;
- int flags, xfd = XConnectionNumber(dpy);
-
- if ((flags = fcntl(0, F_GETFL)) == -1)
- die("cannot get stdin control flags:");
- if (fcntl(0, F_SETFL, flags | O_NONBLOCK) == -1)
- die("cannot set stdin control flags:");
- for (;;) {
- FD_ZERO(&fds);
- FD_SET(xfd, &fds);
- if (!feof(stdin))
- FD_SET(0, &fds);
- if (select(xfd + 1, &fds, NULL, NULL, NULL) == -1)
- die("cannot multiplex input:");
- if (FD_ISSET(xfd, &fds))
- readevent();
- if (FD_ISSET(0, &fds))
- readstdin();
- }
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/nonblockingstdin.h b/user/.config/suckless/dmenu/patch/nonblockingstdin.h
deleted file mode 100644
index a0c4dfe0e..000000000
--- a/user/.config/suckless/dmenu/patch/nonblockingstdin.h
+++ /dev/null
@@ -1 +0,0 @@
-static void readevent();
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/numbers.c b/user/.config/suckless/dmenu/patch/numbers.c
deleted file mode 100644
index 739762e23..000000000
--- a/user/.config/suckless/dmenu/patch/numbers.c
+++ /dev/null
@@ -1,16 +0,0 @@
-static char numbers[NUMBERSBUFSIZE] = "";
-
-static void
-recalculatenumbers()
-{
- unsigned int numer = 0, denom = 0;
- struct item *item;
- if (matchend) {
- numer++;
- for (item = matchend; item && item->left; item = item->left)
- numer++;
- }
- for (item = items; item && item->text; item++)
- denom++;
- snprintf(numbers, NUMBERSBUFSIZE, "%d/%d ", numer, denom);
-}
diff --git a/user/.config/suckless/dmenu/patch/numbers.h b/user/.config/suckless/dmenu/patch/numbers.h
deleted file mode 100644
index 34d3dbc6c..000000000
--- a/user/.config/suckless/dmenu/patch/numbers.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#define NUMBERSMAXDIGITS 100
-#define NUMBERSBUFSIZE (NUMBERSMAXDIGITS * 2) + 1
-
-static void recalculatenumbers();
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/scroll.c b/user/.config/suckless/dmenu/patch/scroll.c
deleted file mode 100644
index 9021edf66..000000000
--- a/user/.config/suckless/dmenu/patch/scroll.c
+++ /dev/null
@@ -1,168 +0,0 @@
-int
-utf8nextchar(const char *str, int len, int i, int inc)
-{
- int n;
-
- for (n = i + inc; n + inc >= 0 && n + inc <= len
- && (str[n] & 0xc0) == 0x80; n += inc)
- ;
- return n;
-}
-
-int
-drw_text_align(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int textlen, int align)
-{
- int ty;
- unsigned int ew;
- XftDraw *d = NULL;
- Fnt *usedfont, *curfont, *nextfont;
- size_t len;
- int utf8strlen, utf8charlen, render = x || y || w || h;
- long utf8codepoint = 0;
- const char *utf8str;
- FcCharSet *fccharset;
- FcPattern *fcpattern;
- FcPattern *match;
- XftResult result;
- int charexists = 0;
- int i, n;
-
- if (!drw || (render && !drw->scheme) || !text || !drw->fonts || textlen <= 0
- || (align != AlignL && align != AlignR))
- return 0;
-
- if (!render) {
- w = ~w;
- } else {
- XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel);
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- d = XftDrawCreate(drw->dpy, drw->drawable,
- DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen));
- }
-
- usedfont = drw->fonts;
- i = align == AlignL ? 0 : textlen;
- x = align == AlignL ? x : x + w;
- while (1) {
- utf8strlen = 0;
- nextfont = NULL;
- /* if (align == AlignL) */
- utf8str = text + i;
-
- while ((align == AlignL && i < textlen) || (align == AlignR && i > 0)) {
- if (align == AlignL) {
- utf8charlen = utf8decode(text + i, &utf8codepoint, MIN(textlen - i, UTF_SIZ));
- if (!utf8charlen) {
- textlen = i;
- break;
- }
- } else {
- n = utf8nextchar(text, textlen, i, -1);
- utf8charlen = utf8decode(text + n, &utf8codepoint, MIN(textlen - n, UTF_SIZ));
- if (!utf8charlen) {
- textlen -= i;
- text += i;
- i = 0;
- break;
- }
- }
- for (curfont = drw->fonts; curfont; curfont = curfont->next) {
- charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
- if (charexists) {
- if (curfont == usedfont) {
- utf8strlen += utf8charlen;
- i += align == AlignL ? utf8charlen : -utf8charlen;
- } else {
- nextfont = curfont;
- }
- break;
- }
- }
-
- if (!charexists || nextfont)
- break;
- else
- charexists = 0;
- }
-
- if (align == AlignR)
- utf8str = text + i;
-
- if (utf8strlen) {
- drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL);
- /* shorten text if necessary */
- if (align == AlignL) {
- for (len = utf8strlen; len && ew > w; ) {
- len = utf8nextchar(utf8str, len, len, -1);
- drw_font_getexts(usedfont, utf8str, len, &ew, NULL);
- }
- } else {
- for (len = utf8strlen; len && ew > w; ) {
- n = utf8nextchar(utf8str, len, 0, +1);
- utf8str += n;
- len -= n;
- drw_font_getexts(usedfont, utf8str, len, &ew, NULL);
- }
- }
-
- if (len) {
- if (render) {
- ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
- XftDrawStringUtf8(d, &drw->scheme[ColFg],
- usedfont->xfont, align == AlignL ? x : x - ew, ty, (XftChar8 *)utf8str, len);
- }
- x += align == AlignL ? ew : -ew;
- w -= ew;
- }
- if (len < utf8strlen)
- break;
- }
-
- if ((align == AlignR && i <= 0) || (align == AlignL && i >= textlen)) {
- break;
- } else if (nextfont) {
- charexists = 0;
- usedfont = nextfont;
- } else {
- /* Regardless of whether or not a fallback font is found, the
- * character must be drawn. */
- charexists = 1;
-
- fccharset = FcCharSetCreate();
- FcCharSetAddChar(fccharset, utf8codepoint);
-
- if (!drw->fonts->pattern) {
- /* Refer to the comment in xfont_create for more information. */
- die("the first font in the cache must be loaded from a font string.");
- }
-
- fcpattern = FcPatternDuplicate(drw->fonts->pattern);
- FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
- FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
-
- FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
- FcDefaultSubstitute(fcpattern);
- match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
-
- FcCharSetDestroy(fccharset);
- FcPatternDestroy(fcpattern);
-
- if (match) {
- usedfont = xfont_create(drw, NULL, match);
- if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
- for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
- ; /* NOP */
- curfont->next = usedfont;
- } else {
- xfont_free(usedfont);
- usedfont = drw->fonts;
- }
- }
- }
- }
- if (d)
- XftDrawDestroy(d);
-
- return x;
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/scroll.h b/user/.config/suckless/dmenu/patch/scroll.h
deleted file mode 100644
index 927df9ae6..000000000
--- a/user/.config/suckless/dmenu/patch/scroll.h
+++ /dev/null
@@ -1,3 +0,0 @@
-enum { AlignL, AlignR };
-
-int drw_text_align(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int textlen, int align);
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patch/xresources.c b/user/.config/suckless/dmenu/patch/xresources.c
deleted file mode 100644
index ae5519f04..000000000
--- a/user/.config/suckless/dmenu/patch/xresources.c
+++ /dev/null
@@ -1,138 +0,0 @@
-#include
-
-void
-readxresources(void)
-{
- XrmInitialize();
-
- char* xrm;
- if ((xrm = XResourceManagerString(drw->dpy))) {
- char *type;
- XrmDatabase xdb = XrmGetStringDatabase(xrm);
- XrmValue xval;
-
- if (XrmGetResource(xdb, "dmenu.font", "*", &type, &xval))
- #if PANGO_PATCH
- strcpy(font, xval.addr);
- #else
- fonts[0] = strdup(xval.addr);
- #endif // PANGO_PATCH
- #if !PANGO_PATCH
- else
- fonts[0] = strdup(fonts[0]);
- #endif // PANGO_PATCH
- if (XrmGetResource(xdb, "dmenu.background", "*", &type, &xval))
- colors[SchemeNorm][ColBg] = strdup(xval.addr);
- else
- colors[SchemeNorm][ColBg] = strdup(colors[SchemeNorm][ColBg]);
- if (XrmGetResource(xdb, "dmenu.foreground", "*", &type, &xval))
- colors[SchemeNorm][ColFg] = strdup(xval.addr);
- else
- colors[SchemeNorm][ColFg] = strdup(colors[SchemeNorm][ColFg]);
- if (XrmGetResource(xdb, "dmenu.selbackground", "*", &type, &xval))
- colors[SchemeSel][ColBg] = strdup(xval.addr);
- else
- colors[SchemeSel][ColBg] = strdup(colors[SchemeSel][ColBg]);
- if (XrmGetResource(xdb, "dmenu.selforeground", "*", &type, &xval))
- colors[SchemeSel][ColFg] = strdup(xval.addr);
- else
- colors[SchemeSel][ColFg] = strdup(colors[SchemeSel][ColFg]);
- if (XrmGetResource(xdb, "dmenu.outbackground", "*", &type, &xval))
- colors[SchemeOut][ColBg] = strdup(xval.addr);
- else
- colors[SchemeOut][ColBg] = strdup(colors[SchemeOut][ColBg]);
- if (XrmGetResource(xdb, "dmenu.outforeground", "*", &type, &xval))
- colors[SchemeOut][ColFg] = strdup(xval.addr);
- else
- colors[SchemeOut][ColFg] = strdup(colors[SchemeOut][ColFg]);
- #if MORECOLOR_PATCH
- if (XrmGetResource(xdb, "dmenu.midbackground", "*", &type, &xval))
- colors[SchemeMid][ColBg] = strdup(xval.addr);
- else
- colors[SchemeMid][ColBg] = strdup(colors[SchemeMid][ColBg]);
- if (XrmGetResource(xdb, "dmenu.midforeground", "*", &type, &xval))
- colors[SchemeMid][ColFg] = strdup(xval.addr);
- else
- colors[SchemeMid][ColFg] = strdup(colors[SchemeMid][ColFg]);
- #endif // MORECOLOR_PATCH
- #if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
- if (XrmGetResource(xdb, "dmenu.selhlbackground", "*", &type, &xval))
- colors[SchemeSelHighlight][ColBg] = strdup(xval.addr);
- else
- colors[SchemeSelHighlight][ColBg] = strdup(colors[SchemeSelHighlight][ColBg]);
- if (XrmGetResource(xdb, "dmenu.selhlforeground", "*", &type, &xval))
- colors[SchemeSelHighlight][ColFg] = strdup(xval.addr);
- else
- colors[SchemeSelHighlight][ColFg] = strdup(colors[SchemeSelHighlight][ColFg]);
- if (XrmGetResource(xdb, "dmenu.hlbackground", "*", &type, &xval))
- colors[SchemeNormHighlight][ColBg] = strdup(xval.addr);
- else
- colors[SchemeNormHighlight][ColBg] = strdup(colors[SchemeNormHighlight][ColBg]);
- if (XrmGetResource(xdb, "dmenu.hlforeground", "*", &type, &xval))
- colors[SchemeNormHighlight][ColFg] = strdup(xval.addr);
- else
- colors[SchemeNormHighlight][ColFg] = strdup(colors[SchemeNormHighlight][ColFg]);
- #endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
- #if HIGHPRIORITY_PATCH
- if (XrmGetResource(xdb, "dmenu.hpbackground", "*", &type, &xval))
- colors[SchemeHp][ColBg] = strdup(xval.addr);
- else
- colors[SchemeHp][ColBg] = strdup(colors[SchemeHp][ColBg]);
- if (XrmGetResource(xdb, "dmenu.hpforeground", "*", &type, &xval))
- colors[SchemeHp][ColFg] = strdup(xval.addr);
- else
- colors[SchemeHp][ColFg] = strdup(colors[SchemeHp][ColFg]);
- #endif // HIGHPRIORITY_PATCH
- #if EMOJI_HIGHLIGHT_PATCH
- if (XrmGetResource(xdb, "dmenu.hoverbackground", "*", &type, &xval))
- colors[SchemeHover][ColBg] = strdup(xval.addr);
- else
- colors[SchemeHover][ColBg] = strdup(colors[SchemeHover][ColBg]);
- if (XrmGetResource(xdb, "dmenu.hoverforeground", "*", &type, &xval))
- colors[SchemeHover][ColFg] = strdup(xval.addr);
- else
- colors[SchemeHover][ColFg] = strdup(colors[SchemeHover][ColFg]);
- if (XrmGetResource(xdb, "dmenu.greenbackground", "*", &type, &xval))
- colors[SchemeGreen][ColBg] = strdup(xval.addr);
- else
- colors[SchemeGreen][ColBg] = strdup(colors[SchemeGreen][ColBg]);
- if (XrmGetResource(xdb, "dmenu.greenforeground", "*", &type, &xval))
- colors[SchemeGreen][ColFg] = strdup(xval.addr);
- else
- colors[SchemeGreen][ColFg] = strdup(colors[SchemeGreen][ColFg]);
- if (XrmGetResource(xdb, "dmenu.yellowbackground", "*", &type, &xval))
- colors[SchemeYellow][ColBg] = strdup(xval.addr);
- else
- colors[SchemeYellow][ColBg] = strdup(colors[SchemeYellow][ColBg]);
- if (XrmGetResource(xdb, "dmenu.yellowforeground", "*", &type, &xval))
- colors[SchemeYellow][ColFg] = strdup(xval.addr);
- else
- colors[SchemeYellow][ColFg] = strdup(colors[SchemeYellow][ColFg]);
- if (XrmGetResource(xdb, "dmenu.bluebackground", "*", &type, &xval))
- colors[SchemeBlue][ColBg] = strdup(xval.addr);
- else
- colors[SchemeBlue][ColBg] = strdup(colors[SchemeBlue][ColBg]);
- if (XrmGetResource(xdb, "dmenu.blueforeground", "*", &type, &xval))
- colors[SchemeBlue][ColFg] = strdup(xval.addr);
- else
- colors[SchemeBlue][ColFg] = strdup(colors[SchemeBlue][ColFg]);
- if (XrmGetResource(xdb, "dmenu.purplebackground", "*", &type, &xval))
- colors[SchemePurple][ColBg] = strdup(xval.addr);
- else
- colors[SchemePurple][ColBg] = strdup(colors[SchemePurple][ColBg]);
- if (XrmGetResource(xdb, "dmenu.purpleforeground", "*", &type, &xval))
- colors[SchemePurple][ColFg] = strdup(xval.addr);
- else
- colors[SchemePurple][ColFg] = strdup(colors[SchemePurple][ColFg]);
- if (XrmGetResource(xdb, "dmenu.redbackground", "*", &type, &xval))
- colors[SchemeRed][ColBg] = strdup(xval.addr);
- else
- colors[SchemeRed][ColBg] = strdup(colors[SchemeRed][ColBg]);
- if (XrmGetResource(xdb, "dmenu.redforeground", "*", &type, &xval))
- colors[SchemeRed][ColFg] = strdup(xval.addr);
- else
- colors[SchemeRed][ColFg] = strdup(colors[SchemeRed][ColFg]);
- #endif // EMOJI_HIGHLIGHT_PATCH
- XrmDestroyDatabase(xdb);
- }
-}
\ No newline at end of file
diff --git a/user/.config/suckless/dmenu/patches.def.h b/user/.config/suckless/dmenu/patches.def.h
deleted file mode 100644
index cfd1450fe..000000000
--- a/user/.config/suckless/dmenu/patches.def.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/* Patches */
-
-/* The alpha patch adds transparency for the dmenu window.
- * You need to uncomment the corresponding line in config.mk to use the -lXrender library
- * when including this patch.
- * https://github.com/bakkeby/patches/blob/master/dmenu/dmenu-alpha-5.0_20210725_523aa08.diff
- */
-#define ALPHA_PATCH 1
-
-/* This patch adds a border around the dmenu window. It is intended to be used with the center
- * or xyw patches, to make the menu stand out from similarly coloured windows.
- * http://tools.suckless.org/dmenu/patches/border/
- */
-#define BORDER_PATCH 1
-
-/* This patch makes dmenu case-insensitive by default, replacing the
- * case-insensitive -i option with a case sensitive -s option.
- * http://tools.suckless.org/dmenu/patches/case-insensitive/
- */
-#define CASEINSENSITIVE_PATCH 0
-
-/* This patch centers dmenu in the middle of the screen.
- * https://tools.suckless.org/dmenu/patches/center/
- */
-#define CENTER_PATCH 1
-
-/* This patch enables color emoji in dmenu by removing a workaround for a BadLength error
- * in the Xft library when color glyphs are used.
- * To enable this you will need an updated Xft library that can handle color glyphs otherwise
- * the program will crash on encountering such characters. Note that you will also need a font
- * that provides color emojis for this to work.
- */
-#define COLOR_EMOJI_PATCH 0
-
-/* Minor patch to enable the use of Ctrl+v (XA_PRIMARY) and Ctrl+Shift+v (CLIPBOARD) to paste.
- * By default dmenu only supports Ctrl+y and Ctrl+Shift+y to paste.
- */
-#define CTRL_V_TO_PASTE_PATCH 0
-
-/* This patch adds a flag (-dy) which makes dmenu run the command given to it whenever input
- * is changed with the current input as the last argument and update the option list according
- * to the output of that command.
- * https://tools.suckless.org/dmenu/patches/dynamicoptions/
- */
-#define DYNAMIC_OPTIONS_PATCH 0
-
-/* This patch will allow for emojis on the left side with a colored background when selected.
- * To test this try running:
- * $ echo -e ":b here\n:p there\n:r and here" | ./dmenu -p "Search..." -W 400 -l 20 -i -h -1
- * NB: the original patch came embedded with the the xyw patch, the morecolors patch and the
- * line height patch and as such is intended to be combined with these.
- * https://tools.suckless.org/dmenu/patches/emoji-highlight/
- */
-#define EMOJI_HIGHLIGHT_PATCH 0
-
-/* This patch make it so that fuzzy matches gets highlighted and is therefore meant
- * to be used together with the fuzzymatch patch.
- * https://tools.suckless.org/dmenu/patches/fuzzyhighlight/
- */
-#define FUZZYHIGHLIGHT_PATCH 1
-
-/* This patch adds support for fuzzy-matching to dmenu, allowing users to type non-consecutive
- * portions of the string to be matched.
- * https://tools.suckless.org/dmenu/patches/fuzzymatch/
- */
-#define FUZZYMATCH_PATCH 1
-
-/* Allows dmenu's entries to be rendered in a grid by adding a new -g flag to specify
- * the number of grid columns. The -g and -l options can be used together to create a
- * G columns * L lines grid.
- * https://tools.suckless.org/dmenu/patches/grid/
- */
-#define GRID_PATCH 1
-
-/* This patch adds the ability to move left and right through a grid.
- * This patch depends on the grid patch.
- * https://tools.suckless.org/dmenu/patches/gridnav/
- */
-#define GRIDNAV_PATCH 0
-
-/* This patch highlights the individual characters of matched text for each dmenu list entry.
- * The fuzzy highlight patch takes precedence over this patch.
- * https://tools.suckless.org/dmenu/patches/highlight/
- */
-#define HIGHLIGHT_PATCH 0
-
-/* This will automatically sort the search result so that high priority items are shown first.
- * https://tools.suckless.org/dmenu/patches/highpriority/
- */
-#define HIGHPRIORITY_PATCH 0
-
-/* This patch causes dmenu to print out the current text each time a key is pressed.
- * https://tools.suckless.org/dmenu/patches/incremental/
- */
-#define INCREMENTAL_PATCH 0
-
-/* This patch adds an option to provide preselected text.
- * https://tools.suckless.org/dmenu/patches/initialtext/
- */
-#define INITIALTEXT_PATCH 0
-
-/* This patch adds a flag which will cause dmenu to select an item immediately if there
- * is only one matching option left.
- * https://tools.suckless.org/dmenu/patches/instant/
- */
-#define INSTANT_PATCH 0
-
-/* This patch adds basic support for json files.
- * This patch depends on the jansson library. Uncomment the relevant line in config.mk when
- * enabling this patch.
- *
- * This patch is not compatible with the multi-selection, printinputtext, pipeout and
- * non-blocking stdin patches.
- * The multi-selection patch takes precedence over this patch.
- * This patch takes precedence over non-blocking stdin, pipeout and printintputtext patches.
- *
- * https://tools.suckless.org/dmenu/patches/json/
- */
-#define JSON_PATCH 0
-
-/* This patch adds a '-h' option which sets the minimum height of a dmenu line. This helps
- * integrate dmenu with other UI elements that require a particular vertical size.
- * http://tools.suckless.org/dmenu/patches/line-height/
- */
-#define LINE_HEIGHT_PATCH 1
-
-/* This patch adds a -wm flag which sets override_redirect to false; thus letting your window
- * manager manage the dmenu window.
- *
- * This may be helpful in contexts where you don't want to exclusively bind dmenu or want to
- * treat dmenu more as a "window" rather than as an overlay.
- * https://tools.suckless.org/dmenu/patches/managed/
- */
-#define MANAGED_PATCH 0
-
-/* This patch adds an additional color scheme for highlighting entries adjacent to the current
- * selection.
- * https://tools.suckless.org/dmenu/patches/morecolor/
- */
-#define MORECOLOR_PATCH 1
-
-/* This patch adds basic mouse support for dmenu.
- * https://tools.suckless.org/dmenu/patches/mouse-support/
- */
-#define MOUSE_SUPPORT_PATCH 1
-
-/* Without this patch when you press Ctrl+Enter dmenu just outputs current item and it is not
- * possible to undo that.
- * With this patch dmenu will output all selected items only on exit. It is also possible to
- * deselect any selected item.
- * Also refer to the dmenu_run replacement on the below URL that supports multiple selections.
- *
- * This patch is not compatible with, and takes precedence over, the json, printinputtext,
- * pipeout and non-blocking stdin patches.
- *
- * https://tools.suckless.org/dmenu/patches/multi-selection/
- */
-#define MULTI_SELECTION_PATCH 0
-
-/* This patch provides dmenu the ability for history navigation similar to that of bash.
- *
- * If you take this patch then it is recommended that you also uncomment the line in the
- * dmenu_run script which replaces the exec command.
- *
- * https://tools.suckless.org/dmenu/patches/navhistory/
- */
-#define NAVHISTORY_PATCH 0
-
-/* Adds the -S option to disable sorting menu items after matching. Useful, for example, when menu
- * items are sorted by their frequency of use (using an external cache) and the most frequently
- * selected items should always appear first regardless of how they were exact, prefix, or
- * substring matches.
- * https://tools.suckless.org/dmenu/patches/no-sort/
- */
-#define NO_SORT_PATCH 0
-
-/* This is a patch to have dmenu read stdin in a non blocking way, making it wait for input both
- * from stdin and from X. This means that you can continue feeding dmenu while you type.
- * This patch is meant to be used along with the incremental patch, so that you can use stdout
- * to feed stdin.
- *
- * This patch is not compatible with the json and multi-selection patches, both of which takes
- * precedence over this patch.
- *
- * https://tools.suckless.org/dmenu/patches/non_blocking_stdin/
- */
-#define NON_BLOCKING_STDIN_PATCH 0
-
-/* Adds text which displays the number of matched and total items in the top right corner of dmenu.
- * https://tools.suckless.org/dmenu/patches/numbers/
- */
-#define NUMBERS_PATCH 1
-
-/* This patch adds simple markup for dmenu using pango markup.
- * This depends on the pango library v1.44 or greater.
- * You need to uncomment the corresponding lines in config.mk to use the pango libraries
- * when including this patch.
- *
- * Note that the pango patch is incompatible with the scroll patch and will result in
- * compilation errors if both are enabled.
- *
- * Note that the pango patch does not protect against the BadLength error from Xft
- * when color glyphs are used, which means that dmenu will crash if color emoji is used.
- *
- * If you need color emoji then you may want to install this patched library from the AUR:
- * https://aur.archlinux.org/packages/libxft-bgra/
- *
- * A long term fix for the libXft library is pending approval of this pull request:
- * https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1
- *
- * Also see:
- * https://developer.gnome.org/pygtk/stable/pango-markup-language.html
- * https://github.com/StillANixRookie/dmenu-pango
- */
-#define PANGO_PATCH 0
-
-/* With this patch dmenu will not directly display the keyboard input, but instead replace
- * it with dots. All data from stdin will be ignored.
- * https://tools.suckless.org/dmenu/patches/password/
- */
-#define PASSWORD_PATCH 0
-
-/* This patch allows the selected text to be piped back out with dmenu. This can be useful if you
- * want to display the output of a command on the screen.
- * Only text starting with the character '#' is piped out by default.
- *
- * This patch is not compatible with the json and multi-select patches, both of which takes
- * precedence over this one.
- *
- * https://tools.suckless.org/dmenu/patches/pipeout/
- */
-#define PIPEOUT_PATCH 0
-
-/* Lifted from the listfullwidth patch this simple change just avoids colors for the prompt (with
- * the -p option or in config.h) by making it use the same style as the rest of the input field.
- * The rest of the listfullwidth patch is covered by the vertfull patch.
- * https://tools.suckless.org/dmenu/patches/listfullwidth/
- */
-#define PLAIN_PROMPT_PATCH 0
-
-/* This patch changes the behaviour of matched items and the Tab key to allow tab completion.
- * https://tools.suckless.org/dmenu/patches/prefix-completion/
- */
-#define PREFIXCOMPLETION_PATCH 0
-
-/* This patch adds an option -ps to specify an item by providing the index that should be
- * pre-selected.
- * https://tools.suckless.org/dmenu/patches/preselect/
- */
-#define PRESELECT_PATCH 0
-
-/* This patch allows dmenu to print out the 0-based index of matched text instead of the matched
- * text itself. This can be useful in cases where you would like to select entries from one array
- * of text but index into another, or when you are selecting from an ordered list of non-unique
- * items.
- * https://tools.suckless.org/dmenu/patches/printindex/
- */
-#define PRINTINDEX_PATCH 0
-
-/* This patch adds a flag (-t) which makes Return key to ignore selection and print the input
- * text to stdout. The flag basically swaps the functions of Return and Shift+Return hotkeys.
- *
- * This patch is not compatible with the multi-select and json patches, both of which takes
- * precedence over this one.
- *
- * https://tools.suckless.org/dmenu/patches/printinputtext/
- */
-#define PRINTINPUTTEXT_PATCH 0
-
-/* This patch adds a new flag to dmenu with which text input will be rejected if it would
- * result in no matching item.
- * https://tools.suckless.org/dmenu/patches/reject-no-match/
- */
-#define REJECTNOMATCH_PATCH 0
-
-/* This patch adds a '-1' option which disables Shift-Return and Ctrl-Return.
- * This guarantees that dmenu will only output one item, and that item was read from stdin.
- * The original patch used '-r'. This was changed to '-1' to avoid conflict with the incremental
- * patch.
- * https://tools.suckless.org/dmenu/patches/restrict-return/
- */
-#define RESTRICT_RETURN_PATCH 0
-
-/* This patch adds support for text scrolling and no longer appends '...' for long input as
- * it can handle long text.
- * https://tools.suckless.org/dmenu/patches/scroll/
- */
-#define SCROLL_PATCH 0
-
-/* This patch allows the symbols, which are printed in dmenu to indicate that either the input
- * is too long or there are too many options to be shown in dmenu in one line, to be defined.
- * https://tools.suckless.org/dmenu/patches/symbols/
- */
-#define SYMBOLS_PATCH 0
-
-/* With this patch dmenu will split input lines at first tab character and only display first
- * part, but it will perform matching on and output full lines as usual.
- *
- * This can be useful if you want to separate data and representation, for example, a music
- * player wrapper can display only a track title to user, but still supply full filename to
- * the underlying script.
- * https://tools.suckless.org/dmenu/patches/tsv/
- */
-#define TSV_PATCH 0
-
-/* This patch prevents dmenu from indenting items at the same level as the prompt length.
- * https://tools.suckless.org/dmenu/patches/vertfull/
- */
-#define VERTFULL_PATCH 0
-
-/* Adds extended window manager hints such as _NET_WM_WINDOW_TYPE and _NET_WM_WINDOW_TYPE_DOCK.
- * https://github.com/Baitinq/dmenu/blob/master/patches/dmenu-wm_type.diff
- */
-#define WMTYPE_PATCH 0
-
-/* This patch adds the ability to configure dmenu via Xresources. At startup, dmenu will read and
- * apply the resources named below:
- * dmenu.font : font or font set
- * dmenu.background : normal background color
- * dmenu.foreground : normal foreground color
- * dmenu.selbackground : selected background color
- * dmenu.selforeground : selected foreground color
- *
- * See patch/xresources.c for more color settings.
- *
- * https://tools.suckless.org/dmenu/patches/xresources/
- */
-#define XRESOURCES_PATCH 0
-
-/* This patch adds options for specifying dmenu window position and width.
- * The center patch takes precedence over the XYW patch if enabled.
- * https://tools.suckless.org/dmenu/patches/xyw/
- */
-#define XYW_PATCH 1
diff --git a/user/.config/suckless/dmenu/patches.h b/user/.config/suckless/dmenu/patches.h
deleted file mode 100644
index cfd1450fe..000000000
--- a/user/.config/suckless/dmenu/patches.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/* Patches */
-
-/* The alpha patch adds transparency for the dmenu window.
- * You need to uncomment the corresponding line in config.mk to use the -lXrender library
- * when including this patch.
- * https://github.com/bakkeby/patches/blob/master/dmenu/dmenu-alpha-5.0_20210725_523aa08.diff
- */
-#define ALPHA_PATCH 1
-
-/* This patch adds a border around the dmenu window. It is intended to be used with the center
- * or xyw patches, to make the menu stand out from similarly coloured windows.
- * http://tools.suckless.org/dmenu/patches/border/
- */
-#define BORDER_PATCH 1
-
-/* This patch makes dmenu case-insensitive by default, replacing the
- * case-insensitive -i option with a case sensitive -s option.
- * http://tools.suckless.org/dmenu/patches/case-insensitive/
- */
-#define CASEINSENSITIVE_PATCH 0
-
-/* This patch centers dmenu in the middle of the screen.
- * https://tools.suckless.org/dmenu/patches/center/
- */
-#define CENTER_PATCH 1
-
-/* This patch enables color emoji in dmenu by removing a workaround for a BadLength error
- * in the Xft library when color glyphs are used.
- * To enable this you will need an updated Xft library that can handle color glyphs otherwise
- * the program will crash on encountering such characters. Note that you will also need a font
- * that provides color emojis for this to work.
- */
-#define COLOR_EMOJI_PATCH 0
-
-/* Minor patch to enable the use of Ctrl+v (XA_PRIMARY) and Ctrl+Shift+v (CLIPBOARD) to paste.
- * By default dmenu only supports Ctrl+y and Ctrl+Shift+y to paste.
- */
-#define CTRL_V_TO_PASTE_PATCH 0
-
-/* This patch adds a flag (-dy) which makes dmenu run the command given to it whenever input
- * is changed with the current input as the last argument and update the option list according
- * to the output of that command.
- * https://tools.suckless.org/dmenu/patches/dynamicoptions/
- */
-#define DYNAMIC_OPTIONS_PATCH 0
-
-/* This patch will allow for emojis on the left side with a colored background when selected.
- * To test this try running:
- * $ echo -e ":b here\n:p there\n:r and here" | ./dmenu -p "Search..." -W 400 -l 20 -i -h -1
- * NB: the original patch came embedded with the the xyw patch, the morecolors patch and the
- * line height patch and as such is intended to be combined with these.
- * https://tools.suckless.org/dmenu/patches/emoji-highlight/
- */
-#define EMOJI_HIGHLIGHT_PATCH 0
-
-/* This patch make it so that fuzzy matches gets highlighted and is therefore meant
- * to be used together with the fuzzymatch patch.
- * https://tools.suckless.org/dmenu/patches/fuzzyhighlight/
- */
-#define FUZZYHIGHLIGHT_PATCH 1
-
-/* This patch adds support for fuzzy-matching to dmenu, allowing users to type non-consecutive
- * portions of the string to be matched.
- * https://tools.suckless.org/dmenu/patches/fuzzymatch/
- */
-#define FUZZYMATCH_PATCH 1
-
-/* Allows dmenu's entries to be rendered in a grid by adding a new -g flag to specify
- * the number of grid columns. The -g and -l options can be used together to create a
- * G columns * L lines grid.
- * https://tools.suckless.org/dmenu/patches/grid/
- */
-#define GRID_PATCH 1
-
-/* This patch adds the ability to move left and right through a grid.
- * This patch depends on the grid patch.
- * https://tools.suckless.org/dmenu/patches/gridnav/
- */
-#define GRIDNAV_PATCH 0
-
-/* This patch highlights the individual characters of matched text for each dmenu list entry.
- * The fuzzy highlight patch takes precedence over this patch.
- * https://tools.suckless.org/dmenu/patches/highlight/
- */
-#define HIGHLIGHT_PATCH 0
-
-/* This will automatically sort the search result so that high priority items are shown first.
- * https://tools.suckless.org/dmenu/patches/highpriority/
- */
-#define HIGHPRIORITY_PATCH 0
-
-/* This patch causes dmenu to print out the current text each time a key is pressed.
- * https://tools.suckless.org/dmenu/patches/incremental/
- */
-#define INCREMENTAL_PATCH 0
-
-/* This patch adds an option to provide preselected text.
- * https://tools.suckless.org/dmenu/patches/initialtext/
- */
-#define INITIALTEXT_PATCH 0
-
-/* This patch adds a flag which will cause dmenu to select an item immediately if there
- * is only one matching option left.
- * https://tools.suckless.org/dmenu/patches/instant/
- */
-#define INSTANT_PATCH 0
-
-/* This patch adds basic support for json files.
- * This patch depends on the jansson library. Uncomment the relevant line in config.mk when
- * enabling this patch.
- *
- * This patch is not compatible with the multi-selection, printinputtext, pipeout and
- * non-blocking stdin patches.
- * The multi-selection patch takes precedence over this patch.
- * This patch takes precedence over non-blocking stdin, pipeout and printintputtext patches.
- *
- * https://tools.suckless.org/dmenu/patches/json/
- */
-#define JSON_PATCH 0
-
-/* This patch adds a '-h' option which sets the minimum height of a dmenu line. This helps
- * integrate dmenu with other UI elements that require a particular vertical size.
- * http://tools.suckless.org/dmenu/patches/line-height/
- */
-#define LINE_HEIGHT_PATCH 1
-
-/* This patch adds a -wm flag which sets override_redirect to false; thus letting your window
- * manager manage the dmenu window.
- *
- * This may be helpful in contexts where you don't want to exclusively bind dmenu or want to
- * treat dmenu more as a "window" rather than as an overlay.
- * https://tools.suckless.org/dmenu/patches/managed/
- */
-#define MANAGED_PATCH 0
-
-/* This patch adds an additional color scheme for highlighting entries adjacent to the current
- * selection.
- * https://tools.suckless.org/dmenu/patches/morecolor/
- */
-#define MORECOLOR_PATCH 1
-
-/* This patch adds basic mouse support for dmenu.
- * https://tools.suckless.org/dmenu/patches/mouse-support/
- */
-#define MOUSE_SUPPORT_PATCH 1
-
-/* Without this patch when you press Ctrl+Enter dmenu just outputs current item and it is not
- * possible to undo that.
- * With this patch dmenu will output all selected items only on exit. It is also possible to
- * deselect any selected item.
- * Also refer to the dmenu_run replacement on the below URL that supports multiple selections.
- *
- * This patch is not compatible with, and takes precedence over, the json, printinputtext,
- * pipeout and non-blocking stdin patches.
- *
- * https://tools.suckless.org/dmenu/patches/multi-selection/
- */
-#define MULTI_SELECTION_PATCH 0
-
-/* This patch provides dmenu the ability for history navigation similar to that of bash.
- *
- * If you take this patch then it is recommended that you also uncomment the line in the
- * dmenu_run script which replaces the exec command.
- *
- * https://tools.suckless.org/dmenu/patches/navhistory/
- */
-#define NAVHISTORY_PATCH 0
-
-/* Adds the -S option to disable sorting menu items after matching. Useful, for example, when menu
- * items are sorted by their frequency of use (using an external cache) and the most frequently
- * selected items should always appear first regardless of how they were exact, prefix, or
- * substring matches.
- * https://tools.suckless.org/dmenu/patches/no-sort/
- */
-#define NO_SORT_PATCH 0
-
-/* This is a patch to have dmenu read stdin in a non blocking way, making it wait for input both
- * from stdin and from X. This means that you can continue feeding dmenu while you type.
- * This patch is meant to be used along with the incremental patch, so that you can use stdout
- * to feed stdin.
- *
- * This patch is not compatible with the json and multi-selection patches, both of which takes
- * precedence over this patch.
- *
- * https://tools.suckless.org/dmenu/patches/non_blocking_stdin/
- */
-#define NON_BLOCKING_STDIN_PATCH 0
-
-/* Adds text which displays the number of matched and total items in the top right corner of dmenu.
- * https://tools.suckless.org/dmenu/patches/numbers/
- */
-#define NUMBERS_PATCH 1
-
-/* This patch adds simple markup for dmenu using pango markup.
- * This depends on the pango library v1.44 or greater.
- * You need to uncomment the corresponding lines in config.mk to use the pango libraries
- * when including this patch.
- *
- * Note that the pango patch is incompatible with the scroll patch and will result in
- * compilation errors if both are enabled.
- *
- * Note that the pango patch does not protect against the BadLength error from Xft
- * when color glyphs are used, which means that dmenu will crash if color emoji is used.
- *
- * If you need color emoji then you may want to install this patched library from the AUR:
- * https://aur.archlinux.org/packages/libxft-bgra/
- *
- * A long term fix for the libXft library is pending approval of this pull request:
- * https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1
- *
- * Also see:
- * https://developer.gnome.org/pygtk/stable/pango-markup-language.html
- * https://github.com/StillANixRookie/dmenu-pango
- */
-#define PANGO_PATCH 0
-
-/* With this patch dmenu will not directly display the keyboard input, but instead replace
- * it with dots. All data from stdin will be ignored.
- * https://tools.suckless.org/dmenu/patches/password/
- */
-#define PASSWORD_PATCH 0
-
-/* This patch allows the selected text to be piped back out with dmenu. This can be useful if you
- * want to display the output of a command on the screen.
- * Only text starting with the character '#' is piped out by default.
- *
- * This patch is not compatible with the json and multi-select patches, both of which takes
- * precedence over this one.
- *
- * https://tools.suckless.org/dmenu/patches/pipeout/
- */
-#define PIPEOUT_PATCH 0
-
-/* Lifted from the listfullwidth patch this simple change just avoids colors for the prompt (with
- * the -p option or in config.h) by making it use the same style as the rest of the input field.
- * The rest of the listfullwidth patch is covered by the vertfull patch.
- * https://tools.suckless.org/dmenu/patches/listfullwidth/
- */
-#define PLAIN_PROMPT_PATCH 0
-
-/* This patch changes the behaviour of matched items and the Tab key to allow tab completion.
- * https://tools.suckless.org/dmenu/patches/prefix-completion/
- */
-#define PREFIXCOMPLETION_PATCH 0
-
-/* This patch adds an option -ps to specify an item by providing the index that should be
- * pre-selected.
- * https://tools.suckless.org/dmenu/patches/preselect/
- */
-#define PRESELECT_PATCH 0
-
-/* This patch allows dmenu to print out the 0-based index of matched text instead of the matched
- * text itself. This can be useful in cases where you would like to select entries from one array
- * of text but index into another, or when you are selecting from an ordered list of non-unique
- * items.
- * https://tools.suckless.org/dmenu/patches/printindex/
- */
-#define PRINTINDEX_PATCH 0
-
-/* This patch adds a flag (-t) which makes Return key to ignore selection and print the input
- * text to stdout. The flag basically swaps the functions of Return and Shift+Return hotkeys.
- *
- * This patch is not compatible with the multi-select and json patches, both of which takes
- * precedence over this one.
- *
- * https://tools.suckless.org/dmenu/patches/printinputtext/
- */
-#define PRINTINPUTTEXT_PATCH 0
-
-/* This patch adds a new flag to dmenu with which text input will be rejected if it would
- * result in no matching item.
- * https://tools.suckless.org/dmenu/patches/reject-no-match/
- */
-#define REJECTNOMATCH_PATCH 0
-
-/* This patch adds a '-1' option which disables Shift-Return and Ctrl-Return.
- * This guarantees that dmenu will only output one item, and that item was read from stdin.
- * The original patch used '-r'. This was changed to '-1' to avoid conflict with the incremental
- * patch.
- * https://tools.suckless.org/dmenu/patches/restrict-return/
- */
-#define RESTRICT_RETURN_PATCH 0
-
-/* This patch adds support for text scrolling and no longer appends '...' for long input as
- * it can handle long text.
- * https://tools.suckless.org/dmenu/patches/scroll/
- */
-#define SCROLL_PATCH 0
-
-/* This patch allows the symbols, which are printed in dmenu to indicate that either the input
- * is too long or there are too many options to be shown in dmenu in one line, to be defined.
- * https://tools.suckless.org/dmenu/patches/symbols/
- */
-#define SYMBOLS_PATCH 0
-
-/* With this patch dmenu will split input lines at first tab character and only display first
- * part, but it will perform matching on and output full lines as usual.
- *
- * This can be useful if you want to separate data and representation, for example, a music
- * player wrapper can display only a track title to user, but still supply full filename to
- * the underlying script.
- * https://tools.suckless.org/dmenu/patches/tsv/
- */
-#define TSV_PATCH 0
-
-/* This patch prevents dmenu from indenting items at the same level as the prompt length.
- * https://tools.suckless.org/dmenu/patches/vertfull/
- */
-#define VERTFULL_PATCH 0
-
-/* Adds extended window manager hints such as _NET_WM_WINDOW_TYPE and _NET_WM_WINDOW_TYPE_DOCK.
- * https://github.com/Baitinq/dmenu/blob/master/patches/dmenu-wm_type.diff
- */
-#define WMTYPE_PATCH 0
-
-/* This patch adds the ability to configure dmenu via Xresources. At startup, dmenu will read and
- * apply the resources named below:
- * dmenu.font : font or font set
- * dmenu.background : normal background color
- * dmenu.foreground : normal foreground color
- * dmenu.selbackground : selected background color
- * dmenu.selforeground : selected foreground color
- *
- * See patch/xresources.c for more color settings.
- *
- * https://tools.suckless.org/dmenu/patches/xresources/
- */
-#define XRESOURCES_PATCH 0
-
-/* This patch adds options for specifying dmenu window position and width.
- * The center patch takes precedence over the XYW patch if enabled.
- * https://tools.suckless.org/dmenu/patches/xyw/
- */
-#define XYW_PATCH 1
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_blue b/user/.config/suckless/dmenu/scripts/dmenu_blue
deleted file mode 100755
index 5b6459605..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_blue
+++ /dev/null
@@ -1,317 +0,0 @@
-#!/usr/bin/env bash
-# _ _ _ _ _ _
-# __| |_ __ ___ ___ _ __ _ _ | |__ | |_ _ ___| |_ ___ ___ | |_ | |__
-# / _` | '_ ` _ \ / _ \ '_ \| | | |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __|| '_ \
-# | (_| | | | | | | __/ | | | |_| |_____| |_) | | |_| | __/ || (_) | (_) | |_ | | | |
-# \__,_|_| |_| |_|\___|_| |_|\__,_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__||_| |_|
-#
-# Author: Nick Clyde (clydedroid)
-# dmenu support by: Layerex
-#
-# A script that generates a dmenu menu that uses bluetoothctl to
-# connect to bluetooth devices and display status info.
-#
-# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
-# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
-#
-# Depends on:
-# Arch repositories: dmenu, bluez-utils (contains bluetoothctl)
-
-# Constants
-divider="---------"
-goback="Back"
-
-# Checks if bluetooth controller is powered on
-power_on() {
- if bluetoothctl show | grep -F -q "Powered: yes"; then
- return 0
- else
- return 1
- fi
-}
-
-# Toggles power state
-toggle_power() {
- if power_on; then
- bluetoothctl power off
- show_menu
- else
- if rfkill list bluetooth | grep -F -q 'blocked: yes'; then
- rfkill unblock bluetooth && sleep 3
- fi
- bluetoothctl power on
- show_menu
- fi
-}
-
-# Checks if controller is scanning for new devices
-scan_on() {
- if bluetoothctl show | grep -F -q "Discovering: yes"; then
- echo "Scan: on"
- return 0
- else
- echo "Scan: off"
- return 1
- fi
-}
-
-# Toggles scanning state
-toggle_scan() {
- if scan_on; then
- kill "$(pgrep -F -f "bluetoothctl scan on")"
- bluetoothctl scan off
- show_menu
- else
- bluetoothctl scan on &
- echo "Scanning..."
- sleep 5
- show_menu
- fi
-}
-
-# Checks if controller is able to pair to devices
-pairable_on() {
- if bluetoothctl show | grep -F -q "Pairable: yes"; then
- echo "Pairable: on"
- return 0
- else
- echo "Pairable: off"
- return 1
- fi
-}
-
-# Toggles pairable state
-toggle_pairable() {
- if pairable_on; then
- bluetoothctl pairable off
- show_menu
- else
- bluetoothctl pairable on
- show_menu
- fi
-}
-
-# Checks if controller is discoverable by other devices
-discoverable_on() {
- if bluetoothctl show | grep -F -q "Discoverable: yes"; then
- echo "Discoverable: on"
- return 0
- else
- echo "Discoverable: off"
- return 1
- fi
-}
-
-# Toggles discoverable state
-toggle_discoverable() {
- if discoverable_on; then
- bluetoothctl discoverable off
- show_menu
- else
- bluetoothctl discoverable on
- show_menu
- fi
-}
-
-# Checks if a device is connected
-device_connected() {
- device_info=$(bluetoothctl info "$1")
- if echo "$device_info" | grep -F -q "Connected: yes"; then
- return 0
- else
- return 1
- fi
-}
-
-# Toggles device connection
-toggle_connection() {
- if device_connected "$1"; then
- bluetoothctl disconnect "$1"
- # device_menu "$device"
- else
- bluetoothctl connect "$1"
- # device_menu "$device"
- fi
-}
-
-# Checks if a device is paired
-device_paired() {
- device_info=$(bluetoothctl info "$1")
- if echo "$device_info" | grep -F -q "Paired: yes"; then
- echo "Paired: yes"
- return 0
- else
- echo "Paired: no"
- return 1
- fi
-}
-
-# Toggles device paired state
-toggle_paired() {
- if device_paired "$1"; then
- bluetoothctl remove "$1"
- device_menu "$device"
- else
- bluetoothctl pair "$1"
- device_menu "$device"
- fi
-}
-
-# Checks if a device is trusted
-device_trusted() {
- device_info=$(bluetoothctl info "$1")
- if echo "$device_info" | grep -F -q "Trusted: yes"; then
- echo "Trusted: yes"
- return 0
- else
- echo "Trusted: no"
- return 1
- fi
-}
-
-# Toggles device connection
-toggle_trust() {
- if device_trusted "$1"; then
- bluetoothctl untrust "$1"
- device_menu "$device"
- else
- bluetoothctl trust "$1"
- device_menu "$device"
- fi
-}
-
-# Prints a short string with the current bluetooth status
-# Useful for status bars like polybar, etc.
-print_status() {
- if power_on; then
- printf ''
-
- mapfile -t paired_devices < <(bluetoothctl paired-devices | grep -F Device | cut -d ' ' -f 2)
- counter=0
-
- for device in "${paired_devices[@]}"; do
- if device_connected "$device"; then
- device_alias="$(bluetoothctl info "$device" | grep -F "Alias" | cut -d ' ' -f 2-)"
-
- if [ $counter -gt 0 ]; then
- printf ", %s" "$device_alias"
- else
- printf " %s" "$device_alias"
- fi
-
- ((counter++))
- fi
- done
- printf "\n"
- else
- echo ""
- fi
-}
-
-# A submenu for a specific device that allows connecting, pairing, and trusting
-device_menu() {
- device=$1
-
- # Get device name and mac address
- device_name="$(echo "$device" | cut -d ' ' -f 3-)"
- mac="$(echo "$device" | cut -d ' ' -f 2)"
-
- # Build options
- if device_connected "$mac"; then
- connected="Connected: yes"
- else
- connected="Connected: no"
- fi
- paired=$(device_paired "$mac")
- trusted=$(device_trusted "$mac")
- options="$connected\n$paired\n$trusted\n$divider\n$goback\nExit"
-
- # Open dmenu menu, read chosen option
- chosen="$(echo -e "$options" | run_dmenu "$device_name")"
-
- # Match chosen option to command
- case $chosen in
- "" | "$divider")
- echo "No option chosen."
- ;;
- "$connected")
- toggle_connection "$mac"
- ;;
- "$paired")
- toggle_paired "$mac"
- ;;
- "$trusted")
- toggle_trust "$mac"
- ;;
- "$goback")
- show_menu
- ;;
- esac
-}
-
-# Opens a dmenu menu with current bluetooth status and options to connect
-show_menu() {
- # Get menu options
- if power_on; then
- power="Power: on"
-
- # Human-readable names of devices, one per line
- # If scan is off, will only list paired devices
- devices=$(bluetoothctl devices | grep -F Device | cut -d ' ' -f 3-)
-
- # Get controller flags
- scan=$(scan_on)
- pairable=$(pairable_on)
- discoverable=$(discoverable_on)
-
- # Options passed to dmenu
- options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable\nExit"
- else
- power="Power: off"
- options="$power\nExit"
- fi
-
- # Open dmenu menu, read chosen option
- chosen="$(echo -e "$options" | run_dmenu "Bluetooth")"
-
- # Match chosen option to command
- case $chosen in
- "" | "$divider")
- echo "No option chosen."
- ;;
- "$power")
- toggle_power
- ;;
- "$scan")
- toggle_scan
- ;;
- "$discoverable")
- toggle_discoverable
- ;;
- "$pairable")
- toggle_pairable
- ;;
- *)
- device=$(bluetoothctl devices | grep -F "$chosen")
- # Open a submenu if a device is selected
- if [[ $device ]]; then device_menu "$device"; fi
- ;;
- esac
-}
-
-original_args=("$@")
-
-# dmenu command to pipe into. Extra arguments to dmenu-bluetooth are passed through to dmenu. This
-# allows the user to set fonts, sizes, colours, etc.
-run_dmenu() {
- dmenu "${original_args[@]}" -b -l 5 -i -p "$1"
-}
-
-case "$1" in
- --status)
- print_status
- ;;
- *)
- show_menu
- ;;
-esac
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_drun b/user/.config/suckless/dmenu/scripts/dmenu_drun
deleted file mode 100755
index 6a392884e..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_drun
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-
-# ***This script was made by Clay Gomera (Drake)***
-# - Description: A simple desktop dmenu script
-# - Dependencies: dmenu, j4-dmenu-desktop
-
-DMENU="dmenu -l 10 -b -i -p Launch:"
-j4-dmenu-desktop --dmenu "$DMENU" --no-generic
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_edit b/user/.config/suckless/dmenu/scripts/dmenu_edit
deleted file mode 100755
index e0b038f5a..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_edit
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# ***This script was made by Clay Gomera (Drake)***
-# - Description: A simple script for file editing in dmenu
-# - Dependencies: dmenu (Everything else can be changed)
-
-# Show list of options
-EDITOR="emacsclient -c -a emacs"
-cd "$HOME" || exit 0
-file=1
-while [ "$file" ]; do
- file=$(fd -LHpd 1 | dmenu -b -l 10 -p "File to edit: $(basename $(pwd))")
- if [ -e "$file" ]; then
- owd=$(pwd)
- if [ -d "$file" ]; then
- cd "$file" || exit 0
- else [ -f "$file" ]
- if [ "$file" ]; then
- $EDITOR "$owd/$file" &
- exit 0
- else
- exit 0
- fi
- fi
- fi
-done
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_emoji b/user/.config/suckless/dmenu/scripts/dmenu_emoji
deleted file mode 100755
index e0ce5615e..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_emoji
+++ /dev/null
@@ -1,1842 +0,0 @@
-#!/bin/bash
-# This files comes from:
-# https://github.com/porras/dmenu-emoji
-#
-# If this file includes emojis below "__DATA__" it is generated.
-# This file was generated: 2022-04-21 12:38:03+00:00
-
-set -e
-
-case "$1" in
- "list")
- data=$(sed '0,/^__DATA__$/d' "$0")
- echo "$data"
- ;;
- "copy")
- input=$(tee)
- if [ ! -z "$input" ]; then
- emoji=${input: -1}
- echo -n "$emoji" | xclip -selection c
- command -v notify-send > /dev/null && notify-send "$emoji copied!"
- fi
- ;;
- "")
- bash $0 list | dmenu -b -i -l 10 -p 'Emoji: ' | bash $0 copy
- ;;
-esac
-
-exit
-
-__DATA__
-grinning face 😀
-grinning face with big eyes 😃
-grinning face with smiling eyes 😄
-beaming face with smiling eyes 😁
-grinning squinting face 😆
-grinning face with sweat 😅
-rolling on the floor laughing 🤣
-face with tears of joy 😂
-slightly smiling face 🙂
-upside-down face 🙃
-winking face 😉
-smiling face with smiling eyes 😊
-smiling face with halo 😇
-smiling face with hearts 🥰
-smiling face with heart-eyes 😍
-star-struck 🤩
-face blowing a kiss 😘
-kissing face 😗
-smiling face ☺️
-kissing face with closed eyes 😚
-kissing face with smiling eyes 😙
-smiling face with tear 🥲
-face savoring food 😋
-face with tongue 😛
-winking face with tongue 😜
-zany face 🤪
-squinting face with tongue 😝
-money-mouth face 🤑
-hugging face 🤗
-face with hand over mouth 🤭
-shushing face 🤫
-thinking face 🤔
-zipper-mouth face 🤐
-face with raised eyebrow 🤨
-neutral face 😐
-expressionless face 😑
-face without mouth 😶
-face in clouds 😶🌫️
-smirking face 😏
-unamused face 😒
-face with rolling eyes 🙄
-grimacing face 😬
-face exhaling 😮💨
-lying face 🤥
-relieved face 😌
-pensive face 😔
-sleepy face 😪
-drooling face 🤤
-sleeping face 😴
-face with medical mask 😷
-face with thermometer 🤒
-face with head-bandage 🤕
-nauseated face 🤢
-face vomiting 🤮
-sneezing face 🤧
-hot face 🥵
-cold face 🥶
-woozy face 🥴
-knocked-out face 😵
-face with spiral eyes 😵💫
-exploding head 🤯
-cowboy hat face 🤠
-partying face 🥳
-disguised face 🥸
-smiling face with sunglasses 😎
-nerd face 🤓
-face with monocle 🧐
-confused face 😕
-worried face 😟
-slightly frowning face 🙁
-frowning face ☹️
-face with open mouth 😮
-hushed face 😯
-astonished face 😲
-flushed face 😳
-pleading face 🥺
-frowning face with open mouth 😦
-anguished face 😧
-fearful face 😨
-anxious face with sweat 😰
-sad but relieved face 😥
-crying face 😢
-loudly crying face 😭
-face screaming in fear 😱
-confounded face 😖
-persevering face 😣
-disappointed face 😞
-downcast face with sweat 😓
-weary face 😩
-tired face 😫
-yawning face 🥱
-face with steam from nose 😤
-pouting face 😡
-angry face 😠
-face with symbols on mouth 🤬
-smiling face with horns 😈
-angry face with horns 👿
-skull 💀
-skull and crossbones ☠️
-pile of poo 💩
-clown face 🤡
-ogre 👹
-goblin 👺
-ghost 👻
-alien 👽
-alien monster 👾
-robot 🤖
-grinning cat 😺
-grinning cat with smiling eyes 😸
-cat with tears of joy 😹
-smiling cat with heart-eyes 😻
-cat with wry smile 😼
-kissing cat 😽
-weary cat 🙀
-crying cat 😿
-pouting cat 😾
-see-no-evil monkey 🙈
-hear-no-evil monkey 🙉
-speak-no-evil monkey 🙊
-kiss mark 💋
-love letter 💌
-heart with arrow 💘
-heart with ribbon 💝
-sparkling heart 💖
-growing heart 💗
-beating heart 💓
-revolving hearts 💞
-two hearts 💕
-heart decoration 💟
-heart exclamation ❣️
-broken heart 💔
-heart on fire ❤️🔥
-mending heart ❤️🩹
-red heart ❤️
-orange heart 🧡
-yellow heart 💛
-green heart 💚
-blue heart 💙
-purple heart 💜
-brown heart 🤎
-black heart 🖤
-white heart 🤍
-hundred points 💯
-anger symbol 💢
-collision 💥
-dizzy 💫
-sweat droplets 💦
-dashing away 💨
-hole 🕳️
-bomb 💣
-speech balloon 💬
-eye in speech bubble 👁️🗨️
-left speech bubble 🗨️
-right anger bubble 🗯️
-thought balloon 💭
-zzz 💤
-waving hand 👋
-raised back of hand 🤚
-hand with fingers splayed 🖐️
-raised hand ✋
-vulcan salute 🖖
-OK hand 👌
-pinched fingers 🤌
-pinching hand 🤏
-victory hand ✌️
-crossed fingers 🤞
-love-you gesture 🤟
-sign of the horns 🤘
-call me hand 🤙
-backhand index pointing left 👈
-backhand index pointing right 👉
-backhand index pointing up 👆
-middle finger 🖕
-backhand index pointing down 👇
-index pointing up ☝️
-thumbs up 👍
-thumbs down 👎
-raised fist ✊
-oncoming fist 👊
-left-facing fist 🤛
-right-facing fist 🤜
-clapping hands 👏
-raising hands 🙌
-open hands 👐
-palms up together 🤲
-handshake 🤝
-folded hands 🙏
-writing hand ✍️
-nail polish 💅
-selfie 🤳
-flexed biceps 💪
-mechanical arm 🦾
-mechanical leg 🦿
-leg 🦵
-foot 🦶
-ear 👂
-ear with hearing aid 🦻
-nose 👃
-brain 🧠
-anatomical heart 🫀
-lungs 🫁
-tooth 🦷
-bone 🦴
-eyes 👀
-eye 👁️
-tongue 👅
-mouth 👄
-baby 👶
-child 🧒
-boy 👦
-girl 👧
-person 🧑
-person: blond hair 👱
-man 👨
-person: beard 🧔
-man: beard 🧔♂️
-woman: beard 🧔♀️
-man: red hair 👨🦰
-man: curly hair 👨🦱
-man: white hair 👨🦳
-man: bald 👨🦲
-woman 👩
-woman: red hair 👩🦰
-person: red hair 🧑🦰
-woman: curly hair 👩🦱
-person: curly hair 🧑🦱
-woman: white hair 👩🦳
-person: white hair 🧑🦳
-woman: bald 👩🦲
-person: bald 🧑🦲
-woman: blond hair 👱♀️
-man: blond hair 👱♂️
-older person 🧓
-old man 👴
-old woman 👵
-person frowning 🙍
-man frowning 🙍♂️
-woman frowning 🙍♀️
-person pouting 🙎
-man pouting 🙎♂️
-woman pouting 🙎♀️
-person gesturing NO 🙅
-man gesturing NO 🙅♂️
-woman gesturing NO 🙅♀️
-person gesturing OK 🙆
-man gesturing OK 🙆♂️
-woman gesturing OK 🙆♀️
-person tipping hand 💁
-man tipping hand 💁♂️
-woman tipping hand 💁♀️
-person raising hand 🙋
-man raising hand 🙋♂️
-woman raising hand 🙋♀️
-deaf person 🧏
-deaf man 🧏♂️
-deaf woman 🧏♀️
-person bowing 🙇
-man bowing 🙇♂️
-woman bowing 🙇♀️
-person facepalming 🤦
-man facepalming 🤦♂️
-woman facepalming 🤦♀️
-person shrugging 🤷
-man shrugging 🤷♂️
-woman shrugging 🤷♀️
-health worker 🧑⚕️
-man health worker 👨⚕️
-woman health worker 👩⚕️
-student 🧑🎓
-man student 👨🎓
-woman student 👩🎓
-teacher 🧑🏫
-man teacher 👨🏫
-woman teacher 👩🏫
-judge 🧑⚖️
-man judge 👨⚖️
-woman judge 👩⚖️
-farmer 🧑🌾
-man farmer 👨🌾
-woman farmer 👩🌾
-cook 🧑🍳
-man cook 👨🍳
-woman cook 👩🍳
-mechanic 🧑🔧
-man mechanic 👨🔧
-woman mechanic 👩🔧
-factory worker 🧑🏭
-man factory worker 👨🏭
-woman factory worker 👩🏭
-office worker 🧑💼
-man office worker 👨💼
-woman office worker 👩💼
-scientist 🧑🔬
-man scientist 👨🔬
-woman scientist 👩🔬
-technologist 🧑💻
-man technologist 👨💻
-woman technologist 👩💻
-singer 🧑🎤
-man singer 👨🎤
-woman singer 👩🎤
-artist 🧑🎨
-man artist 👨🎨
-woman artist 👩🎨
-pilot 🧑✈️
-man pilot 👨✈️
-woman pilot 👩✈️
-astronaut 🧑🚀
-man astronaut 👨🚀
-woman astronaut 👩🚀
-firefighter 🧑🚒
-man firefighter 👨🚒
-woman firefighter 👩🚒
-police officer 👮
-man police officer 👮♂️
-woman police officer 👮♀️
-detective 🕵️
-man detective 🕵️♂️
-woman detective 🕵️♀️
-guard 💂
-man guard 💂♂️
-woman guard 💂♀️
-ninja 🥷
-construction worker 👷
-man construction worker 👷♂️
-woman construction worker 👷♀️
-prince 🤴
-princess 👸
-person wearing turban 👳
-man wearing turban 👳♂️
-woman wearing turban 👳♀️
-person with skullcap 👲
-woman with headscarf 🧕
-person in tuxedo 🤵
-man in tuxedo 🤵♂️
-woman in tuxedo 🤵♀️
-person with veil 👰
-man with veil 👰♂️
-woman with veil 👰♀️
-pregnant woman 🤰
-breast-feeding 🤱
-woman feeding baby 👩🍼
-man feeding baby 👨🍼
-person feeding baby 🧑🍼
-baby angel 👼
-Santa Claus 🎅
-Mrs. Claus 🤶
-mx claus 🧑🎄
-superhero 🦸
-man superhero 🦸♂️
-woman superhero 🦸♀️
-supervillain 🦹
-man supervillain 🦹♂️
-woman supervillain 🦹♀️
-mage 🧙
-man mage 🧙♂️
-woman mage 🧙♀️
-fairy 🧚
-man fairy 🧚♂️
-woman fairy 🧚♀️
-vampire 🧛
-man vampire 🧛♂️
-woman vampire 🧛♀️
-merperson 🧜
-merman 🧜♂️
-mermaid 🧜♀️
-elf 🧝
-man elf 🧝♂️
-woman elf 🧝♀️
-genie 🧞
-man genie 🧞♂️
-woman genie 🧞♀️
-zombie 🧟
-man zombie 🧟♂️
-woman zombie 🧟♀️
-person getting massage 💆
-man getting massage 💆♂️
-woman getting massage 💆♀️
-person getting haircut 💇
-man getting haircut 💇♂️
-woman getting haircut 💇♀️
-person walking 🚶
-man walking 🚶♂️
-woman walking 🚶♀️
-person standing 🧍
-man standing 🧍♂️
-woman standing 🧍♀️
-person kneeling 🧎
-man kneeling 🧎♂️
-woman kneeling 🧎♀️
-person with white cane 🧑🦯
-man with white cane 👨🦯
-woman with white cane 👩🦯
-person in motorized wheelchair 🧑🦼
-man in motorized wheelchair 👨🦼
-woman in motorized wheelchair 👩🦼
-person in manual wheelchair 🧑🦽
-man in manual wheelchair 👨🦽
-woman in manual wheelchair 👩🦽
-person running 🏃
-man running 🏃♂️
-woman running 🏃♀️
-woman dancing 💃
-man dancing 🕺
-person in suit levitating 🕴️
-people with bunny ears 👯
-men with bunny ears 👯♂️
-women with bunny ears 👯♀️
-person in steamy room 🧖
-man in steamy room 🧖♂️
-woman in steamy room 🧖♀️
-person climbing 🧗
-man climbing 🧗♂️
-woman climbing 🧗♀️
-person fencing 🤺
-horse racing 🏇
-skier ⛷️
-snowboarder 🏂
-person golfing 🏌️
-man golfing 🏌️♂️
-woman golfing 🏌️♀️
-person surfing 🏄
-man surfing 🏄♂️
-woman surfing 🏄♀️
-person rowing boat 🚣
-man rowing boat 🚣♂️
-woman rowing boat 🚣♀️
-person swimming 🏊
-man swimming 🏊♂️
-woman swimming 🏊♀️
-person bouncing ball ⛹️
-man bouncing ball ⛹️♂️
-woman bouncing ball ⛹️♀️
-person lifting weights 🏋️
-man lifting weights 🏋️♂️
-woman lifting weights 🏋️♀️
-person biking 🚴
-man biking 🚴♂️
-woman biking 🚴♀️
-person mountain biking 🚵
-man mountain biking 🚵♂️
-woman mountain biking 🚵♀️
-person cartwheeling 🤸
-man cartwheeling 🤸♂️
-woman cartwheeling 🤸♀️
-people wrestling 🤼
-men wrestling 🤼♂️
-women wrestling 🤼♀️
-person playing water polo 🤽
-man playing water polo 🤽♂️
-woman playing water polo 🤽♀️
-person playing handball 🤾
-man playing handball 🤾♂️
-woman playing handball 🤾♀️
-person juggling 🤹
-man juggling 🤹♂️
-woman juggling 🤹♀️
-person in lotus position 🧘
-man in lotus position 🧘♂️
-woman in lotus position 🧘♀️
-person taking bath 🛀
-person in bed 🛌
-people holding hands 🧑🤝🧑
-women holding hands 👭
-woman and man holding hands 👫
-men holding hands 👬
-kiss 💏
-kiss: woman man 👩❤️💋👨
-kiss: man man 👨❤️💋👨
-kiss: woman woman 👩❤️💋👩
-couple with heart 💑
-couple with heart: woman man 👩❤️👨
-couple with heart: man man 👨❤️👨
-couple with heart: woman woman 👩❤️👩
-family 👪
-family: man woman boy 👨👩👦
-family: man woman girl 👨👩👧
-family: man woman girl boy 👨👩👧👦
-family: man woman boy boy 👨👩👦👦
-family: man woman girl girl 👨👩👧👧
-family: man man boy 👨👨👦
-family: man man girl 👨👨👧
-family: man man girl boy 👨👨👧👦
-family: man man boy boy 👨👨👦👦
-family: man man girl girl 👨👨👧👧
-family: woman woman boy 👩👩👦
-family: woman woman girl 👩👩👧
-family: woman woman girl boy 👩👩👧👦
-family: woman woman boy boy 👩👩👦👦
-family: woman woman girl girl 👩👩👧👧
-family: man boy 👨👦
-family: man boy boy 👨👦👦
-family: man girl 👨👧
-family: man girl boy 👨👧👦
-family: man girl girl 👨👧👧
-family: woman boy 👩👦
-family: woman boy boy 👩👦👦
-family: woman girl 👩👧
-family: woman girl boy 👩👧👦
-family: woman girl girl 👩👧👧
-speaking head 🗣️
-bust in silhouette 👤
-busts in silhouette 👥
-people hugging 🫂
-footprints 👣
-monkey face 🐵
-monkey 🐒
-gorilla 🦍
-orangutan 🦧
-dog face 🐶
-dog 🐕
-guide dog 🦮
-service dog 🐕🦺
-poodle 🐩
-wolf 🐺
-fox 🦊
-raccoon 🦝
-cat face 🐱
-cat 🐈
-black cat 🐈⬛
-lion 🦁
-tiger face 🐯
-tiger 🐅
-leopard 🐆
-horse face 🐴
-horse 🐎
-unicorn 🦄
-zebra 🦓
-deer 🦌
-bison 🦬
-cow face 🐮
-ox 🐂
-water buffalo 🐃
-cow 🐄
-pig face 🐷
-pig 🐖
-boar 🐗
-pig nose 🐽
-ram 🐏
-ewe 🐑
-goat 🐐
-camel 🐪
-two-hump camel 🐫
-llama 🦙
-giraffe 🦒
-elephant 🐘
-mammoth 🦣
-rhinoceros 🦏
-hippopotamus 🦛
-mouse face 🐭
-mouse 🐁
-rat 🐀
-hamster 🐹
-rabbit face 🐰
-rabbit 🐇
-chipmunk 🐿️
-beaver 🦫
-hedgehog 🦔
-bat 🦇
-bear 🐻
-polar bear 🐻❄️
-koala 🐨
-panda 🐼
-sloth 🦥
-otter 🦦
-skunk 🦨
-kangaroo 🦘
-badger 🦡
-paw prints 🐾
-turkey 🦃
-chicken 🐔
-rooster 🐓
-hatching chick 🐣
-baby chick 🐤
-front-facing baby chick 🐥
-bird 🐦
-penguin 🐧
-dove 🕊️
-eagle 🦅
-duck 🦆
-swan 🦢
-owl 🦉
-dodo 🦤
-feather 🪶
-flamingo 🦩
-peacock 🦚
-parrot 🦜
-frog 🐸
-crocodile 🐊
-turtle 🐢
-lizard 🦎
-snake 🐍
-dragon face 🐲
-dragon 🐉
-sauropod 🦕
-T-Rex 🦖
-spouting whale 🐳
-whale 🐋
-dolphin 🐬
-seal 🦭
-fish 🐟
-tropical fish 🐠
-blowfish 🐡
-shark 🦈
-octopus 🐙
-spiral shell 🐚
-snail 🐌
-butterfly 🦋
-bug 🐛
-ant 🐜
-honeybee 🐝
-beetle 🪲
-lady beetle 🐞
-cricket 🦗
-cockroach 🪳
-spider 🕷️
-spider web 🕸️
-scorpion 🦂
-mosquito 🦟
-fly 🪰
-worm 🪱
-microbe 🦠
-bouquet 💐
-cherry blossom 🌸
-white flower 💮
-rosette 🏵️
-rose 🌹
-wilted flower 🥀
-hibiscus 🌺
-sunflower 🌻
-blossom 🌼
-tulip 🌷
-seedling 🌱
-potted plant 🪴
-evergreen tree 🌲
-deciduous tree 🌳
-palm tree 🌴
-cactus 🌵
-sheaf of rice 🌾
-herb 🌿
-shamrock ☘️
-four leaf clover 🍀
-maple leaf 🍁
-fallen leaf 🍂
-leaf fluttering in wind 🍃
-grapes 🍇
-melon 🍈
-watermelon 🍉
-tangerine 🍊
-lemon 🍋
-banana 🍌
-pineapple 🍍
-mango 🥭
-red apple 🍎
-green apple 🍏
-pear 🍐
-peach 🍑
-cherries 🍒
-strawberry 🍓
-blueberries 🫐
-kiwi fruit 🥝
-tomato 🍅
-olive 🫒
-coconut 🥥
-avocado 🥑
-eggplant 🍆
-potato 🥔
-carrot 🥕
-ear of corn 🌽
-hot pepper 🌶️
-bell pepper 🫑
-cucumber 🥒
-leafy green 🥬
-broccoli 🥦
-garlic 🧄
-onion 🧅
-mushroom 🍄
-peanuts 🥜
-chestnut 🌰
-bread 🍞
-croissant 🥐
-baguette bread 🥖
-flatbread 🫓
-pretzel 🥨
-bagel 🥯
-pancakes 🥞
-waffle 🧇
-cheese wedge 🧀
-meat on bone 🍖
-poultry leg 🍗
-cut of meat 🥩
-bacon 🥓
-hamburger 🍔
-french fries 🍟
-pizza 🍕
-hot dog 🌭
-sandwich 🥪
-taco 🌮
-burrito 🌯
-tamale 🫔
-stuffed flatbread 🥙
-falafel 🧆
-egg 🥚
-cooking 🍳
-shallow pan of food 🥘
-pot of food 🍲
-fondue 🫕
-bowl with spoon 🥣
-green salad 🥗
-popcorn 🍿
-butter 🧈
-salt 🧂
-canned food 🥫
-bento box 🍱
-rice cracker 🍘
-rice ball 🍙
-cooked rice 🍚
-curry rice 🍛
-steaming bowl 🍜
-spaghetti 🍝
-roasted sweet potato 🍠
-oden 🍢
-sushi 🍣
-fried shrimp 🍤
-fish cake with swirl 🍥
-moon cake 🥮
-dango 🍡
-dumpling 🥟
-fortune cookie 🥠
-takeout box 🥡
-crab 🦀
-lobster 🦞
-shrimp 🦐
-squid 🦑
-oyster 🦪
-soft ice cream 🍦
-shaved ice 🍧
-ice cream 🍨
-doughnut 🍩
-cookie 🍪
-birthday cake 🎂
-shortcake 🍰
-cupcake 🧁
-pie 🥧
-chocolate bar 🍫
-candy 🍬
-lollipop 🍭
-custard 🍮
-honey pot 🍯
-baby bottle 🍼
-glass of milk 🥛
-hot beverage ☕
-teapot 🫖
-teacup without handle 🍵
-sake 🍶
-bottle with popping cork 🍾
-wine glass 🍷
-cocktail glass 🍸
-tropical drink 🍹
-beer mug 🍺
-clinking beer mugs 🍻
-clinking glasses 🥂
-tumbler glass 🥃
-cup with straw 🥤
-bubble tea 🧋
-beverage box 🧃
-mate 🧉
-ice 🧊
-chopsticks 🥢
-fork and knife with plate 🍽️
-fork and knife 🍴
-spoon 🥄
-kitchen knife 🔪
-amphora 🏺
-globe showing Europe-Africa 🌍
-globe showing Americas 🌎
-globe showing Asia-Australia 🌏
-globe with meridians 🌐
-world map 🗺️
-map of Japan 🗾
-compass 🧭
-snow-capped mountain 🏔️
-mountain ⛰️
-volcano 🌋
-mount fuji 🗻
-camping 🏕️
-beach with umbrella 🏖️
-desert 🏜️
-desert island 🏝️
-national park 🏞️
-stadium 🏟️
-classical building 🏛️
-building construction 🏗️
-brick 🧱
-rock 🪨
-wood 🪵
-hut 🛖
-houses 🏘️
-derelict house 🏚️
-house 🏠
-house with garden 🏡
-office building 🏢
-Japanese post office 🏣
-post office 🏤
-hospital 🏥
-bank 🏦
-hotel 🏨
-love hotel 🏩
-convenience store 🏪
-school 🏫
-department store 🏬
-factory 🏭
-Japanese castle 🏯
-castle 🏰
-wedding 💒
-Tokyo tower 🗼
-Statue of Liberty 🗽
-church ⛪
-mosque 🕌
-hindu temple 🛕
-synagogue 🕍
-shinto shrine ⛩️
-kaaba 🕋
-fountain ⛲
-tent ⛺
-foggy 🌁
-night with stars 🌃
-cityscape 🏙️
-sunrise over mountains 🌄
-sunrise 🌅
-cityscape at dusk 🌆
-sunset 🌇
-bridge at night 🌉
-hot springs ♨️
-carousel horse 🎠
-ferris wheel 🎡
-roller coaster 🎢
-barber pole 💈
-circus tent 🎪
-locomotive 🚂
-railway car 🚃
-high-speed train 🚄
-bullet train 🚅
-train 🚆
-metro 🚇
-light rail 🚈
-station 🚉
-tram 🚊
-monorail 🚝
-mountain railway 🚞
-tram car 🚋
-bus 🚌
-oncoming bus 🚍
-trolleybus 🚎
-minibus 🚐
-ambulance 🚑
-fire engine 🚒
-police car 🚓
-oncoming police car 🚔
-taxi 🚕
-oncoming taxi 🚖
-automobile 🚗
-oncoming automobile 🚘
-sport utility vehicle 🚙
-pickup truck 🛻
-delivery truck 🚚
-articulated lorry 🚛
-tractor 🚜
-racing car 🏎️
-motorcycle 🏍️
-motor scooter 🛵
-manual wheelchair 🦽
-motorized wheelchair 🦼
-auto rickshaw 🛺
-bicycle 🚲
-kick scooter 🛴
-skateboard 🛹
-roller skate 🛼
-bus stop 🚏
-motorway 🛣️
-railway track 🛤️
-oil drum 🛢️
-fuel pump ⛽
-police car light 🚨
-horizontal traffic light 🚥
-vertical traffic light 🚦
-stop sign 🛑
-construction 🚧
-anchor ⚓
-sailboat ⛵
-canoe 🛶
-speedboat 🚤
-passenger ship 🛳️
-ferry ⛴️
-motor boat 🛥️
-ship 🚢
-airplane ✈️
-small airplane 🛩️
-airplane departure 🛫
-airplane arrival 🛬
-parachute 🪂
-seat 💺
-helicopter 🚁
-suspension railway 🚟
-mountain cableway 🚠
-aerial tramway 🚡
-satellite 🛰️
-rocket 🚀
-flying saucer 🛸
-bellhop bell 🛎️
-luggage 🧳
-hourglass done ⌛
-hourglass not done ⏳
-watch ⌚
-alarm clock ⏰
-stopwatch ⏱️
-timer clock ⏲️
-mantelpiece clock 🕰️
-twelve o’clock 🕛
-twelve-thirty 🕧
-one o’clock 🕐
-one-thirty 🕜
-two o’clock 🕑
-two-thirty 🕝
-three o’clock 🕒
-three-thirty 🕞
-four o’clock 🕓
-four-thirty 🕟
-five o’clock 🕔
-five-thirty 🕠
-six o’clock 🕕
-six-thirty 🕡
-seven o’clock 🕖
-seven-thirty 🕢
-eight o’clock 🕗
-eight-thirty 🕣
-nine o’clock 🕘
-nine-thirty 🕤
-ten o’clock 🕙
-ten-thirty 🕥
-eleven o’clock 🕚
-eleven-thirty 🕦
-new moon 🌑
-waxing crescent moon 🌒
-first quarter moon 🌓
-waxing gibbous moon 🌔
-full moon 🌕
-waning gibbous moon 🌖
-last quarter moon 🌗
-waning crescent moon 🌘
-crescent moon 🌙
-new moon face 🌚
-first quarter moon face 🌛
-last quarter moon face 🌜
-thermometer 🌡️
-sun ☀️
-full moon face 🌝
-sun with face 🌞
-ringed planet 🪐
-star ⭐
-glowing star 🌟
-shooting star 🌠
-milky way 🌌
-cloud ☁️
-sun behind cloud ⛅
-cloud with lightning and rain ⛈️
-sun behind small cloud 🌤️
-sun behind large cloud 🌥️
-sun behind rain cloud 🌦️
-cloud with rain 🌧️
-cloud with snow 🌨️
-cloud with lightning 🌩️
-tornado 🌪️
-fog 🌫️
-wind face 🌬️
-cyclone 🌀
-rainbow 🌈
-closed umbrella 🌂
-umbrella ☂️
-umbrella with rain drops ☔
-umbrella on ground ⛱️
-high voltage ⚡
-snowflake ❄️
-snowman ☃️
-snowman without snow ⛄
-comet ☄️
-fire 🔥
-droplet 💧
-water wave 🌊
-jack-o-lantern 🎃
-Christmas tree 🎄
-fireworks 🎆
-sparkler 🎇
-firecracker 🧨
-sparkles ✨
-balloon 🎈
-party popper 🎉
-confetti ball 🎊
-tanabata tree 🎋
-pine decoration 🎍
-Japanese dolls 🎎
-carp streamer 🎏
-wind chime 🎐
-moon viewing ceremony 🎑
-red envelope 🧧
-ribbon 🎀
-wrapped gift 🎁
-reminder ribbon 🎗️
-admission tickets 🎟️
-ticket 🎫
-military medal 🎖️
-trophy 🏆
-sports medal 🏅
-1st place medal 🥇
-2nd place medal 🥈
-3rd place medal 🥉
-soccer ball ⚽
-baseball ⚾
-softball 🥎
-basketball 🏀
-volleyball 🏐
-american football 🏈
-rugby football 🏉
-tennis 🎾
-flying disc 🥏
-bowling 🎳
-cricket game 🏏
-field hockey 🏑
-ice hockey 🏒
-lacrosse 🥍
-ping pong 🏓
-badminton 🏸
-boxing glove 🥊
-martial arts uniform 🥋
-goal net 🥅
-flag in hole ⛳
-ice skate ⛸️
-fishing pole 🎣
-diving mask 🤿
-running shirt 🎽
-skis 🎿
-sled 🛷
-curling stone 🥌
-bullseye 🎯
-yo-yo 🪀
-kite 🪁
-pool 8 ball 🎱
-crystal ball 🔮
-magic wand 🪄
-nazar amulet 🧿
-video game 🎮
-joystick 🕹️
-slot machine 🎰
-game die 🎲
-puzzle piece 🧩
-teddy bear 🧸
-piñata 🪅
-nesting dolls 🪆
-spade suit ♠️
-heart suit ♥️
-diamond suit ♦️
-club suit ♣️
-chess pawn ♟️
-joker 🃏
-mahjong red dragon 🀄
-flower playing cards 🎴
-performing arts 🎭
-framed picture 🖼️
-artist palette 🎨
-thread 🧵
-sewing needle 🪡
-yarn 🧶
-knot 🪢
-glasses 👓
-sunglasses 🕶️
-goggles 🥽
-lab coat 🥼
-safety vest 🦺
-necktie 👔
-t-shirt 👕
-jeans 👖
-scarf 🧣
-gloves 🧤
-coat 🧥
-socks 🧦
-dress 👗
-kimono 👘
-sari 🥻
-one-piece swimsuit 🩱
-briefs 🩲
-shorts 🩳
-bikini 👙
-woman’s clothes 👚
-purse 👛
-handbag 👜
-clutch bag 👝
-shopping bags 🛍️
-backpack 🎒
-thong sandal 🩴
-man’s shoe 👞
-running shoe 👟
-hiking boot 🥾
-flat shoe 🥿
-high-heeled shoe 👠
-woman’s sandal 👡
-ballet shoes 🩰
-woman’s boot 👢
-crown 👑
-woman’s hat 👒
-top hat 🎩
-graduation cap 🎓
-billed cap 🧢
-military helmet 🪖
-rescue worker’s helmet ⛑️
-prayer beads 📿
-lipstick 💄
-ring 💍
-gem stone 💎
-muted speaker 🔇
-speaker low volume 🔈
-speaker medium volume 🔉
-speaker high volume 🔊
-loudspeaker 📢
-megaphone 📣
-postal horn 📯
-bell 🔔
-bell with slash 🔕
-musical score 🎼
-musical note 🎵
-musical notes 🎶
-studio microphone 🎙️
-level slider 🎚️
-control knobs 🎛️
-microphone 🎤
-headphone 🎧
-radio 📻
-saxophone 🎷
-accordion 🪗
-guitar 🎸
-musical keyboard 🎹
-trumpet 🎺
-violin 🎻
-banjo 🪕
-drum 🥁
-long drum 🪘
-mobile phone 📱
-mobile phone with arrow 📲
-telephone ☎️
-telephone receiver 📞
-pager 📟
-fax machine 📠
-battery 🔋
-electric plug 🔌
-laptop 💻
-desktop computer 🖥️
-printer 🖨️
-keyboard ⌨️
-computer mouse 🖱️
-trackball 🖲️
-computer disk 💽
-floppy disk 💾
-optical disk 💿
-dvd 📀
-abacus 🧮
-movie camera 🎥
-film frames 🎞️
-film projector 📽️
-clapper board 🎬
-television 📺
-camera 📷
-camera with flash 📸
-video camera 📹
-videocassette 📼
-magnifying glass tilted left 🔍
-magnifying glass tilted right 🔎
-candle 🕯️
-light bulb 💡
-flashlight 🔦
-red paper lantern 🏮
-diya lamp 🪔
-notebook with decorative cover 📔
-closed book 📕
-open book 📖
-green book 📗
-blue book 📘
-orange book 📙
-books 📚
-notebook 📓
-ledger 📒
-page with curl 📃
-scroll 📜
-page facing up 📄
-newspaper 📰
-rolled-up newspaper 🗞️
-bookmark tabs 📑
-bookmark 🔖
-label 🏷️
-money bag 💰
-coin 🪙
-yen banknote 💴
-dollar banknote 💵
-euro banknote 💶
-pound banknote 💷
-money with wings 💸
-credit card 💳
-receipt 🧾
-chart increasing with yen 💹
-envelope ✉️
-e-mail 📧
-incoming envelope 📨
-envelope with arrow 📩
-outbox tray 📤
-inbox tray 📥
-package 📦
-closed mailbox with raised flag 📫
-closed mailbox with lowered flag 📪
-open mailbox with raised flag 📬
-open mailbox with lowered flag 📭
-postbox 📮
-ballot box with ballot 🗳️
-pencil ✏️
-black nib ✒️
-fountain pen 🖋️
-pen 🖊️
-paintbrush 🖌️
-crayon 🖍️
-memo 📝
-briefcase 💼
-file folder 📁
-open file folder 📂
-card index dividers 🗂️
-calendar 📅
-tear-off calendar 📆
-spiral notepad 🗒️
-spiral calendar 🗓️
-card index 📇
-chart increasing 📈
-chart decreasing 📉
-bar chart 📊
-clipboard 📋
-pushpin 📌
-round pushpin 📍
-paperclip 📎
-linked paperclips 🖇️
-straight ruler 📏
-triangular ruler 📐
-scissors ✂️
-card file box 🗃️
-file cabinet 🗄️
-wastebasket 🗑️
-locked 🔒
-unlocked 🔓
-locked with pen 🔏
-locked with key 🔐
-key 🔑
-old key 🗝️
-hammer 🔨
-axe 🪓
-pick ⛏️
-hammer and pick ⚒️
-hammer and wrench 🛠️
-dagger 🗡️
-crossed swords ⚔️
-water pistol 🔫
-boomerang 🪃
-bow and arrow 🏹
-shield 🛡️
-carpentry saw 🪚
-wrench 🔧
-screwdriver 🪛
-nut and bolt 🔩
-gear ⚙️
-clamp 🗜️
-balance scale ⚖️
-white cane 🦯
-link 🔗
-chains ⛓️
-hook 🪝
-toolbox 🧰
-magnet 🧲
-ladder 🪜
-alembic ⚗️
-test tube 🧪
-petri dish 🧫
-dna 🧬
-microscope 🔬
-telescope 🔭
-satellite antenna 📡
-syringe 💉
-drop of blood 🩸
-pill 💊
-adhesive bandage 🩹
-stethoscope 🩺
-door 🚪
-elevator 🛗
-mirror 🪞
-window 🪟
-bed 🛏️
-couch and lamp 🛋️
-chair 🪑
-toilet 🚽
-plunger 🪠
-shower 🚿
-bathtub 🛁
-mouse trap 🪤
-razor 🪒
-lotion bottle 🧴
-safety pin 🧷
-broom 🧹
-basket 🧺
-roll of paper 🧻
-bucket 🪣
-soap 🧼
-toothbrush 🪥
-sponge 🧽
-fire extinguisher 🧯
-shopping cart 🛒
-cigarette 🚬
-coffin ⚰️
-headstone 🪦
-funeral urn ⚱️
-moai 🗿
-placard 🪧
-ATM sign 🏧
-litter in bin sign 🚮
-potable water 🚰
-wheelchair symbol ♿
-men’s room 🚹
-women’s room 🚺
-restroom 🚻
-baby symbol 🚼
-water closet 🚾
-passport control 🛂
-customs 🛃
-baggage claim 🛄
-left luggage 🛅
-warning ⚠️
-children crossing 🚸
-no entry ⛔
-prohibited 🚫
-no bicycles 🚳
-no smoking 🚭
-no littering 🚯
-non-potable water 🚱
-no pedestrians 🚷
-no mobile phones 📵
-no one under eighteen 🔞
-radioactive ☢️
-biohazard ☣️
-up arrow ⬆️
-up-right arrow ↗️
-right arrow ➡️
-down-right arrow ↘️
-down arrow ⬇️
-down-left arrow ↙️
-left arrow ⬅️
-up-left arrow ↖️
-up-down arrow ↕️
-left-right arrow ↔️
-right arrow curving left ↩️
-left arrow curving right ↪️
-right arrow curving up ⤴️
-right arrow curving down ⤵️
-clockwise vertical arrows 🔃
-counterclockwise arrows button 🔄
-BACK arrow 🔙
-END arrow 🔚
-ON! arrow 🔛
-SOON arrow 🔜
-TOP arrow 🔝
-place of worship 🛐
-atom symbol ⚛️
-om 🕉️
-star of David ✡️
-wheel of dharma ☸️
-yin yang ☯️
-latin cross ✝️
-orthodox cross ☦️
-star and crescent ☪️
-peace symbol ☮️
-menorah 🕎
-dotted six-pointed star 🔯
-Aries ♈
-Taurus ♉
-Gemini ♊
-Cancer ♋
-Leo ♌
-Virgo ♍
-Libra ♎
-Scorpio ♏
-Sagittarius ♐
-Capricorn ♑
-Aquarius ♒
-Pisces ♓
-Ophiuchus ⛎
-shuffle tracks button 🔀
-repeat button 🔁
-repeat single button 🔂
-play button ▶️
-fast-forward button ⏩
-next track button ⏭️
-play or pause button ⏯️
-reverse button ◀️
-fast reverse button ⏪
-last track button ⏮️
-upwards button 🔼
-fast up button ⏫
-downwards button 🔽
-fast down button ⏬
-pause button ⏸️
-stop button ⏹️
-record button ⏺️
-eject button ⏏️
-cinema 🎦
-dim button 🔅
-bright button 🔆
-antenna bars 📶
-vibration mode 📳
-mobile phone off 📴
-female sign ♀️
-male sign ♂️
-transgender symbol ⚧️
-multiply ✖️
-plus ➕
-minus ➖
-divide ➗
-infinity ♾️
-double exclamation mark ‼️
-exclamation question mark ⁉️
-red question mark ❓
-white question mark ❔
-white exclamation mark ❕
-red exclamation mark ❗
-wavy dash 〰️
-currency exchange 💱
-heavy dollar sign 💲
-medical symbol ⚕️
-recycling symbol ♻️
-fleur-de-lis ⚜️
-trident emblem 🔱
-name badge 📛
-Japanese symbol for beginner 🔰
-hollow red circle ⭕
-check mark button ✅
-check box with check ☑️
-check mark ✔️
-cross mark ❌
-cross mark button ❎
-curly loop ➰
-double curly loop ➿
-part alternation mark 〽️
-eight-spoked asterisk ✳️
-eight-pointed star ✴️
-sparkle ❇️
-copyright ©️
-registered ®️
-trade mark ™️
-keycap: # #️⃣
-keycap: * *️⃣
-keycap: 0 0️⃣
-keycap: 1 1️⃣
-keycap: 2 2️⃣
-keycap: 3 3️⃣
-keycap: 4 4️⃣
-keycap: 5 5️⃣
-keycap: 6 6️⃣
-keycap: 7 7️⃣
-keycap: 8 8️⃣
-keycap: 9 9️⃣
-keycap: 10 🔟
-input latin uppercase 🔠
-input latin lowercase 🔡
-input numbers 🔢
-input symbols 🔣
-input latin letters 🔤
-A button (blood type) 🅰️
-AB button (blood type) 🆎
-B button (blood type) 🅱️
-CL button 🆑
-COOL button 🆒
-FREE button 🆓
-information ℹ️
-ID button 🆔
-circled M Ⓜ️
-NEW button 🆕
-NG button 🆖
-O button (blood type) 🅾️
-OK button 🆗
-P button 🅿️
-SOS button 🆘
-UP! button 🆙
-VS button 🆚
-Japanese “here” button 🈁
-Japanese “service charge” button 🈂️
-Japanese “monthly amount” button 🈷️
-Japanese “not free of charge” button 🈶
-Japanese “reserved” button 🈯
-Japanese “bargain” button 🉐
-Japanese “discount” button 🈹
-Japanese “free of charge” button 🈚
-Japanese “prohibited” button 🈲
-Japanese “acceptable” button 🉑
-Japanese “application” button 🈸
-Japanese “passing grade” button 🈴
-Japanese “vacancy” button 🈳
-Japanese “congratulations” button ㊗️
-Japanese “secret” button ㊙️
-Japanese “open for business” button 🈺
-Japanese “no vacancy” button 🈵
-red circle 🔴
-orange circle 🟠
-yellow circle 🟡
-green circle 🟢
-blue circle 🔵
-purple circle 🟣
-brown circle 🟤
-black circle ⚫
-white circle ⚪
-red square 🟥
-orange square 🟧
-yellow square 🟨
-green square 🟩
-blue square 🟦
-purple square 🟪
-brown square 🟫
-black large square ⬛
-white large square ⬜
-black medium square ◼️
-white medium square ◻️
-black medium-small square ◾
-white medium-small square ◽
-black small square ▪️
-white small square ▫️
-large orange diamond 🔶
-large blue diamond 🔷
-small orange diamond 🔸
-small blue diamond 🔹
-red triangle pointed up 🔺
-red triangle pointed down 🔻
-diamond with a dot 💠
-radio button 🔘
-white square button 🔳
-black square button 🔲
-chequered flag 🏁
-triangular flag 🚩
-crossed flags 🎌
-black flag 🏴
-white flag 🏳️
-rainbow flag 🏳️🌈
-transgender flag 🏳️⚧️
-pirate flag 🏴☠️
-flag: Ascension Island 🇦🇨
-flag: Andorra 🇦🇩
-flag: United Arab Emirates 🇦🇪
-flag: Afghanistan 🇦🇫
-flag: Antigua & Barbuda 🇦🇬
-flag: Anguilla 🇦🇮
-flag: Albania 🇦🇱
-flag: Armenia 🇦🇲
-flag: Angola 🇦🇴
-flag: Antarctica 🇦🇶
-flag: Argentina 🇦🇷
-flag: American Samoa 🇦🇸
-flag: Austria 🇦🇹
-flag: Australia 🇦🇺
-flag: Aruba 🇦🇼
-flag: Åland Islands 🇦🇽
-flag: Azerbaijan 🇦🇿
-flag: Bosnia & Herzegovina 🇧🇦
-flag: Barbados 🇧🇧
-flag: Bangladesh 🇧🇩
-flag: Belgium 🇧🇪
-flag: Burkina Faso 🇧🇫
-flag: Bulgaria 🇧🇬
-flag: Bahrain 🇧🇭
-flag: Burundi 🇧🇮
-flag: Benin 🇧🇯
-flag: St. Barthélemy 🇧🇱
-flag: Bermuda 🇧🇲
-flag: Brunei 🇧🇳
-flag: Bolivia 🇧🇴
-flag: Caribbean Netherlands 🇧🇶
-flag: Brazil 🇧🇷
-flag: Bahamas 🇧🇸
-flag: Bhutan 🇧🇹
-flag: Bouvet Island 🇧🇻
-flag: Botswana 🇧🇼
-flag: Belarus 🇧🇾
-flag: Belize 🇧🇿
-flag: Canada 🇨🇦
-flag: Cocos (Keeling) Islands 🇨🇨
-flag: Congo - Kinshasa 🇨🇩
-flag: Central African Republic 🇨🇫
-flag: Congo - Brazzaville 🇨🇬
-flag: Switzerland 🇨🇭
-flag: Côte d’Ivoire 🇨🇮
-flag: Cook Islands 🇨🇰
-flag: Chile 🇨🇱
-flag: Cameroon 🇨🇲
-flag: China 🇨🇳
-flag: Colombia 🇨🇴
-flag: Clipperton Island 🇨🇵
-flag: Costa Rica 🇨🇷
-flag: Cuba 🇨🇺
-flag: Cape Verde 🇨🇻
-flag: Curaçao 🇨🇼
-flag: Christmas Island 🇨🇽
-flag: Cyprus 🇨🇾
-flag: Czechia 🇨🇿
-flag: Germany 🇩🇪
-flag: Diego Garcia 🇩🇬
-flag: Djibouti 🇩🇯
-flag: Denmark 🇩🇰
-flag: Dominica 🇩🇲
-flag: Dominican Republic 🇩🇴
-flag: Algeria 🇩🇿
-flag: Ceuta & Melilla 🇪🇦
-flag: Ecuador 🇪🇨
-flag: Estonia 🇪🇪
-flag: Egypt 🇪🇬
-flag: Western Sahara 🇪🇭
-flag: Eritrea 🇪🇷
-flag: Spain 🇪🇸
-flag: Ethiopia 🇪🇹
-flag: European Union 🇪🇺
-flag: Finland 🇫🇮
-flag: Fiji 🇫🇯
-flag: Falkland Islands 🇫🇰
-flag: Micronesia 🇫🇲
-flag: Faroe Islands 🇫🇴
-flag: France 🇫🇷
-flag: Gabon 🇬🇦
-flag: United Kingdom 🇬🇧
-flag: Grenada 🇬🇩
-flag: Georgia 🇬🇪
-flag: French Guiana 🇬🇫
-flag: Guernsey 🇬🇬
-flag: Ghana 🇬🇭
-flag: Gibraltar 🇬🇮
-flag: Greenland 🇬🇱
-flag: Gambia 🇬🇲
-flag: Guinea 🇬🇳
-flag: Guadeloupe 🇬🇵
-flag: Equatorial Guinea 🇬🇶
-flag: Greece 🇬🇷
-flag: South Georgia & South Sandwich Islands 🇬🇸
-flag: Guatemala 🇬🇹
-flag: Guam 🇬🇺
-flag: Guinea-Bissau 🇬🇼
-flag: Guyana 🇬🇾
-flag: Hong Kong SAR China 🇭🇰
-flag: Heard & McDonald Islands 🇭🇲
-flag: Honduras 🇭🇳
-flag: Croatia 🇭🇷
-flag: Haiti 🇭🇹
-flag: Hungary 🇭🇺
-flag: Canary Islands 🇮🇨
-flag: Indonesia 🇮🇩
-flag: Ireland 🇮🇪
-flag: Israel 🇮🇱
-flag: Isle of Man 🇮🇲
-flag: India 🇮🇳
-flag: British Indian Ocean Territory 🇮🇴
-flag: Iraq 🇮🇶
-flag: Iran 🇮🇷
-flag: Iceland 🇮🇸
-flag: Italy 🇮🇹
-flag: Jersey 🇯🇪
-flag: Jamaica 🇯🇲
-flag: Jordan 🇯🇴
-flag: Japan 🇯🇵
-flag: Kenya 🇰🇪
-flag: Kyrgyzstan 🇰🇬
-flag: Cambodia 🇰🇭
-flag: Kiribati 🇰🇮
-flag: Comoros 🇰🇲
-flag: St. Kitts & Nevis 🇰🇳
-flag: North Korea 🇰🇵
-flag: South Korea 🇰🇷
-flag: Kuwait 🇰🇼
-flag: Cayman Islands 🇰🇾
-flag: Kazakhstan 🇰🇿
-flag: Laos 🇱🇦
-flag: Lebanon 🇱🇧
-flag: St. Lucia 🇱🇨
-flag: Liechtenstein 🇱🇮
-flag: Sri Lanka 🇱🇰
-flag: Liberia 🇱🇷
-flag: Lesotho 🇱🇸
-flag: Lithuania 🇱🇹
-flag: Luxembourg 🇱🇺
-flag: Latvia 🇱🇻
-flag: Libya 🇱🇾
-flag: Morocco 🇲🇦
-flag: Monaco 🇲🇨
-flag: Moldova 🇲🇩
-flag: Montenegro 🇲🇪
-flag: St. Martin 🇲🇫
-flag: Madagascar 🇲🇬
-flag: Marshall Islands 🇲🇭
-flag: North Macedonia 🇲🇰
-flag: Mali 🇲🇱
-flag: Myanmar (Burma) 🇲🇲
-flag: Mongolia 🇲🇳
-flag: Macao SAR China 🇲🇴
-flag: Northern Mariana Islands 🇲🇵
-flag: Martinique 🇲🇶
-flag: Mauritania 🇲🇷
-flag: Montserrat 🇲🇸
-flag: Malta 🇲🇹
-flag: Mauritius 🇲🇺
-flag: Maldives 🇲🇻
-flag: Malawi 🇲🇼
-flag: Mexico 🇲🇽
-flag: Malaysia 🇲🇾
-flag: Mozambique 🇲🇿
-flag: Namibia 🇳🇦
-flag: New Caledonia 🇳🇨
-flag: Niger 🇳🇪
-flag: Norfolk Island 🇳🇫
-flag: Nigeria 🇳🇬
-flag: Nicaragua 🇳🇮
-flag: Netherlands 🇳🇱
-flag: Norway 🇳🇴
-flag: Nepal 🇳🇵
-flag: Nauru 🇳🇷
-flag: Niue 🇳🇺
-flag: New Zealand 🇳🇿
-flag: Oman 🇴🇲
-flag: Panama 🇵🇦
-flag: Peru 🇵🇪
-flag: French Polynesia 🇵🇫
-flag: Papua New Guinea 🇵🇬
-flag: Philippines 🇵🇭
-flag: Pakistan 🇵🇰
-flag: Poland 🇵🇱
-flag: St. Pierre & Miquelon 🇵🇲
-flag: Pitcairn Islands 🇵🇳
-flag: Puerto Rico 🇵🇷
-flag: Palestinian Territories 🇵🇸
-flag: Portugal 🇵🇹
-flag: Palau 🇵🇼
-flag: Paraguay 🇵🇾
-flag: Qatar 🇶🇦
-flag: Réunion 🇷🇪
-flag: Romania 🇷🇴
-flag: Serbia 🇷🇸
-flag: Russia 🇷🇺
-flag: Rwanda 🇷🇼
-flag: Saudi Arabia 🇸🇦
-flag: Solomon Islands 🇸🇧
-flag: Seychelles 🇸🇨
-flag: Sudan 🇸🇩
-flag: Sweden 🇸🇪
-flag: Singapore 🇸🇬
-flag: St. Helena 🇸🇭
-flag: Slovenia 🇸🇮
-flag: Svalbard & Jan Mayen 🇸🇯
-flag: Slovakia 🇸🇰
-flag: Sierra Leone 🇸🇱
-flag: San Marino 🇸🇲
-flag: Senegal 🇸🇳
-flag: Somalia 🇸🇴
-flag: Suriname 🇸🇷
-flag: South Sudan 🇸🇸
-flag: São Tomé & Príncipe 🇸🇹
-flag: El Salvador 🇸🇻
-flag: Sint Maarten 🇸🇽
-flag: Syria 🇸🇾
-flag: Eswatini 🇸🇿
-flag: Tristan da Cunha 🇹🇦
-flag: Turks & Caicos Islands 🇹🇨
-flag: Chad 🇹🇩
-flag: French Southern Territories 🇹🇫
-flag: Togo 🇹🇬
-flag: Thailand 🇹🇭
-flag: Tajikistan 🇹🇯
-flag: Tokelau 🇹🇰
-flag: Timor-Leste 🇹🇱
-flag: Turkmenistan 🇹🇲
-flag: Tunisia 🇹🇳
-flag: Tonga 🇹🇴
-flag: Turkey 🇹🇷
-flag: Trinidad & Tobago 🇹🇹
-flag: Tuvalu 🇹🇻
-flag: Taiwan 🇹🇼
-flag: Tanzania 🇹🇿
-flag: Ukraine 🇺🇦
-flag: Uganda 🇺🇬
-flag: U.S. Outlying Islands 🇺🇲
-flag: United Nations 🇺🇳
-flag: United States 🇺🇸
-flag: Uruguay 🇺🇾
-flag: Uzbekistan 🇺🇿
-flag: Vatican City 🇻🇦
-flag: St. Vincent & Grenadines 🇻🇨
-flag: Venezuela 🇻🇪
-flag: British Virgin Islands 🇻🇬
-flag: U.S. Virgin Islands 🇻🇮
-flag: Vietnam 🇻🇳
-flag: Vanuatu 🇻🇺
-flag: Wallis & Futuna 🇼🇫
-flag: Samoa 🇼🇸
-flag: Kosovo 🇽🇰
-flag: Yemen 🇾🇪
-flag: Mayotte 🇾🇹
-flag: South Africa 🇿🇦
-flag: Zambia 🇿🇲
-flag: Zimbabwe 🇿🇼
-flag: England 🏴
-flag: Scotland 🏴
-flag: Wales 🏴
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_power b/user/.config/suckless/dmenu/scripts/dmenu_power
deleted file mode 100755
index 178d3fe05..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_power
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env bash
-
-# ***This script was made by Clay Gomera (Drake)***
-# - Description: A simple power menu dmenu script
-# - Dependencies: dmenu, power-profiles-daemon
-
-## OPTIONS ##
-option1=" Logout"
-option2=" Reboot"
-option3=" Power off"
-option4="💤 Suspend"
-option5="🔒 Lock"
-option6="🔋 Change power profile"
-option7="❌Cancel"
-
-## OPTIONS ARRAY ##
-options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
-
-## POWER PROFILE OPTIONS ##
-pwr1="🔥 Performance"
-pwr2="⚖ Balanced"
-pwr3="⏱ Power Saver"
-pwr4="❌Cancel"
-
-## POWER PROFILES ARRAY ##
-pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4"
-
-## MAIN ACTION COMMAND ##
-action=$(echo -e "$options" | dmenu -b -i -p " ")
-case "$action" in
- $option1*)
- whoami | xargs -I % sh -c 'pkill -KILL -u %';;
- $option2*)
- systemctl reboot;;
- $option3*)
- systemctl poweroff;;
- $option4*)
- betterlockscreen --suspend;;
- $option5*)
- betterlockscreen -l;;
- $option6*)
- currentpwr=$(powerprofilesctl get)
- pwraction=$(echo -e "$pwrs" | dmenu -b -i -p "Current profile is: ${currentpwr} | Select profile:")
- case "$pwraction" in
- $pwr1*)
- powerprofilesctl set performance && notify-send "Power profile switched to performance";;
- $pwr2*)
- powerprofilesctl set balanced && notify-send "Power profile switched to balanced";;
- $pwr3*)
- powerprofilesctl set power-saver && notify-send "Power profile switched to power saver";;
- $pwr4*)
- exit 0
- esac;;
- $option7*)
- exit 0
-esac
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_scrot b/user/.config/suckless/dmenu/scripts/dmenu_scrot
deleted file mode 100755
index 62a6f73c0..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_scrot
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env bash
-
-# ***This script was made by Clay Gomera (Drake)***
-# - Description: A simple screenshot dmenu script
-# - Dependencies: scrot, dmenu, notify-send
-
-## CREATING SCREENSHOT FOLDER ##
-mkdir -p "$HOME/Pictures/Screenshots"
-cd "$HOME/Pictures/Screenshots" || exit 0
-
-## CHOICES ##
-cho1=" Entire screen"
-cho2=" Entire screen with delay"
-cho3=" Focused window"
-cho4=" Select area"
-chos="$cho1\n$cho2\n$cho3\n$cho4"
-
-## DELAY OPTIONS ##
-del1="Take screenshot with 3 sec delay"
-del2="Take screenshot with 5 sec delay"
-del3="Take screenshot with 10 sec delay"
-dels="$del1\n$del2\n$del3"
-
-## DELAY FUNCTION ##
-delays() {
- del=$(echo -e "$dels" | dmenu -b -l 3 -i -p "Select: ");
- case $del in
- $del1)
- scrot -d 3 && notify-send "Screenshot saved";;
- $del2)
- scrot -d 5 && notify-send "Screenshot saved";;
- $del3)
- scrot -d 10 && notify-send "Screenshot saved"
- esac
-}
-
-## ENTIRE SCREEN FUNCTION ##
-screen() {
- scrot && notify-send "Screenshot saved"
-}
-
-## FOCUSED WINDOW FUNCTION
-window() {
- scrot -u -b && notify-send "Screenshot saved."
-}
-
-## SELECTED AREA FUNCTION ##
-area() {
- scrot -s && notify-send "Screenshot saved."
-}
-
-## MAIN ACTION ##
-choice=$(echo -e "$chos" | dmenu -b -l 4 -i -p "Select: ")
-case $choice in
- $cho1)
- screen;;
- $cho2)
- delays;;
- $cho3)
- window;;
- $cho4)
- area
-esac
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_wall b/user/.config/suckless/dmenu/scripts/dmenu_wall
deleted file mode 100755
index a87f9f205..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_wall
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env bash
-
-# ***This script was made by Clay Gomera (Drake)***
-# - Description: A simple wallpaper changer script
-# - Dependencies: dmenu, fd, feh
-
-## MAIN VARIABLES AND COMMANDS ##
-walldir="Pictures/Wallpapers/" # wallpapers folder, change it to yours, make sure that it ends with a /
-cd "$walldir" || exit
-
-## SELECT PICTURE FUNCTION ##
-selectpic() {
- wallpaper=$(fd -p "$walldir" | dmenu -l 10 -b -i -p "Select a wallpaper:")
- if [ "$wallpaper" ]; then
- chosenwall=$wallpaper
- else
- exit 0
- fi
-}
-selectpic
-
-## WALLPAPER SETTING OPTIONS ##
-option1="Fill"
-option2="Center"
-option3="Tile"
-option4="Max"
-option5="Scale"
-options="$option1\n$option2\n$option3\n$option4\n$option5"
-
-## MAIN ACTION ##
-action=$(echo -e "$options" | dmenu -l 10 -b -i -p "Chose the format:")
-case "$action" in
- $option1*)
- feh --bg-fill "$chosenwall";;
- $option2*)
- feh --bg-center "$chosenwall";;
- $option3*)
- feh --bg-tile "$chosenwall";;
- $option4*)
- feh --bg-max "$chosenwall";;
- $option5*)
- feh --bg-scale "$chosenwall";;
-esac
-exit 0
diff --git a/user/.config/suckless/dmenu/scripts/dmenu_wifi b/user/.config/suckless/dmenu/scripts/dmenu_wifi
deleted file mode 100755
index eb1aa0003..000000000
--- a/user/.config/suckless/dmenu/scripts/dmenu_wifi
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env bash
-
-# ***This script was made by Clay Gomera (Drake)***
-# - Description: A simple wifi dmenu script
-# - Dependencies: dmenu, NetworkManager
-
-## DMENU VARIABLES ##
-DMENU1="dmenu -l 10 -b -i -p"
-DMENU2="dmenu -b -p"
-DMENU3="dmenu -l 5 -b -i -p"
-
-## MAIN OPTIONS ##
-option1="Turn on WiFi"
-option2="Turn off WiFi"
-option3="Disconnect WiFi"
-option4="Connect WiFi"
-option5="Setup captive portal"
-option6="Exit"
-options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
-
-wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1)
-## TURN OFF WIFI FUNCTION ##
-turnoff() {
- nmcli radio wifi off
- notify-send "WiFi has been turned off"
-}
-
-## TURN ON WIFI FUNCTION ##
-turnon() {
- nmcli radio wifi on
- notify-send "WiFi has been turned on"
-}
-
-## DISCONNECT WIFI FUNCTION ##
-disconnect() {
- nmcli device disconnect "$wlan"
- sleep 1
- constate=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f3 | head -1)
- if [ "$constate" = "disconnected" ]; then
- notify-send "WiFi has been disconnected"
- fi
-}
-
-## CONNECT FUNCTION ##
-connect() {
- notify-send "Scannig networks, please wait"
- sleep 1
- bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | $DMENU1 "Select Wifi :" | cut -d' ' -f1)
- }
-
-## SELECT PASSWORD FUNCTION ##
-password() {
- pass=$(echo " " | $DMENU2 "Enter Password :")
- }
-
-## MAIN CONNECTION COMMAND ##
-action() {
- nmcli device wifi connect "$bssid" password "$pass" || nmcli device wifi connect "$bssid"
- }
-
-## CHECKING IF WIFI IS WORKING
-check() {
- notify-send "Checking if connection was successful"
- sleep 1
- currentwfi=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f4 | head -1)
- if ping -q -c 2 -W 2 google.com >/dev/null; then
- notify-send "You are now connected to $currentwfi and internet is working properly"
- else
- notify-send "Your internet is not working :("
- fi
-}
-
-## MAIN ACTION COMMANDS ##
-cases=$(echo -e "$options" | $DMENU3 "What do you want to do?" )
-case "$cases" in
- $option1*)
- turnon;;
- $option2*)
- turnoff;;
- $option3*)
- disconnect;;
- $option4*)
- connect;
- password;
- action;
- check;;
- $option5*)
- io.elementary.capnet-assist;;
- $option6*)
- exit 0
-esac
diff --git a/user/.config/suckless/dmenu/stest.1 b/user/.config/suckless/dmenu/stest.1
deleted file mode 100644
index 2667d8aa7..000000000
--- a/user/.config/suckless/dmenu/stest.1
+++ /dev/null
@@ -1,90 +0,0 @@
-.TH STEST 1 dmenu\-VERSION
-.SH NAME
-stest \- filter a list of files by properties
-.SH SYNOPSIS
-.B stest
-.RB [ -abcdefghlpqrsuwx ]
-.RB [ -n
-.IR file ]
-.RB [ -o
-.IR file ]
-.RI [ file ...]
-.SH DESCRIPTION
-.B stest
-takes a list of files and filters by the files' properties, analogous to
-.IR test (1).
-Files which pass all tests are printed to stdout. If no files are given, stest
-reads files from stdin.
-.SH OPTIONS
-.TP
-.B \-a
-Test hidden files.
-.TP
-.B \-b
-Test that files are block specials.
-.TP
-.B \-c
-Test that files are character specials.
-.TP
-.B \-d
-Test that files are directories.
-.TP
-.B \-e
-Test that files exist.
-.TP
-.B \-f
-Test that files are regular files.
-.TP
-.B \-g
-Test that files have their set-group-ID flag set.
-.TP
-.B \-h
-Test that files are symbolic links.
-.TP
-.B \-l
-Test the contents of a directory given as an argument.
-.TP
-.BI \-n " file"
-Test that files are newer than
-.IR file .
-.TP
-.BI \-o " file"
-Test that files are older than
-.IR file .
-.TP
-.B \-p
-Test that files are named pipes.
-.TP
-.B \-q
-No files are printed, only the exit status is returned.
-.TP
-.B \-r
-Test that files are readable.
-.TP
-.B \-s
-Test that files are not empty.
-.TP
-.B \-u
-Test that files have their set-user-ID flag set.
-.TP
-.B \-v
-Invert the sense of tests, only failing files pass.
-.TP
-.B \-w
-Test that files are writable.
-.TP
-.B \-x
-Test that files are executable.
-.SH EXIT STATUS
-.TP
-.B 0
-At least one file passed all tests.
-.TP
-.B 1
-No files passed all tests.
-.TP
-.B 2
-An error occurred.
-.SH SEE ALSO
-.IR dmenu (1),
-.IR test (1)
diff --git a/user/.config/suckless/dmenu/stest.c b/user/.config/suckless/dmenu/stest.c
deleted file mode 100644
index e27d3a5e5..000000000
--- a/user/.config/suckless/dmenu/stest.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "arg.h"
-char *argv0;
-
-#define FLAG(x) (flag[(x)-'a'])
-
-static void test(const char *, const char *);
-static void usage(void);
-
-static int match = 0;
-static int flag[26];
-static struct stat old, new;
-
-static void
-test(const char *path, const char *name)
-{
- struct stat st, ln;
-
- if ((!stat(path, &st) && (FLAG('a') || name[0] != '.') /* hidden files */
- && (!FLAG('b') || S_ISBLK(st.st_mode)) /* block special */
- && (!FLAG('c') || S_ISCHR(st.st_mode)) /* character special */
- && (!FLAG('d') || S_ISDIR(st.st_mode)) /* directory */
- && (!FLAG('e') || access(path, F_OK) == 0) /* exists */
- && (!FLAG('f') || S_ISREG(st.st_mode)) /* regular file */
- && (!FLAG('g') || st.st_mode & S_ISGID) /* set-group-id flag */
- && (!FLAG('h') || (!lstat(path, &ln) && S_ISLNK(ln.st_mode))) /* symbolic link */
- && (!FLAG('n') || st.st_mtime > new.st_mtime) /* newer than file */
- && (!FLAG('o') || st.st_mtime < old.st_mtime) /* older than file */
- && (!FLAG('p') || S_ISFIFO(st.st_mode)) /* named pipe */
- && (!FLAG('r') || access(path, R_OK) == 0) /* readable */
- && (!FLAG('s') || st.st_size > 0) /* not empty */
- && (!FLAG('u') || st.st_mode & S_ISUID) /* set-user-id flag */
- && (!FLAG('w') || access(path, W_OK) == 0) /* writable */
- && (!FLAG('x') || access(path, X_OK) == 0)) != FLAG('v')) { /* executable */
- if (FLAG('q'))
- exit(0);
- match = 1;
- puts(name);
- }
-}
-
-static void
-usage(void)
-{
- fprintf(stderr, "usage: %s [-abcdefghlpqrsuvwx] "
- "[-n file] [-o file] [file...]\n", argv0);
- exit(2); /* like test(1) return > 1 on error */
-}
-
-int
-main(int argc, char *argv[])
-{
- struct dirent *d;
- char path[PATH_MAX], *line = NULL, *file;
- size_t linesiz = 0;
- ssize_t n;
- DIR *dir;
- int r;
-
- ARGBEGIN {
- case 'n': /* newer than file */
- case 'o': /* older than file */
- file = EARGF(usage());
- if (!(FLAG(ARGC()) = !stat(file, (ARGC() == 'n' ? &new : &old))))
- perror(file);
- break;
- default:
- /* miscellaneous operators */
- if (strchr("abcdefghlpqrsuvwx", ARGC()))
- FLAG(ARGC()) = 1;
- else
- usage(); /* unknown flag */
- } ARGEND;
-
- if (!argc) {
- /* read list from stdin */
- while ((n = getline(&line, &linesiz, stdin)) > 0) {
- if (line[n - 1] == '\n')
- line[n - 1] = '\0';
- test(line, line);
- }
- free(line);
- } else {
- for (; argc; argc--, argv++) {
- if (FLAG('l') && (dir = opendir(*argv))) {
- /* test directory contents */
- while ((d = readdir(dir))) {
- r = snprintf(path, sizeof path, "%s/%s",
- *argv, d->d_name);
- if (r >= 0 && (size_t)r < sizeof path)
- test(path, d->d_name);
- }
- closedir(dir);
- } else {
- test(*argv, *argv);
- }
- }
- }
- return match ? 0 : 1;
-}
diff --git a/user/.config/suckless/dmenu/util.c b/user/.config/suckless/dmenu/util.c
deleted file mode 100644
index fe044fc7b..000000000
--- a/user/.config/suckless/dmenu/util.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-
-#include "util.h"
-
-void *
-ecalloc(size_t nmemb, size_t size)
-{
- void *p;
-
- if (!(p = calloc(nmemb, size)))
- die("calloc:");
- return p;
-}
-
-void
-die(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
-
- if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
- fputc(' ', stderr);
- perror(NULL);
- } else {
- fputc('\n', stderr);
- }
-
- exit(1);
-}
diff --git a/user/.config/suckless/dmenu/util.h b/user/.config/suckless/dmenu/util.h
deleted file mode 100644
index 531ab2578..000000000
--- a/user/.config/suckless/dmenu/util.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#ifndef MAX
-#define MAX(A, B) ((A) > (B) ? (A) : (B))
-#endif
-#ifndef MIN
-#define MIN(A, B) ((A) < (B) ? (A) : (B))
-#endif
-#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
-
-void die(const char *fmt, ...);
-void *ecalloc(size_t nmemb, size_t size);
diff --git a/user/.config/suckless/dwm/Makefile b/user/.config/suckless/dwm/Makefile
deleted file mode 100644
index 0f88833bb..000000000
--- a/user/.config/suckless/dwm/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-## ____ __ ##
-## / __ \_________ _/ /_____ ##
-## / / / / ___/ __ `/ //_/ _ \ ##
-## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake) ##
-## /_____/_/ \__,_/_/|_|\___/ My custom dwm build ##
-
-# dwm - dynamic window manager
-
-include config.mk
-
-SRC = drw.c dwm.c util.c
-OBJ = ${SRC:.c=.o}
-
-all: options dwm
-
-options:
- @echo dwm build options:
- @echo "CFLAGS = ${CFLAGS}"
- @echo "LDFLAGS = ${LDFLAGS}"
- @echo "CC = ${CC}"
-
-.c.o:
- ${CC} -c ${CFLAGS} $<
-
-${OBJ}: config.h config.mk
-
-config.h:
- cp config.def.h $@
-
-dwm: ${OBJ}
- ${CC} -o $@ ${OBJ} ${LDFLAGS}
-
-clean:
- rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
-
-dist: clean
- mkdir -p dwm-${VERSION}
- cp -R LICENSE Makefile README config.def.h config.mk\
- dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
- tar -cf dwm-${VERSION}.tar dwm-${VERSION}
- gzip dwm-${VERSION}.tar
- rm -rf dwm-${VERSION}
-
-install: all
- mkdir -p ${DESTDIR}${PREFIX}/bin
- cp -f dwm ${DESTDIR}${PREFIX}/bin
- chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
- mkdir -p ${DESTDIR}${MANPREFIX}/man1
- sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
- chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
-
-uninstall:
- rm -f ${DESTDIR}${PREFIX}/bin/dwm\
- ${DESTDIR}${MANPREFIX}/man1/dwm.1\
-
-.PHONY: all options clean dist install uninstall
diff --git a/user/.config/suckless/dwm/autostart.sh b/user/.config/suckless/dwm/autostart.sh
deleted file mode 100755
index b1f992a2c..000000000
--- a/user/.config/suckless/dwm/autostart.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-## ____ __ ##
-## / __ \_________ _/ /_____ ##
-## / / / / ___/ __ `/ //_/ _ \ ##
-## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake) ##
-## /_____/_/ \__,_/_/|_|\___/ My custom dwm build ##
-
-lxsession &
-dwmblocks &
-sh "$HOME"/.fehbg &
-picom --experimental-backends --config ~/.config/picom/picom.conf &
-unclutter --hide-on-touch &
-dunst --config ~/.config/dunst/dunstrc &
diff --git a/user/.config/suckless/dwm/config.def.h b/user/.config/suckless/dwm/config.def.h
deleted file mode 100644
index 1373685cd..000000000
--- a/user/.config/suckless/dwm/config.def.h
+++ /dev/null
@@ -1,322 +0,0 @@
-/* ____ __ */
-/* / __ \_________ _/ /_____ */
-/* / / / / ___/ __ `/ //_/ _ \ */
-/* / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake) */
-/* /_____/_/ \__,_/_/|_|\___/ My custom dwm build */
-
-// APPEARANCE
-static const unsigned int borderpx = 2; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const unsigned int gappx = 6; /* pixel gap between clients */
-static const int showbar = 1; /* 0 means no bar */
-static const int topbar = 1; /* 0 means bottom bar */
-static const int horizpadbar = 6; /* horizontal padding for statusbar */
-static const int vertpadbar = 7; /* vertical padding for statusbar */
-static const char *fonts[] = {"CaskaydiaCove Nerd Font:size=8:antialias=true:autohint=true"};
-static const char col_1[] = "#1d2021"; /* background color of bar */
-static const char col_2[] = "#928374"; /* border color unfocused windows */
-static const char col_3[] = "#fbf1c7";
-static const char col_4[] = "#cc241d"; /* border color focused windows and tags */
-
-/* bar opacity
- * 0xff is no transparency.
- * 0xee adds wee bit of transparency.
- * 0xdd adds adds a bit more transparency.
- * Play with the value to get desired transparency.
- */
-static const unsigned int baralpha = 0xff;
-static const unsigned int borderalpha = OPAQUE;
-static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { col_3, col_1, col_2 },
- [SchemeSel] = { col_3, col_4, col_4 },
-};
-static const unsigned int alphas[][3] = {
- /* fg bg border */
- [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
- [SchemeSel] = { OPAQUE, baralpha, borderalpha },
-};
-
-// SCRATCHPADS
-typedef struct {
- const char *name;
- const void *cmd;
-} Sp;
-const char *spcmd1[] = {"alacritty", "-t", "sptrm", "--class", "sptrm,sptrm", NULL };
-const char *spcmd2[] = {"alacritty", "-t", "sptop", "--class", "sptop,sptop", "-e", "btop", NULL };
-const char *spcmd3[] = {"alacritty", "-t", "spfli", "--class", "spfli,spfli", "-e", "flix-cli", NULL };
-const char *spcmd4[] = {"alacritty", "-t", "spani", "--class", "spani,spani", "-e", "ani-cli", NULL };
-const char *spcmd5[] = {"alacritty", "-t", "spytf", "--class", "spytf,spytf", "-e", "ytfzf", "-flst", NULL };
-const char *spcmd6[] = {"alacritty", "-t", "spamx", "--class", "spamx,spamx", "-e", "alsamixer", NULL };
-const char *spcmd7[] = {"alacritty", "-t", "sppmx", "--class", "sppmx,sppmx", "-e", "pulsemixer", NULL };
-static Sp scratchpads[] = {
- /* name cmd */
- {"sptrm", spcmd1},
- {"sptop", spcmd2},
- {"spfli", spcmd3},
- {"spani", spcmd4},
- {"spytf", spcmd5},
- {"spamx", spcmd6},
- {"sppmx", spcmd7},
-};
-
-// TAG NAMES
-static const char *tags[] = { "🇪", "🇫", "🇼", "🇨", "🇲", "🇻", "🇽", "🇩", "🇬" };
-
-// RULES
-static const Rule rules[] = {
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
- // class instance title tags mask isfloating monitor
- // NO WORKSPACE
- { "Galculator", NULL, NULL, 0, 1, -1 },
- // E WORKSPACE
- { "Emacs", NULL, NULL, 1, 0, -1 },
- { "Godot", NULL, NULL, 1, 0, -1 },
- { "Virt-manager", NULL, NULL, 1, 0, -1 },
- // F WORKSPACE
- { "vifm", NULL, NULL, 1 << 1, 0, -1 },
- // W WORKSPACE
- { "librewolf", NULL, NULL, 1 << 2, 0, -1 },
- { "qutebrowser", NULL, NULL, 1 << 2, 0, -1 },
- // C WORKSPACE
- { "gomuks", NULL, NULL, 1 << 3, 0, -1 },
- // M WORKSPACE
- { "Audacity", NULL, NULL, 1 << 4, 0, -1 },
- { "Ardour", NULL, NULL, 1 << 4, 0, -1 },
- { "Carla2", NULL, NULL, 1 << 4, 0, -1 },
- { "Carla2-Control", NULL, NULL, 1 << 4, 0, -1 },
- // V WORKSPACE
- { "kdenlive", NULL, NULL, 1 << 5, 0, -1 },
- { "Blender", NULL, NULL, 1 << 5, 0, -1 },
- { "Natron", NULL, NULL, 1 << 5, 0, -1 },
- { "SimpleScreenRecorder", NULL, NULL, 1 << 5, 0, -1 },
- { "Ghb", NULL, NULL, 1 << 5, 0, -1 },
- { "obs", NULL, NULL, 1 << 5, 0, -1 },
- { "mpv", NULL, NULL, 1 << 5, 0, -1 },
- // X WORKSPACE
- { "QjackCtl", NULL, NULL, 1 << 6, 1, -1 },
- { "lsp-plugins", NULL, NULL, 1 << 6, 1, -1 },
- { "qpwgraph", NULL, NULL, 1 << 6, 0, -1 },
- { "Gimp-2.10", NULL, NULL, 1 << 6, 0, -1 },
- { "krita", NULL, NULL, 1 << 6, 0, -1 },
- { "Inkscape", NULL, NULL, 1 << 6, 0, -1 },
- { "Xournalpp", NULL, NULL, 1 << 6, 0, -1 },
- // D WORKSPACE
- { "DesktopEditors", NULL, NULL, 1 << 7, 0, -1 },
- // G WORKSPACE
- { "retroarch", NULL, NULL, 1 << 8, 0, -1 },
- // SCRATCHPADS
- { NULL, "sptrm", NULL, SPTAG(0), 1, -1 },
- { NULL, "sptop", NULL, SPTAG(1), 1, -1 },
- { NULL, "spfli", NULL, SPTAG(2), 1, -1 },
- { NULL, "spani", NULL, SPTAG(3), 1, -1 },
- { NULL, "spytf", NULL, SPTAG(4), 1, -1 },
- { NULL, "spamx", NULL, SPTAG(5), 1, -1 },
- { NULL, "sppmx", NULL, SPTAG(6), 1, -1 },
-};
-
-// LAYOUTS
-static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */
-static const int nmaster = 1; /* number of clients in master area */
-static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
-static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
-#include "grid.c"
-#include "tcl.c"
-#include "fbc.c"
-#include "tlwide.c"
-static const Layout layouts[] = {
- // symbol arrange function
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
- { "HHH", grid },
- { "|||", tcl },
- { "[@]", spiral },
- { "[\\]", dwindle },
- { "[][]=", tilewide },
- { NULL, NULL },
-};
-
-
-// VARIABLES
-/* key definitions */
-#define MODKEY Mod4Mask
-#define TAGKEYS(KEY,TAG) \
- {1, {{MODKEY, KEY}}, view, {.ui = 1 << TAG} }, \
- {1, {{MODKEY|ControlMask, KEY}}, toggleview, {.ui = 1 << TAG} }, \
- {1, {{MODKEY|ShiftMask, KEY}}, tag, {.ui = 1 << TAG} }, \
- {1, {{MODKEY|ControlMask|ShiftMask, KEY}}, toggletag, {.ui = 1 << TAG} },
-/* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
-/* dmenu */
-static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
-static const char *dmenucmd[] = { "dmenu_run", "-i", "-b", "-l", "10", "-p", "Run: ", NULL };
-/* terminal */
-static const char *termcmd[] = { "alacritty", NULL };
-
-
-// KEY BIDINGS
-static Keychord keychords[] = {
-/* modifier chain key key function argument */
-
-// Terminal
- {1, {{MODKEY, XK_Return}}, spawn, {.v = termcmd } },
-
-// Top bar toggle
- {1, {{MODKEY|ControlMask, XK_b}}, togglebar, {0} },
-
-// Windows, tags and layouts manipulation
- // Tag Bindings
- TAGKEYS( XK_1, 0)
- TAGKEYS( XK_2, 1)
- TAGKEYS( XK_3, 2)
- TAGKEYS( XK_4, 3)
- TAGKEYS( XK_5, 4)
- TAGKEYS( XK_6, 5)
- TAGKEYS( XK_7, 6)
- TAGKEYS( XK_8, 7)
- TAGKEYS( XK_9, 8)
- // Close Window
- {1, {{MODKEY, XK_q}}, killclient, {0} },
- // Cycle between tags
- {1, {{MODKEY|ControlMask, XK_Tab}}, view, {0} },
- // Window moving
- {1, {{MODKEY|ShiftMask, XK_j}}, rotatestack, {.i = +1 } },
- {1, {{MODKEY|ShiftMask, XK_k}}, rotatestack, {.i = -1 } },
- // Window focusing
- {1, {{MODKEY, XK_j}}, focusstack, {.i = +1 } },
- {1, {{MODKEY, XK_k}}, focusstack, {.i = -1 } },
- // Increase and decrease master windows count
- {1, {{MODKEY, XK_equal}}, incnmaster, {.i = +1 } },
- {1, {{MODKEY, XK_minus}}, incnmaster, {.i = -1 } },
- // Increase and decrease master window size
- {1, {{MODKEY, XK_h}}, setmfact, {.f = -0.05} },
- {1, {{MODKEY, XK_l}}, setmfact, {.f = +0.05} },
- // Move window to master
- {1, {{MODKEY|ControlMask, XK_Return}}, zoom, {0} },
- // Cycle between layouts fowards and backwards
- {1, {{ MODKEY, XK_Tab}}, cyclelayout, {.i = -1 } },
- {1, {{ MODKEY|ShiftMask, XK_Tab}}, cyclelayout, {.i = +1 } },
- // Switch to tiling layout
- {1, {{MODKEY, XK_t}}, setlayout, {.v = &layouts[0]} },
- // Switch to floating layout
- {1, {{MODKEY, XK_f}}, setlayout, {.v = &layouts[1]} },
- // Switch to monocle layout
- {1, {{MODKEY, XK_m}}, setlayout, {.v = &layouts[2]} },
- // Switch to grid layout
- {1, {{MODKEY, XK_g}}, setlayout, {.v = &layouts[3]} },
- // Switch to three column layout
- {1, {{MODKEY, XK_c}}, setlayout, {.v = &layouts[4]} },
- // Switch to fibonacci spiral layout
- {1, {{MODKEY, XK_s}}, setlayout, {.v = &layouts[5]} },
- // Switch to fibonacci dwindle layout
- {1, {{MODKEY, XK_d}}, setlayout, {.v = &layouts[6]} },
- // Switch to tilewide layout
- {1, {{MODKEY|ControlMask, XK_t}}, setlayout, {.v = &layouts[7]} },
- // Toggle floating mode
- {1, {{MODKEY|ControlMask, XK_f}}, togglefloating, {0} },
- // Toggle fullscreen mode
- {1, {{MODKEY, XK_space}}, togglefullscr, {0} },
- // View all windows of all tags in the current tag
- {1, {{MODKEY, XK_0}}, view, {.ui = ~0 } },
- // Show focused window on all tags
- {1, {{MODKEY|ShiftMask, XK_0}}, tag, {.ui = ~0 } },
- // Focusing between monitors */
- {1, {{MODKEY, XK_comma}}, focusmon, {.i = -1 } },
- {1, {{MODKEY, XK_period}}, focusmon, {.i = +1 } },
- // Move focused window between monitors
- {1, {{MODKEY|ShiftMask, XK_comma}}, tagmon, {.i = -1 } },
- {1, {{MODKEY|ShiftMask, XK_period}}, tagmon, {.i = +1 } },
-
-// Volume control
- // Toggle mute
- {1, {{MODKEY, XK_F1}}, spawn, SHCMD("pamixer -t") },
- // Decrease volume by 5%
- {1, {{MODKEY, XK_F2}}, spawn, SHCMD("pamixer -d 5") },
- // Increase volume by 5%
- {1, {{MODKEY, XK_F3}}, spawn, SHCMD("pamixer -i 5") },
- // Toggle microphone mute
- {1, {{MODKEY, XK_F4}}, spawn, SHCMD("pamixer --default-source -t") },
-
-// Brightness control
- // Decrease brightness by 5%
- {1, {{MODKEY, XK_F5}}, spawn, SHCMD("xbacklight -dec 10") },
- // Increase brightness by 5%
- {1, {{MODKEY, XK_F6}}, spawn, SHCMD("xbacklight -inc 10") },
-
-// Monitor settings
- {1, {{MODKEY, XK_F7}}, spawn, SHCMD("arandr") },
-
-// KEYBOARD LAYOUTS changed with emacs-style keychords SUPER + k (keyboard) followed by "key"
- // Switch to the spanish keyboard layout
- {2, {{MODKEY, XK_x}, {0, XK_e}}, spawn, SHCMD("setxkbmap -layout es") },
- // Switch to the english keyboard layout
- {2, {{MODKEY, XK_x}, {0, XK_u}}, spawn, SHCMD("setxkbmap -layout us") },
-
-// PROGRAMS launched with emacs-style keychords SUPER + a (LETTER) followed by "key"
- // Emacs
- {2, {{MODKEY, XK_a}, {0, XK_e}}, spawn, SHCMD("emacsclient -c -a 'emacs'") },
- // File manager
- {2, {{MODKEY, XK_a}, {0, XK_f}}, spawn, SHCMD("alacritty -t exp --class vifm,vifm -e $HOME/.config/vifm/scripts/vifmrun") },
- // Web browser
- {2, {{MODKEY, XK_a}, {0, XK_w}}, spawn, SHCMD("qutebrowser") },
- // Chat
- {2, {{MODKEY, XK_a}, {0, XK_c}}, spawn, SHCMD("alacritty -t exp --class gomuks,gomuks -e gomuks") },
- // Audio
- {2, {{MODKEY, XK_a}, {0, XK_m}}, spawn, SHCMD("alacritty -t exp --class cmus,cmus -e cmus") },
-
-// DMENU PROMPTS launched with emacs-style keychords SUPER + p (prompt) followed by "key"
- // dmenu
- {2, {{MODKEY, XK_p}, {0, XK_r}}, spawn, {.v = dmenucmd } },
- // dmenu_power
- {2, {{MODKEY, XK_p}, {0, XK_q}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_power") },
- // dmenu_wifi
- {2, {{MODKEY, XK_p}, {0, XK_i}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_wifi") },
- // dmenu_wall
- {2, {{MODKEY, XK_p}, {0, XK_w}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_wall") },
- // dmenu_edit
- {2, {{MODKEY, XK_p}, {0, XK_e}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_edit") },
- // dmenu_scrot
- {2, {{MODKEY, XK_p}, {0, XK_s}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_scrot") },
- // dmenu_drun
- {2, {{MODKEY, XK_p}, {0, XK_d}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_drun") },
- // dmenu_blue
- {2, {{MODKEY, XK_p}, {0, XK_b}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_blue") },
- // dmenu_emoji
- {2, {{MODKEY, XK_p}, {0, XK_z}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_emoji") },
- // dmenu_pipe
- {2, {{MODKEY, XK_p}, {0, XK_p}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_pipe") },
-
-// Scratchpads
- {1, {{MODKEY|ShiftMask, XK_Return}}, togglescratch, {.ui = 0 } },
- {1, {{MODKEY|ShiftMask, XK_b}}, togglescratch, {.ui = 1 } },
- {1, {{MODKEY|ShiftMask, XK_f}}, togglescratch, {.ui = 2 } },
- {1, {{MODKEY|ShiftMask, XK_a}}, togglescratch, {.ui = 3 } },
- {1, {{MODKEY|ShiftMask, XK_y}}, togglescratch, {.ui = 4 } },
- {1, {{MODKEY|ShiftMask, XK_m}}, togglescratch, {.ui = 5 } },
- {1, {{MODKEY|ShiftMask, XK_p}}, togglescratch, {.ui = 6 } },
-
-// DWM BOOTSTRAP
- {1, {{MODKEY|ControlMask, XK_r}}, quit, {1} },
-// {1, {{MODKEY|ShiftMask, XK_q}}, quit, {0} },
-};
-
-/* button definitions */
-/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
-static Button buttons[] = {
- /* click event mask button function argument */
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
- { ClkWinTitle, 0, Button2, zoom, {0} },
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
- { ClkClientWin, MODKEY, Button1, movemouse, {0} },
- { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
- { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
- { ClkTagBar, 0, Button1, view, {0} },
- { ClkTagBar, 0, Button3, toggleview, {0} },
- { ClkTagBar, MODKEY, Button1, tag, {0} },
- { ClkTagBar, MODKEY, Button3, toggletag, {0} },
-};
diff --git a/user/.config/suckless/dwm/config.mk b/user/.config/suckless/dwm/config.mk
deleted file mode 100644
index a7bf37f9c..000000000
--- a/user/.config/suckless/dwm/config.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-## ____ __ ##
-## / __ \_________ _/ /_____ ##
-## / / / / ___/ __ `/ //_/ _ \ ##
-## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake) ##
-## /_____/_/ \__,_/_/|_|\___/ My custom dwm build ##
-
-# dwm version
-VERSION = 6.2
-
-# Customize below to fit your system
-
-# paths
-PREFIX = /usr
-MANPREFIX = ${PREFIX}/share/man
-
-X11INC = /usr/X11R6/include
-X11LIB = /usr/X11R6/lib
-
-# Xinerama, comment if you don't want it
-XINERAMALIBS = -lXinerama
-XINERAMAFLAGS = -DXINERAMA
-
-# freetype
-FREETYPELIBS = -lfontconfig -lXft
-FREETYPEINC = /usr/include/freetype2
-# OpenBSD (uncomment)
-#FREETYPEINC = ${X11INC}/freetype2
-
-# includes and libs
-INCS = -I${X11INC} -I${FREETYPEINC}
-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender
-
-# flags
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
-#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
-CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
-LDFLAGS = ${LIBS}
-
-# Solaris
-#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
-#LDFLAGS = ${LIBS}
-
-# compiler and linker
-CC = cc
diff --git a/user/.config/suckless/dwm/drw.c b/user/.config/suckless/dwm/drw.c
deleted file mode 100644
index 801b35541..000000000
--- a/user/.config/suckless/dwm/drw.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-#include
-
-#include "drw.h"
-#include "util.h"
-
-#define UTF_INVALID 0xFFFD
-#define UTF_SIZ 4
-
-static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
-static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
-static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000};
-static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
-
-static long
-utf8decodebyte(const char c, size_t *i)
-{
- for (*i = 0; *i < (UTF_SIZ + 1); ++(*i))
- if (((unsigned char)c & utfmask[*i]) == utfbyte[*i])
- return (unsigned char)c & ~utfmask[*i];
- return 0;
-}
-
-static size_t
-utf8validate(long *u, size_t i)
-{
- if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF))
- *u = UTF_INVALID;
- for (i = 1; *u > utfmax[i]; ++i)
- ;
- return i;
-}
-
-static size_t
-utf8decode(const char *c, long *u, size_t clen)
-{
- size_t i, j, len, type;
- long udecoded;
-
- *u = UTF_INVALID;
- if (!clen)
- return 0;
- udecoded = utf8decodebyte(c[0], &len);
- if (!BETWEEN(len, 1, UTF_SIZ))
- return 1;
- for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
- udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type);
- if (type)
- return j;
- }
- if (j < len)
- return 0;
- *u = udecoded;
- utf8validate(u, len);
-
- return len;
-}
-
-Drw *
-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
-{
- Drw *drw = ecalloc(1, sizeof(Drw));
-
- drw->dpy = dpy;
- drw->screen = screen;
- drw->root = root;
- drw->w = w;
- drw->h = h;
- drw->visual = visual;
- drw->depth = depth;
- drw->cmap = cmap;
- drw->drawable = XCreatePixmap(dpy, root, w, h, depth);
- drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL);
- XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
-
- return drw;
-}
-
-void
-drw_resize(Drw *drw, unsigned int w, unsigned int h)
-{
- if (!drw)
- return;
-
- drw->w = w;
- drw->h = h;
- if (drw->drawable)
- XFreePixmap(drw->dpy, drw->drawable);
- drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
-}
-
-void
-drw_free(Drw *drw)
-{
- XFreePixmap(drw->dpy, drw->drawable);
- XFreeGC(drw->dpy, drw->gc);
- drw_fontset_free(drw->fonts);
- free(drw);
-}
-
-/* This function is an implementation detail. Library users should use
- * drw_fontset_create instead.
- */
-static Fnt *
-xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
-{
- Fnt *font;
- XftFont *xfont = NULL;
- FcPattern *pattern = NULL;
-
- if (fontname) {
- /* Using the pattern found at font->xfont->pattern does not yield the
- * same substitution results as using the pattern returned by
- * FcNameParse; using the latter results in the desired fallback
- * behaviour whereas the former just results in missing-character
- * rectangles being drawn, at least with some fonts. */
- if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
- fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
- return NULL;
- }
- if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
- fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
- XftFontClose(drw->dpy, xfont);
- return NULL;
- }
- } else if (fontpattern) {
- if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
- fprintf(stderr, "error, cannot load font from pattern.\n");
- return NULL;
- }
- } else {
- die("no font specified.");
- }
-
- /* Do not allow using color fonts. This is a workaround for a BadLength
- * error from Xft with color glyphs. Modelled on the Xterm workaround. See
- * https://bugzilla.redhat.com/show_bug.cgi?id=1498269
- * https://lists.suckless.org/dev/1701/30932.html
- * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
- * and lots more all over the internet.
- */
- FcBool iscol;
- if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
- XftFontClose(drw->dpy, xfont);
- return NULL;
- }
-
- font = ecalloc(1, sizeof(Fnt));
- font->xfont = xfont;
- font->pattern = pattern;
- font->h = xfont->ascent + xfont->descent;
- font->dpy = drw->dpy;
-
- return font;
-}
-
-static void
-xfont_free(Fnt *font)
-{
- if (!font)
- return;
- if (font->pattern)
- FcPatternDestroy(font->pattern);
- XftFontClose(font->dpy, font->xfont);
- free(font);
-}
-
-Fnt*
-drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
-{
- Fnt *cur, *ret = NULL;
- size_t i;
-
- if (!drw || !fonts)
- return NULL;
-
- for (i = 1; i <= fontcount; i++) {
- if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
- cur->next = ret;
- ret = cur;
- }
- }
- return (drw->fonts = ret);
-}
-
-void
-drw_fontset_free(Fnt *font)
-{
- if (font) {
- drw_fontset_free(font->next);
- xfont_free(font);
- }
-}
-
-void
-drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
-{
- if (!drw || !dest || !clrname)
- return;
-
- if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
- clrname, dest))
- die("error, cannot allocate color '%s'", clrname);
-
- dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
-}
-
-/* Wrapper to create color schemes. The caller has to call free(3) on the
- * returned color scheme when done using it. */
-Clr *
-drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
-{
- size_t i;
- Clr *ret;
-
- /* need at least two colors for a scheme */
- if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
- return NULL;
-
- for (i = 0; i < clrcount; i++)
- drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
- return ret;
-}
-
-void
-drw_setfontset(Drw *drw, Fnt *set)
-{
- if (drw)
- drw->fonts = set;
-}
-
-void
-drw_setscheme(Drw *drw, Clr *scm)
-{
- if (drw)
- drw->scheme = scm;
-}
-
-void
-drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)
-{
- if (!drw || !drw->scheme)
- return;
- XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
- if (filled)
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- else
- XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
-}
-
-int
-drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert)
-{
- int i, ty, ellipsis_x = 0;
- unsigned int tmpw, ew, ellipsis_w = 0, ellipsis_len;
- XftDraw *d = NULL;
- Fnt *usedfont, *curfont, *nextfont;
- int utf8strlen, utf8charlen, render = x || y || w || h;
- long utf8codepoint = 0;
- const char *utf8str;
- FcCharSet *fccharset;
- FcPattern *fcpattern;
- FcPattern *match;
- XftResult result;
- int charexists = 0, overflow = 0;
- /* keep track of a couple codepoints for which we have no match. */
- enum { nomatches_len = 64 };
- static struct { long codepoint[nomatches_len]; unsigned int idx; } nomatches;
- static unsigned int ellipsis_width = 0;
-
- if (!drw || (render && (!drw->scheme || !w)) || !text || !drw->fonts)
- return 0;
-
- if (!render) {
- w = invert ? invert : ~invert;
- } else {
- XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
- XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
- x += lpad;
- w -= lpad;
- }
-
- usedfont = drw->fonts;
- if (!ellipsis_width && render)
- ellipsis_width = drw_fontset_getwidth(drw, "...");
- while (1) {
- ew = ellipsis_len = utf8strlen = 0;
- utf8str = text;
- nextfont = NULL;
- while (*text) {
- utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
- for (curfont = drw->fonts; curfont; curfont = curfont->next) {
- charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
- if (charexists) {
- drw_font_getexts(curfont, text, utf8charlen, &tmpw, NULL);
- if (ew + ellipsis_width <= w) {
- /* keep track where the ellipsis still fits */
- ellipsis_x = x + ew;
- ellipsis_w = w - ew;
- ellipsis_len = utf8strlen;
- }
-
- if (ew + tmpw > w) {
- overflow = 1;
- /* called from drw_fontset_getwidth_clamp():
- * it wants the width AFTER the overflow
- */
- if (!render)
- x += tmpw;
- else
- utf8strlen = ellipsis_len;
- } else if (curfont == usedfont) {
- utf8strlen += utf8charlen;
- text += utf8charlen;
- ew += tmpw;
- } else {
- nextfont = curfont;
- }
- break;
- }
- }
-
- if (overflow || !charexists || nextfont)
- break;
- else
- charexists = 0;
- }
-
- if (utf8strlen) {
- if (render) {
- ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
- XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg],
- usedfont->xfont, x, ty, (XftChar8 *)utf8str, utf8strlen);
- }
- x += ew;
- w -= ew;
- }
- if (render && overflow)
- drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert);
-
- if (!*text || overflow) {
- break;
- } else if (nextfont) {
- charexists = 0;
- usedfont = nextfont;
- } else {
- /* Regardless of whether or not a fallback font is found, the
- * character must be drawn. */
- charexists = 1;
-
- for (i = 0; i < nomatches_len; ++i) {
- /* avoid calling XftFontMatch if we know we won't find a match */
- if (utf8codepoint == nomatches.codepoint[i])
- goto no_match;
- }
-
- fccharset = FcCharSetCreate();
- FcCharSetAddChar(fccharset, utf8codepoint);
-
- if (!drw->fonts->pattern) {
- /* Refer to the comment in xfont_create for more information. */
- die("the first font in the cache must be loaded from a font string.");
- }
-
- fcpattern = FcPatternDuplicate(drw->fonts->pattern);
- FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
- FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
- FcPatternAddBool(fcpattern, FC_COLOR, FcFalse);
-
- FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
- FcDefaultSubstitute(fcpattern);
- match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
-
- FcCharSetDestroy(fccharset);
- FcPatternDestroy(fcpattern);
-
- if (match) {
- usedfont = xfont_create(drw, NULL, match);
- if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
- for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
- ; /* NOP */
- curfont->next = usedfont;
- } else {
- xfont_free(usedfont);
- nomatches.codepoint[++nomatches.idx % nomatches_len] = utf8codepoint;
-no_match:
- usedfont = drw->fonts;
- }
- }
- }
- }
- if (d)
- XftDrawDestroy(d);
-
- return x + (render ? w : 0);
-}
-
-void
-drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
-{
- if (!drw)
- return;
-
- XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
- XSync(drw->dpy, False);
-}
-
-unsigned int
-drw_fontset_getwidth(Drw *drw, const char *text)
-{
- if (!drw || !drw->fonts || !text)
- return 0;
- return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
-}
-
-unsigned int
-drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n)
-{
- unsigned int tmp = 0;
- if (drw && drw->fonts && text && n)
- tmp = drw_text(drw, 0, 0, 0, 0, 0, text, n);
- return MIN(n, tmp);
-}
-
-void
-drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h)
-{
- XGlyphInfo ext;
-
- if (!font || !text)
- return;
-
- XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
- if (w)
- *w = ext.xOff;
- if (h)
- *h = font->h;
-}
-
-Cur *
-drw_cur_create(Drw *drw, int shape)
-{
- Cur *cur;
-
- if (!drw || !(cur = ecalloc(1, sizeof(Cur))))
- return NULL;
-
- cur->cursor = XCreateFontCursor(drw->dpy, shape);
-
- return cur;
-}
-
-void
-drw_cur_free(Drw *drw, Cur *cursor)
-{
- if (!cursor)
- return;
-
- XFreeCursor(drw->dpy, cursor->cursor);
- free(cursor);
-}
diff --git a/user/.config/suckless/dwm/drw.h b/user/.config/suckless/dwm/drw.h
deleted file mode 100644
index 94b8bbd19..000000000
--- a/user/.config/suckless/dwm/drw.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-typedef struct {
- Cursor cursor;
-} Cur;
-
-typedef struct Fnt {
- Display *dpy;
- unsigned int h;
- XftFont *xfont;
- FcPattern *pattern;
- struct Fnt *next;
-} Fnt;
-
-enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */
-typedef XftColor Clr;
-
-typedef struct {
- unsigned int w, h;
- Display *dpy;
- int screen;
- Window root;
- Visual *visual;
- unsigned int depth;
- Colormap cmap;
- Drawable drawable;
- GC gc;
- Clr *scheme;
- Fnt *fonts;
-} Drw;
-
-/* Drawable abstraction */
-Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap);
-void drw_resize(Drw *drw, unsigned int w, unsigned int h);
-void drw_free(Drw *drw);
-
-/* Fnt abstraction */
-Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
-void drw_fontset_free(Fnt* set);
-unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
-unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n);
-void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
-
-/* Colorscheme abstraction */
-void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
-Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
-
-/* Cursor abstraction */
-Cur *drw_cur_create(Drw *drw, int shape);
-void drw_cur_free(Drw *drw, Cur *cursor);
-
-/* Drawing context manipulation */
-void drw_setfontset(Drw *drw, Fnt *set);
-void drw_setscheme(Drw *drw, Clr *scm);
-
-/* Drawing functions */
-void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
-int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
-
-/* Map functions */
-void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
diff --git a/user/.config/suckless/dwm/dwm.1 b/user/.config/suckless/dwm/dwm.1
deleted file mode 100644
index ab3967c32..000000000
--- a/user/.config/suckless/dwm/dwm.1
+++ /dev/null
@@ -1,218 +0,0 @@
-.TH DWM 1 dwm\-VERSION
-.SH NAME
-dwm \- dynamic window manager
-.SH SYNOPSIS
-.B dwm
-.RB [ \-v ]
-.SH DESCRIPTION
-dwm is a dynamic window manager for X. It manages windows in tiled, monocle
-and floating layouts. Either layout can be applied dynamically, optimising the
-environment for the application in use and the task performed.
-.P
-In tiled layouts windows are managed in a master and stacking area. The master
-area on the left contains one window by default, and the stacking area on the
-right contains all other windows. The number of master area windows can be
-adjusted from zero to an arbitrary number. In monocle layout all windows are
-maximised to the screen size. In floating layout windows can be resized and
-moved freely. Dialog windows are always managed floating, regardless of the
-layout applied.
-.P
-Windows are grouped by tags. Each window can be tagged with one or multiple
-tags. Selecting certain tags displays all windows with these tags.
-.P
-Each screen contains a small status bar which displays all available tags, the
-layout, the title of the focused window, and the text read from the root window
-name property, if the screen is focused. A floating window is indicated with an
-empty square and a maximised floating window is indicated with a filled square
-before the windows title. The selected tags are indicated with a different
-color. The tags of the focused window are indicated with a filled square in the
-top left corner. The tags which are applied to one or more windows are
-indicated with an empty square in the top left corner.
-.P
-dwm draws a small border around windows to indicate the focus state.
-.P
-On start, dwm can start additional programs that may be specified in two special
-shell scripts (see the FILES section below), autostart_blocking.sh and
-autostart.sh. The former is executed first and dwm will wait for its
-termination before starting. The latter is executed in the background before
-dwm enters its handler loop.
-.P
-Either of these files may be omitted.
-.SH OPTIONS
-.TP
-.B \-v
-prints version information to stderr, then exits.
-.SH USAGE
-.SS Status bar
-.TP
-.B X root window name
-is read and displayed in the status text area. It can be set with the
-.BR xsetroot (1)
-command.
-.TP
-.B Button1
-click on a tag label to display all windows with that tag, click on the layout
-label toggles between tiled and floating layout.
-.TP
-.B Button3
-click on a tag label adds/removes all windows with that tag to/from the view.
-.TP
-.B Mod1\-Button1
-click on a tag label applies that tag to the focused window.
-.TP
-.B Mod1\-Button3
-click on a tag label adds/removes that tag to/from the focused window.
-.SS Keyboard commands
-.TP
-.B Mod1\-Shift\-Return
-Start
-.BR st(1).
-.TP
-.B Mod1\-p
-Spawn
-.BR dmenu(1)
-for launching other programs.
-.TP
-.B Mod1\-,
-Focus previous screen, if any.
-.TP
-.B Mod1\-.
-Focus next screen, if any.
-.TP
-.B Mod1\-Shift\-,
-Send focused window to previous screen, if any.
-.TP
-.B Mod1\-Shift\-.
-Send focused window to next screen, if any.
-.TP
-.B Mod1\-b
-Toggles bar on and off.
-.TP
-.B Mod1\-t
-Sets tiled layout.
-.TP
-.B Mod1\-f
-Sets floating layout.
-.TP
-.B Mod1\-m
-Sets monocle layout.
-.TP
-.B Mod1\-space
-Toggles between current and previous layout.
-.TP
-.B Mod1\-Control\-,
-Cycles backwards in layout list.
-.TP
-.B Mod1\-Control\-.
-Cycles forwards in layout list.
-.TP
-.B Mod1\-j
-Focus next window.
-.TP
-.B Mod1\-k
-Focus previous window.
-.TP
-.B Mod1\-i
-Increase number of windows in master area.
-.TP
-.B Mod1\-d
-Decrease number of windows in master area.
-.TP
-.B Mod1\-l
-Increase master area size.
-.TP
-.B Mod1\-h
-Decrease master area size.
-.TP
-.B Mod1\-Return
-Zooms/cycles focused window to/from master area (tiled layouts only).
-.TP
-.B Mod1\-Shift\-c
-Close focused window.
-.TP
-.B Mod1\-Shift\-f
-Toggle fullscreen for focused window.
-.TP
-.B Mod1\-Shift\-space
-Toggle focused window between tiled and floating state.
-.TP
-.B Mod1\-Tab
-Toggles to the previously selected tags.
-.TP
-.B Mod1\-Shift\-[1..n]
-Apply nth tag to focused window.
-.TP
-.B Mod1\-Shift\-0
-Apply all tags to focused window.
-.TP
-.B Mod1\-Control\-Shift\-[1..n]
-Add/remove nth tag to/from focused window.
-.TP
-.B Mod1\-[1..n]
-View all windows with nth tag.
-.TP
-.B Mod1\-0
-View all windows with any tag.
-.TP
-.B Mod1\-Control\-[1..n]
-Add/remove all windows with nth tag to/from the view.
-.TP
-.B Mod1\-Shift\-q
-Quit dwm.
-.TP
-.B Mod1\-Control\-Shift\-q
-Restart dwm.
-.SS Mouse commands
-.TP
-.B Mod1\-Button1
-Move focused window while dragging. Tiled windows will be toggled to the floating state.
-.TP
-.B Mod1\-Button2
-Toggles focused window between floating and tiled state.
-.TP
-.B Mod1\-Button3
-Resize focused window while dragging. Tiled windows will be toggled to the floating state.
-.SH FILES
-The files containing programs to be started along with dwm are searched for in
-the following directories:
-.IP "1. $XDG_DATA_HOME/dwm"
-.IP "2. $HOME/.local/share/dwm"
-.IP "3. $HOME/.dwm"
-.P
-The first existing directory is scanned for any of the autostart files below.
-.TP 15
-autostart.sh
-This file is started as a shell background process before dwm enters its handler
-loop.
-.TP 15
-autostart_blocking.sh
-This file is started before any autostart.sh; dwm waits for its termination.
-.SH CUSTOMIZATION
-dwm is customized by creating a custom config.h and (re)compiling the source
-code. This keeps it fast, secure and simple.
-.SH SIGNALS
-.TP
-.B SIGHUP - 1
-Restart the dwm process.
-.TP
-.B SIGTERM - 15
-Cleanly terminate the dwm process.
-.SH SEE ALSO
-.BR dmenu (1),
-.BR st (1)
-.SH ISSUES
-Java applications which use the XToolkit/XAWT backend may draw grey windows
-only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early
-JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds
-are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the
-environment variable
-.BR AWT_TOOLKIT=MToolkit
-(to use the older Motif backend instead) or running
-.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D
-or
-.B wmname LG3D
-(to pretend that a non-reparenting window manager is running that the
-XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable
-.BR _JAVA_AWT_WM_NONREPARENTING=1 .
-.SH BUGS
-Send all bug reports with a patch to hackers@suckless.org.
diff --git a/user/.config/suckless/dwm/dwm.c b/user/.config/suckless/dwm/dwm.c
deleted file mode 100644
index d8c6035a0..000000000
--- a/user/.config/suckless/dwm/dwm.c
+++ /dev/null
@@ -1,2510 +0,0 @@
-/* See LICENSE file for copyright and license details.
- *
- * dynamic window manager is designed like any other X client as well. It is
- * driven through handling X events. In contrast to other X clients, a window
- * manager selects for SubstructureRedirectMask on the root window, to receive
- * events about window (dis-)appearance. Only one X connection at a time is
- * allowed to select for this event mask.
- *
- * The event handlers of dwm are organized in an array which is accessed
- * whenever a new event has been fetched. This allows event dispatching
- * in O(1) time.
- *
- * Each child of the root window is called a client, except windows which have
- * set the override_redirect flag. Clients are organized in a linked client
- * list on each monitor, the focus history is remembered through a stack list
- * on each monitor. Each client contains a bit array to indicate the tags of a
- * client.
- *
- * Keys and tagging rules are organized as arrays and defined in config.h.
- *
- * To understand everything else, start reading main().
- */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#ifdef XINERAMA
-#include
-#endif /* XINERAMA */
-#include
-
-#include "drw.h"
-#include "util.h"
-
-/* macros */
-#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
-#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
-#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
- * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
-#define LENGTH(X) (sizeof X / sizeof X[0])
-#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
-#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx)
-#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx)
-#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads))
-#define TAGMASK ((1 << NUMTAGS) - 1)
-#define SPTAG(i) ((1 << LENGTH(tags)) << (i))
-#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags))
-#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
-
-#define OPAQUE 0xffU
-
-/* enums */
-enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeSel }; /* color schemes */
-enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
- NetWMFullscreen, NetActiveWindow, NetWMWindowType,
- NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
-enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
-enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
- ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
-
-typedef union {
- int i;
- unsigned int ui;
- float f;
- const void *v;
-} Arg;
-
-typedef struct {
- unsigned int click;
- unsigned int mask;
- unsigned int button;
- void (*func)(const Arg *arg);
- const Arg arg;
-} Button;
-
-typedef struct Monitor Monitor;
-typedef struct Client Client;
-struct Client {
- char name[256];
- float mina, maxa;
- int x, y, w, h;
- int oldx, oldy, oldw, oldh;
- int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid;
- int bw, oldbw;
- unsigned int tags;
- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
- Client *next;
- Client *snext;
- Monitor *mon;
- Window win;
-};
-
-typedef struct {
- unsigned int mod;
- KeySym keysym;
-} Key;
-
-typedef struct {
- unsigned int n;
- const Key keys[5];
- void (*func)(const Arg *);
- const Arg arg;
-} Keychord;
-
-typedef struct {
- const char *symbol;
- void (*arrange)(Monitor *);
-} Layout;
-
-typedef struct Pertag Pertag;
-struct Monitor {
- char ltsymbol[16];
- float mfact;
- int nmaster;
- int num;
- int by; /* bar geometry */
- int mx, my, mw, mh; /* screen size */
- int wx, wy, ww, wh; /* window area */
- unsigned int seltags;
- unsigned int sellt;
- unsigned int tagset[2];
- int showbar;
- int topbar;
- Client *clients;
- Client *sel;
- Client *stack;
- Monitor *next;
- Window barwin;
- const Layout *lt[2];
- Pertag *pertag;
-};
-
-typedef struct {
- const char *class;
- const char *instance;
- const char *title;
- unsigned int tags;
- int isfloating;
- int monitor;
-} Rule;
-
-/* function declarations */
-static void applyrules(Client *c);
-static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
-static void arrange(Monitor *m);
-static void arrangemon(Monitor *m);
-static void attach(Client *c);
-static void attachbottom(Client *c);
-static void attachstack(Client *c);
-static void buttonpress(XEvent *e);
-static void checkotherwm(void);
-static void cleanup(void);
-static void cleanupmon(Monitor *mon);
-static void clientmessage(XEvent *e);
-static void configure(Client *c);
-static void configurenotify(XEvent *e);
-static void configurerequest(XEvent *e);
-static Monitor *createmon(void);
-static void cyclelayout(const Arg *arg);
-static void destroynotify(XEvent *e);
-static void detach(Client *c);
-static void detachstack(Client *c);
-static Monitor *dirtomon(int dir);
-static void drawbar(Monitor *m);
-static void drawbars(void);
-static void enqueue(Client *c);
-static void enqueuestack(Client *c);
-static void enternotify(XEvent *e);
-static void expose(XEvent *e);
-static void focus(Client *c);
-static void focusin(XEvent *e);
-static void focusmon(const Arg *arg);
-static void focusstack(const Arg *arg);
-static Atom getatomprop(Client *c, Atom prop);
-static int getrootptr(int *x, int *y);
-static long getstate(Window w);
-static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
-static void grabbuttons(Client *c, int focused);
-static void grabkeys(void);
-static void incnmaster(const Arg *arg);
-static void keypress(XEvent *e);
-static void killclient(const Arg *arg);
-static void manage(Window w, XWindowAttributes *wa);
-static void mappingnotify(XEvent *e);
-static void maprequest(XEvent *e);
-static void monocle(Monitor *m);
-static void motionnotify(XEvent *e);
-static void movemouse(const Arg *arg);
-static Client *nexttiled(Client *c);
-static void pop(Client *);
-static void propertynotify(XEvent *e);
-static void quit(const Arg *arg);
-static Monitor *recttomon(int x, int y, int w, int h);
-static void resize(Client *c, int x, int y, int w, int h, int interact);
-static void resizeclient(Client *c, int x, int y, int w, int h);
-static void resizemouse(const Arg *arg);
-static void restack(Monitor *m);
-static void rotatestack(const Arg *arg);
-static void run(void);
-static void runAutostart(void);
-static void scan(void);
-static int sendevent(Client *c, Atom proto);
-static void sendmon(Client *c, Monitor *m);
-static void setclientstate(Client *c, long state);
-static void setfocus(Client *c);
-static void setfullscreen(Client *c, int fullscreen);
-static void setlayout(const Arg *arg);
-static void setmfact(const Arg *arg);
-static void setup(void);
-static void seturgent(Client *c, int urg);
-static void showhide(Client *c);
-static void sigchld(int unused);
-static void sighup(int unused);
-static void sigterm(int unused);
-static void spawn(const Arg *arg);
-static void tag(const Arg *arg);
-static void tagmon(const Arg *arg);
-static void tile(Monitor *);
-static void togglebar(const Arg *arg);
-static void togglefloating(const Arg *arg);
-static void togglescratch(const Arg *arg);
-static void togglefullscr(const Arg *arg);
-static void toggletag(const Arg *arg);
-static void toggleview(const Arg *arg);
-static void unfocus(Client *c, int setfocus);
-static void unmanage(Client *c, int destroyed);
-static void unmapnotify(XEvent *e);
-static void updatebarpos(Monitor *m);
-static void updatebars(void);
-static void updateclientlist(void);
-static int updategeom(void);
-static void updatenumlockmask(void);
-static void updatesizehints(Client *c);
-static void updatestatus(void);
-static void updatetitle(Client *c);
-static void updatewindowtype(Client *c);
-static void updatewmhints(Client *c);
-static void view(const Arg *arg);
-static Client *wintoclient(Window w);
-static Monitor *wintomon(Window w);
-static int xerror(Display *dpy, XErrorEvent *ee);
-static int xerrordummy(Display *dpy, XErrorEvent *ee);
-static int xerrorstart(Display *dpy, XErrorEvent *ee);
-static void xinitvisual();
-static void zoom(const Arg *arg);
-
-/* variables */
-static const char broken[] = "broken";
-static char stext[256];
-static int screen;
-static int sw, sh; /* X display screen geometry width, height */
-static int bh, blw = 0; /* bar geometry */
-static int lrpad; /* sum of left and right padding for text */
-static int (*xerrorxlib)(Display *, XErrorEvent *);
-static unsigned int numlockmask = 0;
-static void (*handler[LASTEvent]) (XEvent *) = {
- [ButtonPress] = buttonpress,
- [ClientMessage] = clientmessage,
- [ConfigureRequest] = configurerequest,
- [ConfigureNotify] = configurenotify,
- [DestroyNotify] = destroynotify,
- [EnterNotify] = enternotify,
- [Expose] = expose,
- [FocusIn] = focusin,
- [KeyPress] = keypress,
- [MappingNotify] = mappingnotify,
- [MapRequest] = maprequest,
- [MotionNotify] = motionnotify,
- [PropertyNotify] = propertynotify,
- [UnmapNotify] = unmapnotify
-};
-static Atom wmatom[WMLast], netatom[NetLast];
-static int restart = 0;
-static int running = 1;
-static Cur *cursor[CurLast];
-static Clr **scheme;
-static Display *dpy;
-static Drw *drw;
-static Monitor *mons, *selmon;
-static Window root, wmcheckwin;
-unsigned int currentkey = 0;
-
-static int useargb = 0;
-static Visual *visual;
-static int depth;
-static Colormap cmap;
-
-/* configuration, allows nested code to access above variables */
-#include "config.h"
-
-struct Pertag {
- unsigned int curtag, prevtag; /* current and previous tag */
- int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
- float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
- unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
- const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
- int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
-};
-
-/* compile-time check if all tags fit into an unsigned int bit array. */
-struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
-
-/* function implementations */
-void
-applyrules(Client *c)
-{
- const char *class, *instance;
- unsigned int i;
- const Rule *r;
- Monitor *m;
- XClassHint ch = { NULL, NULL };
-
- /* rule matching */
- c->isfloating = 0;
- c->tags = 0;
- XGetClassHint(dpy, c->win, &ch);
- class = ch.res_class ? ch.res_class : broken;
- instance = ch.res_name ? ch.res_name : broken;
-
- for (i = 0; i < LENGTH(rules); i++) {
- r = &rules[i];
- if ((!r->title || strstr(c->name, r->title))
- && (!r->class || strstr(class, r->class))
- && (!r->instance || strstr(instance, r->instance)))
- {
- c->isfloating = r->isfloating;
- c->tags |= r->tags;
- if ((r->tags & SPTAGMASK) && r->isfloating) {
- c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2);
- c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
- }
- for (m = mons; m && m->num != r->monitor; m = m->next);
- if (m)
- c->mon = m;
- }
- }
- if (ch.res_class)
- XFree(ch.res_class);
- if (ch.res_name)
- XFree(ch.res_name);
- c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : (c->mon->tagset[c->mon->seltags] & ~SPTAGMASK);
-}
-
-int
-applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact)
-{
- int baseismin;
- Monitor *m = c->mon;
-
- /* set minimum possible */
- *w = MAX(1, *w);
- *h = MAX(1, *h);
- if (interact) {
- if (*x > sw)
- *x = sw - WIDTH(c);
- if (*y > sh)
- *y = sh - HEIGHT(c);
- if (*x + *w + 2 * c->bw < 0)
- *x = 0;
- if (*y + *h + 2 * c->bw < 0)
- *y = 0;
- } else {
- if (*x >= m->wx + m->ww)
- *x = m->wx + m->ww - WIDTH(c);
- if (*y >= m->wy + m->wh)
- *y = m->wy + m->wh - HEIGHT(c);
- if (*x + *w + 2 * c->bw <= m->wx)
- *x = m->wx;
- if (*y + *h + 2 * c->bw <= m->wy)
- *y = m->wy;
- }
- if (*h < bh)
- *h = bh;
- if (*w < bh)
- *w = bh;
- if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) {
- if (!c->hintsvalid)
- updatesizehints(c);
- /* see last two sentences in ICCCM 4.1.2.3 */
- baseismin = c->basew == c->minw && c->baseh == c->minh;
- if (!baseismin) { /* temporarily remove base dimensions */
- *w -= c->basew;
- *h -= c->baseh;
- }
- /* adjust for aspect limits */
- if (c->mina > 0 && c->maxa > 0) {
- if (c->maxa < (float)*w / *h)
- *w = *h * c->maxa + 0.5;
- else if (c->mina < (float)*h / *w)
- *h = *w * c->mina + 0.5;
- }
- if (baseismin) { /* increment calculation requires this */
- *w -= c->basew;
- *h -= c->baseh;
- }
- /* adjust for increment value */
- if (c->incw)
- *w -= *w % c->incw;
- if (c->inch)
- *h -= *h % c->inch;
- /* restore base dimensions */
- *w = MAX(*w + c->basew, c->minw);
- *h = MAX(*h + c->baseh, c->minh);
- if (c->maxw)
- *w = MIN(*w, c->maxw);
- if (c->maxh)
- *h = MIN(*h, c->maxh);
- }
- return *x != c->x || *y != c->y || *w != c->w || *h != c->h;
-}
-
-void
-arrange(Monitor *m)
-{
- if (m)
- showhide(m->stack);
- else for (m = mons; m; m = m->next)
- showhide(m->stack);
- if (m) {
- arrangemon(m);
- restack(m);
- } else for (m = mons; m; m = m->next)
- arrangemon(m);
-}
-
-void
-arrangemon(Monitor *m)
-{
- strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
- if (m->lt[m->sellt]->arrange)
- m->lt[m->sellt]->arrange(m);
-}
-
-void
-attach(Client *c)
-{
- c->next = c->mon->clients;
- c->mon->clients = c;
-}
-
-void
-attachbottom(Client *c)
-{
- Client **tc;
- c->next = NULL;
- for (tc = &c->mon->clients; *tc; tc = &(*tc)->next);
- *tc = c;
-}
-
-void
-attachstack(Client *c)
-{
- c->snext = c->mon->stack;
- c->mon->stack = c;
-}
-
-void
-buttonpress(XEvent *e)
-{
- unsigned int i, x, click;
- Arg arg = {0};
- Client *c;
- Monitor *m;
- XButtonPressedEvent *ev = &e->xbutton;
-
- click = ClkRootWin;
- /* focus monitor if necessary */
- if ((m = wintomon(ev->window)) && m != selmon) {
- unfocus(selmon->sel, 1);
- selmon = m;
- focus(NULL);
- }
- if (ev->window == selmon->barwin) {
- i = x = 0;
- do
- x += TEXTW(tags[i]);
- while (ev->x >= x && ++i < LENGTH(tags));
- if (i < LENGTH(tags)) {
- click = ClkTagBar;
- arg.ui = 1 << i;
- } else if (ev->x < x + blw)
- click = ClkLtSymbol;
- else if (ev->x > selmon->ww - (int)TEXTW(stext))
- click = ClkStatusText;
- else
- click = ClkWinTitle;
- } else if ((c = wintoclient(ev->window))) {
- focus(c);
- restack(selmon);
- XAllowEvents(dpy, ReplayPointer, CurrentTime);
- click = ClkClientWin;
- }
- for (i = 0; i < LENGTH(buttons); i++)
- if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
- && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
- buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
-}
-
-void
-checkotherwm(void)
-{
- xerrorxlib = XSetErrorHandler(xerrorstart);
- /* this causes an error if some other window manager is running */
- XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask);
- XSync(dpy, False);
- XSetErrorHandler(xerror);
- XSync(dpy, False);
-}
-
-void
-cleanup(void)
-{
- Arg a = {.ui = ~0};
- Layout foo = { "", NULL };
- Monitor *m;
- size_t i;
-
- view(&a);
- selmon->lt[selmon->sellt] = &foo;
- for (m = mons; m; m = m->next)
- while (m->stack)
- unmanage(m->stack, 0);
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- while (mons)
- cleanupmon(mons);
- for (i = 0; i < CurLast; i++)
- drw_cur_free(drw, cursor[i]);
- for (i = 0; i < LENGTH(colors); i++)
- free(scheme[i]);
- free(scheme);
- XDestroyWindow(dpy, wmcheckwin);
- drw_free(drw);
- XSync(dpy, False);
- XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
- XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
-}
-
-void
-cleanupmon(Monitor *mon)
-{
- Monitor *m;
-
- if (mon == mons)
- mons = mons->next;
- else {
- for (m = mons; m && m->next != mon; m = m->next);
- m->next = mon->next;
- }
- XUnmapWindow(dpy, mon->barwin);
- XDestroyWindow(dpy, mon->barwin);
- free(mon);
-}
-
-void
-clientmessage(XEvent *e)
-{
- XClientMessageEvent *cme = &e->xclient;
- Client *c = wintoclient(cme->window);
-
- if (!c)
- return;
- if (cme->message_type == netatom[NetWMState]) {
- if (cme->data.l[1] == netatom[NetWMFullscreen]
- || cme->data.l[2] == netatom[NetWMFullscreen])
- setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
- || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
- } else if (cme->message_type == netatom[NetActiveWindow]) {
- if (c != selmon->sel && !c->isurgent)
- seturgent(c, 1);
- }
-}
-
-void
-configure(Client *c)
-{
- XConfigureEvent ce;
-
- ce.type = ConfigureNotify;
- ce.display = dpy;
- ce.event = c->win;
- ce.window = c->win;
- ce.x = c->x;
- ce.y = c->y;
- ce.width = c->w;
- ce.height = c->h;
- ce.border_width = c->bw;
- ce.above = None;
- ce.override_redirect = False;
- XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
-}
-
-void
-configurenotify(XEvent *e)
-{
- Monitor *m;
- Client *c;
- XConfigureEvent *ev = &e->xconfigure;
- int dirty;
-
- /* TODO: updategeom handling sucks, needs to be simplified */
- if (ev->window == root) {
- dirty = (sw != ev->width || sh != ev->height);
- sw = ev->width;
- sh = ev->height;
- if (updategeom() || dirty) {
- drw_resize(drw, sw, bh);
- updatebars();
- for (m = mons; m; m = m->next) {
- for (c = m->clients; c; c = c->next)
- if (c->isfullscreen)
- resizeclient(c, m->mx, m->my, m->mw, m->mh);
- XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
- }
- focus(NULL);
- arrange(NULL);
- }
- }
-}
-
-void
-configurerequest(XEvent *e)
-{
- Client *c;
- Monitor *m;
- XConfigureRequestEvent *ev = &e->xconfigurerequest;
- XWindowChanges wc;
-
- if ((c = wintoclient(ev->window))) {
- if (ev->value_mask & CWBorderWidth)
- c->bw = ev->border_width;
- else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) {
- m = c->mon;
- if (ev->value_mask & CWX) {
- c->oldx = c->x;
- c->x = m->mx + ev->x;
- }
- if (ev->value_mask & CWY) {
- c->oldy = c->y;
- c->y = m->my + ev->y;
- }
- if (ev->value_mask & CWWidth) {
- c->oldw = c->w;
- c->w = ev->width;
- }
- if (ev->value_mask & CWHeight) {
- c->oldh = c->h;
- c->h = ev->height;
- }
- if ((c->x + c->w) > m->mx + m->mw && c->isfloating)
- c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */
- if ((c->y + c->h) > m->my + m->mh && c->isfloating)
- c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */
- if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
- configure(c);
- if (ISVISIBLE(c))
- XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
- } else
- configure(c);
- } else {
- wc.x = ev->x;
- wc.y = ev->y;
- wc.width = ev->width;
- wc.height = ev->height;
- wc.border_width = ev->border_width;
- wc.sibling = ev->above;
- wc.stack_mode = ev->detail;
- XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
- }
- XSync(dpy, False);
-}
-
-Monitor *
-createmon(void)
-{
- Monitor *m;
- unsigned int i;
-
- m = ecalloc(1, sizeof(Monitor));
- m->tagset[0] = m->tagset[1] = 1;
- m->mfact = mfact;
- m->nmaster = nmaster;
- m->showbar = showbar;
- m->topbar = topbar;
- m->lt[0] = &layouts[0];
- m->lt[1] = &layouts[1 % LENGTH(layouts)];
- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
- m->pertag = ecalloc(1, sizeof(Pertag));
- m->pertag->curtag = m->pertag->prevtag = 1;
-
- for (i = 0; i <= LENGTH(tags); i++) {
- m->pertag->nmasters[i] = m->nmaster;
- m->pertag->mfacts[i] = m->mfact;
-
- m->pertag->ltidxs[i][0] = m->lt[0];
- m->pertag->ltidxs[i][1] = m->lt[1];
- m->pertag->sellts[i] = m->sellt;
-
- m->pertag->showbars[i] = m->showbar;
- }
-
- return m;
-}
-
-void
-cyclelayout(const Arg *arg) {
- Layout *l;
- for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++);
- if(arg->i > 0) {
- if(l->symbol && (l + 1)->symbol)
- setlayout(&((Arg) { .v = (l + 1) }));
- else
- setlayout(&((Arg) { .v = layouts }));
- } else {
- if(l != layouts && (l - 1)->symbol)
- setlayout(&((Arg) { .v = (l - 1) }));
- else
- setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] }));
- }
-}
-
-void
-destroynotify(XEvent *e)
-{
- Client *c;
- XDestroyWindowEvent *ev = &e->xdestroywindow;
-
- if ((c = wintoclient(ev->window)))
- unmanage(c, 1);
-}
-
-void
-detach(Client *c)
-{
- Client **tc;
-
- for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next);
- *tc = c->next;
-}
-
-void
-detachstack(Client *c)
-{
- Client **tc, *t;
-
- for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext);
- *tc = c->snext;
-
- if (c == c->mon->sel) {
- for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext);
- c->mon->sel = t;
- }
-}
-
-Monitor *
-dirtomon(int dir)
-{
- Monitor *m = NULL;
-
- if (dir > 0) {
- if (!(m = selmon->next))
- m = mons;
- } else if (selmon == mons)
- for (m = mons; m->next; m = m->next);
- else
- for (m = mons; m->next != selmon; m = m->next);
- return m;
-}
-
-void
-drawbar(Monitor *m)
-{
- int x, w, tw = 0;
- int boxs = drw->fonts->h / 9;
- int boxw = drw->fonts->h / 6 + 2;
- unsigned int i, occ = 0, urg = 0;
- Client *c;
-
- if (!m->showbar)
- return;
-
- /* draw status first so it can be overdrawn by tags later */
- if (m == selmon) { /* status is only drawn on selected monitor */
- drw_setscheme(drw, scheme[SchemeNorm]);
- tw = TEXTW(stext);
- drw_text(drw, m->ww - tw, 0, tw, bh, lrpad / 2, stext, 0);
- }
-
- for (c = m->clients; c; c = c->next) {
- occ |= c->tags;
- if (c->isurgent)
- urg |= c->tags;
- }
- x = 0;
- for (i = 0; i < LENGTH(tags); i++) {
- w = TEXTW(tags[i]);
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
- if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
- x += w;
- }
- w = blw = TEXTW(m->ltsymbol);
- drw_setscheme(drw, scheme[SchemeNorm]);
- x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
-
- if ((w = m->ww - tw - x) > bh) {
- if (m->sel) {
- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
- if (m->sel->isfloating)
- drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
- } else {
- drw_setscheme(drw, scheme[SchemeNorm]);
- drw_rect(drw, x, 0, w, bh, 1, 1);
- }
- }
- drw_map(drw, m->barwin, 0, 0, m->ww, bh);
-}
-
-void
-drawbars(void)
-{
- Monitor *m;
-
- for (m = mons; m; m = m->next)
- drawbar(m);
-}
-
-void
-enqueue(Client *c)
-{
- Client *l;
- for (l = c->mon->clients; l && l->next; l = l->next);
- if (l) {
- l->next = c;
- c->next = NULL;
- }
-}
-
-void
-enqueuestack(Client *c)
-{
- Client *l;
- for (l = c->mon->stack; l && l->snext; l = l->snext);
- if (l) {
- l->snext = c;
- c->snext = NULL;
- }
-}
-
-void
-enternotify(XEvent *e)
-{
- Client *c;
- Monitor *m;
- XCrossingEvent *ev = &e->xcrossing;
-
- if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
- return;
- c = wintoclient(ev->window);
- m = c ? c->mon : wintomon(ev->window);
- if (m != selmon) {
- unfocus(selmon->sel, 1);
- selmon = m;
- } else if (!c || c == selmon->sel)
- return;
- focus(c);
-}
-
-void
-expose(XEvent *e)
-{
- Monitor *m;
- XExposeEvent *ev = &e->xexpose;
-
- if (ev->count == 0 && (m = wintomon(ev->window)))
- drawbar(m);
-}
-
-void
-focus(Client *c)
-{
- if (!c || !ISVISIBLE(c))
- for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
- if (selmon->sel && selmon->sel != c)
- unfocus(selmon->sel, 0);
- if (c) {
- if (c->mon != selmon)
- selmon = c->mon;
- if (c->isurgent)
- seturgent(c, 0);
- detachstack(c);
- attachstack(c);
- grabbuttons(c, 1);
- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
- setfocus(c);
- } else {
- XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
- XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
- }
- selmon->sel = c;
- drawbars();
-}
-
-/* there are some broken focus acquiring clients needing extra handling */
-void
-focusin(XEvent *e)
-{
- XFocusChangeEvent *ev = &e->xfocus;
-
- if (selmon->sel && ev->window != selmon->sel->win)
- setfocus(selmon->sel);
-}
-
-void
-focusmon(const Arg *arg)
-{
- Monitor *m;
-
- if (!mons->next)
- return;
- if ((m = dirtomon(arg->i)) == selmon)
- return;
- unfocus(selmon->sel, 0);
- selmon = m;
- focus(NULL);
-}
-
-void
-focusstack(const Arg *arg)
-{
- Client *c = NULL, *i;
-
- if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
- return;
- if (arg->i > 0) {
- for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
- if (!c)
- for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
- } else {
- for (i = selmon->clients; i != selmon->sel; i = i->next)
- if (ISVISIBLE(i))
- c = i;
- if (!c)
- for (; i; i = i->next)
- if (ISVISIBLE(i))
- c = i;
- }
- if (c) {
- focus(c);
- restack(selmon);
- }
-}
-
-Atom
-getatomprop(Client *c, Atom prop)
-{
- int di;
- unsigned long dl;
- unsigned char *p = NULL;
- Atom da, atom = None;
-
- if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM,
- &da, &di, &dl, &dl, &p) == Success && p) {
- atom = *(Atom *)p;
- XFree(p);
- }
- return atom;
-}
-
-int
-getrootptr(int *x, int *y)
-{
- int di;
- unsigned int dui;
- Window dummy;
-
- return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui);
-}
-
-long
-getstate(Window w)
-{
- int format;
- long result = -1;
- unsigned char *p = NULL;
- unsigned long n, extra;
- Atom real;
-
- if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
- &real, &format, &n, &extra, (unsigned char **)&p) != Success)
- return -1;
- if (n != 0)
- result = *p;
- XFree(p);
- return result;
-}
-
-int
-gettextprop(Window w, Atom atom, char *text, unsigned int size)
-{
- char **list = NULL;
- int n;
- XTextProperty name;
-
- if (!text || size == 0)
- return 0;
- text[0] = '\0';
- if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems)
- return 0;
- if (name.encoding == XA_STRING)
- strncpy(text, (char *)name.value, size - 1);
- else {
- if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) {
- strncpy(text, *list, size - 1);
- XFreeStringList(list);
- }
- }
- text[size - 1] = '\0';
- XFree(name.value);
- return 1;
-}
-
-void
-grabbuttons(Client *c, int focused)
-{
- updatenumlockmask();
- {
- unsigned int i, j;
- unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
- XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
- if (!focused)
- XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
- BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
- for (i = 0; i < LENGTH(buttons); i++)
- if (buttons[i].click == ClkClientWin)
- for (j = 0; j < LENGTH(modifiers); j++)
- XGrabButton(dpy, buttons[i].button,
- buttons[i].mask | modifiers[j],
- c->win, False, BUTTONMASK,
- GrabModeAsync, GrabModeSync, None, None);
- }
-}
-
-void
-grabkeys(void)
-{
- updatenumlockmask();
- {
- unsigned int i, k;
- unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
- KeyCode code;
-
- XUngrabKey(dpy, AnyKey, AnyModifier, root);
- for (i = 0; i < LENGTH(keychords); i++)
- if ((code = XKeysymToKeycode(dpy, keychords[i].keys[currentkey].keysym)))
- for (k = 0; k < LENGTH(modifiers); k++)
- XGrabKey(dpy, code, keychords[i].keys[currentkey].mod | modifiers[k], root,
- True, GrabModeAsync, GrabModeAsync);
- }
-}
-
-void
-incnmaster(const Arg *arg)
-{
- selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
- arrange(selmon);
-}
-
-#ifdef XINERAMA
-static int
-isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
-{
- while (n--)
- if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org
- && unique[n].width == info->width && unique[n].height == info->height)
- return 0;
- return 1;
-}
-#endif /* XINERAMA */
-
-void
-keypress(XEvent *e)
-{
- XEvent event = *e;
- Keychord *keychord;
- unsigned int ran = 0;
- KeySym keysym;
- XKeyEvent *ev;
- Keychord *newoptions;
- Keychord *oldoptions = (Keychord *)malloc(sizeof(keychords));
-
- memcpy(oldoptions, keychords, sizeof(keychords));
- size_t numoption = 0;
- while(!ran){
- ev = &event.xkey;
- keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
- newoptions = (Keychord *)malloc(0);
- numoption = 0;
- for (keychord = oldoptions; keychord->n != 0 && currentkey < 5; keychord = (Keychord *)((char *)keychord + sizeof(Keychord))){
- if(keysym == keychord->keys[currentkey].keysym
- && CLEANMASK(keychord->keys[currentkey].mod) == CLEANMASK(ev->state)
- && keychord->func){
- if(keychord->n == currentkey +1){
- keychord->func(&(keychord->arg));
- ran = 1;
- }else{
- numoption++;
- newoptions = (Keychord *)realloc(newoptions, numoption * sizeof(Keychord));
- memcpy((char *)newoptions + (numoption -1) * sizeof(Keychord),keychord, sizeof(Keychord));
- }
- }
- }
- currentkey++;
- if(numoption == 0)
- break;
- grabkeys();
- while (running && !XNextEvent(dpy, &event) && !ran)
- if(event.type == KeyPress)
- break;
- free(oldoptions);
- oldoptions = newoptions;
- }
- free(newoptions);
- currentkey = 0;
- grabkeys();
-}
-
-void
-killclient(const Arg *arg)
-{
- if (!selmon->sel)
- return;
- if (!sendevent(selmon->sel, wmatom[WMDelete])) {
- XGrabServer(dpy);
- XSetErrorHandler(xerrordummy);
- XSetCloseDownMode(dpy, DestroyAll);
- XKillClient(dpy, selmon->sel->win);
- XSync(dpy, False);
- XSetErrorHandler(xerror);
- XUngrabServer(dpy);
- }
-}
-
-void
-manage(Window w, XWindowAttributes *wa)
-{
- Client *c, *t = NULL;
- Window trans = None;
- XWindowChanges wc;
-
- c = ecalloc(1, sizeof(Client));
- c->win = w;
- /* geometry */
- c->x = c->oldx = wa->x;
- c->y = c->oldy = wa->y;
- c->w = c->oldw = wa->width;
- c->h = c->oldh = wa->height;
- c->oldbw = wa->border_width;
-
- updatetitle(c);
- if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
- c->mon = t->mon;
- c->tags = t->tags;
- } else {
- c->mon = selmon;
- applyrules(c);
- }
-
- if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw)
- c->x = c->mon->mx + c->mon->mw - WIDTH(c);
- if (c->y + HEIGHT(c) > c->mon->my + c->mon->mh)
- c->y = c->mon->my + c->mon->mh - HEIGHT(c);
- c->x = MAX(c->x, c->mon->mx);
- /* only fix client y-offset, if the client center might cover the bar */
- c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
- && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
- c->bw = borderpx;
-
- wc.border_width = c->bw;
- XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
- configure(c); /* propagates border_width, if size doesn't change */
- updatewindowtype(c);
- updatesizehints(c);
- updatewmhints(c);
- XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
- grabbuttons(c, 0);
- if (!c->isfloating)
- c->isfloating = c->oldstate = trans != None || c->isfixed;
- if (c->isfloating)
- XRaiseWindow(dpy, c->win);
- attachbottom(c);
- attachstack(c);
- XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
- (unsigned char *) &(c->win), 1);
- XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
- setclientstate(c, NormalState);
- if (c->mon == selmon)
- unfocus(selmon->sel, 0);
- c->mon->sel = c;
- arrange(c->mon);
- XMapWindow(dpy, c->win);
- focus(NULL);
-}
-
-void
-mappingnotify(XEvent *e)
-{
- XMappingEvent *ev = &e->xmapping;
-
- XRefreshKeyboardMapping(ev);
- if (ev->request == MappingKeyboard)
- grabkeys();
-}
-
-void
-maprequest(XEvent *e)
-{
- static XWindowAttributes wa;
- XMapRequestEvent *ev = &e->xmaprequest;
-
- if (!XGetWindowAttributes(dpy, ev->window, &wa))
- return;
- if (wa.override_redirect)
- return;
- if (!wintoclient(ev->window))
- manage(ev->window, &wa);
-}
-
-void
-monocle(Monitor *m)
-{
- unsigned int n = 0;
- Client *c;
-
- for (c = m->clients; c; c = c->next)
- if (ISVISIBLE(c))
- n++;
- if (n > 0) /* override layout symbol */
- snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
- for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
-}
-
-void
-motionnotify(XEvent *e)
-{
- static Monitor *mon = NULL;
- Monitor *m;
- XMotionEvent *ev = &e->xmotion;
-
- if (ev->window != root)
- return;
- if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
- unfocus(selmon->sel, 1);
- selmon = m;
- focus(NULL);
- }
- mon = m;
-}
-
-void
-movemouse(const Arg *arg)
-{
- int x, y, ocx, ocy, nx, ny;
- Client *c;
- Monitor *m;
- XEvent ev;
- Time lasttime = 0;
-
- if (!(c = selmon->sel))
- return;
- if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
- return;
- restack(selmon);
- ocx = c->x;
- ocy = c->y;
- if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
- None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess)
- return;
- if (!getrootptr(&x, &y))
- return;
- do {
- XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
- switch(ev.type) {
- case ConfigureRequest:
- case Expose:
- case MapRequest:
- handler[ev.type](&ev);
- break;
- case MotionNotify:
- if ((ev.xmotion.time - lasttime) <= (1000 / 60))
- continue;
- lasttime = ev.xmotion.time;
-
- nx = ocx + (ev.xmotion.x - x);
- ny = ocy + (ev.xmotion.y - y);
- if (abs(selmon->wx - nx) < snap)
- nx = selmon->wx;
- else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap)
- nx = selmon->wx + selmon->ww - WIDTH(c);
- if (abs(selmon->wy - ny) < snap)
- ny = selmon->wy;
- else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap)
- ny = selmon->wy + selmon->wh - HEIGHT(c);
- if (!c->isfloating && selmon->lt[selmon->sellt]->arrange
- && (abs(nx - c->x) > snap || abs(ny - c->y) > snap))
- togglefloating(NULL);
- if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
- resize(c, nx, ny, c->w, c->h, 1);
- break;
- }
- } while (ev.type != ButtonRelease);
- XUngrabPointer(dpy, CurrentTime);
- if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
- sendmon(c, m);
- selmon = m;
- focus(NULL);
- }
-}
-
-Client *
-nexttiled(Client *c)
-{
- for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
- return c;
-}
-
-void
-pop(Client *c)
-{
- detach(c);
- attach(c);
- focus(c);
- arrange(c->mon);
-}
-
-void
-propertynotify(XEvent *e)
-{
- Client *c;
- Window trans;
- XPropertyEvent *ev = &e->xproperty;
-
- if ((ev->window == root) && (ev->atom == XA_WM_NAME))
- updatestatus();
- else if (ev->state == PropertyDelete)
- return; /* ignore */
- else if ((c = wintoclient(ev->window))) {
- switch(ev->atom) {
- default: break;
- case XA_WM_TRANSIENT_FOR:
- if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) &&
- (c->isfloating = (wintoclient(trans)) != NULL))
- arrange(c->mon);
- break;
- case XA_WM_NORMAL_HINTS:
- c->hintsvalid = 0;
- break;
- case XA_WM_HINTS:
- updatewmhints(c);
- drawbars();
- break;
- }
- if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
- updatetitle(c);
- if (c == c->mon->sel)
- drawbar(c->mon);
- }
- if (ev->atom == netatom[NetWMWindowType])
- updatewindowtype(c);
- }
-}
-
-void
-quit(const Arg *arg)
-{
- if(arg->i) restart = 1;
- running = 0;
-}
-
-Monitor *
-recttomon(int x, int y, int w, int h)
-{
- Monitor *m, *r = selmon;
- int a, area = 0;
-
- for (m = mons; m; m = m->next)
- if ((a = INTERSECT(x, y, w, h, m)) > area) {
- area = a;
- r = m;
- }
- return r;
-}
-
-void
-resize(Client *c, int x, int y, int w, int h, int interact)
-{
- if (applysizehints(c, &x, &y, &w, &h, interact))
- resizeclient(c, x, y, w, h);
-}
-
-void
-resizeclient(Client *c, int x, int y, int w, int h)
-{
- XWindowChanges wc;
- unsigned int n;
- unsigned int gapoffset;
- unsigned int gapincr;
- Client *nbc;
-
- wc.border_width = c->bw;
-
- /* Get number of clients for the client's monitor */
- for (n = 0, nbc = nexttiled(c->mon->clients); nbc; nbc = nexttiled(nbc->next), n++);
-
- /* Do nothing if layout is floating */
- if (c->isfloating || c->mon->lt[c->mon->sellt]->arrange == NULL) {
- gapincr = gapoffset = 0;
- } else {
- /* Remove border and gap if layout is monocle or only one client */
- if (c->mon->lt[c->mon->sellt]->arrange == monocle || n == 1) {
- gapoffset = 0;
- gapincr = -2 * borderpx;
- wc.border_width = 0;
- } else {
- gapoffset = gappx;
- gapincr = 2 * gappx;
- }
- }
-
- c->oldx = c->x; c->x = wc.x = x + gapoffset;
- c->oldy = c->y; c->y = wc.y = y + gapoffset;
- c->oldw = c->w; c->w = wc.width = w - gapincr;
- c->oldh = c->h; c->h = wc.height = h - gapincr;
-
- XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
- configure(c);
- XSync(dpy, False);
-}
-
-void
-resizemouse(const Arg *arg)
-{
- int ocx, ocy, nw, nh;
- Client *c;
- Monitor *m;
- XEvent ev;
- Time lasttime = 0;
-
- if (!(c = selmon->sel))
- return;
- if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
- return;
- restack(selmon);
- ocx = c->x;
- ocy = c->y;
- if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
- None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess)
- return;
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
- do {
- XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
- switch(ev.type) {
- case ConfigureRequest:
- case Expose:
- case MapRequest:
- handler[ev.type](&ev);
- break;
- case MotionNotify:
- if ((ev.xmotion.time - lasttime) <= (1000 / 60))
- continue;
- lasttime = ev.xmotion.time;
-
- nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
- nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
- if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww
- && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh)
- {
- if (!c->isfloating && selmon->lt[selmon->sellt]->arrange
- && (abs(nw - c->w) > snap || abs(nh - c->h) > snap))
- togglefloating(NULL);
- }
- if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
- resize(c, c->x, c->y, nw, nh, 1);
- break;
- }
- } while (ev.type != ButtonRelease);
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
- XUngrabPointer(dpy, CurrentTime);
- while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
- if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
- sendmon(c, m);
- selmon = m;
- focus(NULL);
- }
-}
-
-void
-restack(Monitor *m)
-{
- Client *c;
- XEvent ev;
- XWindowChanges wc;
-
- drawbar(m);
- if (!m->sel)
- return;
- if (m->sel->isfloating || !m->lt[m->sellt]->arrange)
- XRaiseWindow(dpy, m->sel->win);
- if (m->lt[m->sellt]->arrange) {
- wc.stack_mode = Below;
- wc.sibling = m->barwin;
- for (c = m->stack; c; c = c->snext)
- if (!c->isfloating && ISVISIBLE(c)) {
- XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
- wc.sibling = c->win;
- }
- }
- XSync(dpy, False);
- while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
-}
-
-void
-rotatestack(const Arg *arg)
-{
- Client *c = NULL, *f;
-
- if (!selmon->sel)
- return;
- f = selmon->sel;
- if (arg->i > 0) {
- for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
- if (c){
- detach(c);
- attach(c);
- detachstack(c);
- attachstack(c);
- }
- } else {
- if ((c = nexttiled(selmon->clients))){
- detach(c);
- enqueue(c);
- detachstack(c);
- enqueuestack(c);
- }
- }
- if (c){
- arrange(selmon);
- //unfocus(f, 1);
- focus(f);
- restack(selmon);
- }
-}
-
-void
-run(void)
-{
- XEvent ev;
- /* main event loop */
- XSync(dpy, False);
- while (running && !XNextEvent(dpy, &ev))
- if (handler[ev.type])
- handler[ev.type](&ev); /* call handler */
-}
-
-void
-runAutostart(void) {
- system("cd $HOME/.config/suckless/dwm/; ./autostart.sh &");
-}
-
-void
-scan(void)
-{
- unsigned int i, num;
- Window d1, d2, *wins = NULL;
- XWindowAttributes wa;
-
- if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
- for (i = 0; i < num; i++) {
- if (!XGetWindowAttributes(dpy, wins[i], &wa)
- || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1))
- continue;
- if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)
- manage(wins[i], &wa);
- }
- for (i = 0; i < num; i++) { /* now the transients */
- if (!XGetWindowAttributes(dpy, wins[i], &wa))
- continue;
- if (XGetTransientForHint(dpy, wins[i], &d1)
- && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
- manage(wins[i], &wa);
- }
- if (wins)
- XFree(wins);
- }
-}
-
-void
-sendmon(Client *c, Monitor *m)
-{
- if (c->mon == m)
- return;
- unfocus(c, 1);
- detach(c);
- detachstack(c);
- c->mon = m;
- c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attachbottom(c);
- attachstack(c);
- focus(NULL);
- arrange(NULL);
-}
-
-void
-setclientstate(Client *c, long state)
-{
- long data[] = { state, None };
-
- XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32,
- PropModeReplace, (unsigned char *)data, 2);
-}
-
-int
-sendevent(Client *c, Atom proto)
-{
- int n;
- Atom *protocols;
- int exists = 0;
- XEvent ev;
-
- if (XGetWMProtocols(dpy, c->win, &protocols, &n)) {
- while (!exists && n--)
- exists = protocols[n] == proto;
- XFree(protocols);
- }
- if (exists) {
- ev.type = ClientMessage;
- ev.xclient.window = c->win;
- ev.xclient.message_type = wmatom[WMProtocols];
- ev.xclient.format = 32;
- ev.xclient.data.l[0] = proto;
- ev.xclient.data.l[1] = CurrentTime;
- XSendEvent(dpy, c->win, False, NoEventMask, &ev);
- }
- return exists;
-}
-
-void
-setfocus(Client *c)
-{
- if (!c->neverfocus) {
- XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
- XChangeProperty(dpy, root, netatom[NetActiveWindow],
- XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &(c->win), 1);
- }
- sendevent(c, wmatom[WMTakeFocus]);
-}
-
-void
-setfullscreen(Client *c, int fullscreen)
-{
- if (fullscreen && !c->isfullscreen) {
- XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
- PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
- c->isfullscreen = 1;
- c->oldstate = c->isfloating;
- c->oldbw = c->bw;
- c->bw = 0;
- c->isfloating = 1;
- resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
- XRaiseWindow(dpy, c->win);
- } else if (!fullscreen && c->isfullscreen){
- XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
- PropModeReplace, (unsigned char*)0, 0);
- c->isfullscreen = 0;
- c->isfloating = c->oldstate;
- c->bw = c->oldbw;
- c->x = c->oldx;
- c->y = c->oldy;
- c->w = c->oldw;
- c->h = c->oldh;
- resizeclient(c, c->x, c->y, c->w, c->h);
- arrange(c->mon);
- }
-}
-
-void
-setlayout(const Arg *arg)
-{
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
- selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
- if (arg && arg->v)
- selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
- strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
- if (selmon->sel)
- arrange(selmon);
- else
- drawbar(selmon);
-}
-
-/* arg > 1.0 will set mfact absolutely */
-void
-setmfact(const Arg *arg)
-{
- float f;
-
- if (!arg || !selmon->lt[selmon->sellt]->arrange)
- return;
- f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
- if (f < 0.05 || f > 0.95)
- return;
- selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
- arrange(selmon);
-}
-
-void
-setup(void)
-{
- int i;
- XSetWindowAttributes wa;
- Atom utf8string;
-
- /* clean up any zombies immediately */
- sigchld(0);
-
- signal(SIGHUP, sighup);
- signal(SIGTERM, sigterm);
-
- /* init screen */
- screen = DefaultScreen(dpy);
- sw = DisplayWidth(dpy, screen);
- sh = DisplayHeight(dpy, screen);
- root = RootWindow(dpy, screen);
- xinitvisual();
- drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
- if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- lrpad = drw->fonts->h + horizpadbar;
- bh = drw->fonts->h + vertpadbar;
- updategeom();
- /* init atoms */
- utf8string = XInternAtom(dpy, "UTF8_STRING", False);
- wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
- wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
- wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
- wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
- netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
- netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
- netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
- netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
- netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
- netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
- netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
- netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
- netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
- /* init cursors */
- cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
- cursor[CurResize] = drw_cur_create(drw, XC_sizing);
- cursor[CurMove] = drw_cur_create(drw, XC_fleur);
- /* init appearance */
- scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
- for (i = 0; i < LENGTH(colors); i++)
- scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
- /* init bars */
- updatebars();
- updatestatus();
- /* supporting window for NetWMCheck */
- wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0);
- XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32,
- PropModeReplace, (unsigned char *) &wmcheckwin, 1);
- XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8,
- PropModeReplace, (unsigned char *) "dwm", 3);
- XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32,
- PropModeReplace, (unsigned char *) &wmcheckwin, 1);
- /* EWMH support per view */
- XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
- PropModeReplace, (unsigned char *) netatom, NetLast);
- XDeleteProperty(dpy, root, netatom[NetClientList]);
- /* select events */
- wa.cursor = cursor[CurNormal]->cursor;
- wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask
- |ButtonPressMask|PointerMotionMask|EnterWindowMask
- |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask;
- XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
- XSelectInput(dpy, root, wa.event_mask);
- grabkeys();
- focus(NULL);
-}
-
-
-void
-seturgent(Client *c, int urg)
-{
- XWMHints *wmh;
-
- c->isurgent = urg;
- if (!(wmh = XGetWMHints(dpy, c->win)))
- return;
- wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint);
- XSetWMHints(dpy, c->win, wmh);
- XFree(wmh);
-}
-
-void
-showhide(Client *c)
-{
- if (!c)
- return;
- if (ISVISIBLE(c)) {
- if ((c->tags & SPTAGMASK) && c->isfloating) {
- c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2);
- c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
- }
- /* show clients top down */
- XMoveWindow(dpy, c->win, c->x, c->y);
- if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
- resize(c, c->x, c->y, c->w, c->h, 0);
- showhide(c->snext);
- } else {
- /* hide clients bottom up */
- showhide(c->snext);
- XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
- }
-}
-
-void
-sigchld(int unused)
-{
- if (signal(SIGCHLD, sigchld) == SIG_ERR)
- die("can't install SIGCHLD handler:");
- while (0 < waitpid(-1, NULL, WNOHANG));
-}
-
-void
-sighup(int unused)
-{
- Arg a = {.i = 1};
- quit(&a);
-}
-
-void
-sigterm(int unused)
-{
- Arg a = {.i = 0};
- quit(&a);
-}
-
-void
-spawn(const Arg *arg)
-{
- if (arg->v == dmenucmd)
- dmenumon[0] = '0' + selmon->num;
- if (fork() == 0) {
- if (dpy)
- close(ConnectionNumber(dpy));
- setsid();
- execvp(((char **)arg->v)[0], (char **)arg->v);
- fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
- perror(" failed");
- exit(EXIT_SUCCESS);
- }
-}
-
-void
-tag(const Arg *arg)
-{
- if (selmon->sel && arg->ui & TAGMASK) {
- selmon->sel->tags = arg->ui & TAGMASK;
- focus(NULL);
- arrange(selmon);
- }
-}
-
-void
-tagmon(const Arg *arg)
-{
- if (!selmon->sel || !mons->next)
- return;
- sendmon(selmon->sel, dirtomon(arg->i));
-}
-
-void
-tile(Monitor *m)
-{
- unsigned int i, n, h, mw, my, ty;
- Client *c;
-
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
- if (n == 0)
- return;
-
- if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
- else
- mw = m->ww;
- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
- if (i < m->nmaster) {
- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
- resize(c, m->wx, m->wy + my, mw - (2*c->bw) + (n > 1 ? gappx : 0), h - (2*c->bw), 0);
- if (my + HEIGHT(c) < m->wh)
- my += HEIGHT(c);
- } else {
- h = (m->wh - ty) / (n - i);
- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
- if (ty + HEIGHT(c) < m->wh)
- ty += HEIGHT(c);
- }
-}
-
-void
-togglebar(const Arg *arg)
-{
- selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
- updatebarpos(selmon);
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
- arrange(selmon);
-}
-
-void
-togglefloating(const Arg *arg)
-{
- if (!selmon->sel)
- return;
- if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
- return;
- selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
- if (selmon->sel->isfloating)
- resize(selmon->sel, selmon->sel->x, selmon->sel->y,
- selmon->sel->w, selmon->sel->h, 0);
-
- selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2;
- selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2;
-
- arrange(selmon);
-}
-
-void
-togglescratch(const Arg *arg)
-{
- Client *c;
- unsigned int found = 0;
- unsigned int scratchtag = SPTAG(arg->ui);
- Arg sparg = {.v = scratchpads[arg->ui].cmd};
-
- for (c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next);
- if (found) {
- unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
- if (newtagset) {
- selmon->tagset[selmon->seltags] = newtagset;
- focus(NULL);
- arrange(selmon);
- }
- if (ISVISIBLE(c)) {
- focus(c);
- restack(selmon);
- }
- } else {
- selmon->tagset[selmon->seltags] |= scratchtag;
- spawn(&sparg);
- }
-}
-
-void
-togglefullscr(const Arg *arg)
-{
- if(selmon->sel)
- setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
-}
-
-void
-toggletag(const Arg *arg)
-{
- unsigned int newtags;
-
- if (!selmon->sel)
- return;
- newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
- if (newtags) {
- selmon->sel->tags = newtags;
- focus(NULL);
- arrange(selmon);
- }
-}
-
-void
-toggleview(const Arg *arg)
-{
- unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
- int i;
-
- if (newtagset) {
- selmon->tagset[selmon->seltags] = newtagset;
-
- if (newtagset == ~0) {
- selmon->pertag->prevtag = selmon->pertag->curtag;
- selmon->pertag->curtag = 0;
- }
-
- /* test if the user did not select the same tag */
- if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
- selmon->pertag->prevtag = selmon->pertag->curtag;
- for (i = 0; !(newtagset & 1 << i); i++) ;
- selmon->pertag->curtag = i + 1;
- }
-
- /* apply settings for this view */
- selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
- selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
- selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
- selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
- selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
-
- if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
- togglebar(NULL);
-
- focus(NULL);
- arrange(selmon);
- }
-}
-
-void
-unfocus(Client *c, int setfocus)
-{
- if (!c)
- return;
- grabbuttons(c, 0);
- XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
- if (setfocus) {
- XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
- XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
- }
-}
-
-void
-unmanage(Client *c, int destroyed)
-{
- Monitor *m = c->mon;
- XWindowChanges wc;
-
- detach(c);
- detachstack(c);
- if (!destroyed) {
- wc.border_width = c->oldbw;
- XGrabServer(dpy); /* avoid race conditions */
- XSetErrorHandler(xerrordummy);
- XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
- XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
- setclientstate(c, WithdrawnState);
- XSync(dpy, False);
- XSetErrorHandler(xerror);
- XUngrabServer(dpy);
- }
- free(c);
- focus(NULL);
- updateclientlist();
- arrange(m);
-}
-
-void
-unmapnotify(XEvent *e)
-{
- Client *c;
- XUnmapEvent *ev = &e->xunmap;
-
- if ((c = wintoclient(ev->window))) {
- if (ev->send_event)
- setclientstate(c, WithdrawnState);
- else
- unmanage(c, 0);
- }
-}
-
-void
-updatebars(void)
-{
- Monitor *m;
- XSetWindowAttributes wa = {
- .override_redirect = True,
- .background_pixel = 0,
- .border_pixel = 0,
- .colormap = cmap,
- .event_mask = ButtonPressMask|ExposureMask
- };
- XClassHint ch = {"dwm", "dwm"};
- for (m = mons; m; m = m->next) {
- if (m->barwin)
- continue;
- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth,
- InputOutput, visual,
- CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
- XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
- XMapRaised(dpy, m->barwin);
- XSetClassHint(dpy, m->barwin, &ch);
- }
-}
-
-void
-updatebarpos(Monitor *m)
-{
- m->wy = m->my;
- m->wh = m->mh;
- if (m->showbar) {
- m->wh -= bh;
- m->by = m->topbar ? m->wy : m->wy + m->wh;
- m->wy = m->topbar ? m->wy + bh : m->wy;
- } else
- m->by = -bh;
-}
-
-void
-updateclientlist()
-{
- Client *c;
- Monitor *m;
-
- XDeleteProperty(dpy, root, netatom[NetClientList]);
- for (m = mons; m; m = m->next)
- for (c = m->clients; c; c = c->next)
- XChangeProperty(dpy, root, netatom[NetClientList],
- XA_WINDOW, 32, PropModeAppend,
- (unsigned char *) &(c->win), 1);
-}
-
-int
-updategeom(void)
-{
- int dirty = 0;
-
-#ifdef XINERAMA
- if (XineramaIsActive(dpy)) {
- int i, j, n, nn;
- Client *c;
- Monitor *m;
- XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn);
- XineramaScreenInfo *unique = NULL;
-
- for (n = 0, m = mons; m; m = m->next, n++);
- /* only consider unique geometries as separate screens */
- unique = ecalloc(nn, sizeof(XineramaScreenInfo));
- for (i = 0, j = 0; i < nn; i++)
- if (isuniquegeom(unique, j, &info[i]))
- memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo));
- XFree(info);
- nn = j;
-
- /* new monitors if nn > n */
- for (i = n; i < nn; i++) {
- for (m = mons; m && m->next; m = m->next);
- if (m)
- m->next = createmon();
- else
- mons = createmon();
- }
- for (i = 0, m = mons; i < nn && m; m = m->next, i++)
- if (i >= n
- || unique[i].x_org != m->mx || unique[i].y_org != m->my
- || unique[i].width != m->mw || unique[i].height != m->mh)
- {
- dirty = 1;
- m->num = i;
- m->mx = m->wx = unique[i].x_org;
- m->my = m->wy = unique[i].y_org;
- m->mw = m->ww = unique[i].width;
- m->mh = m->wh = unique[i].height;
- updatebarpos(m);
- }
- /* removed monitors if n > nn */
- for (i = nn; i < n; i++) {
- for (m = mons; m && m->next; m = m->next);
- while ((c = m->clients)) {
- dirty = 1;
- m->clients = c->next;
- detachstack(c);
- c->mon = mons;
- attach(c);
- attachbottom(c);
- attachstack(c);
- }
- if (m == selmon)
- selmon = mons;
- cleanupmon(m);
- }
- free(unique);
- } else
-#endif /* XINERAMA */
- { /* default monitor setup */
- if (!mons)
- mons = createmon();
- if (mons->mw != sw || mons->mh != sh) {
- dirty = 1;
- mons->mw = mons->ww = sw;
- mons->mh = mons->wh = sh;
- updatebarpos(mons);
- }
- }
- if (dirty) {
- selmon = mons;
- selmon = wintomon(root);
- }
- return dirty;
-}
-
-void
-updatenumlockmask(void)
-{
- unsigned int i, j;
- XModifierKeymap *modmap;
-
- numlockmask = 0;
- modmap = XGetModifierMapping(dpy);
- for (i = 0; i < 8; i++)
- for (j = 0; j < modmap->max_keypermod; j++)
- if (modmap->modifiermap[i * modmap->max_keypermod + j]
- == XKeysymToKeycode(dpy, XK_Num_Lock))
- numlockmask = (1 << i);
- XFreeModifiermap(modmap);
-}
-
-void
-updatesizehints(Client *c)
-{
- long msize;
- XSizeHints size;
-
- if (!XGetWMNormalHints(dpy, c->win, &size, &msize))
- /* size is uninitialized, ensure that size.flags aren't used */
- size.flags = PSize;
- if (size.flags & PBaseSize) {
- c->basew = size.base_width;
- c->baseh = size.base_height;
- } else if (size.flags & PMinSize) {
- c->basew = size.min_width;
- c->baseh = size.min_height;
- } else
- c->basew = c->baseh = 0;
- if (size.flags & PResizeInc) {
- c->incw = size.width_inc;
- c->inch = size.height_inc;
- } else
- c->incw = c->inch = 0;
- if (size.flags & PMaxSize) {
- c->maxw = size.max_width;
- c->maxh = size.max_height;
- } else
- c->maxw = c->maxh = 0;
- if (size.flags & PMinSize) {
- c->minw = size.min_width;
- c->minh = size.min_height;
- } else if (size.flags & PBaseSize) {
- c->minw = size.base_width;
- c->minh = size.base_height;
- } else
- c->minw = c->minh = 0;
- if (size.flags & PAspect) {
- c->mina = (float)size.min_aspect.y / size.min_aspect.x;
- c->maxa = (float)size.max_aspect.x / size.max_aspect.y;
- } else
- c->maxa = c->mina = 0.0;
- c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
- c->hintsvalid = 1;
-}
-
-void
-updatestatus(void)
-{
- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
- strcpy(stext, "dwm-"VERSION);
- drawbar(selmon);
-}
-
-void
-updatetitle(Client *c)
-{
- if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))
- gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name);
- if (c->name[0] == '\0') /* hack to mark broken clients */
- strcpy(c->name, broken);
-}
-
-void
-updatewindowtype(Client *c)
-{
- Atom state = getatomprop(c, netatom[NetWMState]);
- Atom wtype = getatomprop(c, netatom[NetWMWindowType]);
-
- if (state == netatom[NetWMFullscreen])
- setfullscreen(c, 1);
- if (wtype == netatom[NetWMWindowTypeDialog])
- c->isfloating = 1;
-}
-
-void
-updatewmhints(Client *c)
-{
- XWMHints *wmh;
-
- if ((wmh = XGetWMHints(dpy, c->win))) {
- if (c == selmon->sel && wmh->flags & XUrgencyHint) {
- wmh->flags &= ~XUrgencyHint;
- XSetWMHints(dpy, c->win, wmh);
- } else
- c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0;
- if (wmh->flags & InputHint)
- c->neverfocus = !wmh->input;
- else
- c->neverfocus = 0;
- XFree(wmh);
- }
-}
-
-void
-view(const Arg *arg)
-{
- int i;
- unsigned int tmptag;
-
- if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
- return;
- selmon->seltags ^= 1; /* toggle sel tagset */
- if (arg->ui & TAGMASK) {
- selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
- selmon->pertag->prevtag = selmon->pertag->curtag;
-
- if (arg->ui == ~0)
- selmon->pertag->curtag = 0;
- else {
- for (i = 0; !(arg->ui & 1 << i); i++) ;
- selmon->pertag->curtag = i + 1;
- }
- } else {
- tmptag = selmon->pertag->prevtag;
- selmon->pertag->prevtag = selmon->pertag->curtag;
- selmon->pertag->curtag = tmptag;
- }
-
- selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
- selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
- selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
- selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
- selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
-
- if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
- togglebar(NULL);
-
- focus(NULL);
- arrange(selmon);
-}
-
-Client *
-wintoclient(Window w)
-{
- Client *c;
- Monitor *m;
-
- for (m = mons; m; m = m->next)
- for (c = m->clients; c; c = c->next)
- if (c->win == w)
- return c;
- return NULL;
-}
-
-Monitor *
-wintomon(Window w)
-{
- int x, y;
- Client *c;
- Monitor *m;
-
- if (w == root && getrootptr(&x, &y))
- return recttomon(x, y, 1, 1);
- for (m = mons; m; m = m->next)
- if (w == m->barwin)
- return m;
- if ((c = wintoclient(w)))
- return c->mon;
- return selmon;
-}
-
-/* There's no way to check accesses to destroyed windows, thus those cases are
- * ignored (especially on UnmapNotify's). Other types of errors call Xlibs
- * default error handler, which may call exit. */
-int
-xerror(Display *dpy, XErrorEvent *ee)
-{
- if (ee->error_code == BadWindow
- || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
- || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable)
- || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable)
- || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable)
- || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch)
- || (ee->request_code == X_GrabButton && ee->error_code == BadAccess)
- || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)
- || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable))
- return 0;
- fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n",
- ee->request_code, ee->error_code);
- return xerrorxlib(dpy, ee); /* may call exit */
-}
-
-int
-xerrordummy(Display *dpy, XErrorEvent *ee)
-{
- return 0;
-}
-
-/* Startup Error handler to check if another window manager
- * is already running. */
-int
-xerrorstart(Display *dpy, XErrorEvent *ee)
-{
- die("dwm: another window manager is already running");
- return -1;
-}
-
-void
-xinitvisual()
-{
- XVisualInfo *infos;
- XRenderPictFormat *fmt;
- int nitems;
- int i;
-
- XVisualInfo tpl = {
- .screen = screen,
- .depth = 32,
- .class = TrueColor
- };
- long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
-
- infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
- visual = NULL;
- for(i = 0; i < nitems; i ++) {
- fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
- if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
- visual = infos[i].visual;
- depth = infos[i].depth;
- cmap = XCreateColormap(dpy, root, visual, AllocNone);
- useargb = 1;
- break;
- }
- }
-
- XFree(infos);
-
- if (! visual) {
- visual = DefaultVisual(dpy, screen);
- depth = DefaultDepth(dpy, screen);
- cmap = DefaultColormap(dpy, screen);
- }
-}
-
-void
-zoom(const Arg *arg)
-{
- Client *c = selmon->sel;
-
- if (!selmon->lt[selmon->sellt]->arrange
- || (selmon->sel && selmon->sel->isfloating))
- return;
- if (c == nexttiled(selmon->clients))
- if (!c || !(c = nexttiled(c->next)))
- return;
- pop(c);
-}
-
-int
-main(int argc, char *argv[])
-{
- if (argc == 2 && !strcmp("-v", argv[1]))
- die("dwm-"VERSION);
- else if (argc != 1)
- die("usage: dwm [-v]");
- if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
- fputs("warning: no locale support\n", stderr);
- if (!(dpy = XOpenDisplay(NULL)))
- die("dwm: cannot open display");
- checkotherwm();
- setup();
-#ifdef __OpenBSD__
- if (pledge("stdio rpath proc exec", NULL) == -1)
- die("pledge");
-#endif /* __OpenBSD__ */
- scan();
- runAutostart();
- run();
- if(restart) execvp(argv[0], argv);
- cleanup();
- XCloseDisplay(dpy);
- return EXIT_SUCCESS;
-}
diff --git a/user/.config/suckless/dwm/dwm.png b/user/.config/suckless/dwm/dwm.png
deleted file mode 100644
index b1f9ba7e5..000000000
Binary files a/user/.config/suckless/dwm/dwm.png and /dev/null differ
diff --git a/user/.config/suckless/dwm/fbc.c b/user/.config/suckless/dwm/fbc.c
deleted file mode 100644
index fce0a577b..000000000
--- a/user/.config/suckless/dwm/fbc.c
+++ /dev/null
@@ -1,66 +0,0 @@
-void
-fibonacci(Monitor *mon, int s) {
- unsigned int i, n, nx, ny, nw, nh;
- Client *c;
-
- for(n = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next), n++);
- if(n == 0)
- return;
-
- nx = mon->wx;
- ny = 0;
- nw = mon->ww;
- nh = mon->wh;
-
- for(i = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next)) {
- if((i % 2 && nh / 2 > 2 * c->bw)
- || (!(i % 2) && nw / 2 > 2 * c->bw)) {
- if(i < n - 1) {
- if(i % 2)
- nh /= 2;
- else
- nw /= 2;
- if((i % 4) == 2 && !s)
- nx += nw;
- else if((i % 4) == 3 && !s)
- ny += nh;
- }
- if((i % 4) == 0) {
- if(s)
- ny += nh;
- else
- ny -= nh;
- }
- else if((i % 4) == 1)
- nx += nw;
- else if((i % 4) == 2)
- ny += nh;
- else if((i % 4) == 3) {
- if(s)
- nx += nw;
- else
- nx -= nw;
- }
- if(i == 0)
- {
- if(n != 1)
- nw = mon->ww * mon->mfact;
- ny = mon->wy;
- }
- else if(i == 1)
- nw = mon->ww - nw;
- i++;
- }
- resize(c, nx, ny, nw - 2 * c->bw, nh - 2 * c->bw, False);
- }
-}
-
-void
-dwindle(Monitor *mon) {
- fibonacci(mon, 1);
-}
-
-void
-spiral(Monitor *mon) {
- fibonacci(mon, 0);
-}
diff --git a/user/.config/suckless/dwm/grid.c b/user/.config/suckless/dwm/grid.c
deleted file mode 100644
index de24c449f..000000000
--- a/user/.config/suckless/dwm/grid.c
+++ /dev/null
@@ -1,28 +0,0 @@
-void
-grid(Monitor *m) {
- unsigned int i, n, cx, cy, cw, ch, aw, ah, cols, rows;
- Client *c;
-
- for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
- n++;
-
- /* grid dimensions */
- for(rows = 0; rows <= n/2; rows++)
- if(rows*rows >= n)
- break;
- cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;
-
- /* window geoms (cell height/width) */
- ch = m->wh / (rows ? rows : 1);
- cw = m->ww / (cols ? cols : 1);
- for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
- cx = m->wx + (i / rows) * cw;
- cy = m->wy + (i % rows) * ch;
- /* adjust height/width of last row/column's windows */
- ah = ((i + 1) % rows == 0) ? m->wh - ch * rows : 0;
- aw = (i >= rows * (cols - 1)) ? m->ww - cw * cols : 0;
- resize(c, cx, cy, cw - 2 * c->bw + aw, ch - 2 * c->bw + ah, False);
- i++;
- }
-}
-
diff --git a/user/.config/suckless/dwm/tcl.c b/user/.config/suckless/dwm/tcl.c
deleted file mode 100644
index 6bcf1cee0..000000000
--- a/user/.config/suckless/dwm/tcl.c
+++ /dev/null
@@ -1,75 +0,0 @@
-void
-tcl(Monitor * m)
-{
- int x, y, h, w, mw, sw, bdw;
- unsigned int i, n;
- Client * c;
-
- for (n = 0, c = nexttiled(m->clients); c;
- c = nexttiled(c->next), n++);
-
- if (n == 0)
- return;
-
- c = nexttiled(m->clients);
-
- mw = m->mfact * m->ww;
- sw = (m->ww - mw) / 2;
- bdw = (2 * c->bw);
- resize(c,
- n < 3 ? m->wx : m->wx + sw,
- m->wy,
- n == 1 ? m->ww - bdw : mw - bdw,
- m->wh - bdw,
- False);
-
- if (--n == 0)
- return;
-
- w = (m->ww - mw) / ((n > 1) + 1);
- c = nexttiled(c->next);
-
- if (n > 1)
- {
- x = m->wx + ((n > 1) ? mw + sw : mw);
- y = m->wy;
- h = m->wh / (n / 2);
-
- if (h < bh)
- h = m->wh;
-
- for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++)
- {
- resize(c,
- x,
- y,
- w - bdw,
- (i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw,
- False);
-
- if (h != m->wh)
- y = c->y + HEIGHT(c);
- }
- }
-
- x = (n + 1 / 2) == 1 ? mw : m->wx;
- y = m->wy;
- h = m->wh / ((n + 1) / 2);
-
- if (h < bh)
- h = m->wh;
-
- for (i = 0; c; c = nexttiled(c->next), i++)
- {
- resize(c,
- x,
- y,
- (i + 1 == (n + 1) / 2) ? w - bdw : w - bdw,
- (i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw,
- False);
-
- if (h != m->wh)
- y = c->y + HEIGHT(c);
- }
-}
-
diff --git a/user/.config/suckless/dwm/tlwide.c b/user/.config/suckless/dwm/tlwide.c
deleted file mode 100644
index f850e6e16..000000000
--- a/user/.config/suckless/dwm/tlwide.c
+++ /dev/null
@@ -1,27 +0,0 @@
-void
-tilewide(Monitor *m)
-{
- unsigned int i, n, w, h, mw, mx, ty;
- Client *c;
-
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
- if (n == 0)
- return;
- if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
- else
- mw = m->ww;
- for (i = mx = ty = 0, c = nexttiled(m->clients); c;
- c = nexttiled(c->next), i++)
- if (i < m->nmaster) {
- w = (mw - mx) / (MIN(n, m->nmaster) - i);
- resize(c, m->wx + mx, m->wy, w - (2*c->bw), (m->wh - ty) - (2*c->bw), 0);
- if (mx + WIDTH(c) < m->ww)
- mx += WIDTH(c);
- } else {
- h = (m->wh - ty) / (n - i);
- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
- if (ty + HEIGHT(c) < m->wh)
- ty += HEIGHT(c);
- }
-}
diff --git a/user/.config/suckless/dwm/transient.c b/user/.config/suckless/dwm/transient.c
deleted file mode 100644
index 040adb5b3..000000000
--- a/user/.config/suckless/dwm/transient.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* cc transient.c -o transient -lX11 */
-
-#include
-#include
-#include
-#include
-
-int main(void) {
- Display *d;
- Window r, f, t = None;
- XSizeHints h;
- XEvent e;
-
- d = XOpenDisplay(NULL);
- if (!d)
- exit(1);
- r = DefaultRootWindow(d);
-
- f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
- h.min_width = h.max_width = h.min_height = h.max_height = 400;
- h.flags = PMinSize | PMaxSize;
- XSetWMNormalHints(d, f, &h);
- XStoreName(d, f, "floating");
- XMapWindow(d, f);
-
- XSelectInput(d, f, ExposureMask);
- while (1) {
- XNextEvent(d, &e);
-
- if (t == None) {
- sleep(5);
- t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
- XSetTransientForHint(d, t, f);
- XStoreName(d, t, "transient");
- XMapWindow(d, t);
- XSelectInput(d, t, ExposureMask);
- }
- }
-
- XCloseDisplay(d);
- exit(0);
-}
diff --git a/user/.config/suckless/dwm/util.c b/user/.config/suckless/dwm/util.c
deleted file mode 100644
index fe044fc7b..000000000
--- a/user/.config/suckless/dwm/util.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include
-#include
-#include
-#include
-
-#include "util.h"
-
-void *
-ecalloc(size_t nmemb, size_t size)
-{
- void *p;
-
- if (!(p = calloc(nmemb, size)))
- die("calloc:");
- return p;
-}
-
-void
-die(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
-
- if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
- fputc(' ', stderr);
- perror(NULL);
- } else {
- fputc('\n', stderr);
- }
-
- exit(1);
-}
diff --git a/user/.config/suckless/dwm/util.h b/user/.config/suckless/dwm/util.h
deleted file mode 100644
index f633b5173..000000000
--- a/user/.config/suckless/dwm/util.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#define MAX(A, B) ((A) > (B) ? (A) : (B))
-#define MIN(A, B) ((A) < (B) ? (A) : (B))
-#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
-
-void die(const char *fmt, ...);
-void *ecalloc(size_t nmemb, size_t size);
diff --git a/user/.config/suckless/dwmblocks/Makefile b/user/.config/suckless/dwmblocks/Makefile
deleted file mode 100644
index c0936340d..000000000
--- a/user/.config/suckless/dwmblocks/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-PREFIX ?= /usr
-CC ?= cc
-
-output: dwmblocks.c blocks.def.h blocks.h
- ${CC} `pkg-config --cflags x11 --libs x11` dwmblocks.c -o dwmblocks
-blocks.h:
- cp blocks.def.h $@
-
-
-clean:
- rm -f *.o *.gch dwmblocks
-install: output
- mkdir -p $(DESTDIR)$(PREFIX)/bin
- install -m 0755 dwmblocks $(DESTDIR)$(PREFIX)/bin/dwmblocks
-uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks
diff --git a/user/.config/suckless/dwmblocks/blocks.def.h b/user/.config/suckless/dwmblocks/blocks.def.h
deleted file mode 100644
index 65e5debd8..000000000
--- a/user/.config/suckless/dwmblocks/blocks.def.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//Modify this file to change what commands output to your statusbar, and recompile using the make command.
-static const Block blocks[] = {
- /*Command*/ /*Update Interval*/ /*Update Signal*/
- {"", "$HOME/.config/suckless/dwmblocks/scripts/cpu", 1, 1},
-
- {"", "$HOME/.config/suckless/dwmblocks/scripts/memory", 1, 1},
-
- {"", "$HOME/.config/suckless/dwmblocks/scripts/layout", 1, 1},
-
- {"", "$HOME/.config/suckless/dwmblocks/scripts/battery", 1, 1},
-
- {"", "$HOME/.config/suckless/dwmblocks/scripts/brightness", 1, 1},
-
- {"", "$HOME/.config/suckless/dwmblocks/scripts/volume", 1, 1},
-
- {"", "$HOME/.config/suckless/dwmblocks/scripts/clock", 5, 0},
-};
-
-//sets delimeter between status commands. NULL character ('\0') means no delimeter.
-static char delim = '|';
diff --git a/user/.config/suckless/dwmblocks/dwmblocks.c b/user/.config/suckless/dwmblocks/dwmblocks.c
deleted file mode 100644
index 88bdfb0b0..000000000
--- a/user/.config/suckless/dwmblocks/dwmblocks.c
+++ /dev/null
@@ -1,175 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#define LENGTH(X) (sizeof(X) / sizeof (X[0]))
-#define CMDLENGTH 50
-
-typedef struct {
- char* icon;
- char* command;
- unsigned int interval;
- unsigned int signal;
-} Block;
-void sighandler(int num);
-void replace(char *str, char old, char new);
-void getcmds(int time);
-#ifndef __OpenBSD__
-void getsigcmds(int signal);
-void setupsignals();
-void sighandler(int signum);
-#endif
-int getstatus(char *str, char *last);
-void setroot();
-void statusloop();
-void termhandler(int signum);
-
-
-#include "blocks.h"
-
-static Display *dpy;
-static int screen;
-static Window root;
-static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0};
-static char statusstr[2][256];
-static int statusContinue = 1;
-static void (*writestatus) () = setroot;
-
-void replace(char *str, char old, char new)
-{
- int N = strlen(str);
- for(int i = 0; i < N; i++)
- if(str[i] == old)
- str[i] = new;
-}
-
-//opens process *cmd and stores output in *output
-void getcmd(const Block *block, char *output)
-{
- strcpy(output, block->icon);
- char *cmd = block->command;
- FILE *cmdf = popen(cmd,"r");
- if (!cmdf)
- return;
- char c;
- int i = strlen(block->icon);
- fgets(output+i, CMDLENGTH-i, cmdf);
- i = strlen(output);
- if (delim != '\0' && --i)
- output[i++] = delim;
- output[i++] = '\0';
- pclose(cmdf);
-}
-
-void getcmds(int time)
-{
- const Block* current;
- for(int i = 0; i < LENGTH(blocks); i++)
- {
- current = blocks + i;
- if ((current->interval != 0 && time % current->interval == 0) || time == -1)
- getcmd(current,statusbar[i]);
- }
-}
-
-#ifndef __OpenBSD__
-void getsigcmds(int signal)
-{
- const Block *current;
- for (int i = 0; i < LENGTH(blocks); i++)
- {
- current = blocks + i;
- if (current->signal == signal)
- getcmd(current,statusbar[i]);
- }
-}
-
-void setupsignals()
-{
- for(int i = 0; i < LENGTH(blocks); i++)
- {
- if (blocks[i].signal > 0)
- signal(SIGRTMIN+blocks[i].signal, sighandler);
- }
-
-}
-#endif
-
-int getstatus(char *str, char *last)
-{
- strcpy(last, str);
- str[0] = '\0';
- for(int i = 0; i < LENGTH(blocks); i++)
- strcat(str, statusbar[i]);
- str[strlen(str)-1] = '\0';
- return strcmp(str, last);//0 if they are the same
-}
-
-void setroot()
-{
- if (!getstatus(statusstr[0], statusstr[1]))//Only set root if text has changed.
- return;
- Display *d = XOpenDisplay(NULL);
- if (d) {
- dpy = d;
- }
- screen = DefaultScreen(dpy);
- root = RootWindow(dpy, screen);
- XStoreName(dpy, root, statusstr[0]);
- XCloseDisplay(dpy);
-}
-
-void pstdout()
-{
- if (!getstatus(statusstr[0], statusstr[1]))//Only write out if text has changed.
- return;
- printf("%s\n",statusstr[0]);
- fflush(stdout);
-}
-
-
-void statusloop()
-{
-#ifndef __OpenBSD__
- setupsignals();
-#endif
- int i = 0;
- getcmds(-1);
- while(statusContinue)
- {
- getcmds(i);
- writestatus();
- sleep(1.0);
- i++;
- }
-}
-
-#ifndef __OpenBSD__
-void sighandler(int signum)
-{
- getsigcmds(signum-SIGRTMIN);
- writestatus();
-}
-#endif
-
-void termhandler(int signum)
-{
- statusContinue = 0;
- exit(0);
-}
-
-int main(int argc, char** argv)
-{
- for(int i = 0; i < argc; i++)
- {
- if (!strcmp("-d",argv[i]))
- delim = argv[++i][0];
- else if(!strcmp("-p",argv[i]))
- writestatus = pstdout;
- }
- signal(SIGTERM, termhandler);
- signal(SIGINT, termhandler);
- statusloop();
-}
diff --git a/user/.config/suckless/dwmblocks/scripts/clock b/user/.config/suckless/dwmblocks/scripts/clock
deleted file mode 100755
index 02daad24a..000000000
--- a/user/.config/suckless/dwmblocks/scripts/clock
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-clock=$(date '+%I')
-case "$clock" in
- "00") icon="🕛" ;;
- "01") icon="🕐" ;;
- "02") icon="🕑" ;;
- "03") icon="🕒" ;;
- "04") icon="🕓" ;;
- "05") icon="🕔" ;;
- "06") icon="🕕" ;;
- "07") icon="🕖" ;;
- "08") icon="🕗" ;;
- "09") icon="🕘" ;;
- "10") icon="🕙" ;;
- "11") icon="🕚" ;;
- "12") icon="🕛" ;;
-esac
-date=$(date "+%Y %b %d (%a) - $icon %I:%M%p")
-echo " 📅 $date"
diff --git a/user/.config/suckless/dwmblocks/scripts/cpu b/user/.config/suckless/dwmblocks/scripts/cpu
deleted file mode 100755
index b00c18ee4..000000000
--- a/user/.config/suckless/dwmblocks/scripts/cpu
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-usage=$(top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}')
-echo -e " CPU: ${usage%.*}% "
diff --git a/user/.config/suckless/dwmblocks/scripts/memory b/user/.config/suckless/dwmblocks/scripts/memory
deleted file mode 100755
index 80311d66b..000000000
--- a/user/.config/suckless/dwmblocks/scripts/memory
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')"
-echo -e " RAM: $mem "