Sat Jun 1 05:49:46 PM CEST 2024

This commit is contained in:
Thomas Avé 2024-06-01 17:49:46 +02:00
parent 0ce2405c81
commit 392bd9c0d6
68 changed files with 166 additions and 7980 deletions

@ -1 +0,0 @@
Subproject commit fc2b46896fe9daf1b1b1a6a0af5ae6fcfefa7511

View File

@ -1,109 +0,0 @@
-- Grab environment we need
local ipairs = ipairs
local math = math
--- The gridh layout layoutbox icon.
-- @beautiful beautiful.layout_gridh
-- @param surface
-- @see gears.surface
--- The gridv layout layoutbox icon.
-- @beautiful beautiful.layout_gridv
-- @param surface
-- @see gears.surface
local grid = {}
local function do_grid(p, orientation)
local wa = p.workarea
local cls = p.clients
-- Swap workarea dimensions, if our orientation is "east"
if orientation == 'east' then
wa.width, wa.height = wa.height, wa.width
wa.x, wa.y = wa.y, wa.x
end
if #cls > 0 then
local rows, cols
if #cls == 2 then
rows, cols = 1, 2
else
rows = math.ceil(math.sqrt(#cls))
cols = math.ceil(#cls / rows)
end
local first_col_rows = #cls - rows * (cols - 1)
for k, c in ipairs(cls) do
k = k - 1
local g = {}
local row, col, lrows, lcols
if k < first_col_rows then
row = k
col = 0
lrows = first_col_rows
lcols = cols
else
row = (k - first_col_rows) % rows
col = math.floor((k - first_col_rows) / rows) + 1
lrows = rows
lcols = cols
end
if row == lrows - 1 then
g.height = wa.height - math.ceil(wa.height / lrows) * row
g.y = wa.height - g.height
else
g.height = math.ceil(wa.height / lrows)
g.y = g.height * row
end
if col == lcols - 1 then
g.width = wa.width - math.ceil(wa.width / lcols) * col
g.x = wa.width - g.width
else
g.width = math.ceil(wa.width / lcols)
g.x = g.width * col
end
g.y = g.y + wa.y
g.x = g.x + wa.x
-- Swap window dimensions, if our orientation is "east"
if orientation == 'east' then
g.width, g.height = g.height, g.width
g.x, g.y = g.y, g.x
end
p.geometries[c] = g
end
end
end
-- Horizontal grid layout.
-- @param screen The screen to arrange.
grid.horizontal = {}
grid.horizontal.name = "gridh"
function grid.horizontal.arrange(p)
return do_grid(p, "east")
end
-- Vertical grid layout.
-- @param screen The screen to arrange.
grid.name = "grid"
function grid.arrange(p)
return do_grid(p, "south")
end
--- The grid layout.
-- Try to give all clients the same size.
-- @clientlayout awful.layout.suit.grid
-- @usebeautiful beautiful.layout_gridv
--- The horizontal grid layout.
-- Try to give all clients the same size.
-- @clientlayout awful.layout.suit.grid.horizontal
-- @usebeautiful beautiful.layout_gridh
return grid

View File

@ -1,95 +0,0 @@
local naughty = require("naughty")
local beautiful = require("beautiful")
local gears = require("gears")
local awful = require("awful")
local dpi = beautiful.xresources.apply_dpi
-- ===================================================================
-- Theme Definitions
-- ===================================================================
naughty.config.defaults.ontop = true
naughty.config.defaults.icon_size = dpi(32)
naughty.config.defaults.screen = awful.screen.focused()
naughty.config.defaults.timeout = 3
naughty.config.defaults.title = "System Notification"
naughty.config.defaults.margin = dpi(16)
naughty.config.defaults.border_width = 0
naughty.config.defaults.position = "top_right"
naughty.config.defaults.shape = function(cr, w, h)
gears.shape.rounded_rect(cr, w, h, dpi(6))
end
naughty.config.padding = dpi(7)
naughty.config.spacing = dpi(7)
naughty.config.icon_dirs = {
"/usr/share/icons/Tela-dark",
"/usr/share/pixmaps/"
}
naughty.config.icon_formats = {"png", "svg"}
-- Timeouts
naughty.config.presets.low.timeout = 3
naughty.config.presets.critical.timeout = 0
naughty.config.presets.normal = {
font = beautiful.title_font,
fg = beautiful.fg_normal,
bg = beautiful.bg_normal,
position = "top_right"
}
naughty.config.presets.low = {
font = beautiful.title_font,
fg = beautiful.fg_normal,
bg = beautiful.bg_normal,
position = "top_right"
}
naughty.config.presets.critical = {
font = "SF Display Bold 10",
fg = "#ffffff",
bg = "#ff0000",
position = "top_right",
timeout = 0
}
naughty.config.presets.ok = naughty.config.presets.normal
naughty.config.presets.info = naughty.config.presets.normal
naughty.config.presets.warn = naughty.config.presets.critical
-- ===================================================================
-- 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)
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

View File

@ -1,26 +0,0 @@
local awful = require("awful")
local lain = require("lain")
local grid = require("components.layout.grid")
local quake = lain.util.quake({app="alacritty", followtag=true, argname = '--class %s', extra="--option=window.opacity=1.0 --option=\"colors.primary.background='#000d2b'\" -e tmux", height=0.3})
-- Import panels
local top_panel = require("components.top-panel")
-- Set up each screen (add tags & panels)
awful.screen.connect_for_each_screen(function(s)
for i = 1, 10, 1
do
awful.tag.add(tostring(i % 10), {
layout = grid,
screen = s,
selected = i == 1
})
end
s.quake = quake
-- Only add the top panel on the primary screen
if s.index == 1 then
top_panel.create(s)
end
end)

View File

@ -1,183 +0,0 @@
-- ===================================================================
-- Initialization
-- ===================================================================
local awful = require("awful")
local beautiful = require("beautiful")
local wibox = require("wibox")
local theme = require("theme")
local lain = require("lain")
local tag_list = require("components.widgets.tag-list")
local layout_box = require("components.widgets.layout-box")
local battery_widget = require("components.widgets.battery-widget.battery")
local volume_widget = require("components.widgets.volume-widget.volume")
local pl = require("utils.powerline")
-- import widgets
local task_list = require("components.widgets.task-list")
-- ===================================================================
-- Custom Widgets
-- ===================================================================
local top_panel = {}
local watch_widget, watch_timer = awful.widget.watch('bash -c "checkupdates | wc -l"', 360)
local updates_indicator = wibox.widget{
{
layout = wibox.layout.fixed.horizontal,
{
{
widget = watch_widget,
},
top = 0, bottom = 2, left = 0, right = 0,
widget = wibox.container.margin
},
{
{
image = "/usr/share/icons/Papirus/48x48/apps/org.kde.archUpdate.svg",
forced_width = 18,
widget = wibox.widget.imagebox,
},
top = 5, bottom = 0, left = 5, right = 0,
widget = wibox.container.margin
}
},
widget = wibox.container.background
}
local frequency_widget = wibox.widget {
layout = wibox.layout.fixed.horizontal,
awful.widget.watch('bash -c "/usr/bin/cat /proc/cpuinfo | grep MHz | cut -b 12- | sort -r | head -n 1 | xargs printf \'%f / 1000\n\' | bc -l | awk \'{printf \\"%.2f\\n\\", $0}\'"', 1),
wibox.widget.textbox('GHz')
}
local memory_widget = wibox.widget{
layout = wibox.layout.fixed.horizontal,
lain.widget.mem({
settings = function()
widget:set_markup(lain.util.markup.font(theme.font, mem_now.used .. " MB"))
end,
}),
}
local cpu_widget = wibox.widget{
layout = wibox.layout.fixed.horizontal,
lain.widget.cpu({
settings = function()
widget:set_markup(lain.util.markup.font(theme.font, "CPU: " .. cpu_now.usage .. "%"))
end,
})
}
local clock = wibox.widget.textclock('%a %b %d, %H:%M:%S', 1)
local tag_lists = {}
local current_tag_list = wibox.widget {
layout = wibox.layout.fixed.horizontal
}
local layout_boxes = {}
local current_layout_box = wibox.widget {
layout = wibox.layout.fixed.horizontal
}
local governor_selector, governor_timer = awful.widget.watch('bash -c "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"', 5)
-- ===================================================================
-- Bar Creation
-- ===================================================================
top_panel.create = function(s)
local panel = awful.wibar({
screen = s,
position = "top",
ontop = true,
height = beautiful.top_panel_height,
width = s.geometry.width,
bg = "#12151cbb"
})
for t in screen do
tag_lists[t] = tag_list.create(t)
layout_boxes[t] = layout_box.create(t)
end
current_tag_list:add(tag_lists[s])
current_layout_box:add(layout_boxes[s])
panel:setup {
expand = "none",
layout = wibox.layout.align.horizontal,
task_list.create(s),
current_tag_list,
{
layout = wibox.layout.fixed.horizontal,
pl(wibox.widget{}, theme.bg_normal .. "00", theme.top_panel_powerline),
pl(wibox.container.margin(wibox.widget.systray(), 0, 0, 5, 5), theme.top_panel_powerline, theme.bg_normal),
pl(volume_widget({widget_type='icon_and_text'}), theme.bg_normal, theme.top_panel_powerline),
pl(awful.widget.watch('bash -c "sensors | grep Tctl | cut -f 10 -d \' \' | cut -c 2-"', 5), theme.top_panel_powerline, theme.bg_normal),
pl(memory_widget, theme.bg_normal, theme.top_panel_powerline),
pl(cpu_widget, theme.top_panel_powerline, theme.bg_normal),
pl(frequency_widget, theme.bg_normal, theme.top_panel_powerline),
pl(updates_indicator, theme.top_panel_powerline, theme.bg_normal),
pl(current_layout_box, theme.bg_normal, theme.top_panel_powerline),
pl(clock, theme.top_panel_powerline, theme.top_panel_powerline),
}
}
-- ===================================================================
-- Functionality
-- ===================================================================
-- hide panel when client is fullscreen
local function change_panel_visibility(client)
if client.screen == s then
panel.ontop = not client.fullscreen
end
end
-- connect panel visibility function to relevant signals
client.connect_signal("property::fullscreen", change_panel_visibility)
client.connect_signal("focus", change_panel_visibility)
client.connect_signal("focus", function (c, _)
current_tag_list:reset(current_tag_list)
current_tag_list:add(tag_lists[c.screen])
current_layout_box:reset(current_layout_box)
current_layout_box:add(layout_boxes[c.screen])
end)
-- connect panel visibility function to relevant signals
updates_indicator:connect_signal("button::press", function(_, _, _, _)
local update_command = 'WINIT_X11_SCALE_FACTOR=1 alacritty -e bash -c "yay ; echo \'\nDone, press any key to exit...\' ; read"'
awful.spawn.easy_async_with_shell(update_command, function(_)
watch_timer:emit_signal("timeout")
end)
end)
clock:connect_signal("button::press", function(_, _, _, _)
awful.spawn('gnome-calendar')
end)
governor_selector:connect_signal("button::press", function(c, _, _, button)
awful.spawn.easy_async_with_shell('bash -c "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"', function(output)
output = output:gsub("%s+", "")
if output == 'powersave' then
awful.spawn.easy_async('sudo /opt/power/performance.sh', function(_)
governor_selector:emit_signal("timeout")
end)
else
awful.spawn.easy_async('sudo /opt/power/powersave.sh', function(_)
governor_timer:emit_signal("timeout")
end)
end
end)
end)
end
return top_panel

View File

@ -1,75 +0,0 @@
# Battery widget
Simple and easy-to-install widget for Awesome Window Manager.
This widget consists of:
- an icon which shows the battery level:
![Battery Widget](./bat-wid-1.png)
- a pop-up window, which shows up when you hover over an icon:
![Battery Widget](./bat-wid-2.png)
Alternatively you can use a tooltip (check the code):
![Battery Widget](./bat-wid-22.png)
- a pop-up warning message which appears on bottom right corner when battery level is less that 15% (you can get the image [here](https://vk.com/images/stickers/1933/512.png)):
![Battery Widget](./bat-wid-3.png)
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `font` | Play 8 | Fond |
| `path_to_icons` | `/usr/share/icons/Arc/status/symbolic/` | Path to the folder with icons* |
| `show_current_level`| false | Show current charge level |
| `margin_right`|0| The right margin of the widget|
| `margin_left`|0| The left margin of the widget|
| `display_notification` | `false` | Display a notification on mouseover |
| `notification_position` | `top_right` | The notification position |
| `timeout` | 10 | How often in seconds the widget refreshes |
| `warning_msg_title` | _Huston, we have a problem_ | Title of the warning popup |
| `warning_msg_text` | _Battery is dying_ | Text of the warning popup |
| `warning_msg_position` | `bottom_right` | Position of the warning popup |
| `warning_msg_icon` | ~/.config/awesome/awesome-wm-widgets/battery-widget/spaceman.jpg | Icon of the warning popup |
| `enable_battery_warning` | `true` | Display low battery warning |
*Note: the widget expects following icons to be present in the folder:
- battery-caution-charging-symbolic.svg
- battery-empty-charging-symbolic.svg
- battery-full-charged-symbolic.svg
- battery-full-symbolic.svg
- battery-good-symbolic.svg
- battery-low-symbolic.svg
- battery-caution-symbolic.svg
- battery-empty-symbolic.svg
- battery-full-charging-symbolic.svg
- battery-good-charging-symbolic.svg
- battery-low-charging-symbolic.svg
- battery-missing-symbolic.svg
## Installation
This widget reads the output of acpi tool.
- install `acpi` and check the output:
```bash
$ sudo apt-get install acpi
$ acpi
Battery 0: Discharging, 66%, 02:34:06 remaining
```
```lua
local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
battery_widget(),
...
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,209 +0,0 @@
-------------------------------------------------
-- Battery Widget for Awesome Window Manager
-- Shows the battery status using the ACPI tool
-- More details could be found here:
-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget
-- @author Pavel Makhov
-- @copyright 2017 Pavel Makhov
-------------------------------------------------
local awful = require("awful")
local naughty = require("naughty")
local watch = require("awful.widget.watch")
local wibox = require("wibox")
local gfs = require("gears.filesystem")
local dpi = require('beautiful').xresources.apply_dpi
-- acpi sample outputs
-- Battery 0: Discharging, 75%, 01:51:38 remaining
-- Battery 0: Charging, 53%, 00:57:43 until charged
local HOME = os.getenv("HOME")
local WIDGET_DIR = HOME .. '/.config/awesome/awesome-wm-widgets/battery-widget'
local battery_widget = {}
local function worker(user_args)
local args = user_args or {}
local font = args.font or 'Play 8'
local path_to_icons = args.path_to_icons or "/usr/share/icons/Arc/status/symbolic/"
local show_current_level = args.show_current_level or false
local margin_left = args.margin_left or 0
local margin_right = args.margin_right or 0
local display_notification = args.display_notification or false
local display_notification_onClick = args.display_notification_onClick or true
local position = args.notification_position or "top_right"
local timeout = args.timeout or 10
local warning_msg_title = args.warning_msg_title or 'Huston, we have a problem'
local warning_msg_text = args.warning_msg_text or 'Battery is dying'
local warning_msg_position = args.warning_msg_position or 'bottom_right'
local warning_msg_icon = args.warning_msg_icon or WIDGET_DIR .. '/spaceman.jpg'
local enable_battery_warning = args.enable_battery_warning
if enable_battery_warning == nil then
enable_battery_warning = true
end
if not gfs.dir_readable(path_to_icons) then
naughty.notify{
title = "Battery Widget",
text = "Folder with icons doesn't exist: " .. path_to_icons,
preset = naughty.config.presets.critical
}
end
local icon_widget = wibox.widget {
{
id = "icon",
widget = wibox.widget.imagebox,
resize = false
},
valign = 'center',
layout = wibox.container.place,
}
local level_widget = wibox.widget {
font = font,
widget = wibox.widget.textbox
}
battery_widget = wibox.widget {
icon_widget,
level_widget,
layout = wibox.layout.fixed.horizontal,
}
-- Popup with battery info
-- One way of creating a pop-up notification - naughty.notify
local notification
local function show_battery_status(batteryType)
awful.spawn.easy_async([[bash -c 'acpi']],
function(stdout, _, _, _)
naughty.destroy(notification)
notification = naughty.notify{
text = stdout,
title = "Battery status",
icon = path_to_icons .. batteryType .. ".svg",
icon_size = dpi(16),
position = position,
timeout = 5, hover_timeout = 0.5,
width = 200,
screen = mouse.screen
}
end
)
end
-- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one
--battery_popup = awful.tooltip({objects = {battery_widget}})
-- To use colors from beautiful theme put
-- following lines in rc.lua before require("battery"):
-- beautiful.tooltip_fg = beautiful.fg_normal
-- beautiful.tooltip_bg = beautiful.bg_normal
local function show_battery_warning()
naughty.notify {
icon = warning_msg_icon,
icon_size = 100,
text = warning_msg_text,
title = warning_msg_title,
timeout = 25, -- show the warning for a longer time
hover_timeout = 0.5,
position = warning_msg_position,
bg = "#F06060",
fg = "#EEE9EF",
width = 300,
screen = mouse.screen
}
end
local last_battery_check = os.time()
local batteryType = "battery-good-symbolic"
watch("acpi -i", timeout,
function(widget, stdout)
local battery_info = {}
local capacities = {}
for s in stdout:gmatch("[^\r\n]+") do
-- Match a line with status and charge level
local status, charge_str, _ = string.match(s, '.+: ([%a%s]+), (%d?%d?%d)%%,?(.*)')
if status ~= nil then
-- Enforce that for each entry in battery_info there is an
-- entry in capacities of zero. If a battery has status
-- "Unknown" then there is no capacity reported and we treat it
-- as zero capactiy for later calculations.
table.insert(battery_info, {status = status, charge = tonumber(charge_str)})
table.insert(capacities, 0)
end
-- Match a line where capacity is reported
local cap_str = string.match(s, '.+:.+last full capacity (%d+)')
if cap_str ~= nil then
capacities[#capacities] = tonumber(cap_str) or 0
end
end
local capacity = 0
local charge = 0
local status
for i, batt in ipairs(battery_info) do
if capacities[i] ~= nil then
if batt.charge >= charge then
status = batt.status -- use most charged battery status
-- this is arbitrary, and maybe another metric should be used
end
-- Adds up total (capacity-weighted) charge and total capacity.
-- It effectively ignores batteries with status "Unknown" as we
-- treat them with capacity zero.
charge = charge + batt.charge * capacities[i]
capacity = capacity + capacities[i]
end
end
charge = charge / capacity
if show_current_level then
level_widget.text = string.format('%d%%', charge)
end
if (charge >= 1 and charge < 15) then
batteryType = "battery-empty%s-symbolic"
if enable_battery_warning and status ~= 'Charging' and os.difftime(os.time(), last_battery_check) > 300 then
-- if 5 minutes have elapsed since the last warning
last_battery_check = os.time()
show_battery_warning()
end
elseif (charge >= 15 and charge < 40) then batteryType = "battery-caution%s-symbolic"
elseif (charge >= 40 and charge < 60) then batteryType = "battery-low%s-symbolic"
elseif (charge >= 60 and charge < 80) then batteryType = "battery-good%s-symbolic"
elseif (charge >= 80 and charge <= 100) then batteryType = "battery-full%s-symbolic"
end
if status == 'Charging' then
batteryType = string.format(batteryType, '-charging')
else
batteryType = string.format(batteryType, '')
end
widget.icon:set_image(path_to_icons .. batteryType .. ".svg")
-- Update popup text
-- battery_popup.text = string.gsub(stdout, "\n$", "")
end,
icon_widget)
if display_notification then
battery_widget:connect_signal("mouse::enter", function() show_battery_status(batteryType) end)
battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end)
elseif display_notification_onClick then
battery_widget:connect_signal("button::press", function(_,_,_,button)
if (button == 3) then show_battery_status(batteryType) end
end)
battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end)
end
return wibox.container.margin(battery_widget, margin_left, margin_right)
end
return setmetatable(battery_widget, { __call = function(_, ...) return worker(...) end })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,43 +0,0 @@
local awful = require('awful')
-- ===================================================================
-- Widget Creation
-- ===================================================================
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
local layout_box = {}
layout_box.create = function(s)
local box = awful.widget.layoutbox(s)
box:buttons(
awful.util.table.join(
awful.button({}, 1,
function()
awful.layout.inc(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
)
)
)
return box
end
return layout_box

View File

@ -1,65 +0,0 @@
local awful = require("awful")
local wibox = require("wibox")
local theme = require("theme")
local tag_list = {}
tag_list.create = function(s)
local filter = function(tag)
local count = 0
for _, t in ipairs(s.tags) do
if #t:clients() > 0 or t.selected then
count = count + 1
end
end
return (#tag:clients() > 0 and count > 1) or (tag.selected and #tag:clients() == 0 and count > 1)
end
local taglist_buttons = awful.util.table.join(
awful.button({}, 1,
function(c)
c.selected = true
for _, tag in ipairs(s.tags) do
if tag.index ~= c.index then
tag.selected = false
end
end
end
)
)
return awful.widget.taglist {
screen = s,
-- filter = awful.widget.taglist.filter.noempty,
filter = filter,
widget_template = {
{
{
id = 'index_role',
widget = wibox.widget.textbox,
},
left = 10,
right = 10,
widget = wibox.container.margin
},
id = 'background_role',
widget = wibox.container.background,
create_callback = function(self, c3, _, _)
self:get_children_by_id('index_role')[1].markup = '<b> '..c3.name..' </b>'
self:connect_signal('mouse::enter', function()
if self.bg ~= theme.top_panel_powerline then
self.backup = self.bg
self.has_backup = true
end
self.bg = theme.top_panel_powerline
end)
self:connect_signal('mouse::leave', function()
if self.has_backup and not c3.selected then self.bg = self.backup end
end)
end,
},
buttons = taglist_buttons,
}
end
return tag_list

View File

@ -1,224 +0,0 @@
-- ████████╗ █████╗ ███████╗██╗ ██╗ ██╗ ██╗███████╗████████╗
-- ╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝ ██║ ██║██╔════╝╚══██╔══╝
-- ██║ ███████║███████╗█████╔╝ ██║ ██║███████╗ ██║
-- ██║ ██╔══██║╚════██║██╔═██╗ ██║ ██║╚════██║ ██║
-- ██║ ██║ ██║███████║██║ ██╗ ███████╗██║███████║ ██║
-- ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚══════╝╚═╝╚══════╝ ╚═╝
-- ===================================================================
-- Initialization
-- ===================================================================
local awful = require('awful')
local wibox = require('wibox')
local gears = require('gears')
local pl = require("utils.powerline")
local theme = require("theme")
local dpi = require('beautiful').xresources.apply_dpi
local capi = {button = button}
local ICON_DIR = gears.filesystem.get_configuration_dir() .. "/images/"
-- define module table
local task_list = {}
-- ===================================================================
-- Functionality
-- ===================================================================
local function create_buttons(buttons, object)
if buttons then
local btns = {}
for _, b in ipairs(buttons) do
-- Create a proxy button object: it will receive the real
-- press and release events, and will propagate them to the
-- button object the user provided, but with the object as
-- argument.
local btn = capi.button {modifiers = b.modifiers, button = b.button}
btn:connect_signal('press',
function()
object.minimized = false
object:raise()
end
)
btns[#btns + 1] = btn
end
return btns
end
end
local function list_update(w, buttons, label, _, objects)
-- update the widgets, creating them if needed
w:reset()
local index = 0
local count = 0
for _ in pairs(objects) do
count = count + 1
end
local static_length = 16 * count
local total_text_length = 0
for _, o in ipairs(objects) do
if o.name then
total_text_length = total_text_length + o.name:len()
end
end
local truncate = (total_text_length + static_length) > 170
for i, o in ipairs(objects) do
index = index + 1
local ib, cb, tb, cbm, bgb, tbm, ibm, tt, l, ll
ib = wibox.widget.imagebox()
tb = wibox.widget.textbox()
cb = wibox.container.margin(wibox.widget.imagebox(ICON_DIR .. "close.svg"), dpi(9), dpi(0), dpi(9), dpi(9))
cb.shape = gears.shape.circle
cbm = wibox.container.margin(cb, dpi(0), dpi(0), dpi(0), dpi(0)) -- 4, 8 ,12 ,12 -- close button
cbm:buttons(gears.table.join(awful.button({}, 1, nil,
function()
o.kill(o)
end
)))
bgb = wibox.container.background()
tbm = wibox.container.margin(tb, dpi(4), dpi(4))
ibm = wibox.container.margin(ib, dpi(5), dpi(5), dpi(5), dpi(5)) -- 12 is default top and bottom margin --app icon
l = wibox.layout.fixed.horizontal()
ll = wibox.layout.fixed.horizontal()
-- All of this is added in a fixed widget
l:fill_space(true)
l:add(ibm)
l:add(tbm)
ll:add(l)
ll:add(cbm)
if (index % 2 == 0) then
local end_color = (count == index or objects[index+1].minimized) and "" or theme.top_panel_powerline
local main_color = o.minimized and "" or theme.bg_normal
bgb:set_widget(pl(ll, main_color, end_color, true))
else
local end_color = (count == index or objects[index+1].minimized) and "" or theme.bg_normal
local main_color = o.minimized and "" or theme.top_panel_powerline
bgb:set_widget(pl(ll, main_color, end_color, true))
end
l:buttons(create_buttons(buttons, o))
-- Tooltip to display whole title, if it was truncated
tt = awful.tooltip({
objects = {tb},
mode = 'outside',
align = 'bottom',
delay_show = 1,
})
local text, _, bg_image, icon, args = label(o, tb)
args = args or {}
-- The text might be invalid, so use pcall.
if text == nil or text == '' then
tbm:set_margins(0)
else
-- truncate when title is too long
local text_only = text:match('>(.*)<')
local max_length = math.floor((155 - static_length) / count)
if (truncate and text_only:len() > max_length) then
text = text:gsub('>(.*)<', '>' .. string.sub(text_only, 1, max_length) .. '...<')
tt:set_text(text)
tt:add_to_object(tb)
else
tt:remove_from_object(tb)
end
if not tb:set_markup_silently(text) then
tb:set_markup('<i>&lt;Invalid text&gt;</i>')
end
end
-- bgb:set_bg(bg)
if type(bg_image) == 'function' then
-- TODO: Why does this pass nil as an argument?
bg_image = bg_image(tb, o, nil, objects, i)
end
-- bgb:set_bgimage(bg_image)
if icon then
ib.image = icon
else
ibm:set_margins(0)
end
w:add(bgb)
end
end
-- ===================================================================
-- Widget Creation
-- ===================================================================
local tasklist_buttons = awful.util.table.join(
awful.button({}, 1,
function(c)
if c == client.focus then
c.minimized = true
else
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
if not c:isvisible() and c.first_tag then
c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end
),
awful.button({}, 2,
function(c)
c.kill(c)
end
),
awful.button({}, 4,
function()
awful.client.focus.byidx(1)
end
),
awful.button({}, 5,
function()
awful.client.focus.byidx(-1)
end
)
)
local filter = function(c, _)
local tags = c.screen.tags
for _, t in ipairs(tags) do
if t.selected then
local ctags = c:tags()
for _, v in ipairs(ctags) do
if v == t and c.screen == client.focus.screen then
return true
end
end
end
end
return false
end
task_list.create = function(s)
return awful.widget.tasklist(
s,
filter,
tasklist_buttons,
{},
list_update,
wibox.layout.fixed.horizontal()
)
end
return task_list

View File

@ -1,119 +0,0 @@
# Volume widget
Volume widget based on [amixer](https://linux.die.net/man/1/amixer) (is used for controlling the audio volume) and [pacmd](https://linux.die.net/man/1/pacmd) (is used for selecting a sink/source). Also, the widget provides an easy way to customize how it looks, following types are supported out-of-the-box:
![types](screenshots/variations.png)
From left to right: `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc`
A right-click on the widget opens a popup where you can choose a sink/source:
![sink-sources](screenshots/volume-sink-sources.png)
Left click toggles mute and middle click opens a mixer ([pavucontrol](https://freedesktop.org/software/pulseaudio/pavucontrol/) by default).
### Features
- switch between sinks/sources by right click on the widget;
- more responsive than previous versions of volume widget, which were refreshed once a second;
- 5 predefined customizable looks;
## Installation
Clone the repo under **~/.config/awesome/** and add widget in **rc.lua**:
```lua
local volume_widget = require('awesome-wm-widgets.volume-widget.volume')
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
-- default
volume_widget(),
-- customized
volume_widget{
widget_type = 'arc'
},
```
Note that widget uses following command the get the current volume: `amixer -D pulse sget Master`, so please make sure that it works for you, otherwise you need to set parameter `device = 'default'`.
### Shortcuts
To improve responsiveness of the widget when volume level is changed by a shortcut use corresponding methods of the widget:
```lua
awful.key({ modkey }, "]", function() volume_widget:inc(5) end),
awful.key({ modkey }, "[", function() volume_widget:dec(5) end),
awful.key({ modkey }, "\\", function() volume_widget:toggle() end),
```
## Customization
It is possible to customize the widget by providing a table with all or some of the following config parameters:
### Generic parameter
| Name | Default | Description |
|---|---|---|
| `mixer_cmd` | `pavucontrol` | command to run on middle click (e.g. a mixer program) |
| `step` | `5` | How much the volume is raised or lowered at once (in %) |
| `widget_type`| `icon_and_text`| Widget type, one of `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc` |
| `device` | `pulse` | Select the device name to control |
Depends on the chosen widget type add parameters from the corresponding section below:
#### `icon` parameters
| Name | Default | Description |
|---|---|---|
| `icon_dir`| `./icons`| Path to the folder with icons |
_Note:_ if you are changing icons, the folder should contain following .svg images:
- audio-volume-high-symbolic
- audio-volume-medium-symbolic
- audio-volume-low-symbolic
- audio-volume-muted-symbolic
#### `icon_and_text` parameters
| Name | Default | Description |
|---|---|---|
| `icon_dir`| `./icons`| Path to the folder with icons |
| `font` | `beautiful.font` | Font name and size, like `Play 12` |
#### `arc` parameters
| Name | Default | Description |
|---|---|---|
| `thickness` | 2 | Thickness of the arc |
| `main_color` | `beautiful.fg_color` | Color of the arc |
| `bg_color` | `#ffffff11` | Color of the arc's background |
| `mute_color` | `beautiful.fg_urgent` | Color of the arc when mute |
| `size` | 18 | Size of the widget |
#### `horizontal_bar` parameters
| Name | Default | Description |
|---|---|---|
| `main_color` | `beautiful.fg_normal` | Color of the bar |
| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute |
| `bg_color` | `'#ffffff11'` | Color of the bar's background |
| `width` | `50` | The bar width |
| `margins` | `10` | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) |
| `shape` | `'bar'` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
| `with_icon` | `true` | Show volume icon|
_Note:_ I didn't figure out how does the `forced_height` property of progressbar widget work (maybe it doesn't work at all), thus there is a workaround with margins.
#### `vertical_bar` parameters
| Name | Default | Description |
|---|---|---|
| `main_color` | `beautiful.fg_normal` | Color of the bar |
| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute |
| `bg_color` | `'#ffffff11'` | Color of the bar's background |
| `width` | `10` | The bar width |
| `margins` | `20` | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) |
| `shape` | `'bar'` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
| `with_icon` | `true` | Show volume icon|

View File

@ -1,88 +0,0 @@
<?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="16"
viewBox="0 0 16 16"
height="16"
id="svg2"
version="1.1"
inkscape:version="0.91 r"
sodipodi:docname="audio-volume-high-symbolic.svg">
<metadata
id="metadata30">
<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>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1215"
inkscape:window-height="776"
id="namedview28"
showgrid="true"
inkscape:zoom="38.125"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
showguides="true"
inkscape:snap-intersection-paths="false"
inkscape:object-paths="false">
<inkscape:grid
type="xygrid"
id="grid4158" />
</sodipodi:namedview>
<defs
id="defs4" />
<path
d="M 6,2 2,6 2,10 6,14 6,9 7,8 6,7 Z"
id="path18"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="cccccccc" />
<path
d="M 1.300003,5 C 0.216589,5 0,6.163269 0,7.4 L 0,8.6 C 0,9.836747 0.24312,11 1.300003,11 L 3,11 3,5 Z"
id="path20"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="ssssccs" />
<path
style="opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.140638,1 11.726417,2.413582 C 12.808349,3.4955144 13.990412,5.4467621 14,8 c 0,2.551493 -1.192916,4.505751 -2.273583,5.586418 L 13.140638,15 C 14.595711,13.544927 16.019176,11 16,8 16.035061,5 14.595117,2.4544787 13.140638,1 Z"
id="path4508"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11,3.1156678 9.5897193,4.5261118 C 10.372347,5.3087395 11,6.5690611 11,8 11,9.4309388 10.372767,10.690952 9.5897193,11.474 L 11,12.884 C 12.275645,11.608355 13,9.854095 13,8 13,6.1543677 12.273068,4.3887355 11,3.1156678 Z"
id="path4529"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 8.629,5 7.2094668,6.4096296 C 8,7.05621 8,7.805653 8,8 8,8.1932576 7.982199,8.9408674 7.209,9.59 L 8.6289063,11 C 9.8466375,9.952694 10,8.5984701 10,8 10,7.400497 9.854476,6.062891 8.629,5 Z"
id="path4569"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscccc" />
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,88 +0,0 @@
<?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="16"
viewBox="0 0 16 16"
height="16"
id="svg2"
version="1.1"
inkscape:version="0.91 r"
sodipodi:docname="audio-volume-low-symbolic.svg">
<metadata
id="metadata30">
<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>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1215"
inkscape:window-height="776"
id="namedview28"
showgrid="true"
inkscape:zoom="38.125"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
showguides="true"
inkscape:snap-intersection-paths="false"
inkscape:object-paths="false">
<inkscape:grid
type="xygrid"
id="grid4158" />
</sodipodi:namedview>
<defs
id="defs4" />
<path
d="M 6,2 2,6 2,10 6,14 6,9 7,8 6,7 Z"
id="path18"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="cccccccc" />
<path
d="M 1.300003,5 C 0.216589,5 0,6.163269 0,7.4 L 0,8.6 C 0,9.836747 0.24312,11 1.300003,11 L 3,11 3,5 Z"
id="path20"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="ssssccs" />
<path
style="opacity:0.3;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.140638,1 11.726417,2.413582 C 12.808349,3.4955144 13.990412,5.4467621 14,8 c 0,2.551493 -1.192916,4.505751 -2.273583,5.586418 L 13.140638,15 C 14.595711,13.544927 16.019176,11 16,8 16.035061,5 14.595117,2.4544787 13.140638,1 Z"
id="path4508"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:0.3;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11,3.1156678 9.5897193,4.5261118 C 10.372347,5.3087395 11,6.5690611 11,8 11,9.4309388 10.372767,10.690952 9.5897193,11.474 L 11,12.884 C 12.275645,11.608355 13,9.854095 13,8 13,6.1543677 12.273068,4.3887355 11,3.1156678 Z"
id="path4529"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 8.629,5 7.2094668,6.4096296 C 8,7.05621 8,7.805653 8,8 8,8.1932576 7.982199,8.9408674 7.209,9.59 L 8.6289063,11 C 9.8466375,9.952694 10,8.5984701 10,8 10,7.400497 9.854476,6.062891 8.629,5 Z"
id="path4569"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscccc" />
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,88 +0,0 @@
<?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="16"
viewBox="0 0 16 16"
height="16"
id="svg2"
version="1.1"
inkscape:version="0.91 r"
sodipodi:docname="audio-volume-medium-symbolic.svg">
<metadata
id="metadata30">
<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>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1215"
inkscape:window-height="776"
id="namedview28"
showgrid="true"
inkscape:zoom="38.125"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
showguides="true"
inkscape:snap-intersection-paths="false"
inkscape:object-paths="false">
<inkscape:grid
type="xygrid"
id="grid4158" />
</sodipodi:namedview>
<defs
id="defs4" />
<path
d="M 6,2 2,6 2,10 6,14 6,9 7,8 6,7 Z"
id="path18"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="cccccccc" />
<path
d="M 1.300003,5 C 0.216589,5 0,6.163269 0,7.4 L 0,8.6 C 0,9.836747 0.24312,11 1.300003,11 L 3,11 3,5 Z"
id="path20"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="ssssccs" />
<path
style="opacity:0.3;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.140638,1 11.726417,2.413582 C 12.808349,3.4955144 13.990412,5.4467621 14,8 c 0,2.551493 -1.192916,4.505751 -2.273583,5.586418 L 13.140638,15 C 14.595711,13.544927 16.019176,11 16,8 16.035061,5 14.595117,2.4544787 13.140638,1 Z"
id="path4508"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11,3.1156678 9.5897193,4.5261118 C 10.372347,5.3087395 11,6.5690611 11,8 11,9.4309388 10.372767,10.690952 9.5897193,11.474 L 11,12.884 C 12.275645,11.608355 13,9.854095 13,8 13,6.1543677 12.273068,4.3887355 11,3.1156678 Z"
id="path4529"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 8.629,5 7.2094668,6.4096296 C 8,7.05621 8,7.805653 8,8 8,8.1932576 7.982199,8.9408674 7.209,9.59 L 8.6289063,11 C 9.8466375,9.952694 10,8.5984701 10,8 10,7.400497 9.854476,6.062891 8.629,5 Z"
id="path4569"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscccc" />
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,88 +0,0 @@
<?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="16"
viewBox="0 0 16 16"
height="16"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="audio-volume-muted-symbolic.svg">
<metadata
id="metadata30">
<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>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1215"
inkscape:window-height="776"
id="namedview28"
showgrid="true"
inkscape:zoom="38.125"
inkscape:cx="3.4229508"
inkscape:cy="7.947541"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
showguides="true"
inkscape:snap-intersection-paths="false"
inkscape:object-paths="false">
<inkscape:grid
type="xygrid"
id="grid4158" />
</sodipodi:namedview>
<defs
id="defs4" />
<path
d="M 6,2 2,6 2,10 6,14 6,9 7,8 6,7 Z"
id="path18"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="cccccccc" />
<path
d="M 1.300003,5 C 0.216589,5 0,6.163269 0,7.4 L 0,8.6 C 0,9.836747 0.24312,11 1.300003,11 L 3,11 3,5 Z"
id="path20"
inkscape:connector-curvature="0"
style="fill:#bebebe"
sodipodi:nodetypes="ssssccs" />
<path
style="opacity:0.3;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.140638,1 11.726417,2.413582 C 12.808349,3.4955144 13.990412,5.4467621 14,8 c 0,2.551493 -1.192916,4.505751 -2.273583,5.586418 L 13.140638,15 C 14.595711,13.544927 16.019176,11 16,8 16.035061,5 14.595117,2.4544787 13.140638,1 Z"
id="path4508"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:0.3;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11,3.1156678 9.5897193,4.5261118 C 10.372347,5.3087395 11,6.5690611 11,8 11,9.4309388 10.372767,10.690952 9.5897193,11.474 L 11,12.884 C 12.275645,11.608355 13,9.854095 13,8 13,6.1543677 12.273068,4.3887355 11,3.1156678 Z"
id="path4529"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="opacity:0.3;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 8.629,5 7.2094668,6.4096296 C 8,7.05621 8,7.805653 8,8 8,8.1932576 7.982199,8.9408674 7.209,9.59 L 8.6289063,11 C 9.8466375,9.952694 10,8.5984701 10,8 10,7.400497 9.854476,6.062891 8.629,5 Z"
id="path4569"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscccc" />
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

View File

@ -1,105 +0,0 @@
local utils = {}
local function split(string_to_split, separator)
if separator == nil then separator = "%s" end
local t = {}
for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do
table.insert(t, str)
end
return t
end
function utils.extract_sinks_and_sources(pacmd_output)
local sinks = {}
local sources = {}
local device
local properties
local ports
local in_sink = false
local in_source = false
local in_device = false
local in_properties = false
local in_ports = false
for line in pacmd_output:gmatch("[^\r\n]+") do
if string.match(line, 'source%(s%) available.') then
in_sink = false
in_source = true
end
if string.match(line, 'sink%(s%) available.') then
in_sink = true
in_source = false
end
if string.match(line, 'index:') then
in_device = true
in_properties = false
device = {
id = line:match(': (%d+)'),
is_default = string.match(line, '*') ~= nil
}
if in_sink then
table.insert(sinks, device)
elseif in_source then
table.insert(sources, device)
end
end
if string.match(line, '^\tproperties:') then
in_device = false
in_properties = true
properties = {}
device['properties'] = properties
end
if string.match(line, 'ports:') then
in_device = false
in_properties = false
in_ports = true
ports = {}
device['ports'] = ports
end
if string.match(line, 'active port:') then
in_device = false
in_properties = false
in_ports = false
device['active_port'] = line:match(': (.+)'):gsub('<',''):gsub('>','')
end
if in_device then
local t = split(line, ': ')
local key = t[1]:gsub('\t+', ''):lower()
local value = t[2]:gsub('^<', ''):gsub('>$', '')
device[key] = value
end
if in_properties then
local t = split(line, '=')
local key = t[1]:gsub('\t+', ''):gsub('%.', '_'):gsub('-', '_'):gsub(':', ''):gsub("%s+$", "")
local value
if t[2] == nil then
value = t[2]
else
value = t[2]:gsub('"', ''):gsub("^%s+", ""):gsub(' Analog Stereo', '')
end
properties[key] = value
end
if in_ports then
local t = split(line, ': ')
local key = t[1]
if key ~= nil then
key = key:gsub('\t+', '')
end
ports[key] = t[2]
end
end
return sinks, sources
end
return utils

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-volume-2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path></svg>

Before

Width:  |  Height:  |  Size: 354 B

View File

@ -1,230 +0,0 @@
-------------------------------------------------
-- The Ultimate Volume Widget for Awesome Window Manager
-- More details could be found here:
-- https://github.com/streetturtle/widgets/tree/master/volume-widget
-- @author Pavel Makhov
-- @copyright 2020 Pavel Makhov
-------------------------------------------------
local awful = require("awful")
local wibox = require("wibox")
local spawn = require("awful.spawn")
local gears = require("gears")
local beautiful = require("beautiful")
local watch = require("awful.widget.watch")
local utils = require("components.widgets.volume-widget.utils")
local LIST_DEVICES_CMD = [[sh -c "pacmd list-sinks; pacmd list-sources"]]
local function GET_VOLUME_CMD(device) return 'amixer -D ' .. device .. ' sget Master' end
local function INC_VOLUME_CMD(device, step) return 'amixer -D ' .. device .. ' sset Master ' .. step .. '%+' end
local function DEC_VOLUME_CMD(device, step) return 'amixer -D ' .. device .. ' sset Master ' .. step .. '%-' end
local function TOG_VOLUME_CMD(device) return 'amixer -D ' .. device .. ' sset Master toggle' end
local widget_types = {
icon_and_text = require("components.widgets.volume-widget.widgets.icon-and-text-widget"),
icon = require("components.widgets.volume-widget.widgets.icon-widget"),
arc = require("components.widgets.volume-widget.widgets.arc-widget"),
horizontal_bar = require("components.widgets.volume-widget.widgets.horizontal-bar-widget"),
vertical_bar = require("components.widgets.volume-widget.widgets.vertical-bar-widget")
}
local volume = {}
local rows = { layout = wibox.layout.fixed.vertical }
local popup = awful.popup{
bg = beautiful.bg_normal,
ontop = true,
visible = false,
shape = gears.shape.rounded_rect,
border_width = 1,
border_color = beautiful.bg_focus,
maximum_width = 400,
offset = { y = 5 },
widget = {}
}
local function build_main_line(device)
if device.active_port ~= nil and device.ports[device.active_port] ~= nil then
return device.properties.device_description .. ' · ' .. device.ports[device.active_port]
else
return device.properties.device_description
end
end
local function build_rows(devices, on_checkbox_click, device_type)
local device_rows = { layout = wibox.layout.fixed.vertical }
for _, device in pairs(devices) do
local checkbox = wibox.widget {
checked = device.is_default,
color = beautiful.bg_normal,
paddings = 2,
shape = gears.shape.circle,
forced_width = 20,
forced_height = 20,
check_color = beautiful.fg_urgent,
widget = wibox.widget.checkbox
}
checkbox:connect_signal("button::press", function()
spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function()
on_checkbox_click()
end)
end)
local row = wibox.widget {
{
{
{
checkbox,
valign = 'center',
layout = wibox.container.place,
},
{
{
text = build_main_line(device),
align = 'left',
widget = wibox.widget.textbox
},
left = 10,
layout = wibox.container.margin
},
spacing = 8,
layout = wibox.layout.align.horizontal
},
margins = 4,
layout = wibox.container.margin
},
bg = beautiful.bg_normal,
widget = wibox.container.background
}
row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end)
row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end)
local old_cursor, old_wibox
row:connect_signal("mouse::enter", function()
local wb = mouse.current_wibox
old_cursor, old_wibox = wb.cursor, wb
wb.cursor = "hand1"
end)
row:connect_signal("mouse::leave", function()
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end)
row:connect_signal("button::press", function()
spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function()
on_checkbox_click()
end)
end)
table.insert(device_rows, row)
end
return device_rows
end
local function build_header_row(text)
return wibox.widget{
{
markup = "<b>" .. text .. "</b>",
align = 'center',
widget = wibox.widget.textbox
},
bg = beautiful.bg_normal,
widget = wibox.container.background
}
end
local function rebuild_popup()
spawn.easy_async(LIST_DEVICES_CMD, function(stdout)
local sinks, sources = utils.extract_sinks_and_sources(stdout)
for i = 0, #rows do rows[i]=nil end
table.insert(rows, build_header_row("SINKS"))
table.insert(rows, build_rows(sinks, function() rebuild_popup() end, "sink"))
table.insert(rows, build_header_row("SOURCES"))
table.insert(rows, build_rows(sources, function() rebuild_popup() end, "source"))
popup:setup(rows)
end)
end
local function worker(user_args)
local args = user_args or {}
local mixer_cmd = args.mixer_cmd or 'pavucontrol'
local widget_type = args.widget_type
local refresh_rate = args.refresh_rate or 1
local step = args.step or 5
local device = args.device or 'pipewire'
if widget_types[widget_type] == nil then
volume.widget = widget_types['icon_and_text'].get_widget(args.icon_and_text_args)
else
volume.widget = widget_types[widget_type].get_widget(args)
end
local function update_graphic(widget, stdout)
local mute = string.match(stdout, "%[(o%D%D?)%]") -- \[(o\D\D?)\] - [on] or [off]
if mute == 'off' then widget:mute()
elseif mute == 'on' then widget:unmute()
end
local volume_level = string.match(stdout, "(%d?%d?%d)%%") -- (\d?\d?\d)\%)
if volume_level ~= nil then
volume_level = string.format("% 3d", volume_level)
widget:set_volume_level(volume_level)
end
end
function volume:inc(s)
spawn.easy_async(INC_VOLUME_CMD(device, s or step), function(stdout) update_graphic(volume.widget, stdout) end)
end
function volume:dec(s)
spawn.easy_async(DEC_VOLUME_CMD(device, s or step), function(stdout) update_graphic(volume.widget, stdout) end)
end
function volume:toggle()
spawn.easy_async(TOG_VOLUME_CMD(device), function(stdout) update_graphic(volume.widget, stdout) end)
end
function volume:mixer()
if mixer_cmd then
spawn.easy_async(mixer_cmd)
end
end
volume.widget:buttons(
awful.util.table.join(
awful.button({}, 3, function()
if popup.visible then
popup.visible = not popup.visible
else
rebuild_popup()
popup:move_next_to(mouse.current_widget_geometry)
end
end),
awful.button({}, 4, function() volume:inc() end),
awful.button({}, 5, function() volume:dec() end),
awful.button({}, 2, function() volume:mixer() end),
awful.button({}, 1, function() volume:toggle() end)
)
)
watch(GET_VOLUME_CMD(device), refresh_rate, update_graphic, volume.widget)
return volume.widget
end
return setmetatable(volume, { __call = function(_, ...) return worker(...) end })

