moved to personal fennel config for awesome and added qutebrowser

This commit is contained in:
Chris Cochrun 2020-10-13 17:35:26 -05:00
parent 403cb92b7d
commit 688748f8a6
502 changed files with 8576 additions and 9597 deletions

View file

@ -0,0 +1,174 @@
local awful = require('awful')
local wibox = require('wibox')
local gears = require('gears')
local naughty = require('naughty')
local watch = awful.widget.watch
local dpi = require('beautiful').xresources.apply_dpi
local clickable_container = require('widget.bluetooth.clickable-container')
local config_dir = gears.filesystem.get_configuration_dir()
local widget_icon_dir = config_dir .. 'widget/bluetooth/icons/'
local icons = require('theme.icons')
local device_state = false
local action_name = wibox.widget {
text = 'Bluetooth Connection',
font = 'SF Pro Text Regular 11',
align = 'left',
widget = wibox.widget.textbox
}
local button_widget = wibox.widget {
{
id = 'icon',
image = icons.toggled_off,
widget = wibox.widget.imagebox,
resize = true
},
layout = wibox.layout.align.horizontal
}
local widget_button = wibox.widget {
{
button_widget,
top = dpi(7),
bottom = dpi(7),
widget = wibox.container.margin
},
widget = clickable_container
}
local action_widget = wibox.widget {
{
action_name,
nil,
{
widget_button,
layout = wibox.layout.fixed.horizontal,
},
layout = wibox.layout.align.horizontal,
},
left = dpi(24),
right = dpi(24),
forced_height = dpi(48),
widget = wibox.container.margin
}
local update_imagebox = function()
if device_state then
button_widget.icon:set_image(icons.toggled_on)
else
button_widget.icon:set_image(icons.toggled_off)
end
end
local check_device_state = function()
awful.spawn.easy_async_with_shell(
'rfkill list bluetooth',
function(stdout)
if stdout:match('Soft blocked: yes') then
device_state = false
else
device_state = true
end
update_imagebox()
end
)
end
check_device_state()
local power_on_cmd = [[
rfkill unblock bluetooth
# Create an AwesomeWM Notification
awesome-client "
naughty = require('naughty')
naughty.notification({
app_name = 'Bluetooth Manager',
title = 'System Notification',
message = 'Initializing bluetooth device...',
icon = ']] .. widget_icon_dir .. 'loading' .. '.svg' .. [['
})
"
# Add a delay here so we can enable the bluetooth
sleep 1
bluetoothctl power on
]]
local power_off_cmd = [[
bluetoothctl power off
rfkill block bluetooth
# Create an AwesomeWM Notification
awesome-client "
naughty = require('naughty')
naughty.notification({
app_name = 'Bluetooth Manager',
title = 'System Notification',
message = 'The bluetooth device has been disabled.',
icon = ']] .. widget_icon_dir .. 'bluetooth-off' .. '.svg' .. [['
})
"
]]
local toggle_action = function()
if device_state then
device_state = false
awful.spawn.easy_async_with_shell(
power_off_cmd,
function(stdout) end
)
else
device_state = true
awful.spawn.easy_async_with_shell(
power_on_cmd,
function(stdout) end
)
end
update_imagebox()
end
widget_button:buttons(
gears.table.join(
awful.button(
{},
1,
nil,
function()
toggle_action()
end
)
)
)
watch(
'rfkill list bluetooth',
5,
function(_, stdout)
check_device_state()
collectgarbage('collect')
end
)
return action_widget

View file

