X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/1f3a80d5d88e84b90356fcde064cd6beeaed0018..65ff7e627552a6242979de1b1352ea5bd0992e30:/.config/awesome/rc.lua diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index eaa6451..86ce215 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -24,6 +24,7 @@ local has_fdo, freedesktop = pcall(require, "freedesktop") -- Other libraries local lain = require("lain") local ccwidgets = require("cryptocoin_widgets") +local fxwidgets = require("forex_widgets") local clocksarray = require("clocksarray") local dbg = require("debugfunc") local th = require("taghelpers") @@ -77,7 +78,9 @@ cmdkey = "Mod3" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = { default = awful.layout.suit.fair, + default_horiz = awful.layout.suit.fair.horizontal, tiled = awful.layout.suit.tile, + tiled_horiz = awful.layout.suit.tile.top, floating = awful.layout.suit.floating, maximised = awful.layout.suit.max } @@ -86,6 +89,8 @@ awful.layout.layouts = { layouts.tiled, layouts.maximised, layouts.floating, + layouts.default_horiz, + layouts.tiled_horiz, } -- }}} @@ -295,17 +300,19 @@ awful.screen.connect_for_each_screen(function(s) layout = wibox.layout.fixed.horizontal, }) - if s == screen.primary then +-- if s == screen.primary then right_widgets = gears.table.join({ make_spacer(" "), ccwidgets.btc_widget, make_spacer(), ccwidgets.eth_widget, make_spacer(), + fxwidgets.ecb_widget, + make_spacer(), lain_bat.widget, make_spacer(), }, right_widgets) - end +-- end s.mywibox:setup { layout = wibox.layout.align.horizontal, @@ -380,7 +387,7 @@ tag.connect_signal("request::screen", function(t) end naughty.notify({ title = "Screen removed", - text = "Salvaged tab " .. t.name .. " onto screen " .. t.screen.name, + text = "Salvaged tab " .. t.name, }) end) @@ -409,10 +416,11 @@ end local function initialise_to_autorandr_profile() local profile + profile = nil local function process_line(line) if profile then return end - local match = string.match(line, "^([^%s]+) %(detected%)$") + local match = string.match(line, "^([^%s]+) %(detected%)") if match then profile = match end @@ -433,7 +441,7 @@ local function initialise_to_autorandr_profile() end awful.spawn.with_line_callback('autorandr', { - stderr = process_line, + stdout = process_line, output_done = output_done, exit = handle_exit }) @@ -472,7 +480,7 @@ default_tags = gears.table.join(default_tags, { selected = true, exec_once = { terminal .. " -name irc -e env MOSH_TITLE_NOPREFIX=true mosh -4 -- irc-host tmux new -As irc irssi" }, instance = { "irc" }, - targets = { "catalyst/eDP1", "mtvic/eDP1", "lehel/DisplayPort-2" }, + targets = { "catalyst/eDP1", "mtvic/eDP1", "gauting/eDP1", "lehel/DisplayPort-2" }, }, { name = "[m]", @@ -483,7 +491,7 @@ default_tags = gears.table.join(default_tags, { selected = true, exec_once = { "revolt" }, instance = { "Revolt" }, - targets = { "catalyst/eDP1", "mtvic/eDP1", "lehel/DisplayPort-2" }, + targets = { "catalyst/eDP1", "mtvic/eDP1", "gauting/eDP1", "lehel/DisplayPort-2" }, }, { name = "dflt", @@ -500,7 +508,7 @@ default_tags = gears.table.join(default_tags, { layout = layouts.default, exec_once = { "thunderbird" }, class = { "Thunderbird" }, - targets = { "catalyst/HDMI1", "mtvic/eDP1", "lehel/DisplayPort-1" }, + targets = { "catalyst/HDMI1", "mtvic/eDP1", "gauting/eDP1", "lehel/DisplayPort-1" }, }, { name = "chr", @@ -509,7 +517,7 @@ default_tags = gears.table.join(default_tags, { layout = layouts.default, exec_once = { "chromium" }, class = { "Chromium" }, - targets = { "catalyst/HDMI1", "mtvic/eDP1", "lehel/DisplayPort-1" }, + targets = { "catalyst/HDMI1", "mtvic/eDP1", "gauting/eDP1", "lehel/DisplayPort-1" }, }, { name = "ffx", @@ -518,7 +526,7 @@ default_tags = gears.table.join(default_tags, { layout = layouts.default, exec_once = { "firefox" }, class = { "Firefox" }, - targets = { "catalyst/HDMI1", "mtvic/eDP1", "lehel/DisplayPort-1" }, + targets = { "catalyst/HDMI1", "mtvic/eDP1", "gauting/eDP1", "lehel/DisplayPort-1" }, }, }) @@ -905,14 +913,28 @@ awful.key(nil, "XF86AudioMicMute", function () awful.spawn("pactl set-source-mut awful.key({ cmdkey }, "Home", function () awful.spawn("pactl set-source-mute 1 toggle") end), awful.key(nil, "XF86MonBrightnessDown", function () awful.spawn("xbacklight -dec 5%") end), awful.key(nil, "XF86MonBrightnessUp", function () awful.spawn("xbacklight -inc 5%") end), -awful.key(nil, "XF86Display", function () awful.spawn("") end), +awful.key(nil, "XF86Display", function () awful.spawn("autorandr --change --force"); initialise_to_autorandr_profile() end), awful.key(nil, "XF86WLAN", function () awful.spawn("") end), awful.key(nil, "XF86Tools", function () awful.spawn("") end), awful.key(nil, "XF86Search", function () awful.spawn("") end), awful.key(nil, "XF86LaunchA", function () awful.spawn("") end), -awful.key(nil, "XF86Explorer", function () awful.spawn("") end) +awful.key(nil, "XF86Explorer", function () awful.spawn("") end), + +awful.key({ cmdkey }, "Left", function () awful.spawn("xmms2 prev") end), +awful.key({ cmdkey }, "Right", function () awful.spawn("xmms2 next") end), +awful.key({ cmdkey }, "space", function () awful.spawn("xmms2 toggle") end), +awful.key({ cmdkey }, "\\", function () run_output_notify("xmms2 list") end) ) +function run_output_notify(cmd) + awful.spawn.easy_async(cmd, function(stdout, stderr, reason, exit_code) + naughty.notify({ + preset = naughty.config.presets.low, + title = "XMMS2 playlist", + text = stdout}) + end) +end + -- Set keys root.keys(globalkeys) -- }}} @@ -974,7 +996,7 @@ awful.rules.rules = { { rule = { class = "URxvt" }, properties = { size_hints_honor = false, } }, - { rule = { instance = "irc" }, + { rule = { instance = "irc" }, callback = move_to_tag_by_name(nil, "irc"), }, { rule = { class = "Revolt" }, @@ -992,12 +1014,24 @@ awful.rules.rules = { { rule_any = { class = { "MuPDF", "Wicd-client.py", + "Gxmessage", + "Pinentry" + }}, + properties = { floating = true, + maximized = false, + focus = true, + placement = awful.placement.centered, + }, + }, + { rule_any = { instance = { + "tridactyl-edit", + "libreoffice", + "pdfshuffler" }}, properties = { floating = true, + maximized = false, focus = true, - placement = function(c) - float_client_in_the_middle_with_margins(c, 50, 25) - end, + placement = awful.placement.centered, }, }, -- { rule_any = { class = {