View File

@ -1,46 +0,0 @@
local wibox = require("wibox")
local beautiful = require('beautiful')
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/components/widgets/volume-widget/icons/'
local widget = {}
function widget.get_widget(widgets_args)
local args = widgets_args or {}
local thickness = args.thickness or 2
local main_color = args.main_color or beautiful.fg_color
local bg_color = args.bg_color or '#ffffff11'
local mute_color = args.mute_color or beautiful.fg_urgent
local size = args.size or 18
return wibox.widget {
{
id = "icon",
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
resize = true,
widget = wibox.widget.imagebox,
},
max_value = 100,
thickness = thickness,
start_angle = 4.71238898, -- 2pi*3/4
forced_height = size,
forced_width = size,
bg = bg_color,
paddings = 2,
widget = wibox.container.arcchart,
set_volume_level = function(self, new_value)
self.value = new_value
end,
mute = function(self)
self.colors = { mute_color }
end,
unmute = function(self)
self.colors = { main_color }
end
}
end
return widget

View File

@ -1,58 +0,0 @@
local wibox = require("wibox")
local beautiful = require('beautiful')
local gears = require("gears")
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/components/widgets/volume-widget/icons/'
local widget = {}
function widget.get_widget(widgets_args)
local args = widgets_args or {}
local main_color = args.main_color or beautiful.fg_normal
local mute_color = args.mute_color or beautiful.fg_urgent
local bg_color = args.bg_color or '#ffffff11'
local width = args.width or 50
local margins = args.margins or 10
local shape = args.shape or 'bar'
local with_icon = args.with_icon == true and true or false
local bar = wibox.widget {
{
{
id = "icon",
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
resize = false,
widget = wibox.widget.imagebox,
},
valign = 'center',
visible = with_icon,
layout = wibox.container.place,
},
{
id = 'bar',
max_value = 100,
forced_width = width,
color = main_color,
margins = { top = margins, bottom = margins },
background_color = bg_color,
shape = gears.shape[shape],
widget = wibox.widget.progressbar,
},
spacing = 4,
layout = wibox.layout.fixed.horizontal,
set_volume_level = function(self, new_value)
self:get_children_by_id('bar')[1]:set_value(tonumber(new_value))
end,
mute = function(self)
self:get_children_by_id('bar')[1]:set_color(mute_color)
end,
unmute = function(self)
self:get_children_by_id('bar')[1]:set_color(main_color)
end
}
return bar
end
return widget