@ -0,0 +1,35 @@
local wibox = require('wibox')
function build(widget)
local container =
wibox.widget {
widget,
widget = wibox.container.background,
}
local old_cursor, old_wibox
container:connect_signal(
'mouse::enter',
function()
-- Hm, no idea how to get the wibox from this signal's arguments...
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = 'hand1'
end
end
)
container:connect_signal(
'mouse::leave',
function()
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
return container
end
return build

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="240"
height="240"
viewBox="0 0 240 240"
version="1.1"
id="svg4"
sodipodi:docname="bluetooth-connected.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1321"
inkscape:window-height="740"
id="namedview6"
showgrid="false"
inkscape:pagecheckerboard="true"
inkscape:zoom="0.86915209"
inkscape:cx="-203.9165"
inkscape:cy="77.465699"
inkscape:window-x="45"
inkscape:window-y="28"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
d="M 70,120 50,100 30,120 50,140 Z M 177.05,77.05 120,20 H 110 V 95.85 L 64.15,50 50,64.15 105.85,120 50,175.85 64.15,190 110,144.15 V 220 h 10 L 177.05,162.95 134.15,120 Z M 130,58.3 148.8,77.1 130,95.85 Z M 148.8,162.95 130,181.7 V 144.1 Z M 190,100 l -20,20 20,20 20,-20 z"
id="path2"
style="fill:#ffffff;fill-opacity:1;stroke-width:5"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="240" height="240" viewBox="0 0 24.00 24.00" enable-background="new 0 0 24.00 24.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 12.9975,5.83L 14.8775,7.71L 13.2813,9.31125L 14.6925,10.7175L 17.71,7.7L 12.0025,2.0025L 11.0013,2.0025L 11.0013,7.03125L 12.9975,9.02875M 5.41,3.99875L 3.99875,5.41L 10.5912,12.0025L 5,17.5875L 6.41125,18.9988L 11.0013,14.4088L 11.0013,22.0025L 12.0025,22.0025L 16.2887,17.71L 18.5888,20L 20,18.5887M 12.9975,18.1687L 12.9975,14.4088L 14.8775,16.2888"/>
</svg>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="240"
height="240"
viewBox="0 0 240 240"
version="1.1"
id="svg4"
sodipodi:docname="bluetooth-scanning.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1321"
inkscape:window-height="740"
id="namedview6"
showgrid="false"
inkscape:pagecheckerboard="true"
inkscape:zoom="0.43457604"
inkscape:cx="-749.4527"
inkscape:cy="-132.18179"
inkscape:window-x="45"
inkscape:window-y="28"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
d="m 142.4,120.1 23.2,23.2 c 2.8,-7.25 4.4,-15.1 4.4,-23.3 0,-8.15 -1.55,-15.95 -4.3,-23.15 z M 195.3,67.15 182.65,79.8 c 6.25,12.05 9.85,25.7 9.85,40.25 0,14.55 -3.6,28.15 -9.85,40.25 l 12,12 C 204.3,156.8 210,138.65 210,119.15 c 0,-19.1 -5.45,-36.85 -14.7,-52 z M 157.05,77.05 100,20 H 90 V 95.85 L 44.15,50 30,64.15 85.85,120 30,175.85 44.15,190 90,144.15 V 220 h 10 L 157.05,162.95 114.15,120 Z M 110,58.3 128.8,77.1 110,95.85 Z M 128.8,162.95 110,181.7 v -37.6 z"
id="path2"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke-width:5" />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="240" height="240" viewBox="0 0 24.00 24.00" enable-background="new 0 0 24.00 24.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 14.8783,16.2911L 12.9993,18.1701L 12.9993,14.4121M 12.9993,5.82607L 14.8783,7.70507L 12.9993,9.58407M 17.7063,7.70507L 11.9993,1.99807L 10.9993,1.99807L 10.9993,9.58407L 6.41331,4.99807L 4.99931,6.41207L 10.5853,11.9981L 4.99931,17.5841L 6.41331,18.9981L 10.9993,14.4121L 10.9993,21.9981L 11.9993,21.9981L 17.7063,16.2911L 13.4133,11.9981L 17.7063,7.70507 Z "/>
</svg>

View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="240"
height="240"
viewBox="0 0 240 240"
version="1.1"
id="svg4"
sodipodi:docname="ic_sync_48px.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1321"
inkscape:window-height="740"
id="namedview6"
showgrid="false"
inkscape:pagecheckerboard="true"
inkscape:zoom="0.61458333"
inkscape:cx="-276.66458"
inkscape:cy="-76.310045"
inkscape:window-x="45"
inkscape:window-y="28"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
d="M 120,47.272727 V 20 L 83.636361,56.363636 120,92.72727 V 65.454545 c 30.13636,0 54.54545,24.409095 54.54545,54.545455 0,9.22727 -2.31818,17.86364 -6.31818,25.5 l 13.27272,13.27273 C 188.54545,147.5 192.72727,134.27273 192.72727,120 192.72727,79.818182 160.18181,47.272727 120,47.272727 Z m 0,127.272723 c -30.136366,0 -54.545457,-24.40909 -54.545457,-54.54545 0,-9.22727 2.318182,-17.86364 6.318182,-25.5 L 58.499998,81.227273 C 51.454543,92.5 47.272725,105.72727 47.272725,120 c 0,40.18182 32.545455,72.72727 72.727275,72.72727 V 220 L 156.36363,183.63636 120,147.27273 Z"
id="path2"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke-width:4.5454545" />
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,90 @@
-------------------------------------------------
-- Bluetooth Widget for Awesome Window Manager
-- Shows the bluetooth status using the bluetoothctl command
-- Better with Blueman Manager
-------------------------------------------------
local awful = require('awful')
local gears = require('gears')
local naughty = require('naughty')
local wibox = require('wibox')
local watch = awful.widget.watch
local dpi = require('beautiful').xresources.apply_dpi
local apps = require('configuration.apps')
local clickable_container = require('widget.clickable-container')
local config_dir = gears.filesystem.get_configuration_dir()
local widget_icon_dir = config_dir .. 'widget/bluetooth/icons/'
local return_button = function()
local widget =
wibox.widget {
{
id = 'icon',
image = widget_icon_dir .. 'bluetooth-off' .. '.svg',
widget = wibox.widget.imagebox,
resize = true
},
layout = wibox.layout.align.horizontal
}
local widget_button = wibox.widget {
{
widget,
margins = dpi(7),
widget = wibox.container.margin
},
widget = clickable_container
}
widget_button:buttons(
gears.table.join(
awful.button(
{},
1,
nil,
function()
awful.spawn(apps.default.bluetooth_manager, false)
end
)
)
)
local bluetooth_tooltip = awful.tooltip
{
objects = {widget_button},
mode = 'outside',
align = 'right',
margin_leftright = dpi(8),
margin_topbottom = dpi(8),
preferred_positions = {'right', 'left', 'top', 'bottom'}
}
watch(
'rfkill list bluetooth',
5,
function(_, stdout)
local widget_icon_name = nil
if stdout:match('Soft blocked: yes') then
widget_icon_name = 'bluetooth-off'
bluetooth_tooltip.markup = 'Bluetooth is off'
else
widget_icon_name = 'bluetooth'
bluetooth_tooltip.markup = 'Bluetooth is on'
end
widget.icon:set_image(widget_icon_dir .. widget_icon_name .. '.svg')
collectgarbage('collect')
end,
widget
)
return widget_button
end
return return_button