View File

@ -1,59 +0,0 @@
local wibox = require("wibox")
local beautiful = require('beautiful')
local widget = {}
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/components/widgets/volume-widget/icons/'
function widget.get_widget(widgets_args)
local args = widgets_args or {}
local font = args.font or beautiful.font
local icon_dir = args.icon_dir or ICON_DIR
return wibox.widget {
{
{
id = "icon",
resize = false,
widget = wibox.widget.imagebox,
},
valign = 'center',
layout = wibox.container.place
},
{
id = 'txt',
font = font,
widget = wibox.widget.textbox
},
layout = wibox.layout.fixed.horizontal,
set_volume_level = function(self, new_value)
self:get_children_by_id('txt')[1]:set_text(new_value)
local volume_icon_name
if self.is_muted then
volume_icon_name = 'audio-volume-muted-symbolic'
else
local new_value_num = tonumber(new_value)
if (new_value_num >= 0 and new_value_num < 33) then
volume_icon_name="audio-volume-low-symbolic"
elseif (new_value_num < 66) then
volume_icon_name="audio-volume-medium-symbolic"
else
volume_icon_name="audio-volume-high-symbolic"
end
end
self:get_children_by_id('icon')[1]:set_image(icon_dir .. volume_icon_name .. '.svg')
end,
mute = function(self)
self.is_muted = true
self:get_children_by_id('icon')[1]:set_image(icon_dir .. 'audio-volume-muted-symbolic.svg')
end,
unmute = function(self)
self.is_muted = false
end
}
end
return widget

View File

@ -1,46 +0,0 @@
local wibox = require("wibox")
local widget = {}
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/components/widgets/volume-widget/icons/'
function widget.get_widget(widgets_args)
local args = widgets_args or {}
local icon_dir = args.icon_dir or ICON_DIR
return wibox.widget {
{
id = "icon",
resize = false,
widget = wibox.widget.imagebox,
},
valign = 'center',
layout = wibox.container.place,
set_volume_level = function(self, new_value)
local volume_icon_name
if self.is_muted then
volume_icon_name = 'audio-volume-muted-symbolic'
else
local new_value_num = tonumber(new_value)
if (new_value_num >= 0 and new_value_num < 33) then
volume_icon_name="audio-volume-low-symbolic"
elseif (new_value_num < 66) then
volume_icon_name="audio-volume-medium-symbolic"
else
volume_icon_name="audio-volume-high-symbolic"
end
end
self:get_children_by_id('icon')[1]:set_image(icon_dir .. volume_icon_name .. '.svg')
end,
mute = function(self)
self.is_muted = true
self:get_children_by_id('icon')[1]:set_image(icon_dir .. 'audio-volume-muted-symbolic.svg')
end,
unmute = function(self)
self.is_muted = false
end
}
end
return widget

View File

@ -1,64 +0,0 @@
local wibox = require("wibox")
local beautiful = require('beautiful')
local gears = require("gears")
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/components/widgets/volume-widget/icons/'
local widget = {}
function widget.get_widget(widgets_args)
local args = widgets_args or {}
local main_color = args.main_color or beautiful.fg_normal
local mute_color = args.mute_color or beautiful.fg_urgent
local bg_color = args.bg_color or '#ffffff11'
local width = args.width or 10
local margins = args.height or 2
local shape = args.shape or 'bar'
local with_icon = args.with_icon == true and true or false
local bar = wibox.widget {
{
{
id = "icon",
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
resize = false,
widget = wibox.widget.imagebox,
},
valign = 'center',
visible = with_icon,
layout = wibox.container.place,
},
{
{
id = 'bar',
max_value = 100,
forced_width = width,
forced_height = 5,
margins = { top = margins, bottom = margins },
color = main_color,
background_color = bg_color,
shape = gears.shape[shape],
widget = wibox.widget.progressbar,
},
forced_width = width,
direction = 'east',
layout = wibox.container.rotate,
},
spacing = 4,
layout = wibox.layout.fixed.horizontal,
set_volume_level = function(self, new_value)
self:get_children_by_id('bar')[1]:set_value(tonumber(new_value))
end,
mute = function(self)
self:get_children_by_id('bar')[1]:set_color(mute_color)
end,
unmute = function(self)
self:get_children_by_id('bar')[1]:set_color(main_color)
end
}
return bar
end
return widget

View File

@ -1,3 +0,0 @@
<svg width="461" height="461" viewBox="0 0 461 461" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M285.08 230.397L456.218 59.27C462.294 53.193 462.294 43.359 456.218 37.284L423.511 4.56501C420.598 1.65401 416.645 0.0150146 412.519 0.0150146C408.392 0.0150146 404.439 1.65401 401.526 4.56501L230.388 175.705L59.25 4.56501C56.337 1.65401 52.384 0.0150146 48.257 0.0150146C44.131 0.0150146 40.177 1.65401 37.265 4.56501L4.55799 37.284C-1.51901 43.359 -1.51901 53.193 4.55799 59.27L175.696 230.398L4.57499 401.505C-1.49901 407.582 -1.49901 417.416 4.57499 423.491L37.284 456.21C40.195 459.121 44.149 460.76 48.276 460.76C52.403 460.76 56.356 459.121 59.27 456.21L230.387 285.09L401.505 456.21C404.418 459.121 408.371 460.76 412.498 460.76C416.626 460.76 420.579 459.121 423.49 456.21L456.199 423.491C462.273 417.416 462.273 407.582 456.199 401.505L285.08 230.397Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 894 B

View File

@ -1,707 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local naughty = require("naughty")
local beautiful = require("beautiful")
local volume_widget = require("components.widgets.volume-widget.volume")
local dpi = beautiful.xresources.apply_dpi
local modkey = "Mod4"
-- define module table
local keys = {}
-- AwesomeWM Vim Tmux Navigator
local function get_first_nonempty_tag()
local screen = awful.screen.focused()
local tags = screen.tags
for _, t in ipairs(tags) do
if #t:clients() == 0 then
return t
end
end
end
local focus_bydirection = function(direction)
awful.client.focus.global_bydirection(direction)
if client.focus then
-- focus on the client
client.focus:raise()
end
-- BUG: focus across screens is wonky when there are no clients on the destination screen
-- https://github.com/awesomeWM/awesome/issues/3638
-- Workaround: manually unfocus client after moving focus to an empty screen
local is_empty_destination = #awful.screen.focused().clients < 1
if is_empty_destination then
-- manually unfocus the current focused client
client.focus = nil
end
end
require("awesomewm-vim-tmux-navigator") {
up = {"Up", "k"},
down = {"Down", "j"},
left = {"Left", "h"},
right = {"Right", "l"},
mod = "Mod4",
mod_keysym = "Super_L",
experimental = true,
focus = focus_bydirection
}
-- ===================================================================
-- Movement Functions (Called by some keybinds)
-- ===================================================================
local function get_screen(s)
return s and screen[s]
end
-- Move given client to given direction
local function move_client(sel, dir)
sel = sel or awful.client.focus
if sel then
-- move focus
awful.client.focus.global_bydirection(dir, sel)
local c = client.focus
-- swapping inside a screen
if get_screen(sel.screen) == get_screen(c.screen) and sel ~= c then
c:swap(sel)
client.focus = sel
sel:raise()
-- swapping to an empty screen
elseif sel == c then
sel:move_to_screen(awful.screen.focused())
-- swapping to a nonempty screen
elseif get_screen(sel.screen) ~= get_screen(c.screen) and sel ~= c then
sel:move_to_screen(c.screen)
client.focus = sel
sel:raise()
end
end
end
-- Resize client in given direction
local floating_resize_amount = dpi(20)
local tiling_resize_factor = 0.01
local function resize_client(c, direction)
if awful.layout.get(mouse.screen) == awful.layout.suit.floating or (c and c.floating) then
if direction == "up" then
c:relative_move(0, 0, 0, -floating_resize_amount)
elseif direction == "down" then
c:relative_move(0, 0, 0, floating_resize_amount)
elseif direction == "left" then
c:relative_move(0, 0, -floating_resize_amount, 0)
elseif direction == "right" then
c:relative_move(0, 0, floating_resize_amount, 0)
end
else
if direction == "up" then
awful.client.incwfact(-tiling_resize_factor)
elseif direction == "down" then
awful.client.incwfact(tiling_resize_factor)
elseif direction == "left" then
awful.tag.incmwfact(-tiling_resize_factor)
elseif direction == "right" then
awful.tag.incmwfact(tiling_resize_factor)
end
end
end
-- ===================================================================
-- Mouse bindings
-- ===================================================================
-- Mouse buttons on the desktop
keys.desktopbuttons = gears.table.join(
-- left click on desktop to hide notification
awful.button({}, 1,
function ()
naughty.destroy_all_notifications()
end
),
awful.button({}, 7, function() volume_widget:inc(5) end),
awful.button({}, 6, function() volume_widget:dec(5) end)
)
-- Mouse buttons on the client
keys.clientbuttons = gears.table.join(
-- Raise client
awful.button({}, 1,
function(c)
client.focus = c
c:raise()
end
),
-- Move and Resize Client
awful.button({modkey}, 1, awful.mouse.client.move),
awful.button({modkey}, 3, awful.mouse.client.resize),
awful.button({}, 7, function() volume_widget:inc(5) end),
awful.button({}, 6, function() volume_widget:dec(5) end)
)
-- ===================================================================
-- Desktop Key bindings
-- ===================================================================
keys.globalkeys = gears.table.join(
-- =========================================
-- SPAWN APPLICATION KEY BINDINGS
-- =========================================
-- Spawn terminal
awful.key({modkey}, "Return",
function()
local c = client.focus
if c and c.class == "Alacritty" then
awful.spawn(string.format(os.getenv("XDG_CONFIG_HOME") .. "/scripts/launch_alacritty.sh %d", c.pid))
else
awful.spawn('bash -c "WINIT_X11_SCALE_FACTOR=1 alacritty"')
end
end,
{description = "open a terminal", group = "launcher"}
),
-- Spawn terminal
awful.key({modkey, "Shift"}, "Return",
function()
awful.spawn('bash -c "WINIT_X11_SCALE_FACTOR=1 alacritty"')
end,
{description = "open a terminal", group = "launcher"}
),
-- Spawn browser
awful.key({modkey}, "b",
function()
awful.spawn("firefox")
end,
{description = "Open Firefox", group = "launcher"}
),
-- Lock the screen
awful.key({"Control", "Mod1"}, "l",
function()
awful.spawn('bash -c "i3lockr --blur 25"')
end,
{description = "Open lock", group = "launcher"}
),
-- Generate TOTP
awful.key({modkey}, "y",
function()
awful.spawn.with_shell(os.getenv("XDG_CONFIG_HOME") .. "/rofi/rofi-ykman.sh")
end,
{description = "Generate TOTP", group = "launcher"}
),
-- Spawn file manager
awful.key({modkey}, "a",
function()
awful.spawn("nautilus")
end,
{description = "Open Nautilus", group = "launcher"}
),
-- launch rofi
awful.key({modkey}, "XF86Launch5",
function()
awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/scripts/toggle_rofi.sh")
end,
{description = "application launcher", group = "launcher"}
),
-- launch rofi
awful.key({modkey}, "d",
function()
awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/scripts/toggle_rofi.sh")
end,
{description = "application launcher", group = "launcher"}
),
-- launch clipman
awful.key({modkey}, "c",
function()
awful.spawn.with_shell('CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu')
end,
{description = "Clipboard manager", group = "launcher"}
),
-- Go to sleep
awful.key({"Control", "Mod2", "Mod4"}, "q",
function()
awful.spawn.with_shell('systemctl suspend')
end,
{description = "Clipboard manager", group = "launcher"}
),
-- Quake
awful.key({ }, "F9", function () awful.screen.focused().quake:toggle() end),
-- =========================================
-- FUNCTION KEYS
-- =========================================
-- Brightness
awful.key({}, "XF86MonBrightnessUp",
function()
awful.spawn("xbacklight -inc 10", false)
end,
{description = "+10%", group = "hotkeys"}
),
awful.key({}, "XF86MonBrightnessDown",
function()
awful.spawn("xbacklight -dec 10", false)
end,
{description = "-10%", group = "hotkeys"}
),
-- ALSA volume control
awful.key({}, "XF86AudioRaiseVolume",
function()
volume_widget:inc(5)
end,
{description = "volume up", group = "hotkeys"}
),
awful.key({}, "XF86AudioLowerVolume",
function()
volume_widget:dec(5)
end,
{description = "volume down", group = "hotkeys"}
),
awful.key({}, "XF86AudioMute",
function()
volume_widget:toggle()
end,
{description = "toggle mute", group = "hotkeys"}
),
awful.key({}, "XF86AudioNext",
function()
awful.spawn("playerctl next", false)
end,
{description = "next music", group = "hotkeys"}
),
awful.key({}, "XF86AudioPrev",
function()
awful.spawn("playerctl previous", false)
end,
{description = "previous music", group = "hotkeys"}
),
awful.key({}, "XF86AudioPlay",
function()
awful.spawn("playerctl play-pause", false)
end,
{description = "play/pause music", group = "hotkeys"}
),
awful.key({modkey}, "XF86AudioMute",
function()
awful.spawn("playerctl play-pause", false)
end,
{description = "play/pause music", group = "hotkeys"}
),
awful.key({modkey}, "XF86AudioRaiseVolume",
function()
awful.spawn("playerctl next", false)
end,
{description = "volume up", group = "hotkeys"}
),
awful.key({modkey}, "XF86AudioLowerVolume",
function()
awful.spawn("playerctl previous", false)
end,
{description = "volume down", group = "hotkeys"}
),
-- Screenshot on prtscn using scrot
awful.key({}, "Print",
function()
awful.spawn("scrot -e 'mv $f ~/Pictures/Screenshots/ 2>/dev/null'", false)
end
),
-- =========================================
-- RELOAD / QUIT AWESOME
-- =========================================
-- Reload Awesome
awful.key({modkey, "Shift"}, "r",
awesome.restart,
{description = "reload awesome", group = "awesome"}
),
-- Quit Awesome
awful.key({modkey}, "Escape",
function()
-- emit signal to show the exit screen
awful.spawn("rofi -show power-menu -modi power-menu:" .. os.getenv("XDG_CONFIG_HOME") .. "/scripts/rofi-power-menu")
end,
{description = "toggle exit screen", group = "hotkeys"}
),
awful.key({}, "XF86PowerOff",
function()
-- emit signal to show the exit screen
awful.spawn("rofi -show power-menu -modi power-menu:~/.config/scripts/rofi-power-menu")
end,
{description = "toggle exit screen", group = "hotkeys"}
),
awful.key({}, "XF86Calculator",
function()
awful.spawn("rofi -show calc -modi calc -no-show-match -no-sort -calc-command \"echo -n '{result}' | xsel --clipboard\"")
end,
{description = "Launch the calculator", group = "hotkeys"}
),
-- Focus client by index (cycle through clients)
awful.key({modkey}, "Tab",
function()
local screen = awful.screen.focused()
local tags = screen.tags
local current_tag = screen.selected_tag
local used_tags = {}
for _, t in ipairs(tags) do
if t == current_tag or #t:clients() > 0 then
table.insert(used_tags, t)
end
end
local found = false
for _, t in ipairs(used_tags) do
if found then
t:view_only()
return
elseif t == current_tag then
found = true
end
end
used_tags[1]:view_only()
end,
{description = "Switch to next tag", group = "client"}
),
awful.key({modkey, "Shift"}, "Tab",
function()
local tags = root.tags()
local current_tag = awful.screen.focused().selected_tag
local used_tags = {}
for _, t in ipairs(tags) do
if t == current_tag or #t:clients() > 0 then
table.insert(used_tags, t)
end
end
local found = false
for _, t in ipairs(used_tags) do
if found then
awful.screen.focus(t.screen.index)
t:view_only()
return
elseif t == current_tag then
found = true
end
end
used_tags[1]:view_only()
end,
{description = "Switch to next tag", group = "client"}
),
awful.key({"Mod1"}, "Tab", -- Alt-Tab Cycle through clients
function()
local clients = {}
local found = false
local function focus_client(c)
awful.screen.focus(c.screen.index)
c.first_tag:view_only()
client.focus = c
c:raise()
end
for _, t in ipairs(root.tags()) do
for i, c in ipairs(t:clients()) do
if found then
focus_client(c)
return
elseif c == client.focus then
found = true
end
table.insert(clients, c)
end
end
focus_client(clients[1])
end,
{description = "Switch to next tag", group = "client"}
),
awful.key({modkey}, "t",
function()
local first_empty = get_first_nonempty_tag()
if first_empty ~= nil then
first_empty:view_only()
end
end,
{description = "Switch to next tag", group = "client"}
),
awful.key({modkey, "Shift"}, "t",
function()
local first_empty = get_first_nonempty_tag()
if first_empty ~= nil then
client.focus:move_to_tag(first_empty)
first_empty:view_only()
end
end,
{description = "Switch to next tag", group = "client"}
),
-- =========================================
-- SCREEN FOCUSING
-- =========================================
-- Focus screen by index (cycle through screens)
awful.key({modkey}, "s",
function()
awful.screen.focus_relative(-1)
end
),
-- =========================================
-- CLIENT RESIZING
-- =========================================
awful.key({modkey, "Control"}, "Down",
function(_)
resize_client(client.focus, "down")
end
),
awful.key({modkey, "Control"}, "Up",
function(_)
resize_client(client.focus, "up")
end
),
awful.key({modkey, "Control"}, "Left",
function(_)
resize_client(client.focus, "left")
end
),
awful.key({modkey, "Control"}, "Right",
function(_)
resize_client(client.focus, "right")
end
),
awful.key({modkey, "Control"}, "j",
function(_)
resize_client(client.focus, "down")
end
),
awful.key({ modkey, "Control" }, "k",
function(_)
resize_client(client.focus, "up")
end
),
awful.key({modkey, "Control"}, "h",
function(_)
resize_client(client.focus, "left")
end
),
awful.key({modkey, "Control"}, "l",
function(_)
resize_client(client.focus, "right")
end
),
-- =========================================
-- GAP CONTROL
-- =========================================
-- Gap control
-- awful.key({modkey, :Shift"}, "minus",
-- function()
-- awful.tag.incgap(5, nil)
-- end,
-- {description = "increment gaps size for the current tag", group = "gaps"}
-- ),
-- awful.key({modkey}, "minus",
-- function()
-- awful.tag.incgap(-5, nil)
-- end,
-- {description = "decrement gap size for the current tag", group = "gaps"}
-- ),
awful.key({ modkey }, "=",
function ()
awful.tag.incncol( 1, nil, true)
end,
{description = "increase the number of columns", group = "layout"}
),
awful.key({ modkey }, "minus",
function ()
awful.tag.incncol(-1, nil, true)
end,
{description = "decrease the number of columns", group = "layout"}
),
-- =========================================
-- LAYOUT SELECTION
-- =========================================
-- select next layout
awful.key({modkey}, "space",
function()
awful.layout.inc(1)
end,
{description = "select next", group = "layout"}
),
-- select previous layout
awful.key({modkey, "Shift"}, "space",
function()
awful.layout.inc(-1)
end,
{description = "select previous", group = "layout"}
),
-- =========================================
-- CLIENT MINIMIZATION
-- =========================================
-- restore minimized client
awful.key({modkey, "Shift"}, "n",
function()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
c:raise()
end
end,
{description = "restore minimized", group = "client"}
)
)
-- ===================================================================
-- Client Key bindings
-- ===================================================================
keys.clientkeys = gears.table.join(
-- Move to edge or swap by direction
awful.key({modkey, "Shift"}, "Down",
function(c)
move_client(c, "down")
end
),
awful.key({modkey, "Shift"}, "Up",
function(c)
move_client(c, "up")
end
),
awful.key({modkey, "Shift"}, "Left",
function(c)
move_client(c, "left")
end
),
awful.key({modkey, "Shift"}, "Right",
function(c)
move_client(c, "right")
end
),
awful.key({modkey, "Shift"}, "j",
function(c)
move_client(c, "down")
end
),
awful.key({modkey, "Shift"}, "k",
function(c)
move_client(c, "up")
end
),
awful.key({modkey, "Shift"}, "h",
function(c)
move_client(c, "left")
end
),
awful.key({modkey, "Shift"}, "l",
function(c)
move_client(c, "right")
end
),
-- close client
awful.key({modkey}, "q",
function(c)
c:kill()
for _, i in ipairs(client.get()) do
i.minimized = false
end
end,
{description = "close", group = "client"}
),
-- float client
awful.key({modkey}, "f",
function(c)
awful.client.floating.toggle(c)
end,
{description = "float", group = "client"}
),
-- Minimize
awful.key({modkey}, "n",
function(c)
c.minimized = true
end,
{description = "minimize", group = "client"}
),
-- Maximize
awful.key({modkey}, "m",
function(c)
c.maximized = not c.maximized
c:raise()
end,
{description = "(un)maximize", group = "client"}
),
-- Full Screen
awful.key({modkey}, "F11",
function(c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "(un)fullscreen", group = "client"}
)
)
local function register_tag(tag)
keys.globalkeys = gears.table.join(keys.globalkeys,
-- Switch to tag
awful.key({modkey}, "#" .. tag + 9,
function()
local screen = awful.screen.focused()
local t = screen.tags[tag]
if t then
t:view_only()
end
end,
{description = "view tag #"..tag, group = "tag"}
),
-- Move client to tag
awful.key({modkey, "Shift"}, "#" .. tag + 9,
function()
if client.focus then
local t= client.focus.screen.tags[tag]
if t then
client.focus:move_to_tag(t)
t:view_only()
end
end
end,
{description = "move focused client to tag #"..tag, group = "tag"}
)
)
end
-- Bind all key numbers to tags
for i = 1, 10 do
register_tag(i)
end
return keys

@ -1 +0,0 @@
Subproject commit 88f5a8abd2649b348ffec433a24a263b37f122c0

View File

@ -1,69 +0,0 @@
-- Standard awesome libraries
local gears = require("gears")
local awful = require("awful")
local beautiful = require("beautiful")
-- Local imports
local grid = require("components.layout.grid")
-- Import theme
beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua")
-- Load components
require("components.notifications")
require("components.screen")
require("utils.signals")
-- Autofocus a new client when previously focused one is closed
require("awful.autofocus")
-- Define layouts
awful.layout.append_default_layouts({
awful.layout.suit.tile,
awful.layout.suit.floating,
grid.horizontal,
awful.layout.suit.fair.horizontal,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
grid,
})
-- List of apps to run on start-up
local run_on_start_up = {
"numlockx on",
"nm-applet",
"xcape -e \"Super_L=Super_L|XF86Launch5\" -t 5000",
gears.filesystem.get_configuration_dir() .. "/scripts/setup_display.sh",
"feh --no-fehbg --bg-fill " .. gears.filesystem.get_configuration_dir() .. "/images/wallpaper.png",
}
-- Run all the apps listed in run_on_start_up
for _, app in ipairs(run_on_start_up) do
local findme = app
local firstspace = app:find(" ")
if firstspace then
findme = app:sub(0, firstspace - 1)
end
-- Run commands only if it's not already running.
awful.spawn.with_shell(string.format("echo 'pgrep -f -u $USER -x %s > /dev/null || (%s)' | bash -", findme, app), false)
end
-- Start timers
gears.timer {
timeout = 60,
call_now = true,
autostart = true,
callback = function()
awful.spawn({"xmodmap", "/home/user/.Xmodmap"}) -- If not repeated it sometimes just stops working
end
}
-- Import Keybinds
local keys = require("keys")
root.keys(keys.globalkeys)
root.buttons(keys.desktopbuttons)
-- Import rules
local create_rules = require("rules").create
awful.rules.rules = create_rules(keys.clientkeys, keys.clientbuttons)

View File

@ -1,73 +0,0 @@
-- ██████╗ ██╗ ██╗██╗ ███████╗███████╗
-- ██╔══██╗██║ ██║██║ ██╔════╝██╔════╝
-- ██████╔╝██║ ██║██║ █████╗ ███████╗
-- ██╔══██╗██║ ██║██║ ██╔══╝ ╚════██║
-- ██║ ██║╚██████╔╝███████╗███████╗███████║
-- ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝
-- ===================================================================
-- Initialization
-- ===================================================================
local awful = require("awful")
local beautiful = require("beautiful")
-- define screen height and width
local screen_height = awful.screen.focused().geometry.height
local screen_width = awful.screen.focused().geometry.width
-- define module table
local rules = {}
-- ===================================================================
-- Rules
-- ===================================================================
-- return a table of client rules including provided keys / buttons
function rules.create(clientkeys, clientbuttons)
return {
-- All clients will match this rule.
{
rule = {},
properties = {
titlebars_enabled = beautiful.titlebars_enabled,
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.centered,
size_hints_honor = false
},
},
-- Floating clients.
{
rule_any = {
name = {
"Steam Guard - Computer Authorization Required"
},
role = {
"pop-up",
"GtkFileChooserDialog"
},
type = {
"dialog"
}
}, properties = {floating = true}
},
-- File chooser dialog
{
rule_any = {role = {"GtkFileChooserDialog"}},
properties = {floating = true, width = screen_width * 0.55, height = screen_height * 0.65}
},
}
end
-- return module table
return rules

View File

@ -1,48 +0,0 @@
local dpi = require("beautiful.xresources").apply_dpi
local theme = {}
-- Font
theme.font = "Ubuntu 12"
theme.title_font = "Ubuntu 12"
-- Background
theme.bg_normal = "#1f2430"
theme.bg_dark = "#000000"
theme.bg_focus = "#151821"
theme.bg_urgent = "#ed8274"
theme.bg_minimize = "#444444"
-- Foreground
theme.fg_normal = "#ffffff"
theme.fg_focus = "#e4e4e4"
theme.fg_urgent = "#ffffff"
theme.fg_minimize = "#ffffff"
-- Window Gap Distance
theme.useless_gap = dpi(2)
-- Show Gaps if Only One Client is Visible
theme.gap_single_client = false
-- Window Borders
theme.border_width = dpi(3)
theme.border_normal = "#00000000"
theme.border_focus = "#002F5F"
theme.border_marked = theme.fg_urgent
-- Panel Sizing
theme.top_panel_height = dpi(30)
theme.top_panel_powerline = "#002F5F"
-- Taglist
theme.taglist_bg_focus = theme.top_panel_powerline
-- Notification Sizing
theme.notification_max_width = dpi(350)
-- System Tray
theme.bg_systray = theme.top_panel_powerline
theme.systray_icon_spacing = dpi(15)
-- return theme
return theme

View File

@ -1,22 +0,0 @@
local mouse_utils = {}
function mouse_utils.move_mouse_onto_focused_client()
local c = client.focus
if c then
local geometry = c:geometry()
local mouse_coords = mouse.coords()
local margin = 10
-- Don't move the mouse if it's already over the client
if not (mouse_coords.x > geometry.x - margin
and mouse_coords.x < geometry.x + geometry.width + margin
and mouse_coords.y > geometry.y - margin
and mouse_coords.y < geometry.y + geometry.height + margin) then
local x = geometry.x + geometry.width/2
local y = geometry.y + geometry.height/2
mouse.coords({x = x, y = y}, true)
end
end
end
return mouse_utils

View File

@ -1,34 +0,0 @@
local lain = require("lain")
local wibox = require("wibox")
local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi
-- ===================================================================
-- Helper functions
-- ===================================================================
local function powerline(widget, bgcolor, adjacentcolor, right)
right = right or false
local arrow = right and lain.util.separators.arrow_right or lain.util.separators.arrow_left
-- if (not right) then
-- table.insert(container, )
-- else
-- table.insert(container, )
-- end
return wibox.widget{
{
layout = wibox.layout.fixed.horizontal,
{
wibox.container.margin(widget, dpi(6), dpi(10), dpi(0), dpi(1)),
bg = bgcolor,
widget = wibox.container.background
},
arrow(bgcolor, adjacentcolor)
},
top = 0, bottom = 0, left = 0, right = 0,
widget = wibox.container.margin
}
end
return powerline

View File

@ -1,79 +0,0 @@
local awful = require("awful")
local beautiful = require("beautiful")
local gears = require("gears")
local mouse_utils = require("utils.mouse")
-- Focus clients under mouse
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)
client.connect_signal("manage", function (c)
-- Set the window as a slave (put it at the end of others instead of setting it as master)
if not awesome.startup then
awful.client.setslave(c)
end
if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
-- Unminimize and unmaximize the other clients
for _, o in ipairs(client.get()) do
o.minimized = false
o.maximized = false
o.fullscreen = false
end
gears.timer.delayed_call(function()
local geometry = c:geometry()
local x = geometry.x + geometry.width/2
local y = geometry.y + geometry.height/2
mouse.coords({x = x, y = y}, true)
end)
end)
-- Reload config when screen geometry changes
screen.connect_signal("property::geometry", awesome.restart)
-- ===================================================================
-- Garbage collection (allows for lower memory consumption)
-- ===================================================================
collectgarbage("setpause", 110)
collectgarbage("setstepmul", 1000)
client.connect_signal("property::maximized", function(focused)
local hide = focused.maximized or focused.fullscreen
for _, c in ipairs(client.get()) do
if not c.floating and c.screen == focused.screen and c.first_tag == focused.first_tag then
c.minimized = hide
end
end
focused.minimized = false
end)
client.connect_signal("unmanage", function(unmanaged)
if unmanaged.maximized then
for _, c in ipairs(client.get()) do
if not c.floating and c.screen == unmanaged.screen then
c.minimized = false
end
end
end
end)
client.connect_signal("focus", function(c)
if #c.screen.clients > 1 then
c.border_color = beautiful.border_focus
end
gears.timer.delayed_call(mouse_utils.move_mouse_onto_focused_client)
end)
client.connect_signal("unfocus", function(c)
c.border_color = beautiful.border_normal
end)

View File

@ -1,12 +0,0 @@
[global]
frame_color = "#00000000"
separator_color= frame
background = "#24273A"
foreground = "#ffffff"
font = "Ubuntu 10.5"
width = (0, 600)
padding = 15
origin = top-right
offset = 10x10
horizontal_padding = 20
gap_size = 15

View File

@ -1,26 +0,0 @@
[user]
email = email@thomasave.be
name = Thomas Avé
[alias]
s = status
a = add
[color]
ui = auto
[core]
excludesfile = ~/.gitignore
editor = nvim
[diff]
noprefix = true
[pull]
rebase = false
[push]
autoSetupRemote = true
[init]
defaultBranch = master
[credential]
helper = store
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f

View File

@ -1,8 +0,0 @@
(
move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
)

View File

@ -1,23 +0,0 @@
(
selected_tab: Reset,
command_fg: White,
selection_bg: Blue,
selection_fg: White,
cmdbar_bg: Blue,
cmdbar_extra_lines_bg: Blue,
disabled_fg: DarkGray,
diff_line_add: Green,
diff_line_delete: Red,
diff_file_added: LightGreen,
diff_file_removed: LightRed,
diff_file_moved: LightMagenta,
diff_file_modified: Yellow,
commit_hash: Magenta,
commit_time: LightCyan,
commit_author: Green,
danger_fg: Red,
push_gauge_bg: Blue,
push_gauge_fg: Reset,
tag_fg: LightMagenta,
branch_fg: LightYellow,
)

View File

@ -1,13 +0,0 @@
theme = "base16_transparent"
[editor]
line-number = "relative"
mouse = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.file-picker]
hidden = false

View File

@ -1,61 +0,0 @@
{ config, pkgs, ... }:
{
home.username = "server";
home.homeDirectory = "/home/server";
home.stateVersion = "23.11"; # Please read the comment before changing.
targets.genericLinux.enable = true;
nixpkgs.config.allowUnfree = true;
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
pkgs.ctop
pkgs.nodejs
pkgs.luarocks
pkgs.jre
pkgs.stdenv.cc.cc.lib
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
home.sessionVariables = {
EDITOR = "nvim";
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
};
programs.home-manager.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
};
}

View File

@ -1,6 +0,0 @@
ipc = off
splash = false
preload = ~/.config/awesome/images/wallpaper.png
wallpaper = DP-3,~/.config/awesome/images/wallpaper.png
wallpaper = DP-2,~/.config/awesome/images/wallpaper.png
wallpaper = HDMI-A-1,~/.config/awesome/images/wallpaper.png

View File

@ -1,184 +0,0 @@
set $mod Mod4
font pango:monospace 0
exec --no-startup-id "/home/user/.config/scripts/setup_display.sh"
exec_always --no-startup-id "feh --no-fehbg --bg-fill /home/user/.config/wallpaper/wallpaper.png"
exec --no-startup-id "picom -b"
exec_always --no-startup-id "killall polybar; polybar -r &"
exec --no-startup-id "nm-applet &"
exec_always --no-startup-id "xmodmap /home/user/.Xmodmap"
exec --no-startup-id xcape -e "Super_L=Super_L|XF86Launch5" -t 5000
bindsym --whole-window --border button7 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym --whole-window --border button6 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
bindsym $mod+XF86AudioMute exec --no-startup-id playerctl play-pause
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym $mod+XF86AudioRaiseVolume exec --no-startup-id playerctl next
bindsym $mod+XF86AudioLowerVolume exec --no-startup-id playerctl previous
bindsym $mod+XF86AudioMute exec --no-startup-id playerctl play-pause
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s 10%+
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 10%-
bindsym ctrl+Mod4+q exec systemctl suspend
bindsym ctrl+Mod1+l exec i3lockr --blur 25
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec /home/user/.config/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2)
bindsym $mod+minus split v; exec /home/user/.config/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2)
bindsym $mod+bar split h; exec /home/user/.config/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2)
# kill focused window
bindsym $mod+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec "~/.config/scripts/toggle_rofi.sh"
bindsym $mod+XF86Launch5 exec "~/.config/scripts/toggle_rofi.sh"
bindsym $mod+Escape exec "rofi -show power-menu -modi power-menu:~/.config/scripts/rofi-power-menu"
bindsym XF86PowerOff exec "rofi -show power-menu -modi power-menu:~/.config/scripts/rofi-power-menu"
bindsym $mod+c exec CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu
bindsym $mod+b exec firefox
bindsym $mod+a exec nautilus
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+ctrl+l split h
# split in vertical orientation
bindsym $mod+ctrl+j split v
# change container layout (stacked, tabbed, toggle split)
# bindsym $mod+m exec "/home/user/.config/i3/toggle_maximize.sh"
bindsym $mod+m fullscreen toggle
# toggle tiling / floating
bindsym $mod+f floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
workspace 1 output DP-1
workspace 2 output primary
workspace 1 output DP-2
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1; workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2; workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3; workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4; workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5; workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6; workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7; workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8; workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9; workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10; workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window's width.
# Pressing right will grow the window's width.
# Pressing up will shrink the window's height.
# Pressing down will grow the window's height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
# Colors
client.focused #00000000 #00000000 #ffffff #2e9ef4 #002F5F
client.unfocused #00000000 #00000000 #ffffff #2e9ef4 #00000000
client.focused_inactive #00000000 #00000000 #ffffff #484e50 #00000000
bindsym $mod+r mode "resize"
# Hide the title bar
default_border pixel 2
default_floating_border pixel 2
# Useless gapps
gaps inner 5
smart_gaps on

View File

@ -1,15 +0,0 @@
ACTIVE_WORKSPACE=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused == true) | .name')
if [ $ACTIVE_WORKSPACE != fullscreen ]
then
i3-msg mark _maximized_window
gnome-terminal
i3-msg mark _placeholder_window
i3-msg [con_mark="_maximized_window"] focus
i3-msg move container to workspace fullscreen
i3-msg [con_mark="_maximized_window"] focus
else
i3-msg swap mark "_placeholder_window"
i3-msg [con_mark="_maximized_window"] focus
i3-msg unmark _maximized_window
i3-msg [con_mark="_placeholder_window"] kill
fi

View File

@ -1,412 +0,0 @@
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = true;
# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 10;
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
# shadow-opacity = .75
# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
shadow-offset-x = -7;
# The top offset for shadows, in pixels. (defaults to -15)
# shadow-offset-y = -15
shadow-offset-y = -7;
# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0
# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0
# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
# shadow-color = "#000000"
# Specify a list of conditions of windows that should have no shadow.
#
# examples:
# shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"_GTK_FRAME_EXTENTS@:c",
"!focused"
];
# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
# clip-shadow-above = []
# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
# shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
# xinerama-shadow-crop = false
#################################
# Fading #
#################################
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used.
fading = false
# fading = false;
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
fade-in-step = 1;
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
# fade-out-step = 0.03
fade-out-step = 1;
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
fade-delta = 0
# Specify a list of conditions of windows that should not be faded.
# fade-exclude = []
# Do not fade on window open/close.
no-fading-openclose = true
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false
#################################
# Transparency / Opacity #
#################################
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 0.99
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
# inactive-opacity-override = true
# inactive-opacity-override = true;
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
# active-opacity = 1.0
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0
# Specify a list of conditions of windows that should never be considered focused.
# focus-exclude = []
focus-exclude = [ "class_g = 'Cairo-clock'" ];
# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
# Note we don't make any guarantee about possible conflicts with other
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
# example:
# opacity-rule = [ "80:class_g = 'URxvt'" ];
#
opacity-rule = ["0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'",]
#################################
# Corners #
#################################
# Sets the radius of rounded window corners. When > 0, the compositor will
# round the corners of windows. Does not interact well with
# `transparent-clipping`.
corner-radius = 0
# Exclude conditions for rounded corners.
rounded-corners-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
# Background-Blurring #
#################################
# Parameters for background blurring, see the *BLUR* section for more information.
# blur-method =
# blur-size = 12
#
# blur-deviation = false
#
# blur-strength = 5
# Blur background of semi-transparent / ARGB windows.
# Bad in performance, with driver-dependent behavior.
# The name of the switch may change without prior notifications.
#
# blur-background = false
# Blur background of windows when the window frame is not opaque.
# Implies:
# blur-background
# Bad in performance, with driver-dependent behavior. The name may change.
#
# blur-background-frame = false
# Use fixed blur strength rather than adjusting according to window opacity.
# blur-background-fixed = false
# Specify the blur convolution kernel, with the following format:
# example:
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
#
# blur-kern = ""
blur-kern = "3x3box";
# Exclude conditions for background blur.
# blur-background-exclude = []
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# General Settings #
#################################
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
backend = "glx"
# backend = "xrender";
# Enable/disable VSync.
# vsync = false
vsync = true;
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
# dbus = false
# Try to detect WM windows (a non-override-redirect window with no
# child that has 'WM_STATE') and mark them as active.
#
# mark-wmwin-focused = false
mark-wmwin-focused = true;
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
# mark-ovredir-focused = false
mark-ovredir-focused = true;
# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# detect-rounded-corners = false
detect-rounded-corners = true;
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
#
# detect-client-opacity = false
detect-client-opacity = true;
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
#
# use-ewmh-active-win = false
# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
# unredir-if-possible-exclude = []
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# detect-transient = false
detect-transient = true;
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. This usually means windows from the same application
# will be considered focused or unfocused at the same time.
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
#
# detect-client-leader = false
# Resize damaged region by a specific number of pixels.
# A positive value enlarges it while a negative one shrinks it.
# If the value is positive, those additional pixels will not be actually painted
# to screen, only used in blur calculation, and such. (Due to technical limitations,
# with use-damage, those pixels will still be incorrectly painted to screen.)
# Primarily used to fix the line corruption issues of blur,
# in which case you should use the blur radius value here
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
# with a 5x5 one you use `--resize-damage 2`, and so on).
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
#
# resize-damage = 1
# Specify a list of conditions of windows that should be painted with inverted color.
# Resource-hogging, and is not well tested.
#
# invert-color-include = []
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content (but never
# practically happened) and may not work with blur-background.
# My tests show a 15% performance boost. Recommended.
#
glx-no-stencil = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes,
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
# Recommended if it works.
#
# glx-no-rebind-pixmap = false
# Disable the use of damage information.
# This cause the whole screen to be redrawn everytime, instead of the part of the screen
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
# The opposing option is use-damage
#
# no-use-damage = false
use-damage = true;
# Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers
# with GLX backend for some users.
#
# xrender-sync-fence = false
# GLX backend: Use specified GLSL fragment shader for rendering window contents.
# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
# in the source tree for examples.
#
# glx-fshader-win = ""
# Force all windows to be painted with blending. Useful if you
# have a glx-fshader-win that could turn opaque pixels transparent.
#
# force-win-blend = false
# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# no-ewmh-fullscreen = false
# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
#
# max-brightness = 1.0
# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them.
#
# transparent-clipping = false
# Set the log level. Possible values are:
# "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case doesn't matter.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# log-level = "debug"
log-level = "warn";
# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = "/path/to/your/log/file"
# Show all X errors (for debugging)
# show-all-xerrors = false
# Write process ID to a file.
# write-pid-path = "/path/to/your/log/file"
# Window type settings
#
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
# "tooltip", "notification", "combo", and "dnd".
#
# Following per window-type options are available: ::
#
# fade, shadow:::
# Controls window-type-specific shadow and fade settings.
#
# opacity:::
# Controls default opacity of the window type.
#
# focus:::
# Controls whether the window of this type is to be always considered focused.
# (By default, all window types except "normal" and "dialog" has this on.)
#
# full-shadow:::
# Controls whether shadow is drawn under the parts of the window that you
# normally won't be able to see. Useful when the window has parts of it
# transparent, and you want shadows in those areas.
#
# clip-shadow-above:::
# Controls wether shadows that would have been drawn above the window should
# be clipped. Useful for dock windows that should have no shadow painted on top.
#
# redir-ignore:::
# Controls whether this type of windows should cause screen to become
# redirected again after been unredirected. If you have unredir-if-possible
# set, and doesn't want certain window to cause unnecessary screen redirection,
# you can set this to `true`.
#
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; clip-shadow-above = true; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
};

View File

@ -1,13 +0,0 @@
;==========================================================
; Color theme
;==========================================================
[colors]
background = #1f2430
blue = #002F5F
red = #802929
green = #427241
yellow = #dbd759
black = #000000
white = #ffffff
gray = #808080

View File

@ -1,198 +0,0 @@
;==========================================================
;
;==========================================================
; Include powerline utility
include-file = ~/.config/polybar/powerline-for-polybar.config
; Include color scheme
include-file = ~/.config/polybar/colors.config
;=======================================
; Bar
;=======================================
[bar/example]
; Generic options
width = 100%
height = 32
dpi-x = 96
dpi-y = 96
tray-position = right
tray-background = ${colors.blue}
tray-offset-x = 0
tray-padding = 7
; Set bar's default background/foreground color
background = #9912151c
foreground = ${colors.white}
; Set bar's fonts list
font-0 = "Noto Sans:size=13:weight=85:antialias=true;3"
font-1 = "Source Code Pro:pixelsize=20:antialias=true;6"
font-2 = "Source Code Pro:size=11:weight=bold:antialias=true;3"
font-3 = "Font Awesome 6 Free Solid:size=10:antialias=true;3"
font-4 = "Font Awesome 6 Free:size=10:antialias=true;3"
font-5 = "Font Awesome 6 Brands:size=10:antialias=true;3"
font-6 = "Font Awesome v4 Compatibility:size=10:antialias=true;3"
; Set modules list
modules-left = xwindow
modules-center = i3
modules-right = updates temperature memory clockspeed cpu pulseaudio date startarrow
fixed-center = true
;=======================================
; Modules
;=======================================
[module/startarrow]
inherit = powerline-modules/right-to-left-starting-arrow
background = ${colors.blue}
background-next = ${colors.background}
[module/pulseaudio]
type = internal/pulseaudio
inherit = powerline-templates/right-to-left-item
background = ${colors.blue}
background-next = ${colors.background}
label-muted-foreground = ${colors.gray}
format-foreground = ${colors.white}
format-volume-background = ${colors.blue}
format-muted-background = ${colors.blue}
format-volume = " <ramp-volume> <label-volume> "
format-muted = "  <label-volume> "
ramp-volume-0 = 🔈
ramp-volume-1 = 🔊
[module/date]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${colors.blue}
; Other settings
type = internal/date
format-background = ${self.background}
format-foreground = ${colors.white}
date = " %a %b %d, %H:%M:%S "
[module/cpu]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${colors.blue}
; Other settings
type = internal/cpu
format-background = ${self.background}
format-foreground = ${colors.white}
label = " CPU %percentage%% "
[module/memory]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${colors.blue}
; Other settings
type = internal/memory
format-background = ${self.background}
format-foreground = ${colors.white}
label = " %used% "
[module/updates]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${root.background}
; Other settings
type = custom/script
format-background = ${self.background}
format-foreground = ${colors.white}
format-warn-background = ${self.background}
exec = checkupdates | wc -l
format = "  <label> "
click-left = WINIT_X11_SCALE_FACTOR=1 alacritty -e bash -c "yay ; echo Done, press any key to exit... ; read"
[module/clockspeed]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.blue}
background-next = ${colors.background}
; Other settings
type = custom/script
format-background = ${self.background}
format-foreground = ${colors.white}
format-warn-background = ${self.background}
exec = cat /proc/cpuinfo | grep MHz | cut -b 12- | sort -r | head -n 1 | xargs printf '%f / 1000\\n' | bc -l | awk '{printf "%.2f\\n", $0}'
format = " <label> GHz "
[module/temperature]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.blue}
background-next = ${colors.background}
; Other settings
type = custom/script
format-background = ${colors.blue}
format-foreground = ${colors.white}
format-warn-background = ${self.background}
exec = sensors | grep Tctl | awk '{print $2}' | cut -d '+' -f 2
format = " <label> "
[module/governor]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${colors.blue}
; Other settings
type = custom/script
format-background = ${self.background}
format-foreground = ${colors.white}
format-warn-background = ${self.background}
exec = cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
format = " <label> "
click-left = /home/user/.config/scripts/toggle_performance.sh
[module/xwindow]
; Other settings
type = internal/xwindow
inherit = powerline-templates/left-to-right-item
background = ${colors.blue}
background-next = ${root.background}
format-background = ${self.background}
format-foreground = ${colors.white}
label = "  %title% "
label-maxlen = 80
[module/i3]
type = internal/i3
pin-workspaces = false
show-urgent = true
index-sort = true
enable-click = true
label-unfocused-padding = 3
label-focused-background = ${colors.blue}
label-visible-background = ${colors.background}
label-focused-padding = 3
label-focused-font=3
label-unfocused-font=3
label-visible-font=3
label-separator-padding = 2
label-focused = %index%
label-unfocused = %index%
label-visible = %index%
label-visible-mode = %mode%
label-mode-padding = 3
label-visible-padding = 3
label-mode-background = ${colors.blue}
[module/battery]
type = custom/script
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${colors.blue}
format-background = ${self.background}
format-foreground = ${colors.white}
exec = upower -i /org/freedesktop/UPower/devices/battery_BAT1 | ag percentage | awk '{print $2}'
format = " <label>  "

View File

@ -1,448 +0,0 @@
; ============================================================================ ;
;
; POWERLINE FOR POLYBAR - powerline-for-polybar.config
;
; ---------------------------------------------------------------------------- ;
;
; This file contains all the necessary stuff to build your own, Powerline-based,
; fancy Polybar setup.
;
; ---------------------------------------------------------------------------- ;
;
; All provided templates are documented in this file, with a description and
; the usage syntax.
;
; ============================================================================ ;
; ============================================================================
;
; :: STAND-ALONE MODULES ::
;
; ============================================================================ ;
; ============================================================================ ;
; modules :: left-to-right
; ============================================================================ ;
;
; # Left-to-right starting arrow
;
; Display a starting arrow at the beginning of a left-to-right line.
;
; NOTE: You may want to add customized content here. DON'T ! Use a regular,
; left-to-right-item for this purpose. Background and foreground colors
; are set on a per module basis.
;
; Usage:
; [module/mystartingarrow]
; inherit = powerline-modules/left-to-right-starting-arrow
; background = #rrggbb
; background-next = #rrggbb
;
; Mandatory settings:
; background Color of starting arrow. People often wants this to match
; the main theme color.
; background-next Background color of first item in line.
;
[powerline-modules/left-to-right-starting-arrow]
type = custom/text
content-background = ${self.background-next}
content-foreground = ${self.background}
content = ""
;
; # Left-to-right end-of-line separator
;
; Display a final arrow to nicely end your line with separators.
;
; Usage:
; [module/myendingarrow]
; inherit = powerline-modules/left-to-right-end-of-line-separator
; separator = #rrggbb
;
; Mandatory settings:
; separator Color of line item separator.
;
[powerline-modules/left-to-right-end-of-line-separator]
type = custom/text
content-foreground = ${self.separator}
content = ""
; ============================================================================ ;
; modules :: right-to-left
; ============================================================================ ;
;
; # Right-to-left starting arrow
;
; Display a starting arrow at the beginning of a right-to-left line.
;
; NOTE: You may want to add customized content here. DON'T ! Use a regular,
; right-to-left-item for this purpose. Background and foreground colors
; are set on a per module basis.
;
; Usage:
; [module/mystartingarrow]
; inherit = powerline-modules/right-to-left-starting-arrow
; background = #rrggbb
; background-next = #rrggbb
;
; Mandatory settings:
; background Color of starting arrow. People often wants this to match
; the main theme color.
; background-next Background color of first item in line.
;
[powerline-modules/right-to-left-starting-arrow]
type = custom/text
content-background = ${self.background-next}
content-foreground = ${self.background}
label-font = 1
content = " "
;
; # Right-to-left end-of-line separator
;
; Display a final arrow to nicely end your line with separators.
;
; Usage:
; [module/myendingarrow]
; inherit = powerline-modules/right-to-left-end-of-line-separator
; separator = #rrggbb
;
; Mandatory settings:
; separator Color of line item separator.
;
[powerline-modules/right-to-left-end-of-line-separator]
type = custom/text
content-foreground = ${self.separator}
label-font = 1
content = "  "
; ============================================================================ ;
;
; :: MODULES TEMPLATES ::
;
; ============================================================================ ;
; ============================================================================ ;
; templates :: left-to-right
; ============================================================================ ;
;
; # Left-to-right in-line item
;
; Display a left-to-right, in-line item.
;
; Usage:
; [module/mymodule]
; inherit = powerline-templates/left-to-right-item
; background = #rrggbb
; background-next = #rrggbb
; (...)
;
; Mandatory settings:
; background Background color of current item
; background-next Background color of next item in line. Should be set on
; ${root.background} if current item is last in line.
;
[powerline-templates/left-to-right-item]
format-suffix-foreground = ${self.background}
format-suffix-background = ${self.background-next}
format-suffix = ""
format-volume-suffix-foreground = ${self.background}
format-volume-suffix-background = ${self.background-next}
format-volume-suffix = ""
format-muted-suffix-foreground = ${self.background}
format-muted-suffix-background = ${self.background-next}
format-muted-suffix = ""
format-mounted-suffix-foreground = ${self.background}
format-mounted-suffix-background = ${self.background-next}
format-mounted-suffix = ""
format-unmounted-suffix-foreground = ${self.background}
format-unmounted-suffix-background = ${self.background-next}
format-unmounted-suffix = ""
format-connected-suffix-foreground = ${self.background}
format-connected-suffix-background = ${self.background-next}
format-connected-suffix = ""
format-disconnected-suffix-foreground = ${self.background}
format-disconnected-suffix-background = ${self.background-next}
format-disconnected-suffix = ""
content-suffix-foreground = ${self.background}
content-suffix-background = ${self.background-next}
content-suffix = ""
;
; # Left-to-right in-line item with separator
;
; Display a left-to-right, in-line item with separator.
;
; Usage:
; [module/mymodule]
; inherit = powerline-templates/left-to-right-item-with-separator
; background = #rrggbb
; separator = #rrggbb
; (...)
;
; Mandatory settings:
; background Background color of current item
; separator Color of line item separator.
;
[powerline-templates/left-to-right-item-with-separator]
; Prefixes
format-prefix-foreground = ${self.separator}
format-prefix-background = ${self.background}
format-prefix = ""
format-volume-prefix-foreground = ${self.separator}
format-volume-prefix-background = ${self.background}
format-volume-prefix = ""
format-muted-prefix-foreground = ${self.background}
format-muted-prefix-background = ${self.separator}
format-muted-prefix = ""
format-mounted-prefix-foreground = ${self.separator}
format-mounted-prefix-background = ${self.background}
format-mounted-prefix = ""
format-unmounted-prefix-foreground = ${self.separator}
format-unmounted-prefix-background = ${self.background}
format-unmounted-prefix = ""
format-connected-prefix-foreground = ${self.separator}
format-connected-prefix-background = ${self.background}
format-connected-prefix = ""
format-disconnected-prefix-foreground = ${self.separator}
format-disconnected-prefix-background = ${self.background}
format-disconnected-prefix = ""
content-prefix-foreground = ${self.separator}
content-prefix-background = ${self.background}
content-prefix = ""
; Suffixes
format-suffix-foreground = ${self.background}
format-suffix-background = ${self.separator}
format-suffix = ""
format-volume-suffix-foreground = ${self.background}
format-volume-suffix-background = ${self.separator}
format-volume-suffix = ""
format-muted-suffix-foreground = ${self.separator}
format-muted-suffix-background = ${self.background}
format-muted-suffix = ""
format-mounted-suffix-foreground = ${self.background}
format-mounted-suffix-background = ${self.separator}
format-mounted-suffix = ""
format-unmounted-suffix-foreground = ${self.background}
format-unmounted-suffix-background = ${self.separator}
format-unmounted-suffix = ""
format-connected-suffix-foreground = ${self.background}
format-connected-suffix-background = ${self.separator}
format-connected-suffix = ""
format-disconnected-suffix-foreground = ${self.background}
format-disconnected-suffix-background = ${self.separator}
format-disconnected-suffix = ""
content-suffix-foreground = ${self.background}
content-suffix-background = ${self.separator}
content-suffix = ""
;
; # Left-to-right line-starting item with separator
;
; Display a left-to-right, *line starting* item with separator.
;
; NOTE: This template shall only be inherited by the leftmost item of a
; left-to-right line with separators. It avoids the appearance
; of a separating arrow half at the leftmost part of the item.
;
; Usage:
; [module/mystartingmodule]
; inherit = powerline-templates/left-to-right-starting-item-with-separator
; background = #rrggbb
; separator = #rrggbb
; (...)
;
; Mandatory settings:
; background Background color of current item
; separator Color of line item separator.
;
[powerline-templates/left-to-right-starting-item-with-separator]
; Suffixes needed only
format-suffix-foreground = ${self.background}
format-suffix-background = ${self.separator}
format-suffix = ""
format-volume-suffix-foreground = ${self.background}
format-volume-suffix-background = ${self.separator}
format-volume-suffix = ""
format-muted-suffix-foreground = ${self.separator}
format-muted-suffix-background = ${self.background}
format-muted-suffix = ""
format-mounted-suffix-foreground = ${self.background}
format-mounted-suffix-background = ${self.separator}
format-mounted-suffix = ""
format-unmounted-suffix-foreground = ${self.background}
format-unmounted-suffix-background = ${self.separator}
format-unmounted-suffix = ""
format-connected-suffix-foreground = ${self.background}
format-connected-suffix-background = ${self.separator}
format-connected-suffix = ""
format-disconnected-suffix-foreground = ${self.background}
format-disconnected-suffix-background = ${self.separator}
format-disconnected-suffix = ""
content-suffix-foreground = ${self.background}
content-suffix-background = ${self.separator}
content-suffix = ""
; ============================================================================ ;
; templates :: right-to-left
; ============================================================================ ;
;
; # Right-to-left in-line item
;
; Display a right-to-left, in-line item.
;
; Usage:
; [module/mymodule]
; inherit = powerline-templates/right-to-left-item
; background = #rrggbb
; background-next = #rrggbb
; (...)
;
; Mandatory settings:
; background Background color of current item
; background-next Background color of next item in line. Should be set on
; ${root.background} if current item is last in line.
;
[powerline-templates/right-to-left-item]
format-prefix-foreground = ${self.background}
format-prefix-background = ${self.background-next}
format-prefix = ""
format-volume-prefix-foreground = ${self.background}
format-volume-prefix-background = ${self.background-next}
format-volume-prefix = ""
format-muted-prefix-foreground = ${self.background}
format-muted-prefix-background = ${self.background-next}
format-muted-prefix = ""
format-mounted-prefix-foreground = ${self.background}
format-mounted-prefix-background = ${self.background-next}
format-mounted-prefix = ""
format-unmounted-prefix-foreground = ${self.background}
format-unmounted-prefix-background = ${self.background-next}
format-unmounted-prefix = ""
format-connected-prefix-foreground = ${self.background}
format-connected-prefix-background = ${self.background-next}
format-connected-prefix = ""
format-disconnected-prefix-foreground = ${self.background}
format-disconnected-prefix-background = ${self.background-next}
format-disconnected-prefix = ""
content-prefix-foreground = ${self.background}
content-prefix-background = ${self.background-next}
content-prefix = ""
;
; # Right-to-left in-line item with separator
;
; Display a right-to-left, in-line item with separator.
;
; Usage:
; [module/mymodule]
; inherit = powerline-templates/right-to-left-item-with-separator
; background = #rrggbb
; separator = #rrggbb
; (...)
;
; Mandatory settings:
; background Background color of current item
; separator Color of line item separator.
;
[powerline-templates/right-to-left-item-with-separator]
; Prefixes
format-prefix-foreground = ${self.background}
format-prefix-background = ${self.separator}
format-prefix = ""
format-volume-prefix-foreground = ${self.background}
format-volume-prefix-background = ${self.separator}
format-volume-prefix = ""
format-muted-prefix-foreground = ${self.separator}
format-muted-prefix-background = ${self.background}
format-muted-prefix = ""
format-mounted-prefix-foreground = ${self.background}
format-mounted-prefix-background = ${self.separator}
format-mounted-prefix = ""
format-unmounted-prefix-foreground = ${self.background}
format-unmounted-prefix-background = ${self.separator}
format-unmounted-prefix = ""
format-connected-prefix-foreground = ${self.background}
format-connected-prefix-background = ${self.separator}
format-connected-prefix = ""
format-disconnected-prefix-foreground = ${self.background}
format-disconnected-prefix-background = ${self.separator}
format-disconnected-prefix = ""
content-prefix-foreground = ${self.background}
content-prefix-background = ${self.separator}
content-prefix = ""
; Suffixes
format-suffix-foreground = ${self.separator}
format-suffix-background = ${self.background}
format-suffix = ""
format-volume-suffix-foreground = ${self.separator}
format-volume-suffix-background = ${self.background}
format-volume-suffix = ""
format-muted-suffix-foreground = ${self.background}
format-muted-suffix-background = ${self.separator}
format-muted-suffix = ""
format-mounted-suffix-foreground = ${self.separator}
format-mounted-suffix-background = ${self.background}
format-mounted-suffix = ""
format-unmounted-suffix-foreground = ${self.separator}
format-unmounted-suffix-background = ${self.background}
format-unmounted-suffix = ""
format-connected-suffix-foreground = ${self.separator}
format-connected-suffix-background = ${self.background}
format-connected-suffix = ""
format-disconnected-suffix-foreground = ${self.separator}
format-disconnected-suffix-background = ${self.background}
format-disconnected-suffix = ""
content-suffix-foreground = ${self.separator}
content-suffix-background = ${self.background}
content-suffix = ""
;
; # Right-to-left line-starting item with separator
;
; Display a right-to-left, *line starting* item with separator.
;
; NOTE: This template shall only be inherited by the rightmost item of a
; right-to-left line with separators. It avoids the appearance
; of a separating arrow half at the rightmost part of the item.
;
; Usage:
; [module/mystartingmodule]
; inherit = powerline-templates/right-to-left-starting-item-with-separator
; background = #rrggbb
; separator = #rrggbb
; (...)
;
; Mandatory settings:
; background Background color of current item
; separator Color of line item separator.
;
[powerline-templates/right-to-left-starting-item-with-separator]
; Prefixes needed only
format-prefix-foreground = ${self.background}
format-prefix-background = ${self.separator}
format-prefix = ""
format-volume-prefix-foreground = ${self.background}
format-volume-prefix-background = ${self.separator}
format-volume-prefix = ""
format-muted-prefix-foreground = ${self.separator}
format-muted-prefix-background = ${self.background}
format-muted-prefix = ""
format-mounted-prefix-foreground = ${self.background}
format-mounted-prefix-background = ${self.separator}
format-mounted-prefix = ""
format-unmounted-prefix-foreground = ${self.background}
format-unmounted-prefix-background = ${self.separator}
format-unmounted-prefix = ""
format-connected-prefix-foreground = ${self.background}
format-connected-prefix-background = ${self.separator}
format-connected-prefix = ""
format-disconnected-prefix-foreground = ${self.background}
format-disconnected-prefix-background = ${self.separator}
format-disconnected-prefix = ""
content-prefix-foreground = ${self.background}
content-prefix-background = ${self.separator}
content-prefix = ""

View File

@ -1,4 +0,0 @@
try:
from main import *
except Exception as e:
print(e)

View File

@ -1,206 +0,0 @@
from libqtile import bar, layout, hook
from qtile_extras import widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
from qtile_extras.widget.decorations import PowerLineDecoration
from widgets.volume import Volume
import traverse
class Colors:
background = "#1f2430"
accent = "#002F5F"
panel_height = 28
panel_font_size = 13
font = "Ubuntu"
powerline_right= {
"decorations": [
PowerLineDecoration(path="arrow_right", size=10)
],
"padding": 6
}
screens = [
Screen(
top=bar.Bar(
widgets = [
widget.TaskList(theme_path="/user/share/icons/Papirus/16x16/"),
widget.Sep(padding=10, linewidth=0),
widget.GroupBox(
rounded=False,
inactive="#ffffff",
active="#ffffff",
highlight_method="block",
highlight_color=Colors.accent,
this_current_screen_border=Colors.accent,
other_current_screen_border=Colors.accent,
this_screen_border="#00000000",
other_screen_border="#00000000",
font="Ubuntu bold",
padding=9,
hide_unused=True
),
widget.Spacer(),
widget.Sep(linewidth=0, background=None, **powerline_right), # Workaround for having the last arrow
widget.Systray(icon_size=24, background=Colors.accent, **powerline_right),
widget.Memory(format="{MemUsed: .2f}{mm}", measure_mem="G", background=Colors.background, **powerline_right),
widget.ThermalSensor(tag_sensor='Tctl', background=Colors.accent, **powerline_right),
widget.CPU(background=Colors.background, format="CPU {load_percent}%", **powerline_right),
widget.CPU(background=Colors.accent, format="{freq_max}GHz", **powerline_right),
Volume(size=12, background=Colors.background, theme_path="/usr/share/icons/Papirus/16x16/"),
Volume(background=Colors.background, **powerline_right),
widget.Image(filename="/usr/share/icons/Papirus/48x48/apps/org.kde.archUpdate.svg", background=Colors.accent, margin_y=6),
widget.CheckUpdates(background=Colors.accent, distro="Arch_yay", initial_text="0", no_update_string="0", execute='WINIT_X11_SCALE_FACTOR=1 alacritty -e bash -c "yay ; echo \'\nDone, press any key to exit...\' ; read"', **powerline_right),
widget.CurrentLayout(background=Colors.background, **powerline_right),
widget.Clock(
foreground="#ffffff",
background=Colors.accent,
format="%a %b %d, %H:%M:%S",
**powerline_right
),
widget.Sep(padding=2, linewidth=0, background=Colors.accent),
],
size=panel_height, background=Colors.background + "99"
),
wallpaper="/home/user/.config/qtile/wallpaper.png",
wallpaper_mode="stretch"
),
Screen(wallpaper="/home/user/.config/qtile/wallpaper.png", wallpaper_mode="stretch"),
Screen(wallpaper="/home/user/.config/qtile/wallpaper.png", wallpaper_mode="stretch"),
]
mod = "mod4"
terminal = guess_terminal()
keys = [
# A list of available commands that can be bound to keys can be found
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
# Switch between windows
Key([mod], 'k', lazy.function(traverse.up)),
Key([mod], 'j', lazy.function(traverse.down)),
Key([mod], 'h', lazy.function(traverse.left)),
Key([mod], 'l', lazy.function(traverse.right)),
Key([mod], "f", lazy.window.toggle_floating(), desc="Move focus up"),
Key([mod], "m", lazy.window.toggle_fullscreen(), desc="Move focus up"),
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
# Move windows between left/right columns or move up/down in current stack.
# Moving out of range in Columns layout will create new column.
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
# Grow windows. If current window is on the edge of screen and direction
# will be to screen edge - window would shrink.
Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"),
Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right"),
Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"),
Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# Toggle between split and unsplit sides of stack.
# Split = all windows displayed
# Unsplit = 1 window displayed, like Max layout, but still with
# multiple stack panes
Key(
[mod, "shift"],
"Return",
lazy.layout.toggle_split(),
desc="Toggle between split and unsplit sides of stack",
),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod], "b", lazy.spawn("firefox"), desc="Launch browser"),
# Toggle between different layouts as defined below
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
]
groups = []
for i in list(range(1, 10)) + [0]:
groups.append(Group(str(i)))
for i in groups[:10]:
keys.extend(
[
# mod1 + letter of group = switch to group
Key(
[mod],
i.name,
lazy.group[i.name].toscreen(),
desc="Switch to group {}".format(i.name),
),
# mod1 + shift + letter of group = switch to & move focused window to group
Key(
[mod, "shift"],
i.name,
lazy.window.togroup(i.name, switch_group=True),
desc="Switch to & move focused window to group {}".format(i.name),
),
# Or, use below if you prefer not to switch to that group.
# # mod1 + shift + letter of group = move focused window to group
# Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
# desc="move focused window to group {}".format(i.name)),
]
)
layout_settings = {
"border_focus": Colors.accent,
"border_normal": "#050f43",
# "border_normal_stack": "#00000000",
# "border_focus_stack": "#00000000",
"border_width": 2,
"margin": 3
}
mouse = [
Drag([mod], "Button1", lazy.window.set_position(),
start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_position(), start=lazy.window.get_size())
]
layouts = [
layout.Columns(**layout_settings),
layout.Tile(**layout_settings),
layout.Max(),
# Try more layouts by unleashing below layouts.
# layout.Stack(num_stacks=2),
# layout.Bsp(),
# layout.Matrix(),
# layout.MonadTall(),
# layout.MonadWide(),
# layout.RatioTile(),
# layout.TreeTab(),
# layout.VerticalTile(),
# layout.Zoomy(),
]
dgroups_key_binder = None
dgroups_app_rules = [] # type: list
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(
float_rules=[
*layout.Floating.default_float_rules,
Match(wm_class="confirmreset"), # gitk
Match(wm_class="makebranch"), # gitk
Match(wm_class="maketag"), # gitk
Match(wm_class="ssh-askpass"), # ssh-askpass
Match(title="branchdialog"), # gitk
Match(title="pinentry"), # GPG key password entry
]
)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True
# If things like steam games want to auto-minimize themselves when losing
# focus, should we respect this or not?
auto_minimize = False
wmname = "LG3D"

View File

@ -1,100 +0,0 @@
"""
This plugin exports four functions - up, down, left and right - that when called will
move window focus to the first window in that general direction. Focussing is based
entirely on position and geometry, so is independent of screens, layouts and whether
windows are floating or tiled. It can also move focus to and from empty screens.
Example usage:
import traverse
keys.extend([
Key([mod], 'k', lazy.function(traverse.up)),
Key([mod], 'j', lazy.function(traverse.down)),
Key([mod], 'h', lazy.function(traverse.left)),
Key([mod], 'l', lazy.function(traverse.right)),
])
Qtile versions known to work: 0.16 - 0.18
"""
from libqtile.config import Screen
def up(qtile):
_focus_window(qtile, -1, 'y')
def down(qtile):
_focus_window(qtile, 1, 'y')
def left(qtile):
_focus_window(qtile, -1, 'x')
def right(qtile):
_focus_window(qtile, 1, 'x')
def get_window_in_direction(qtile, dir, axis):
win = None
win_wide = None
dist = 10000
dist_wide = 10000
cur = qtile.current_window
if not cur:
cur = qtile.current_screen
if axis == 'x':
dim = 'width'
band_axis = 'y'
band_dim = 'height'
cur_pos = cur.x
band_min = cur.y
band_max = cur.y + cur.height
else:
dim = 'height'
band_axis = 'x'
band_dim = 'width'
band_min = cur.x
cur_pos = cur.y
band_max = cur.x + cur.width
cur_pos += getattr(cur, dim) / 2
windows = [w for g in qtile.groups if g.screen for w in g.windows]
windows.extend([s for s in qtile.screens if not s.group.windows])
if cur in windows:
windows.remove(cur)
for w in windows:
if isinstance(w, Screen) or not w.minimized:
pos = getattr(w, axis) + getattr(w, dim) / 2
gap = dir * (pos - cur_pos)
if gap > 5:
band_pos = getattr(w, band_axis) + getattr(w, band_dim) / 2
if band_min < band_pos < band_max:
if gap < dist:
dist = gap
win = w
else:
if gap < dist_wide:
dist_wide = gap
win_wide = w
if not win:
win = win_wide
return win
def _focus_window(qtile, dir, axis):
win = get_window_in_direction(qtile, dir, axis)
if win:
qtile.focus_screen(win.group.screen.index)
win.group.focus(win, True)
if not isinstance(win, Screen):
win.focus(False)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 KiB

View File

@ -1,28 +0,0 @@
from qtile_extras.widget import Volume as QVolume
from libqtile import images
class Volume(QVolume):
def __init__(self, size=None, **kwargs):
super().__init__(**kwargs)
self.size = size
def setup_images(self):
names = (
"audio-volume-high",
"audio-volume-low",
"audio-volume-medium",
"audio-volume-muted",
)
d_images = images.Loader(self.theme_path)(*names)
for name, img in d_images.items():
new_height = self.size if self.size else self.bar.height - 1
img.resize(height=new_height)
if img.width > self.length:
self.length = img.width + self.actual_padding * 2
if self.size:
matrix = img.pattern.get_matrix()
matrix.translate(tx=0, ty=-1 * (self.bar.height -1 - self.size) / 2 - 1)
img.pattern.set_matrix(matrix)
self.surfaces[name] = img.pattern

View File

@ -1,115 +1 @@
/*
Copyright © Blacksuan19 @ 2020
part of material ocean colorscheme
licensed under GNU's GPL 3
*/
* {
background: #0f111a;
foreground: #f1f1f1;
selected: #0033a1;
selected-text: #ffffff;
}
window {
transparency: "real";
background-color: @background;
text-color: @foreground;
width: 800px;
border-radius: 5px;
}
textbox-prompt-colon {
expand: false;
background-color: @background;
padding: 4px 0px 0px 6px;
}
inputbar {
children: [ textbox-prompt-colon, entry ];
background-color: @background;
text-color: @foreground;
expand: false;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @selected;
margin: 0px 0px 0px 0px;
padding: 0px 0px 4px 0px;
position: center;
}
entry {
background-color: @background;
text-color: @foreground;
placeholder-color: @foreground;
expand: true;
horizontal-align: 0;
blink: true;
padding: 4px 0px 0px 4px;
font: "SF Pro Rounded 25";
}
case-indicator {
background-color: @background;
text-color: @foreground;
spacing: 0;
}
listview {
background-color: @background;
columns: 1;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
fixed-height:true;
lines: 5;
}
mainbox {
background-color: @background;
children: [ inputbar, message, listview ];
spacing: 20px;
padding: 20px 15px 15px 15px;
}
message {
children: [ textbox ];
border-radius: 5px;
}
textbox {
background-color: @selected;
text-color: @foreground;
padding: 20px 6px 20px 80px;
}
element {
background-color: @background;
text-color: @foreground;
orientation: horizontal;
border-radius: 4px;
padding: 2px 2px 2px 2px;
}
element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
element-icon {
size: 40px;
border: 10px;
}
element-text {
padding: 20px 0px 0px 10px;
}
element selected {
background-color: @selected;
text-color: @selected-text;
border: 0px;
border-radius: 3px;
border-color: @selected;
}

View File

@ -1,289 +0,0 @@
set nocompatible
syntax on
let VIMHOME = split(&rtp, ",")[0]
let $VIMHOME = VIMHOME
" vim-plug
call plug#begin(VIMHOME."/plugs")
" Plug 'Valloric/YouCompleteMe'
Plug 'nixprime/cpsm', {'do': './install.sh'}
Plug 'kien/ctrlp.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'ervandew/supertab'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'ConradIrwin/vim-bracketed-paste'
Plug 'NLKNguyen/papercolor-theme'
Plug 'Shougo/deoplete.nvim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'cohama/lexima.vim', {'do': 'sed -i \"s/has(.nvim.) && //\" autoload/lexima/insmode.vim'}
Plug 'editorconfig/editorconfig-vim'
Plug 'gmarik/Vundle.vim'
Plug 'hdima/python-syntax'
Plug 'jeetsukumaran/vim-buffergator'
Plug 'kristijanhusak/vim-hybrid-material'
Plug 'lambdalisue/fern.vim'
Plug 'lervag/vimtex'
Plug 'neovimhaskell/haskell-vim'
Plug 'nvie/vim-flake8'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'pangloss/vim-javascript'
Plug 'posva/vim-vue'
Plug 'rhysd/vim-grammarous'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'tmux-plugins/vim-tmux'
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'tomtom/tcomment_vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-scripts/indentpython.vim'
Plug 'vimwiki/vimwiki'
call plug#end()
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
let mapleader=","
:command W w
:command Q q
:command WQ wq
:command Wq wq
nnoremap j gj
nnoremap k gk
nnoremap <C-U> <C-O>
nnoremap <C-E> <C-U>
" don't store .swp files in the file's own directory
" neither for .ext~ files
set directory=/home/user/.vim/tmp/
set backupdir=/home/user/.vim/tmp/
" VimWiki
let g:vimwiki_key_mappings = { 'table_mappings': 0 }
let g:vimwiki_markdown_link_ext = 1
autocmd FileType vimwiki setlocal shiftwidth=2 softtabstop=2 expandtab
" Autoindent for filetype
filetype plugin indent on
set autoindent
set encoding=utf-8
set scrolloff=5
set sidescrolloff=10
set completeopt-=preview
set backspace=indent,eol,start
" Splits
set splitbelow
set splitright
" CtrlP
let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'}
nnoremap <silent> <C-o> :CtrlPBuffer<CR>
let g:cpsm_unicode=1
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
" Unsaved buffer switching
set hidden
" Line numbering
set number
set numberwidth=4
:set mouse=a
" Allow xterm-key usage inside tmux
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
" Persistent undo
set undodir=~/.vim/undodir/
set undofile
set undolevels=1000
set undoreload=10000
" Searching
set ignorecase
set smartcase
set incsearch
set hlsearch
nnoremap <leader><space> :noh<CR>
" Text wrapping
set lbr
" Vimtex
let g:tex_flavor = 'latex'
" Tabs
if has("autocmd")
filetype plugin indent on
autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab
endif
" Terminal colors
set t_Co=256
set background=dark
let g:airline_theme="solarized"
let g:airline_solarized_bg="dark"
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Commenting
nnoremap <silent> <leader>c :TComment<CR>
nnoremap <silent> <leader>C :TCommentBlock<CR>
vnoremap <silent> <leader>c :TCommentInline<CR>
vnoremap <silent> <leader>C :TCommentBlock<CR>
" Tab completion
set wildmode=longest,list
set wildmenu
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 13
let g:airline_powerline_fonts = 1
set laststatus=2
set ttimeoutlen=50
" Color scheme
syntax enable
let python_highlight_all=1
let g:solarized_termcolors=256
colorscheme hybrid_material
" Remap u to y
vnoremap u y
" Save clipboard on quit
autocmd VimLeave * call system("xsel -ib", getreg('+'))
" Automatically remove trailing spaces
let blacklist = ['vimwiki']
autocmd BufWritePre * if index(blacklist, &ft) < 0 | :%s/\s\+$//e
" Use deoplete.
autocmd FileType python let g:deoplete#enable_at_startup = 1
" VPW: set filetype for .py3
autocmd BufRead,BufNewFile *.py3 set filetype=python
" Vue indent
autocmd FileType vue setlocal shiftwidth=2 softtabstop=2 expandtab
autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 expandtab
autocmd FileType vue syntax sync fromstart
" Disable shift+k for manual lookup
map <S-k> <Nop>
" Prolog: set filetype for .pl
autocmd BufRead,BufNewFile *.pl set filetype=prolog
" Disable modelines, fix CVE
set modelines=0
set nomodeline
" Coc extensions
set updatetime=300
set shortmess+=c
if has("nvim-0.5.0") || has("patch-8.1.1564")
" Recently vim can merge signcolumn and number column into one
set signcolumn=number
else
set signcolumn=yes
endif
let g:coc_global_extensions = []
command! -nargs=1 Ext :call add(g:coc_global_extensions, <args>)
let g:coc_filetype_map = {'tex': 'latex', 'md': 'markdown'}
nmap <silent> <leader>p <Plug>(coc-diagnostic-prev)
nmap <silent> <leader>n <Plug>(coc-diagnostic-next)
nmap <silent> <leader>f <Plug>(coc-codeaction-line)
vmap <silent> <leader>f <Plug>(coc-codeaction-line)
nmap <buffer> gd <plug>(lsp-definition)
nnoremap <Leader>p :CocList yank<CR>
vnoremap <Leader>p :CocList yank<CR>
Ext 'coc-snippets'
Ext 'coc-emoji'
Ext 'coc-highlight'
Ext 'coc-emmet'
" Ext 'coc-omnisharp'
Ext 'coc-vimtex'
Ext 'coc-json'
Ext 'coc-java'
Ext 'coc-pyright'
Ext 'coc-css'
Ext 'coc-html'
Ext 'coc-cmake'
Ext 'coc-clangd'
Ext 'coc-docker'
Ext 'coc-fzf-preview'
Ext 'coc-ltex'
Ext 'coc-vetur'
Ext 'coc-yank'
" Ext 'coc-sh'
" FZF Preview
nnoremap <silent> <Leader>/ :<C-u>CocCommand fzf-preview.Lines --add-fzf-arg=--no-sort --add-fzf-arg=--query="'"<CR>
nnoremap <silent> <C-f> :<C-u>CocCommand fzf-preview.ProjectGrepRecall<CR>
nnoremap <silent> <Leader>d :<C-u>CocCommand fzf-preview.CocCurrentDiagnostics<CR>
nnoremap <silent> <Leader>d :<C-u>CocCommand fzf-preview.CocCurrentDiagnostics<CR>
delc Ext
" Language Server
if executable('pyls')
" pip install python-language-server
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'allowlist': ['python'],
\ })
endif
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=yes
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gs <plug>(lsp-document-symbol-search)
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
nmap <buffer> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> gt <plug>(lsp-type-definition)
nmap <buffer> <leader>rn <plug>(lsp-rename)
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
nmap <buffer> K <plug>(lsp-hover)
nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
nnoremap <buffer> <expr><c-d> lsp#scroll(-4)
let g:lsp_format_sync_timeout = 1000
autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
" refer to doc to add more commands
endfunction
augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END
" Tab for completion
let g:SuperTabContextDefaultCompletionType = "<c-n>"
let g:SuperTabDefaultCompletionType = "<c-n>"
" Go to Defintion CoC
nmap <buffer> gd :call CocActionAsync('jumpDefinition')<CR>

View File

@ -1,141 +0,0 @@
# Partially stolen from https://bitbucket.org/mblum/libgp/src/2537ea7329ef/.ycm_extra_conf.py
import os, glob, subprocess, re
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
STD = "-std=c++17"
flags = [
'-Wall',
'-Wextra',
'-Wno-long-long',
'-Wno-variadic-macros',
'-pedantic',
'-Weffc++',
'-fexceptions',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
STD,
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x', 'c++',
'-isystem', '/usr/include/qt',
'-I', 'include',
'-I', '.',
'-I', 'src',
'-I', 'main/cpp'
]
def AddSystemIncludes():
global flags
try:
output = subprocess.check_output(["clang++", STD, "-E", "-v", "-x", "c++", os.devnull], stderr=subprocess.STDOUT).decode("utf-8")
for loc in re.findall(r"^ (/.*)$", output, re.M):
flags += ["-isystem", loc]
except:
print("Clang++ not found")
flags += [
'-isystem', '/usr/include/x86_64-linux-gnu/c++/7',
'-isystem', '/usr/include/c++/7',
'-isystem', '/usr/include',
'-isystem', '/usr/local/include'
]
AddSystemIncludes()
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = None
if compilation_database_folder:
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def FlagsForFile( filename ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile( filename )
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
else:
# relative_to = DirectoryOfThisScript()
relative_to = ProjectRoot(filename)
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + ["-I", os.path.abspath(os.path.dirname(filename))] + ExtIncludes(relative_to) + BuildIncludes(relative_to, filename)
try:
resources_lib_base = os.path.join(relative_to, "main", "resources", "lib")
final_flags += ["-I"+os.path.join(resources_lib_base, f, "include") for f in os.listdir(resources_lib_base)]
except: pass
return {
'flags': final_flags,
'do_cache': True
}
def ProjectRoot(filename):
path = os.path.abspath(os.path.dirname(filename))
while path != os.path.abspath(os.path.dirname(path)) and not (os.path.isdir(os.path.join(path, ".git")) or os.path.isdir(os.path.join(path, "include")) or os.path.isdir(os.path.join(path, "src"))):
path = os.path.abspath(os.path.dirname(path))
if not (os.path.isdir(os.path.join(path, "include")) or os.path.isdir(os.path.join(path, "src")) or os.path.isdir(os.path.join(path, "main"))):
return os.path.abspath(os.path.dirname(filename))
else:
return path
def ExtIncludes(path):
starting_paths = glob.glob(os.path.join(path, "build", "ext-*")) + glob.glob(os.path.join(path, "ext", "*"))
paths = starting_paths
for p in starting_paths:
paths += glob.glob(os.path.join(p, "include")) + glob.glob(os.path.join(p, "*", "include"))
paths += glob.glob(os.path.join(p, "src", "ext-*")) + glob.glob(os.path.join(p, "src", "ext-*", "include")) + glob.glob(os.path.join(p, "src", "ext-*", "*", "include"))
return ["-I%s" % p for p in paths]
def BuildIncludes(project_root, filename):
file_path = os.path.abspath(os.path.dirname(filename))[len(project_root) + 1:]
return ["-I%s/build/%s" % (project_root, file_path)]

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
{
"python.linting.enabled": false,
"ltex.enabled": ["latex", "markdown"],
"ltex.language":"en-GB"
}

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +0,0 @@
keycode 94 = grave asciitilde dead_grave dead_tilde grave asciitilde
keycode 49 = less greater less greater bar brokenbar bar brokenbar
keycode 49 = Shift_L
keycode 108 = Multi_key

View File

@ -6,6 +6,7 @@
(import ./modules/nvim/config.nix { inherit config pkgs; }) (import ./modules/nvim/config.nix { inherit config pkgs; })
(import ./modules/email/config.nix { inherit config pkgs; }) (import ./modules/email/config.nix { inherit config pkgs; })
(import ./modules/hyprland/config.nix { inherit inputs config pkgs; }) (import ./modules/hyprland/config.nix { inherit inputs config pkgs; })
(import ./modules/rofi/config.nix { inherit inputs config pkgs; })
]; ];
home.stateVersion = "24.11"; home.stateVersion = "24.11";
@ -31,6 +32,18 @@
s = "status"; s = "status";
a = "add"; a = "add";
}; };
extraConfig = {
credentials.helper = "store";
pull.rebase = false;
push.autoSetupRemove = true;
init.defaultBranch = "master";
diff.noprefix = true;
color.ui = "auto";
core = {
excludesfile = "~/.gitignore";
editor = "${pkgs.neovim}/bin/nvim";
};
};
}; };
home.sessionVariables = { home.sessionVariables = {

View File

@ -75,6 +75,25 @@ in
]; ];
}; };
}; };
services.dunst = {
enable = true;
settings = {
global = {
frame_color = "#00000000";
separator_color = "frame";
background = "#24273A";
foreground = "#ffffff";
font = "Ubuntu 10.5";
width = "(0, 600)";
padding = 15;
origin = "top-right";
offset = "10x10";
horizontal_padding = 20;
gap_size = 15;
};
};
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
systemd.variables = [ "--all" ]; systemd.variables = [ "--all" ];

View File

@ -0,0 +1,134 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
papirus-icon-theme
];
programs.rofi = {
enable = true;
font = "SF Pro Rounded 13";
extraConfig = {
show-icons = true;
icon-theme = "Papirus";
kb-cancel = "Super_L+XF86Launch5,Escape";
combi-hide-mode-prefix = true;
};
theme = {
let
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
background = mkLiteral "#0f111a";
foreground = mkLiteral "#f1f1f1";
selected = mkLiteral "#0033a1";
selected-text = mkLiteral "#ffffff";
}
"window" = {
transparency = "real";
background-color = mkLiteral "@background";
text-color = mkLiteral "@foreground";
width = mkLiteral "800px";
border-radius = mkLiteral "5px";
}
"textbox-prompt-colon" = {
expand = mkLiteral "false";
background-color = mkLiteral "@background";
padding = mkLiteral "4px 0px 0px 6px";
}
"inputbar" = {
children = mkLiteral "[ textbox-prompt-colon, entry ]";
background-color = mkLiteral "@background";
text-color = mkLiteral "@foreground";
expand = mkLiteral "false";
border = mkLiteral "0px 0px 0px 0px";
border-radius = mkLiteral "0px";
border-color = mkLiteral "@selected";
margin = mkLiteral "0px 0px 0px 0px";
padding = mkLiteral "0px 0px 4px 0px";
position = mkLiteral "center";
}
"entry" = {
background-color = mkLiteral "@background";
text-color = mkLiteral "@foreground";
placeholder-color = mkLiteral "@foreground";
expand = mkLiteral "true";
horizontal-align = mkLiteral "0";
blink = mkLiteral "true";
padding = mkLiteral "4px 0px 0px 4px";
font = "SF Pro Rounded 25";
}
"case-indicator" = {
background-color = mkLiteral "@background";
text-color = mkLiteral "@foreground";
spacing = mkLiteral "0";
}
"listview" = {
background-color = mkLiteral "@background";
columns = mkLiteral "1";
spacing = mkLiteral "5px";
cycle = mkLiteral "true";
dynamic = mkLiteral "true";
layout = mkLiteral "vertical";
fixed-height = "true";
lines = mkLiteral "5";
}
"mainbox" = {
background-color = mkLiteral "@background";
children = mkLiteral "[ inputbar, message, listview ]";
spacing = mkLiteral "20px";
padding = mkLiteral "20px 15px 15px 15px";
}
"message" = {
children = mkLiteral "[ textbox ]";
border-radius = mkLiteral "5px";
}
"textbox" = {
background-color = mkLiteral "@selected";
text-color = mkLiteral "@foreground";
padding = mkLiteral "20px 6px 20px 80px";
}
"element" = {
background-color = mkLiteral "@background";
text-color = mkLiteral "@foreground";
orientation = mkLiteral "horizontal";
border-radius = mkLiteral "4px";
padding = mkLiteral "2px 2px 2px 2px";
}
"element-text, element-icon" = {
background-color = mkLiteral "inherit";
text-color = mkLiteral "inherit";
}
"element-icon" = {
size = mkLiteral "40px";
border = mkLiteral "10px";
}
"element-text" = {
padding = mkLiteral "20px 0px 0px 10px";
}
"element selected" = {
background-color = mkLiteral "@selected";
text-color = mkLiteral "@selected-text";
border = mkLiteral "0px";
border-radius = mkLiteral "3px";
border-color = mkLiteral "@selected";
}
}
};
};
}