hyprland base

This commit is contained in:
flick0
2023-09-09 15:28:47 +00:00
parent 588421dc73
commit 52512928ea
655 changed files with 0 additions and 56771 deletions

View File

@@ -1 +0,0 @@
-/.png

View File

@@ -1,5 +0,0 @@
{
"Lua.runtime.version": "LuaJIT",
"Lua.workspace.library": ["${3rd}/love2d/library"],
"Lua.workspace.checkThirdParty": false
}

View File

@@ -1,228 +0,0 @@
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local naughty = require("naughty")
local beautiful = require("beautiful")
local helpers = require("helpers")
local icons = require("icons")
local notifications = require("notifications")
local apps = {}
apps.browser = function()
awful.spawn(user.browser, { switchtotag = true })
end
apps.file_manager = function()
awful.spawn(user.file_manager, { floating = true })
end
apps.telegram = function()
helpers.run_or_raise({ class = 'TelegramDesktop' }, false, "telegram", { switchtotag = true })
end
apps.discord = function()
-- Run or raise Discord running in the browser, spawned with Chromium browser's app mode
-- >> Ubuntu / Debian
-- helpers.run_or_raise({instance = 'discordapp.com__channels_@me'}, false, "chromium-browser --app=\"https://discordapp.com/channels/@me\"")
-- >> Arch
helpers.run_or_raise({ instance = 'discordapp.com__channels_@me' }, false,
"chromium --app=\"https://discordapp.com/channels/@me\"")
-- Run or raise Discord app
-- helpers.run_or_raise({class = 'discord'}, false, "discord")
end
apps.weechat = function()
helpers.run_or_raise({ instance = 'weechat' }, true, user.terminal .. " --class weechat -e weechat")
end
apps.mail = function()
helpers.run_or_raise({ instance = 'email' }, false, user.email_client, { switchtotag = true })
end
apps.gimp = function()
helpers.run_or_raise({ class = 'Gimp' }, false, "gimp")
end
apps.steam = function()
helpers.run_or_raise({ class = 'Steam' }, false, "steam")
end
apps.lutris = function()
helpers.run_or_raise({ class = 'Lutris' }, false, "lutris")
end
apps.youtube = function()
awful.spawn.with_shell("rofi_mpvtube")
end
apps.networks = function()
awful.spawn.with_shell("rofi_networks")
end
apps.passwords = function()
helpers.run_or_raise({ class = 'KeePassXC' }, true, "keepassxc")
end
apps.volume = function()
helpers.run_or_raise({ class = 'Pavucontrol' }, true, "pavucontrol")
end
apps.torrent = function()
helpers.run_or_raise({ instance = 'torrent' }, true, user.terminal .. " --class torrent -e transmission-remote-cli")
end
apps.editor = function()
helpers.run_or_raise({ instance = 'editor' }, false, user.editor, { switchtotag = true })
end
-- Toggle compositor
apps.compositor = function()
awful.spawn.with_shell("sh -c 'pgrep picom > /dev/null && pkill picom || picom --experimental-backends --config ~/.config/picom/picom.conf & disown'")
end
local night_mode_notif
apps.night_mode = function()
local cmd = "pgrep redshift > /dev/null && (pkill redshift && echo 'OFF') || (echo 'ON' && redshift -l 0:0 -t 3700:3700 -r &>/dev/null &)"
awful.spawn.easy_async_with_shell(cmd, function(out)
local message = out:match('ON') and "Activated!" or "Deactivated!"
night_mode_notif = notifications.notify_dwim({ title = "Night mode", message = message, app_name = "night_mode",
icon = icons.image.redshift }, night_mode_notif)
end)
end
local screenkey_notif
apps.screenkey = function()
local cmd = "pgrep screenkey > /dev/null && (pkill screenkey && echo 'OFF') || (echo 'ON' && screenkey --ignore Caps_Lock --bg-color '#FFFFFF' --font-color '#000000' &>/dev/null &)"
awful.spawn.easy_async_with_shell(cmd, function(out)
local message = out:match('ON') and "Activated!" or "Deactivated!"
screenkey_notif = notifications.notify_dwim({ title = "Screenkey", message = message, app_name = "screenkey",
icon = icons.image.keyboard }, screenkey_notif)
end)
end
apps.record = function()
awful.spawn.with_shell("screenrec.sh")
end
-- I only use emacs for org mode :)
apps.org = function()
helpers.run_or_raise({ class = 'Emacs' }, false, "emacs")
end
apps.music = function()
helpers.scratchpad({ instance = "music" }, user.music_client)
end
apps.process_monitor = function()
helpers.run_or_raise({ instance = 'htop' }, false, user.terminal .. " --class htop -e htop", { switchtotag = true })
end
apps.process_monitor_gui = function()
helpers.run_or_raise({ class = 'Lxtask' }, false, "lxtask")
end
apps.temperature_monitor = function()
helpers.run_or_raise({ class = 'sensors' }, false, user.terminal .. " --class sensors -e watch sensors",
{ switchtotag = true, tag = mouse.screen.tags[5] })
end
apps.battery_monitor = function()
helpers.run_or_raise({ class = 'battop' }, false, user.terminal .. " --class battop -e battop",
{ switchtotag = true, tag = mouse.screen.tags[5] })
end
apps.markdown_input = function()
helpers.scratchpad(
{ instance = "markdown_input" },
user.terminal .. " --class markdown_input -e nvim -c 'startinsert' /tmp/scratchpad.md",
nil)
end
-- Scratchpad terminal with tmux (see bin/scratchpad)
apps.scratchpad = function()
helpers.scratchpad({ instance = "scratchpad" }, "scratchpad", nil)
end
-- Screenshots
local capture_notif = nil
local screenshot_notification_app_name = "screenshot"
function apps.screenshot(action, delay)
-- Read-only actions
if action == "browse" then
awful.spawn.with_shell("cd " .. user.dirs.screenshots .. " && sxiv $(ls -t)")
return
elseif action == "gimp" then
awful.spawn.with_shell("cd " .. user.dirs.screenshots .. " && gimp $(ls -t | head -n1)")
naughty.notification({ message = "Opening last screenshot with GIMP", icon = icon,
app_name = screenshot_notification_app_name })
return
end
-- Screenshot capturing actions
local cmd
local timestamp = os.date("%Y.%m.%d-%H.%M.%S")
local filename = user.dirs.screenshots .. "/" .. timestamp .. ".screenshot.png"
local maim_args = "-u -b 3 -m 5"
local icon = icons.image.screenshot
local prefix
if delay then
prefix = "sleep " .. tostring(delay) .. " && "
else
prefix = ""
end
-- Configure action buttons for the notification
local screenshot_open = naughty.action { name = "Open" }
local screenshot_copy = naughty.action { name = "Copy" }
local screenshot_edit = naughty.action { name = "Edit" }
local screenshot_delete = naughty.action { name = "Delete" }
screenshot_open:connect_signal('invoked', function()
awful.spawn.with_shell("cd " .. user.dirs.screenshots .. " && sxiv $(ls -t)")
end)
screenshot_copy:connect_signal('invoked', function()
awful.spawn.with_shell("xclip -selection clipboard -t image/png " .. filename .. " &>/dev/null")
end)
screenshot_edit:connect_signal('invoked', function()
awful.spawn.with_shell("gimp " .. filename .. " >/dev/null")
end)
screenshot_delete:connect_signal('invoked', function()
awful.spawn.with_shell("rm " .. filename)
end)
if action == "full" then
cmd = prefix .. "maim " .. maim_args .. " " .. filename
awful.spawn.easy_async_with_shell(cmd, function()
naughty.notification({
title = "Screenshot",
message = "Screenshot taken",
icon = icon,
actions = { screenshot_open, screenshot_copy, screenshot_edit, screenshot_delete },
app_name = screenshot_notification_app_name,
})
end)
elseif action == "selection" then
cmd = "maim " .. maim_args .. " -s " .. filename
capture_notif = naughty.notification({ title = "Screenshot", message = "Select area to capture.", icon = icon,
timeout = 1, app_name = screenshot_notification_app_name })
awful.spawn.easy_async_with_shell(cmd, function(_, __, ___, exit_code)
naughty.destroy(capture_notif)
if exit_code == 0 then
naughty.notification({
title = "Screenshot",
message = "Selection captured",
icon = icon,
actions = { screenshot_open, screenshot_copy, screenshot_edit, screenshot_delete },
app_name = screenshot_notification_app_name,
})
end
end)
elseif action == "clipboard" then
capture_notif = naughty.notification({ title = "Screenshot", message = "Select area to copy to clipboard",
icon = icon })
cmd = "maim " ..
maim_args ..
" -s /tmp/maim_clipboard && xclip -selection clipboard -t image/png /tmp/maim_clipboard &>/dev/null && rm /tmp/maim_clipboard"
awful.spawn.easy_async_with_shell(cmd, function(_, __, ___, exit_code)
if exit_code == 0 then
capture_notif = notifications.notify_dwim({ title = "Screenshot",
message = "Copied selection to clipboard", icon = icon, app_name = screenshot_notification_app_name }
, capture_notif)
else
naughty.destroy(capture_notif)
end
end)
end
end
return apps

View File

@@ -1,37 +0,0 @@
#!/usr/bin/bash
#////////////////////////////////////////////////////////////////////////
# set awesome dir
conf=$HOME/.config/awesome
#////////////////////////////////////////////////////////////////////////
echo "awesome config path:$conf"
#////////////////////////////////////////////////////////////////////////
# show dashboard
touch /tmp/awesomewm-show-dashboard
#////////////////////////////////////////////////////////////////////////
#////////////////////////////////////////////////////////////////////////
# set wallpaper to /config/wallpaper.jpg or /config/wallpaper.png
if [ -f "$conf/config/wallpaper.jpg" ]; then
nitrogen --set-zoom-fill "$conf/config/wallpaper.jpg"
else
nitrogen --set-zoom-fill "$conf/config/wallpaper.png"
fi
#////////////////////////////////////////////////////////////////////////
#////////////////////////////////////////////////////////////////////////
# start compositor
pkill picom
picom --experimental-backend --config "$conf/config/picom.conf"
#////////////////////////////////////////////////////////////////////////
#////////////////////////////////////////////////////////////////////////
# colorscheme
read -r theme<"$conf/config/colorscheme"
cd ~/Documents/code/themer/
./themer -a $theme
sleep 1
awesome-client 'awesome.restart()'
#////////////////////////////////////////////////////////////////////////

View File

@@ -1 +0,0 @@
catppuccin-macchiato

View File

@@ -1,71 +0,0 @@
font_family JetBrains Mono Medium
bold_font JetBrains Mono Bold
italic_font JetBrains Mono Italic
bold_italic_font JetBrains Mono Bold Italic
window_padding_width 10.0
# The basic colors
foreground #c5cff5
background #24273a
selection_foreground #24273a
selection_background #c6a0f6
# Cursor colors
cursor #c6a0f6
cursor_text_color #24273a
# URL underline color when hovering with mouse
url_color #7dc4e4
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar
active_tab_foreground #24273a
active_tab_background #c6a0f6
inactive_tab_foreground #c5cff5
inactive_tab_background #24273a
tab_bar_background #24273a
# marks
mark1_foreground #24273a
mark1_background #91d7e3
mark2_foreground #24273a
mark2_background #a6da95
mark3_foreground #24273a
mark3_background #8aadf4
# black
color0 #181926
color8 #1e2030
# red
color1 #ed8796
color9 #ed8796
# green
color2 #a6da95
color10 #a6da95
# yellow
color3 #eed49f
color11 #eed49f
# blue
color4 #8aadf4
color12 #8aadf4
# magenta
color5 #ee99a0
color13 #ee99a0
# cyan
color6 #91d7e3
color14 #91d7e3
# white
color7 #b7bdf8
color15 #5a5f78

View File

@@ -1,197 +0,0 @@
# User's picom configuration.
# https://github.com/owl4ce/dotfiles
# SHADOWS
# ---
# Enabled client-side shadows on windows.
shadow = true;
# The blur radius for shadows, in pixels.
shadow-radius = 40;
# The opacity of shadows.
shadow-opacity = 0.1;
# The left offset for shadows, in pixels.
shadow-offset-x = -27;
# The top offset for shadows, in pixels.
shadow-offset-y = -27;
# Specify a list of conditions of windows that should have no shadows.
shadow-exclude = [
# "! name ~= ''",
"class_g = 'Conky'",
"class_g = 'GLava'",
"class_g ?= 'Notify-osd'",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"_GTK_FRAME_EXTENTS@:c"
];
# Crop shadows of a window fully on a particular Xinerama screen to the screen.
xinerama-shadow-crop = true;
# FADING
# ---
# Fade windows in/out when opening/closing and when opacity changes.
fading = true;
# Opacity change between steps while fading in.
fade-in-step = 0.025;
# Opacity change between steps while fading out.
fade-out-step = 0.025;
# The time between steps in fade step, in milliseconds.
fade-delta = 4;
# Do not fade destroyed ARGB windows with WM frame.
# Workaround of bugs in Openbox, Fluxbox, etc.
no-fading-destroyed-argb = true;
# OPACITY
# ---
# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
inactive-opacity-override = false;
# CORNERS
# ---
# Sets the radius of rounded window corners.
# When > 0, the compositor will round the corners of windows.
corner-radius = 8;
# Exclude conditions for rounded corners.
rounded-corners-exclude = [
"name *= 'rofi'",
"name *= 'screenkey'",
"name *= 'tint2'",
"class_g = 'Conky'",
"class_g = 'GLava'",
"window_type = 'dock'",
"window_type = 'desktop'",
# "window_type = 'tooltip'",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"_GTK_FRAME_EXTENTS@:c"
];
# BACKGROUND BLURRING
# ---
# Parameters for background blurring, see the *BLUR* section for more information.
# Specify the background blurring blur method to use.
blur-method = "none";
# Exclude conditions for background blur.
blur-background-exclude = [
"! name ~= ''",
" name *= 'jgmenu'",
" name *= 'tint2'",
"class_g = 'Conky'",
"class_g = 'GLava'",
"window_type = 'dock'",
"window_type = 'desktop'",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"_GTK_FRAME_EXTENTS@:c"
];
# GENERAL
# ---
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
backend = "glx";
# Enable or disable VSync.
vsync = true;
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
mark-ovredir-focused = true;
# Try to detect windows with rounded corners and don't consider them shaped windows.
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 = 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 = true;
# 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;
# Use 'WM_TRANSIENT_FOR' to group windows,
# and consider windows in the same group focused at the same time.
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 = true;
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content 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 = 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 = true;
# 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 = "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 = "/dev/null"
# WINDOW-TYPE
# ---
#
# '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",
# "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 = 1.00; };
menu = { fade = true; shadow = true; opacity = 1.00; };
popup_menu = { fade = true; shadow = true; opacity = 1.00; };
dropdown_menu = { fade = true; shadow = true; opacity = 1.00; };
utility = { fade = true; shadow = true; opacity = 1.00; };
dialog = { fade = true; shadow = true; opacity = 1.00; };
notify = { fade = true; shadow = true; opacity = 1.00; };
dock = { fade = true; shadow = false; clip-shadow-above = true; };
dnd = { fade = true; shadow = false; };
unknown = { fade = true; shadow = true; opacity = 1.00; };
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 KiB

View File

@@ -1,205 +0,0 @@
local awful = require("awful")
local beautiful = require("beautiful")
local helpers = require("helpers")
local gears = require("gears")
local wibox = require("wibox")
-- Disable popup tooltip on titlebar button hover
awful.titlebar.enable_tooltip = false
local decorations = {}
-- >> Default decoration management functions
-- They make sure not to affect custom decorations added on the same position
-- as the default titlebar
-- Can be overrided by the selected decoration theme when the titlebar
-- configuration is more complex
function decorations.hide(c)
if not c.custom_decoration or not c.custom_decoration[beautiful.titlebar_position] then
awful.titlebar.hide(c, beautiful.titlebar_position)
end
end
function decorations.show(c)
if not c.custom_decoration or not c.custom_decoration[beautiful.titlebar_position] then
awful.titlebar.show(c, beautiful.titlebar_position)
end
end
-- We use `cycle` instead of `toggle` since some decoration themes may provide
-- the ability to change between different types of titlebars (e.g. full,
-- minimal, none)
function decorations.cycle(c)
if not c.custom_decoration or not c.custom_decoration[beautiful.titlebar_position] then
awful.titlebar.toggle(c, beautiful.titlebar_position)
end
end
-- Helper function to be used by decoration themes to enable client rounding
function decorations.enable_rounding()
-- Apply rounded corners to clients if needed
if beautiful.border_radius and beautiful.border_radius > 0 then
client.connect_signal("manage", function (c, startup)
if not c.fullscreen and not c.maximized then
c.shape = helpers.rrect(beautiful.border_radius)
end
end)
-- Fullscreen and maximized clients should not have rounded corners
local function no_round_corners (c)
if c.fullscreen or c.maximized then
c.shape = gears.shape.rectangle
else
c.shape = helpers.rrect(beautiful.border_radius)
end
end
client.connect_signal("property::fullscreen", no_round_corners)
client.connect_signal("property::maximized", no_round_corners)
beautiful.snap_shape = helpers.rrect(beautiful.border_radius * 2)
else
beautiful.snap_shape = gears.shape.rectangle
end
end
local button_commands = {
['close'] = { fun = function(c) c:kill() end, track_property = nil } ,
['maximize'] = { fun = function(c) c.maximized = not c.maximized; c:raise() end, track_property = "maximized" },
['minimize'] = { fun = function(c) c.minimized = true end },
['sticky'] = { fun = function(c) c.sticky = not c.sticky; c:raise() end, track_property = "sticky" },
['ontop'] = { fun = function(c) c.ontop = not c.ontop; c:raise() end, track_property = "ontop" },
['floating'] = { fun = function(c) c.floating = not c.floating; c:raise() end, track_property = "floating" },
}
-- >> Helper functions for generating simple window buttons
-- Generates a button using an AwesomeWM widget
decorations.button = function (c, shape, color, unfocused_color, hover_color, size, margin, cmd)
local button = wibox.widget {
forced_height = size,
forced_width = size,
-- bg = "#00000000",
bg = (client.focus and c == client.focus) and color or unfocused_color,
-- border_color = unfocused_color,
-- border_width = dpi(2),
shape = shape,
widget = wibox.container.background()
}
-- Instead of adding spacing between the buttons, we add margins
-- around them. That way it is more forgiving to click them
-- (especially if they are very small)
local button_widget = wibox.widget {
button,
margins = margin,
widget = wibox.container.margin(),
}
button_widget:buttons(gears.table.join(
awful.button({ }, 1, function ()
button_commands[cmd].fun(c)
end)
))
local p = button_commands[cmd].track_property
-- Track client property if needed
if p then
c:connect_signal("property::"..p, function ()
button.bg = c[p] and color .. "40" or color
end)
c:connect_signal("focus", function ()
button.bg = c[p] and color .. "40" or color
end)
button_widget:connect_signal("mouse::leave", function ()
if c == client.focus then
button.bg = c[p] and color .. "40" or color
else
button.bg = unfocused_color
end
end)
else
button_widget:connect_signal("mouse::leave", function ()
if c == client.focus then
button.bg = color
else
button.bg = unfocused_color
end
end)
c:connect_signal("focus", function ()
button.bg = color
end)
end
button_widget:connect_signal("mouse::enter", function ()
button.bg = hover_color
end)
c:connect_signal("unfocus", function ()
button.bg = unfocused_color
end)
return button_widget
end
-- Generates a button from a text symbol
decorations.text_button = function (c, symbol, font, color, unfocused_color, hover_color, size, margin, cmd)
local button = wibox.widget {
align = "center",
valign = "center",
font = font,
-- Initialize with the "unfocused" color
markup = helpers.colorize_text(symbol, unfocused_color),
-- Increase the width of the textbox in order to make it easier to click. It does not affect the size of the symbol itself.
forced_width = size + margin * 2,
widget = wibox.widget.textbox
}
button:buttons(gears.table.join(
awful.button({ }, 1, function ()
button_commands[cmd].fun(c)
end)
))
local p = button_commands[cmd].track_property
-- Track client property if needed
if p then
c:connect_signal("property::"..p, function ()
button.markup = helpers.colorize_text(symbol, c[p] and color .. "40" or color)
end)
c:connect_signal("focus", function ()
button.markup = helpers.colorize_text(symbol, c[p] and color .. "40" or color)
end)
button:connect_signal("mouse::leave", function ()
if c == client.focus then
button.markup = helpers.colorize_text(symbol, c[p] and color .. "40" or color)
else
button.markup = helpers.colorize_text(symbol, unfocused_color)
end
end)
else
button:connect_signal("mouse::leave", function ()
if c == client.focus then
button.markup = helpers.colorize_text(symbol, color)
else
button.markup = helpers.colorize_text(symbol, unfocused_color)
end
end)
c:connect_signal("focus", function ()
button.markup = helpers.colorize_text(symbol, color)
end)
end
button:connect_signal("mouse::enter", function ()
button.markup = helpers.colorize_text(symbol, hover_color)
end)
c:connect_signal("unfocus", function ()
button.markup = helpers.colorize_text(symbol, unfocused_color)
end)
return button
end
-- Load theme and custom decorations
function decorations.init(theme_name)
require("decorations.themes." .. theme_name)
-- Custom decorations for specific clients
require("decorations.mpd")
end
return decorations

View File

@@ -1,334 +0,0 @@
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local helpers = require("helpers")
local notifications = require("notifications")
local keys = require("keys")
local create_little_circle = function(color)
return wibox.widget {
forced_width = dpi(8),
forced_height = dpi(8),
bg = color,
shape = gears.shape.circle,
widget = wibox.container.background
}
end
-- 2x2 grid of little circles
local toolbar_icon = wibox.widget {
create_little_circle(x.color4),
create_little_circle(x.color1),
create_little_circle(x.color3),
create_little_circle(x.color2),
spacing = dpi(2),
forced_num_cols = 2,
forced_num_rows = 2,
layout = wibox.layout.grid
}
local toolbar_position = "left"
local toolbar_size = dpi(60)
local toolbar_bg = x.color0.."66"
local toolbar_enabled_initially = true
-- Note: Some terminals require moving the window after toggling
-- the toolbar in order to keep the window in the same place.
-- If your music terminal moves everytime you toggle the toolbar,
-- set its name to true in terminal_has_to_move_after_resizing
-- The name should be the command you use to launch it
-- e.g. "gnome-terminal" for GNOME Terminal
local terminal_has_to_move_after_resizing = {
["kitty"] = true,
}
-- Get music client terminal name
local music_client_terminal = user.music_client:match("(%w+)(.+)")
local terminal_has_to_move = terminal_has_to_move_after_resizing[music_client_terminal]
local mpd_toolbar_toggle = function(c)
if c.toolbar_enabled then
c.toolbar_enabled = false
awful.titlebar.hide(c, toolbar_position)
c.width = c.width + toolbar_size
if terminal_has_to_move then
c.x = c.x - toolbar_size
end
else
c.toolbar_enabled = true
awful.titlebar.show(c, toolbar_position)
c.width = c.width - toolbar_size
if terminal_has_to_move then
c.x = c.x + toolbar_size
end
end
end
local create_toolbar_button = function(c)
local toolbar_button = wibox.widget {
{
nil,
{
nil,
toolbar_icon,
expand = "none",
layout = wibox.layout.align.horizontal
},
expand = "none",
layout = wibox.layout.align.vertical
},
forced_width = dpi(34),
forced_height = dpi(34),
shape = gears.shape.circle,
widget = wibox.container.background
}
toolbar_button:connect_signal("mouse::enter", function ()
toolbar_button.bg = x.color8.."55"
end)
toolbar_button:connect_signal("mouse::leave", function ()
toolbar_button.bg = "#00000000"
end)
c.toolbar_enabled = toolbar_enabled_initially
toolbar_button:buttons(gears.table.join(
awful.button({ }, 1, function() mpd_toolbar_toggle(c) end)
))
return toolbar_button
end
local control_button_bg = "#00000000"
local control_button_bg_hover = x.color0
local control_button = function(c, symbol, color, size, on_click, on_right_click)
local icon = wibox.widget{
markup = helpers.colorize_text(symbol, color),
font = "icomoon 12",
align = "center",
valign = "center",
widget = wibox.widget.textbox()
}
local button = wibox.widget {
icon,
bg = control_button_bg,
widget = wibox.container.background
}
local container = wibox.widget {
button,
strategy = "min",
height = dpi(50),
widget = wibox.container.constraint,
}
container:buttons(gears.table.join(
awful.button({ }, 1, on_click),
awful.button({ }, 3, on_right_click)
))
container:connect_signal("mouse::enter", function ()
button.bg = control_button_bg_hover
end)
container:connect_signal("mouse::leave", function ()
button.bg = control_button_bg
end)
return container
end
local mpd_buttons = require("noodle.mpd_buttons")
local volume_bar = wibox.widget {
max_value = 100,
value = 50,
margins = {
top = dpi(20),
bottom = dpi(20),
left = dpi(6),
right = dpi(6),
},
forced_width = dpi(60),
shape = gears.shape.rounded_bar,
bar_shape = gears.shape.rounded_bar,
color = x.color4,
background_color = x.foreground.."11",
border_width = 0,
widget = wibox.widget.progressbar,
}
-- Update bar
awesome.connect_signal("evil::mpd_volume", function(value)
volume_bar.value = value and value <= 100 and value or 100
end)
-- Set up volume bar buttons
volume_bar:connect_signal("button::press", function(_, lx, __, button)
if button == 1 then
awful.spawn.with_shell("mpc volume "..tostring(math.ceil(lx * 100 / volume_bar.forced_width)))
end
end)
local volume = wibox.widget {
volume_bar,
helpers.horizontal_pad(dpi(3)),
{
align = "left",
font = "icomoon 16",
markup = helpers.colorize_text("", x.color1),
widget = wibox.widget.textbox()
},
helpers.horizontal_pad(dpi(2)),
layout = wibox.layout.fixed.horizontal
}
volume:buttons(gears.table.join(
-- Scroll - Increase or decrease volume
awful.button({ }, 4, function ()
awful.spawn.with_shell("mpc volume +5")
end),
awful.button({ }, 5, function ()
awful.spawn.with_shell("mpc volume -5")
end)
))
local random_color = x.color1
local random_symbol = ""
local random_button = control_button(c, random_symbol, random_color, dpi(30), function()
awful.spawn.with_shell("mpc random")
end)
local loop_color = x.color3
local loop_symbol = ""
local loop_button = control_button(c, loop_symbol, loop_color, dpi(30), function()
awful.spawn.with_shell("mpc repeat")
end)
local loop_textbox = loop_button:get_all_children()[1]:get_all_children()[1]
local random_textbox = random_button:get_all_children()[1]:get_all_children()[1]
local disabled_color = x.color8
-- Update loop and random button colors based on their state
awesome.connect_signal("evil::mpd_options", function(loop, random)
if loop then
loop_textbox.markup = helpers.colorize_text(loop_symbol, loop_color)
else
loop_textbox.markup = helpers.colorize_text(loop_symbol, disabled_color)
end
if random then
random_textbox.markup = helpers.colorize_text(random_symbol, random_color)
else
random_textbox.markup = helpers.colorize_text(random_symbol, disabled_color)
end
end)
local notifications_color = x.color2
local notifications_symbol = ""
local notifications_button
notifications_button = control_button(c, notifications_symbol, notifications.mpd.enabled and notifications_color or disabled_color, dpi(30), function()
notifications.mpd.toggle()
local text = notifications_button:get_all_children()[1]:get_all_children()[1]
text.markup = helpers.colorize_text(notifications_symbol, notifications.mpd.enabled and notifications_color or disabled_color)
end)
local main_titlebar_size = dpi(50)
local mpd_create_decoration = function (c)
-- Main titlebar
awful.titlebar(c, { position = "top", size = main_titlebar_size, bg = x.background }):setup {
{
{
create_toolbar_button(c),
{
buttons = keys.titlebar_buttons,
widget = wibox.container.background
},
layout = wibox.layout.align.horizontal
},
mpd_buttons,
{
nil,
{
buttons = keys.titlebar_buttons,
widget = wibox.container.background
},
volume,
layout = wibox.layout.align.horizontal
},
expand = "outside",
layout = wibox.layout.align.horizontal
},
left = dpi(10),
right = dpi(10),
widget = wibox.container.margin
}
-- Toolbar
-- The functions that send keys to the ncmpcpp client assume that
-- you are using default ncmpcpp keybindings. Otherwise, you will
-- have to modify the helpers.send_key() function arguments so they
-- send your desired keys.
awful.titlebar(c, { position = toolbar_position, size = toolbar_size, bg = x.background }):setup {
{
{
-- Go to playlist and focus currently playing song
control_button(c, "", x.color6, dpi(30), function()
helpers.send_key_sequence(c, "1o")
end),
-- Toggle lyrics
control_button(c, "", x.color5, dpi(30), function()
helpers.send_key(c, "l")
end),
-- Go to list of playlists
control_button(c, "", x.color4, dpi(30), function()
helpers.send_key(c, "5")
end),
-- Visualizer button
control_button(c, "", x.color5, dpi(30),
-- Left click - Go to visualizer
function()
helpers.send_key(c, "8")
end,
-- Right click - Toggle visualizer
function()
awful.spawn.with_shell("mpc toggleoutput mpd_fifo")
end
),
random_button,
loop_button,
notifications_button,
layout = wibox.layout.flex.vertical
},
{
buttons = keys.titlebar_buttons,
widget = wibox.container.background
},
layout = wibox.layout.align.vertical
},
bg = toolbar_bg,
shape = helpers.prrect(dpi(20), false, true, false, false),
widget = wibox.container.background
}
if not toolbar_enabled_initially then
awful.titlebar.hide(c, toolbar_position)
end
-- Set custom decoration flags
c.custom_decoration = { top = true, left = true }
end
-- Add the titlebar whenever a new music client is spawned
table.insert(awful.rules.rules, {
rule_any = {
class = {
"music",
},
instance = {
"music",
},
},
properties = {},
callback = mpd_create_decoration
})

View File

@@ -1,48 +0,0 @@
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local keys = require("keys")
local decorations = require("decorations")
-- This decoration theme will round clients according to your theme's
-- border_radius value
-- Disable this if using `picom` to round your corners
-- decorations.enable_rounding()
-- Button configuration
local gen_button_size = dpi(8)
local gen_button_margin = dpi(8)
local gen_button_color_unfocused = x.color8
local gen_button_shape = gears.shape.circle
-- Add a titlebar
client.connect_signal("request::titlebars", function(c)
awful.titlebar(c, {font = beautiful.titlebar_font, position = beautiful.titlebar_position, size = beautiful.titlebar_size}) : setup {
nil,
{
buttons = keys.titlebar_buttons,
font = beautiful.titlebar_font,
align = beautiful.titlebar_title_align or "center",
widget = beautiful.titlebar_title_enabled and awful.titlebar.widget.titlewidget(c) or wibox.widget.textbox("")
},
{
-- AwesomeWM native buttons (images loaded from theme)
-- awful.titlebar.widget.minimizebutton(c),
-- awful.titlebar.widget.maximizedbutton(c),
-- awful.titlebar.widget.closebutton(c),
-- Generated buttons
decorations.button(c, gen_button_shape, x.color3, gen_button_color_unfocused, x.color11, gen_button_size, gen_button_margin, "minimize"),
decorations.button(c, gen_button_shape, x.color2, gen_button_color_unfocused, x.color10, gen_button_size, gen_button_margin, "maximize"),
decorations.text_button(c, "", "Material Icons 9", x.color1, gen_button_color_unfocused, x.color9, gen_button_size, gen_button_margin, "close"),
-- Create some extra padding at the edge
helpers.horizontal_pad(gen_button_margin / 2),
layout = wibox.layout.fixed.horizontal
},
layout = wibox.layout.align.horizontal
}
end)

View File

@@ -1,35 +0,0 @@
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local keys = require("keys")
local decorations = require("decorations")
-- This decoration theme will round clients according to your theme's
-- border_radius value
decorations.enable_rounding()
-- Add a titlebar
client.connect_signal("request::titlebars", function(c)
awful.titlebar(c, {font = beautiful.titlebar_font, position = beautiful.titlebar_position, size = beautiful.titlebar_size}) : setup {
nil,
{
buttons = keys.titlebar_buttons,
font = beautiful.titlebar_font,
align = beautiful.titlebar_title_align or "center",
widget = beautiful.titlebar_title_enabled and awful.titlebar.widget.titlewidget(c) or wibox.widget.textbox("")
},
{
awful.titlebar.widget.minimizebutton(c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.closebutton(c),
-- Create some extra padding at the edge
helpers.horizontal_pad(dpi(3)),
layout = wibox.layout.fixed.horizontal
},
layout = wibox.layout.align.horizontal
}
end)

View File

@@ -1,25 +0,0 @@
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local keys = require("keys")
local decorations = require("decorations")
-- This decoration theme will round clients according to your theme's
-- border_radius value
decorations.enable_rounding()
-- Add a titlebar
client.connect_signal("request::titlebars", function(c)
awful.titlebar(c, {font = beautiful.titlebar_font, position = beautiful.titlebar_position, size = beautiful.titlebar_size}) : setup {
nil,
{
buttons = keys.titlebar_buttons,
font = beautiful.titlebar_font,
align = beautiful.titlebar_title_align or "center",
widget = beautiful.titlebar_title_enabled and awful.titlebar.widget.titlewidget(c) or wibox.widget.textbox("")
},
layout = wibox.layout.align.horizontal
}
end)

View File

@@ -1,209 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local apps = require("apps")
-- local naughty = require("naughty")
local helpers = require("helpers")
-- Appearance
-- local button_size = beautiful.app_drawer_icon_size or dpi(100)
--
local keybinds = {}
-- Helper function that creates buttons given a text symbol, color, hover_color
-- and the command to run on click.
local function create_button(symbol, color, hover_color, cmd, key)
local icon = wibox.widget {
markup = helpers.colorize_text(symbol, color),
align = "center",
valign = "center",
font = "icomoon 50",
forced_width = dpi(180),
forced_height = dpi(200),
widget = wibox.widget.textbox
}
-- Press "animation"
icon:connect_signal("button::press", function(_, _, __, button)
if button == 3 then
icon.markup = helpers.colorize_text(symbol, hover_color.."55")
end
end)
icon:connect_signal("button::release", function ()
icon.markup = helpers.colorize_text(symbol, hover_color)
end)
-- Hover "animation"
icon:connect_signal("mouse::enter", function ()
icon.markup = helpers.colorize_text(symbol, hover_color)
end)
icon:connect_signal("mouse::leave", function ()
icon.markup = helpers.colorize_text(symbol, color)
end)
-- Change cursor on hover
helpers.add_hover_cursor(icon, "hand1")
-- Adds mousebinds if cmd is provided
if cmd then
icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
cmd()
end),
awful.button({ }, 3, function ()
cmd()
end)
))
end
-- Add keybind to dict, if given
if key then
keybinds[key] = cmd
end
return icon
end
-- Create app buttons
local browser = create_button("", x.color3, x.color11, apps.browser, "w")
local discord = create_button("", x.color5, x.color13, apps.discord, "d")
local telegram = create_button("", x.color4, x.color12, apps.telegram, "t")
local mail = create_button("", x.color6, x.color14, apps.mail, "m")
local files = create_button("", x.color3, x.color11, apps.file_manager, "f")
local gimp = create_button("", x.color5, x.color13, apps.gimp, "g")
local youtube = create_button("", x.color1, x.color9, apps.youtube, "y")
local networks = create_button("", x.color3, x.color11, apps.networks, "n")
local passwords = create_button("", x.color1, x.color9, apps.passwords, "p")
local night_mode = create_button("", x.color1, x.color9, apps.night_mode, "x")
local record = create_button("", x.color4, x.color12, apps.record, "r")
local lutris = create_button("", x.color6, x.color14, apps.lutris, "l")
local steam = create_button("", x.color2, x.color10, apps.steam, "s")
local org = create_button("", x.color2, x.color10, apps.org, "o")
local compositor = create_button("", x.color5, x.color13, apps.compositor, "z")
local restart_awesome = create_button("", x.color4, x.color12)
restart_awesome:buttons(gears.table.join(
awful.button({ }, 1, awesome.restart)
))
-- Create the widget
app_drawer = wibox({visible = false, ontop = true, type = "dock"})
awful.placement.maximize(app_drawer)
app_drawer.bg = "#00000000"
-- app_drawer.bg = beautiful.app_drawer_bg or x.background or "#111111"
app_drawer.fg = beautiful.app_drawer_fg or x.foreground or "#FEFEFE"
-- Add app drawer or mask to each screen
for s in screen do
if s == screen.primary then
s.app_drawer = app_drawer
else
s.app_drawer = helpers.screen_mask(s, beautiful.lock_screen_bg or beautiful.exit_screen_bg or x.background)
end
end
local function set_visibility(v)
for s in screen do
s.app_drawer.visible = v
end
end
local app_drawer_grabber
function app_drawer_hide()
awful.keygrabber.stop(app_drawer_grabber)
set_visibility(false)
end
function app_drawer_show()
-- naughty.notify({text = "starting the keygrabber"})
app_drawer_grabber = awful.keygrabber.run(function(_, key, event)
local invalid_key = false
-- Debug
-- naughty.notify({ title = event, text = key })
-- if event == "press" and key == "Alt_L" or key == "Alt_R" then
-- naughty.notify({ title = "you pressed alt" })
-- end
-- if event == "release" and key == "Alt_L" or key == "Alt_R" then
-- naughty.notify({ title = "you released alt" })
-- end
if event == "release" then return end
if keybinds[key] then
keybinds[key]()
else
invalid_key = true
end
if not invalid_key or key == 'Escape' then
app_drawer_hide()
end
end)
set_visibility(true)
end
app_drawer:buttons(gears.table.join(
-- Left click - Hide app_drawer
awful.button({ }, 1, function ()
app_drawer_hide()
end),
-- Right click - Hide app_drawer
awful.button({ }, 2, function ()
app_drawer_hide()
end),
-- Middle click - Hide app_drawer
awful.button({ }, 2, function ()
app_drawer_hide()
end)
))
local function create_stripe(widgets, bg)
local buttons = wibox.widget {
-- spacing = dpi(20),
layout = wibox.layout.fixed.horizontal
}
for _, widget in ipairs(widgets) do
buttons:add(widget)
end
local stripe = wibox.widget {
{
nil,
{
nil,
buttons,
expand = "none",
layout = wibox.layout.align.horizontal
},
expand = "none",
layout = wibox.layout.align.vertical
},
bg = bg,
widget = wibox.container.background
}
return stripe
end
app_drawer:setup {
-- Background
{
-- Stripes
create_stripe({browser, youtube, discord, telegram}, "#00000000"),
create_stripe({mail, org, files, passwords}, x.color8.."20"),
create_stripe({gimp, record, lutris, steam}, x.color8.."40"),
create_stripe({networks, night_mode, compositor, restart_awesome}, x.color8.."60"),
layout = wibox.layout.flex.vertical
},
bg = x.background,
-- bg = x.background.."AA",
-- bg = "#00000000",
widget = wibox.container.background
}

View File

@@ -1,246 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local keys = require("keys")
local dock_autohide_delay = 0.5 -- seconds
-- {{{ Widgets
local update_taglist = function (item, tag, index)
if tag.selected then
item.bg = beautiful.taglist_text_color_focused[index]
elseif tag.urgent then
item.bg = beautiful.taglist_text_color_urgent[index]
elseif #tag:clients() > 0 then
item.bg = beautiful.taglist_text_color_occupied[index]
else
item.bg = beautiful.taglist_text_color_empty[index]
end
end
local dock = require("noodle.dock")
local dock_placement = function(w)
return awful.placement.bottom(w)
end
local tag_colors_empty = { "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000" }
local tag_colors_urgent = { x.foreground, x.foreground, x.foreground, x.foreground, x.foreground, x.foreground, x.foreground, x.foreground, x.foreground, x.foreground }
local tag_colors_focused = {
x.color1,
x.color5,
x.color4,
x.color6,
x.color2,
x.color3,
x.color1,
x.color5,
x.color4,
x.color6,
}
local tag_colors_occupied = {
x.color1.."45",
x.color5.."45",
x.color4.."45",
x.color6.."45",
x.color2.."45",
x.color3.."45",
x.color1.."45",
x.color5.."45",
x.color4.."45",
x.color6.."45",
}
-- Helper function that updates a taglist item
local update_taglist = function (item, tag, index)
if tag.selected then
item.bg = tag_colors_focused[index]
elseif tag.urgent then
item.bg = tag_colors_urgent[index]
elseif #tag:clients() > 0 then
item.bg = tag_colors_occupied[index]
else
item.bg = tag_colors_empty[index]
end
end
awful.screen.connect_for_each_screen(function(s)
-- Create a taglist for every screen
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = keys.taglist_buttons,
layout = {
spacing = 10,
spacing_widget = {
color = '#00ff00',
shape = gears.shape.circle,
widget = wibox.widget.separator,
},
layout = wibox.layout.flex.horizontal,
},
widget_template = {
widget = wibox.container.background,
create_callback = function(self, tag, index, _)
update_taglist(self, tag, index)
end,
update_callback = function(self, tag, index, _)
update_taglist(self, tag, index)
end,
}
}
-- Create the taglist wibox
s.taglist_box = awful.wibar({
screen = s,
visible = true,
ontop = false,
type = "dock",
position = "top",
height = dpi(10),
-- position = "left",
-- width = dpi(6),
bg = "#00000000",
})
s.taglist_box:setup {
widget = s.mytaglist,
}
-- Create the dock wibox
s.dock = awful.popup({
-- Size is dynamic, no need to set it here
visible = false,
bg = "#00000000",
ontop = true,
type = "dock",
placement = dock_placement,
widget = dock
})
dock_placement(s.dock)
local popup_timer
local autohide = function ()
if popup_timer then
popup_timer:stop()
popup_timer = nil
end
popup_timer = gears.timer.start_new(dock_autohide_delay, function()
popup_timer = nil
s.dock.visible = false
end)
end
-- Initialize wibox activator
s.dock_activator = wibox({ screen = s, height = 1, bg = "#00000000", visible = true, ontop = true})
awful.placement.bottom(s.dock_activator)
s.dock_activator:connect_signal("mouse::enter", function()
s.dock.visible = true
if popup_timer then
popup_timer:stop()
popup_timer = nil
end
end)
-- We have set the dock_activator to be ontop, but we do not want it to be
-- above fullscreen clients
local function no_dock_activator_ontop(c)
if c.fullscreen then
s.dock_activator.ontop = false
else
s.dock_activator.ontop = true
end
end
client.connect_signal("focus", no_dock_activator_ontop)
client.connect_signal("unfocus", no_dock_activator_ontop)
client.connect_signal("property::fullscreen", no_dock_activator_ontop)
s:connect_signal("removed", function (s)
client.disconnect_signal("focus", no_dock_activator_ontop)
client.disconnect_signal("unfocus", no_dock_activator_ontop)
client.disconnect_signal("property::fullscreen", no_dock_activator_ontop)
end)
s.dock_activator:buttons(
gears.table.join(
awful.button({ }, 4, function ()
awful.tag.viewprev()
end),
awful.button({ }, 5, function ()
awful.tag.viewnext()
end)
))
local function adjust_dock()
-- Reset position every time the number of dock items changes
dock_placement(s.dock)
-- Adjust activator width every time the dock wibox width changes
s.dock_activator.width = s.dock.width + dpi(250)
-- And recenter
awful.placement.bottom(s.dock_activator)
end
adjust_dock()
s.dock:connect_signal("property::width", adjust_dock)
s.dock:connect_signal("mouse::enter", function ()
if popup_timer then
popup_timer:stop()
popup_timer = nil
end
end)
s.dock:connect_signal("mouse::leave", function ()
autohide()
end)
s.dock_activator:connect_signal("mouse::leave", function ()
autohide()
end)
-- Create a system tray widget
s.systray = wibox.widget.systray()
-- Create the tray box
s.traybox = wibox({ screen = s, width = dpi(150), height = beautiful.wibar_height, bg = "#00000000", visible = false, ontop = true})
s.traybox:setup {
{
{
nil,
s.systray,
expand = "none",
layout = wibox.layout.align.horizontal,
},
margins = dpi(10),
widget = wibox.container.margin
},
bg = beautiful.bg_systray,
shape = helpers.rrect(beautiful.border_radius),
widget = wibox.container.background
}
awful.placement.bottom_right(s.traybox, { margins = beautiful.useless_gap * 2 })
s.traybox:buttons(gears.table.join(
awful.button({ }, 2, function ()
s.traybox.visible = false
end)
))
end)
awesome.connect_signal("elemental::dismiss", function()
local s = mouse.screen
s.dock.visible = false
end)
-- Every bar theme should provide these fuctions
function wibars_toggle()
local s = awful.screen.focused()
s.dock.visible = not s.dock.visible
end
function tray_toggle()
local s = awful.screen.focused()
s.traybox.visible = not s.traybox.visible
end

View File

@@ -1,355 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local apps = require("apps")
local keys = require("keys")
local helpers = require("helpers")
-- Helper function that creates a button widget
local create_button = function (symbol, color, bg_color, hover_color)
local widget = wibox.widget {
font = "icomoon 14",
align = "center",
id = "text_role",
valign = "center",
markup = helpers.colorize_text(symbol, color),
widget = wibox.widget.textbox()
}
local section = wibox.widget {
widget,
forced_width = dpi(70),
bg = bg_color,
widget = wibox.container.background
}
-- Hover animation
section:connect_signal("mouse::enter", function ()
section.bg = hover_color
end)
section:connect_signal("mouse::leave", function ()
section.bg = bg_color
end)
-- helpers.add_hover_cursor(section, "hand1")
return section
end
local exit = create_button("", x.color6, x.color8.."C0",x.color8.."E0")
exit:buttons(gears.table.join(
awful.button({ }, 1, function ()
exit_screen_show()
end)
))
local volume_symbol = ""
local volume_muted_color = x.color8
local volume_unmuted_color = x.color5
local volume = create_button(volume_symbol, volume_unmuted_color, x.color8.."30", x.color8.."50")
volume:buttons(gears.table.join(
-- Left click - Mute / Unmute
awful.button({ }, 1, function ()
helpers.volume_control(0)
end),
-- Right click - Run or raise volume control client
awful.button({ }, 3, apps.volume),
-- Scroll - Increase / Decrease volume
awful.button({ }, 4, function ()
helpers.volume_control(5)
end),
awful.button({ }, 5, function ()
helpers.volume_control(-5)
end)
))
awesome.connect_signal("evil::volume", function(_, muted)
local t = volume:get_all_children()[1]
if muted then
t.markup = helpers.colorize_text(volume_symbol, volume_muted_color)
else
t.markup = helpers.colorize_text(volume_symbol, volume_unmuted_color)
end
end)
local microphone_symbol = ""
local microphone_muted_color = x.color8
local microphone_unmuted_color = x.color3
local microphone = create_button(microphone_symbol, microphone_unmuted_color, x.color8.."60", x.color8.."80")
microphone:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("amixer -D pulse sset Capture toggle &> /dev/null")
end)
))
awesome.connect_signal("evil::microphone", function(muted)
local t = microphone:get_all_children()[1]
if muted then
t.markup = helpers.colorize_text(microphone_symbol, microphone_muted_color)
else
t.markup = helpers.colorize_text(microphone_symbol, microphone_unmuted_color)
end
end)
local music = create_button("", x.color4, x.color8.."90", x.color8.."B0")
music:buttons(gears.table.join(
awful.button({ }, 1, apps.music),
awful.button({ }, 3, apps.music),
-- Scrolling: Adjust mpd volume
awful.button({ }, 4, function ()
awful.spawn.with_shell("mpc volume +5")
end),
awful.button({ }, 5, function ()
awful.spawn.with_shell("mpc volume -5")
end)
))
local sandwich = create_button("", x.color1, x.color8.."30", x.color8.."50")
sandwich:buttons(gears.table.join(
awful.button({ }, 1, function ()
app_drawer_show()
end),
awful.button({ }, 2, apps.scratchpad),
awful.button({ }, 3, function ()
tray_toggle()
end)
))
local tag_colors_empty = { "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", "#00000000", }
local tag_colors_urgent = {
x.background,
x.background,
x.background,
x.background,
x.background,
x.background,
x.background,
x.background,
x.background,
x.background
}
local tag_colors_focused = {
x.color1,
x.color5,
x.color4,
x.color6,
x.color2,
x.color3,
x.color1,
x.color5,
x.color4,
x.color6,
}
local tag_colors_occupied = {
x.color1.."55",
x.color5.."55",
x.color4.."55",
x.color6.."55",
x.color2.."55",
x.color3.."55",
x.color1.."55",
x.color5.."55",
x.color4.."55",
x.color6.."55",
}
-- Helper function that updates a taglist item
local update_taglist = function (item, tag, index)
if tag.selected then
item.bg = tag_colors_focused[index]
elseif tag.urgent then
item.bg = tag_colors_urgent[index]
elseif #tag:clients() > 0 then
item.bg = tag_colors_occupied[index]
else
item.bg = tag_colors_empty[index]
end
end
awful.screen.connect_for_each_screen(function(s)
-- Create a taglist for every screen
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = keys.taglist_buttons,
layout = wibox.layout.flex.horizontal,
widget_template = {
widget = wibox.container.background,
create_callback = function(self, tag, index, _)
update_taglist(self, tag, index)
end,
update_callback = function(self, tag, index, _)
update_taglist(self, tag, index)
end,
}
}
-- Create a tasklist for every screen
s.mytasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = keys.tasklist_buttons,
style = {
font = beautiful.tasklist_font,
bg = x.color0,
},
layout = {
-- spacing = dpi(10),
-- layout = wibox.layout.fixed.horizontal
layout = wibox.layout.flex.horizontal
},
widget_template = {
{
{
id = 'text_role',
align = "center",
widget = wibox.widget.textbox,
},
forced_width = dpi(220),
left = dpi(15),
right = dpi(15),
-- Add margins to top and bottom in order to force the
-- text to be on a single line, if needed. Might need
-- to adjust them according to font size.
top = dpi(4),
bottom = dpi(4),
widget = wibox.container.margin
},
-- shape = helpers.rrect(dpi(8)),
-- border_width = dpi(2),
id = "bg_role",
-- id = "background_role",
-- shape = gears.shape.rounded_bar,
widget = wibox.container.background,
},
}
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox.resize = true
s.mylayoutbox.forced_width = beautiful.wibar_height - dpi(5)
s.mylayoutbox.forced_height = beautiful.wibar_height - dpi(5)
s.mylayoutbox:buttons(gears.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)))
-- Create the wibox
s.mywibox = awful.wibar({screen = s, visible = true, ontop = true, type = "dock", position = "bottom"})
s.mywibox.height = beautiful.wibar_height
-- s.mywibox.width = beautiful.wibar_width
-- For antialiasing
-- The actual background color is defined in the wibar items
-- s.mywibox.bg = "#00000000"
-- s.mywibox.bg = x.color8
-- s.mywibox.bg = x.foreground
-- s.mywibox.bg = x.background.."88"
-- s.mywibox.bg = x.background
s.mywibox.bg = x.color0
-- Bar placement
awful.placement.maximize_horizontally(s.mywibox)
-- Wibar items
-- Add or remove widgets here
s.mywibox:setup {
sandwich,
s.mytasklist,
{
volume,
microphone,
music,
exit,
layout = wibox.layout.fixed.horizontal
},
-- expand = "none",
layout = wibox.layout.align.horizontal
}
-- Create the top bar
s.mytopwibox = awful.wibar({screen = s, visible = true, ontop = false, type = "dock", position = "top", height = dpi(5)})
-- Bar placement
awful.placement.maximize_horizontally(s.mytopwibox)
s.mytopwibox.bg = "#00000000"
s.mytopwibox:setup {
widget = s.mytaglist,
}
-- Create a system tray widget
s.systray = wibox.widget.systray()
-- Create a wibox that will only show the tray
-- Hidden by default. Can be toggled with a keybind.
s.traybox = wibox({visible = false, ontop = true, type = "normal"})
s.traybox.width = dpi(120)
s.traybox.height = beautiful.wibar_height
awful.placement.bottom_left(s.traybox, {honor_workarea = true, margins = beautiful.screen_margin * 2})
s.traybox.bg = "#00000000"
s.traybox:setup {
s.systray,
bg = beautiful.bg_systray,
shape = helpers.rrect(beautiful.border_radius),
widget = wibox.container.background()
}
s.traybox:buttons(gears.table.join(
-- Middle click - Hide traybox
awful.button({ }, 2, function ()
s.traybox.visible = false
end)
))
-- Hide traybox when mouse leaves
s.traybox:connect_signal("mouse::leave", function ()
s.traybox.visible = false
end)
-- Place bar at the bottom and add margins
-- awful.placement.bottom(s.mywibox, {margins = beautiful.screen_margin * 2})
-- Also add some screen padding so that clients do not stick to the bar
-- For "awful.wibar"
-- s.padding = { bottom = s.padding.bottom + beautiful.screen_margin * 2 }
-- For "wibox"
-- s.padding = { bottom = s.mywibox.height + beautiful.screen_margin * 2 }
end)
-- We have set the wibar(s) to be ontop, but we do not want it to be above fullscreen clients
local function no_wibar_ontop(c)
local s = awful.screen.focused()
if c.fullscreen then
s.mywibox.ontop = false
else
s.mywibox.ontop = true
end
end
client.connect_signal("focus", no_wibar_ontop)
client.connect_signal("unfocus", no_wibar_ontop)
client.connect_signal("property::fullscreen", no_wibar_ontop)
-- Every bar theme should provide these fuctions
function wibars_toggle()
local s = awful.screen.focused()
s.mywibox.visible = not s.mywibox.visible
s.mytopwibox.visible = not s.mytopwibox.visible
end
function tray_toggle()
local s = awful.screen.focused()
s.traybox.visible = not s.traybox.visible
end

View File

@@ -1,130 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local apps = require("apps")
local icons = require("icons")
local helpers = require("helpers")
local keys = require("keys")
-- {{{ Widgets
local desktop_control = require("noodle.desktop_control")
local minimal_tasklist = require("noodle.minimal_tasklist")
-- Start button widget (can toggle sidebar, tray, scratchpad)
start_widget = wibox.widget.imagebox(icons.image.start)
start_widget:buttons(gears.table.join(
-- Left click - Toggle sidebar
awful.button({ }, 1, function ()
sidebar_toggle()
end),
-- Middle click - Toggle scratchpad
awful.button({ }, 2, apps.scratchpad),
-- Right click - Toggle tray
awful.button({ }, 3, function ()
local traybox = awful.screen.focused().traybox
traybox.visible = not traybox.visible
end)
))
-- Create item separator
textseparator = wibox.widget.textbox()
textseparator.text = beautiful.separator_text
textseparator.font = "hurmit nerd font bold 14"
textseparator.markup = helpers.colorize_text(textseparator.text, beautiful.separator_fg)
-- Create padding
pad = wibox.widget.textbox(" ")
-- }}}
local update_taglist = function (item, tag, index)
if tag.selected then
item.image = beautiful.taglist_icons_focused[index]
elseif tag.urgent then
item.image = beautiful.taglist_icons_urgent[index]
elseif #tag:clients() > 0 then
item.image = beautiful.taglist_icons_occupied[index]
else
item.image = beautiful.taglist_icons_empty[index]
end
end
awful.screen.connect_for_each_screen(function(s)
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
layout = wibox.layout.fixed.horizontal,
widget_template = {
widget = wibox.widget.imagebox,
-- Add support for hover colors and an index label
create_callback = function(self, tag, index, objects)
update_taglist(self, tag, index)
end,
update_callback = function(self, tag, index, objects)
update_taglist(self, tag, index)
end,
},
buttons = keys.taglist_buttons
}
-- Create a system tray widget
s.systray = wibox.widget.systray()
-- Create the wibox
s.mywibox = awful.wibar({ position = beautiful.wibar_position, screen = s, width = beautiful.wibar_width, height = beautiful.wibar_height, shape = helpers.rrect(beautiful.wibar_border_radius)})
-- Wibar items
-- Add or remove widgets here
s.mywibox:setup {
layout = wibox.layout.fixed.horizontal,
pad,
start_widget,
textseparator,
s.mytaglist,
textseparator,
desktop_control,
pad
}
-- Only set them if they exist, else they overwrite the position variable
if beautiful.wibar_x then
s.mywibox.x = beautiful.wibar_x
end
if beautiful.wibar_y then
s.mywibox.y = beautiful.wibar_y
end
-- Create a wibox that will only show the tray
-- Hidden by default. Can be toggled with a keybind.
s.traybox = wibox({visible = false, ontop = true, shape = gears.shape.rounded_bar, type = "dock"})
s.traybox.width = dpi(150)
s.traybox.height = dpi(38)
s.traybox.x = beautiful.screen_margin * 2
-- s.traybox.x = s.geometry.width - s.traybox.width - beautiful.screen_margin * 2
s.traybox.y = s.geometry.height - s.traybox.height - beautiful.screen_margin * 2
s.traybox.bg = beautiful.bg_systray
s.traybox:setup {
-- wibox.widget.textbox("test"),
pad,
s.systray,
pad,
layout = wibox.layout.align.horizontal
}
s.traybox:buttons(gears.table.join(
-- Middle click - Hide traybox
awful.button({ }, 2, function ()
s.traybox.visible = false
end)
))
end)
-- Every bar theme should provide these fuctions
function wibars_toggle()
local s = awful.screen.focused()
s.mywibox.visible = not s.mywibox.visible
end
function tray_toggle()
local s = awful.screen.focused()
s.traybox.visible = not s.traybox.visible
end

View File

@@ -1,127 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
--local xrdb = xresources.get_current_theme()
local helpers = require("helpers")
local keys = require("keys")
-- {{{ Widgets
local desktop_mode_widget = require("noodle.desktop_mode_widget")
local minimal_tasklist = require("noodle.minimal_tasklist")
-- Volume widget prefix
volumebar_prefix = wibox.widget.textbox("")
volumebar_prefix.markup = helpers.colorize_text(volumebar_prefix.text, beautiful.prefix_fg)
-- Keyboard map indicator and switcher
keyboardlayout_prefix = wibox.widget.textbox("")
keyboardlayout_prefix.markup = helpers.colorize_text(keyboardlayout_prefix.text, beautiful.prefix_fg)
mykeyboardlayout = awful.widget.keyboardlayout()
-- Create a textclock widget that shows date
date_prefix = wibox.widget.textbox("")
date_prefix.markup = helpers.colorize_text(date_prefix.text, beautiful.prefix_fg)
--mytextdate = wibox.widget.textclock("%a %d %B")
mytextdate = wibox.widget.textclock("%j days around the sun") --HAHA very useful
-- Create a textclock widget
clock_prefix = wibox.widget.textbox("")
clock_prefix.markup = helpers.colorize_text(clock_prefix.text, beautiful.prefix_fg)
mytextclock = wibox.widget.textclock("%H:%M")
-- Create item separator
textseparator = wibox.widget.textbox()
textseparator.text = beautiful.separator_text
textseparator.markup = helpers.colorize_text(textseparator.text, beautiful.separator_fg)
-- Create padding
pad = wibox.widget.textbox(" ")
-- }}}
-- Create a wibox for each screen and add it
awful.screen.connect_for_each_screen(function(s)
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt({prompt = " Run: ", fg = beautiful.prompt_fg})
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.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)))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, keys.taglist_buttons)
s.mytaglist.font = beautiful.font
-- Outer gaps
--awful.screen.padding(awful.screen.focused(),{left = 28, right = 28, top = 28, bottom = 28})
-- Create a system tray widget
s.systray = wibox.widget.systray()
s.systray.visible = false -- can be toggled by a keybind
-- Create the wibox
s.mywibox = awful.wibar({ position = beautiful.wibar_position, screen = s, width = beautiful.wibar_width, height = beautiful.wibar_height, shape = helpers.rrect(beautiful.wibar_border_radius)})
-- Wibar items
-- Add or remove widgets here
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
--s.mylayoutbox,
--mylauncher,
s.mytaglist,
textseparator,
minimal_tasklist
},
{ -- Middle widgets
layout = wibox.layout.fixed.horizontal,
--s.mypromptbox,
--textseparator,
--s.mytasklist,
--minimal_tasklist
},
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
--mpdarc_widget,
--textseparator,
--volumebar_prefix,
--volumebar_widget,
--textseparator,
--keyboardlayout_prefix,
--mykeyboardlayout,
--textseparator,
s.systray,
--minimal_tasklist,
textseparator,
--date_prefix,
mytextdate,
textseparator,
--clock_prefix,
mytextclock,
textseparator,
desktop_mode_widget,
pad,
pad
},
}
-- Place bar at the bottom and add margins
awful.placement.bottom(s.mywibox, {margins = beautiful.useless_gap * 2})
-- Also add some screen padding so that clients do not stick to the bar
s.padding = { bottom = s.padding.bottom + beautiful.useless_gap * 2 }
end)
-- Every bar theme should provide these fuctions
function wibars_toggle()
local s = awful.screen.focused()
s.mywibox.visible = not s.mywibox.visible
end
function tray_toggle()
local s = awful.screen.focused()
s.systray.visible = not s.systray.visible
end

View File

@@ -1,172 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local keys = require("keys")
local helpers = require("helpers")
-- Helper function that updates a taglist item
local update_taglist = function (item, tag, index)
if tag.selected then
item.markup = helpers.colorize_text(beautiful.taglist_text_focused[index], beautiful.taglist_text_color_focused[index])
elseif tag.urgent then
item.markup = helpers.colorize_text(beautiful.taglist_text_urgent[index], beautiful.taglist_text_color_urgent[index])
elseif #tag:clients() > 0 then
item.markup = helpers.colorize_text(beautiful.taglist_text_occupied[index], beautiful.taglist_text_color_occupied[index])
else
item.markup = helpers.colorize_text(beautiful.taglist_text_empty[index], beautiful.taglist_text_color_empty[index])
end
end
-- Create a wibox for each screen and add it
awful.screen.connect_for_each_screen(function(s)
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
layout = wibox.layout.fixed.horizontal,
widget_template = {
widget = wibox.widget.textbox,
create_callback = function(self, tag, index, _)
self.align = "center"
self.valign = "center"
self.forced_width = dpi(25)
self.font = beautiful.taglist_text_font
update_taglist(self, tag, index)
end,
update_callback = function(self, tag, index, _)
update_taglist(self, tag, index)
end,
},
buttons = keys.taglist_buttons
}
-- Create a system tray widget
s.systray = wibox.widget.systray()
-- Create a wibox that will only show the tray
-- Hidden by default. Can be toggled with a keybind.
s.traybox = wibox({visible = false, ontop = true, shape = helpers.rrect(beautiful.border_radius), type = "dock"})
s.traybox.width = dpi(120)
s.traybox.height = beautiful.wibar_height - beautiful.screen_margin * 4
s.traybox.x = s.geometry.width - beautiful.screen_margin * 2 - s.traybox.width
s.traybox.y = s.geometry.height - s.traybox.height - beautiful.screen_margin * 2
-- s.traybox.y = s.geometry.height - s.traybox.height - s.traybox.height / 2
s.traybox.bg = beautiful.bg_systray
s.traybox:setup {
s.systray,
left = dpi(6),
right = dpi(6),
widget = wibox.container.margin
}
s.traybox:buttons(gears.table.join(
-- Middle click - Hide traybox
awful.button({ }, 2, function ()
s.traybox.visible = false
end)
))
-- Hide traybox when mouse leaves
s.traybox:connect_signal("mouse::leave", function ()
s.traybox.visible = false
end)
-- Create text weather widget
local text_weather = require("noodle.text_weather")
local weather_widget_icon = text_weather:get_all_children()[1]
weather_widget_icon.font = "Typicons 11"
local weather_widget_text = text_weather:get_all_children()[2]
weather_widget_text.font = "sans 9"
-- Create a window control widget
local close_button = wibox.widget.textbox()
close_button.font = "Typicons 11"
close_button.markup = helpers.colorize_text("", x.color1)
close_button:buttons(gears.table.join(
awful.button({ }, 1, function ()
if client.focus then
client.focus:kill()
end
end)
))
local maximize_button = wibox.widget.textbox()
maximize_button:buttons(gears.table.join(
awful.button({ }, 1, function ()
if client.focus then
client.focus.maximized = not client.focus.maximized
end
end)
))
maximize_button.font = "Typicons 11"
maximize_button.markup = helpers.colorize_text("", x.color5)
local minimize_button = wibox.widget.textbox()
minimize_button:buttons(gears.table.join(
awful.button({ }, 1, function ()
if client.focus then
client.focus.minimized = true
end
end)
))
minimize_button.font = "Typicons 11"
minimize_button.markup = helpers.colorize_text("", x.color6)
local window_buttons = wibox.widget {
minimize_button,
maximize_button,
close_button,
{ -- Padding
spacing = dpi(6),
layout = wibox.layout.fixed.horizontal
},
spacing = dpi(12),
layout = wibox.layout.fixed.horizontal
}
window_buttons:buttons(gears.table.join(
awful.button({ }, 2, function ()
awful.spawn.with_shell("rofi -matching fuzzy -show windowcd")
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(-1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(1)
end)
))
-- Create the wibox
s.mywibox = awful.wibar({ position = beautiful.wibar_position, screen = s, width = beautiful.wibar_width, height = beautiful.wibar_height, shape = helpers.rrect(beautiful.wibar_border_radius)})
-- Wibar items
-- Add or remove widgets here
s.mywibox:setup {
{
{ -- Some padding
layout = wibox.layout.fixed.horizontal
},
text_weather,
spacing = dpi(12),
layout = wibox.layout.fixed.horizontal
},
s.mytaglist,
window_buttons,
expand = "none",
layout = wibox.layout.align.horizontal
}
end)
local s = mouse.screen
-- Show traybox when the mouse touches the rightmost edge of the wibar
traybox_activator = wibox({ x = s.geometry.width - 1, y = s.geometry.height - beautiful.wibar_height, height = beautiful.wibar_height, width = 1, opacity = 0, visible = true, bg = beautiful.wibar_bg })
traybox_activator:connect_signal("mouse::enter", function ()
-- awful.screen.focused().traybox.visible = true
s.traybox.visible = true
end)
-- Every bar theme should provide these fuctions
function wibars_toggle()
local s = awful.screen.focused()
s.mywibox.visible = not s.mywibox.visible
end
function tray_toggle()
local s = awful.screen.focused()
s.traybox.visible = not s.traybox.visible
end

View File

@@ -1,599 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
local icons = require("icons")
local helpers = require("helpers")
local apps = require("apps")
local keygrabber = require("awful.keygrabber")
-- Appearance
local box_radius = beautiful.dashboard_box_border_radius or dpi(12)
local box_gap = dpi(6)
-- Get screen geometry
local screen_width = awful.screen.focused().geometry.width
local screen_height = awful.screen.focused().geometry.height
-- Create the widget
dashboard = wibox({visible = false, ontop = true, type = "dock", screen = screen.primary})
awful.placement.maximize(dashboard)
dashboard.bg = beautiful.dashboard_bg or beautiful.exit_screen_bg or beautiful.wibar_bg or "#111111"
dashboard.fg = beautiful.dashboard_fg or beautiful.exit_screen_fg or beautiful.wibar_fg or "#FEFEFE"
-- Add dashboard or mask to each screen
awful.screen.connect_for_each_screen(function(s)
if s == screen.primary then
s.dashboard = dashboard
else
s.dashboard = helpers.screen_mask(s, dashboard.bg)
end
end)
local function set_visibility(v)
for s in screen do
s.dashboard.visible = v
end
end
dashboard:buttons(gears.table.join(
-- Middle click - Hide dashboard
awful.button({ }, 2, function ()
dashboard_hide()
end)
))
-- Helper function that puts a widget inside a box with a specified background color
-- Invisible margins are added so that the boxes created with this function are evenly separated
-- The widget_to_be_boxed is vertically and horizontally centered inside the box
local function create_boxed_widget(widget_to_be_boxed, width, height, bg_color)
local box_container = wibox.container.background()
box_container.bg = bg_color
box_container.forced_height = height
box_container.forced_width = width
box_container.shape = helpers.rrect(box_radius)
-- box_container.shape = helpers.prrect(20, true, true, true, true)
-- box_container.shape = helpers.prrect(30, true, true, false, true)
local boxed_widget = wibox.widget {
-- Add margins
{
-- Add background color
{
-- Center widget_to_be_boxed horizontally
nil,
{
-- Center widget_to_be_boxed vertically
nil,
-- The actual widget goes here
widget_to_be_boxed,
layout = wibox.layout.align.vertical,
expand = "none"
},
layout = wibox.layout.align.horizontal,
expand = "none"
},
widget = box_container,
},
margins = box_gap,
color = "#FF000000",
widget = wibox.container.margin
}
return boxed_widget
end
-- User widget
local user_picture_container = wibox.container.background()
-- user_picture_container.shape = gears.shape.circle
user_picture_container.shape = helpers.prrect(dpi(40), true, true, false, true)
user_picture_container.forced_height = dpi(140)
user_picture_container.forced_width = dpi(140)
local user_picture = wibox.widget {
{
wibox.widget.imagebox(user.profile_picture),
widget = user_picture_container
},
shape = helpers.rrect(box_radius / 2),
widget = wibox.container.background
}
local username = os.getenv("USER")
local user_text = wibox.widget.textbox(username:upper())
user_text.font = "San Francisco Display Heavy 20"
user_text.align = "center"
user_text.valign = "center"
local host_text = wibox.widget.textbox()
awful.spawn.easy_async_with_shell("hostname", function(out)
-- Remove trailing whitespaces
out = out:gsub('^%s*(.-)%s*$', '%1')
host_text.markup = helpers.colorize_text("@"..out, x.color8)
end)
-- host_text.markup = "<span foreground='" .. x.color8 .."'>" .. minutes.text .. "</span>"
host_text.font = "monospace 16"
host_text.align = "center"
host_text.valign = "center"
local user_widget = wibox.widget {
user_picture,
helpers.vertical_pad(dpi(24)),
user_text,
helpers.vertical_pad(dpi(4)),
host_text,
layout = wibox.layout.fixed.vertical
}
local user_box = create_boxed_widget(user_widget, dpi(300), dpi(340), x.background)
-- Calendar
local calendar = require("noodle.calendar")
-- Update calendar whenever dashboard is shown
dashboard:connect_signal("property::visible", function ()
if dashboard.visible then
calendar.date = os.date('*t')
end
end)
local calendar_box = create_boxed_widget(calendar, dpi(300), dpi(400), x.background)
-- local calendar_box = create_boxed_widget(calendar, 380, 540, x.color0)
local disk_arc = wibox.widget {
start_angle = 3 * math.pi / 2,
min_value = 0,
max_value = 100,
value = 50,
border_width = 0,
thickness = dpi(8),
forced_width = dpi(90),
forced_height = dpi(90),
rounded_edge = true,
bg = x.color8.."55",
colors = { x.color13 },
widget = wibox.container.arcchart
}
local disk_hover_text_value = wibox.widget {
align = "center",
valign = "center",
font = "sans medium 13",
widget = wibox.widget.textbox()
}
local disk_hover_text = wibox.widget {
disk_hover_text_value,
{
align = "center",
valign = "center",
font = "sans medium 10",
widget = wibox.widget.textbox("free")
},
spacing = dpi(2),
visible = false,
layout = wibox.layout.fixed.vertical
}
awesome.connect_signal("evil::disk", function(used, total)
disk_arc.value = used * 100 / total
disk_hover_text_value.markup = helpers.colorize_text(tostring(helpers.round(total - used, 1)).."G", x.color4)
end)
local disk_icon = wibox. widget {
align = "center",
valign = "center",
font = "icomoon 23",
markup = helpers.colorize_text("", x.color4),
widget = wibox.widget.textbox()
}
local disk = wibox.widget {
{
nil,
disk_hover_text,
expand = "none",
layout = wibox.layout.align.vertical
},
disk_icon,
disk_arc,
top_only = false,
layout = wibox.layout.stack
}
local disk_box = create_boxed_widget(disk, dpi(150), dpi(150), x.background)
disk_box:connect_signal("mouse::enter", function ()
disk_icon.visible = false
disk_hover_text.visible = true
end)
disk_box:connect_signal("mouse::leave", function ()
disk_icon.visible = true
disk_hover_text.visible = false
end)
-- File system bookmarks
local function create_bookmark(name, path, color, hover_color)
local bookmark = wibox.widget.textbox()
bookmark.font = "sans bold 16"
-- bookmark.text = wibox.widget.textbox(name:sub(1,1):upper()..name:sub(2))
bookmark.markup = helpers.colorize_text(name, color)
bookmark.align = "center"
bookmark.valign = "center"
-- Buttons
bookmark:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell(user.file_manager.." "..path)
dashboard_hide()
end),
awful.button({ }, 3, function ()
awful.spawn.with_shell(user.terminal.." -e 'ranger' "..path)
dashboard_hide()
end)
))
-- Hover effect
bookmark:connect_signal("mouse::enter", function ()
bookmark.markup = helpers.colorize_text(name, hover_color)
end)
bookmark:connect_signal("mouse::leave", function ()
bookmark.markup = helpers.colorize_text(name, color)
end)
helpers.add_hover_cursor(bookmark, "hand1")
return bookmark
end
local bookmarks = wibox.widget {
create_bookmark("home", os.getenv("HOME"), x.color1, x.color9),
create_bookmark("downloads", user.dirs.downloads, x.color2, x.color10),
create_bookmark("music", user.dirs.music, x.color6, x.color14),
create_bookmark("pictures", user.dirs.pictures, x.color4, x.color12),
create_bookmark("wallpapers", user.dirs.wallpapers, x.color5, x.color13),
create_bookmark("screenshots", user.dirs.screenshots, x.color3, x.color11),
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
}
local bookmarks_box = create_boxed_widget(bookmarks, dpi(200), dpi(300), x.background)
-- Corona
local corona_cases = wibox.widget.textbox()
local corona_deaths = wibox.widget.textbox()
local corona = wibox.widget {
{
align = "center",
valign = "center",
font = "Sans bold 20",
markup = helpers.colorize_text("Pandemic", x.color2),
widget = wibox.widget.textbox()
},
{
{
align = "center",
valign = "center",
font = "icomoon 20",
markup = helpers.colorize_text("", x.color3),
widget = wibox.widget.textbox()
},
{
align = "center",
valign = "center",
font = "sans medium 14",
widget = corona_cases
},
spacing = dpi(6),
layout = wibox.layout.fixed.horizontal
},
{
{
align = "center",
valign = "center",
font = "icomoon 20",
markup = helpers.colorize_text("", x.color1),
widget = wibox.widget.textbox()
},
{
align = "center",
valign = "center",
font = "sans medium 14",
widget = corona_deaths
},
spacing = dpi(6),
layout = wibox.layout.fixed.horizontal
},
spacing = dpi(20),
layout = wibox.layout.fixed.vertical
}
awesome.connect_signal("evil::coronavirus", function(cases_total, cases_today, deaths_total, deaths_today)
corona_cases.markup = cases_total.." <i>(+"..cases_today..")</i>"
corona_deaths.markup = deaths_total.." <i>(+"..deaths_today..")</i>"
end)
local corona_box = create_boxed_widget(corona, dpi(200), dpi(180), x.background)
corona_box:buttons(gears.table.join(
-- Left click - Go to a more detailed website
awful.button({ }, 1, function ()
awful.spawn.with_shell(user.browser.." https://www.worldometers.info/coronavirus/")
dashboard_hide()
end)
))
helpers.add_hover_cursor(corona_box, "hand1")
-- Fortune
local fortune_command = "fortune -n 140 -s"
local fortune_update_interval = 3600
-- local fortune_command = "fortune -n 140 -s computers"
local fortune = wibox.widget {
font = "sans medium 11",
text = "Loading your cookie...",
widget = wibox.widget.textbox
}
local update_fortune = function()
awful.spawn.easy_async_with_shell(fortune_command, function(out)
-- Remove trailing whitespaces
out = out:gsub('^%s*(.-)%s*$', '%1')
fortune.markup = "<i>"..helpers.colorize_text(out, x.color4).."</i>"
end)
end
gears.timer {
autostart = true,
timeout = fortune_update_interval,
single_shot = false,
call_now = true,
callback = update_fortune
}
local fortune_widget = wibox.widget {
{
nil,
fortune,
layout = wibox.layout.align.horizontal,
},
margins = box_gap * 4,
color = "#00000000",
widget = wibox.container.margin
}
local fortune_box = create_boxed_widget(fortune_widget, dpi(300), dpi(140), x.background)
fortune_box:buttons(gears.table.join(
-- Left click - New fortune
awful.button({ }, 1, update_fortune)
))
helpers.add_hover_cursor(fortune_box, "hand1")
-- URL launcher petals
local petal_font = "Sans Bold 11"
local function create_url_petal(text, bg_color, hover_color, url, tl, tr, br, bl)
local petal_container = wibox.widget {
bg = bg_color,
forced_height = dpi(65),
forced_width = dpi(65),
shape = helpers.prrect(99, tl, tr, br, bl),
widget = wibox.container.background()
}
local petal = wibox.widget {
{
{
font = petal_font,
align = "center",
valign = "center",
widget = wibox.widget.textbox(text)
},
widget = petal_container
},
-- Put the petal container inside a rounded container. Why?
-- Because I want the unrounded petal corner to not be pointy!
shape = helpers.rrect(dpi(4)),
widget = wibox.container.background()
}
petal:buttons(
gears.table.join(
awful.button({ }, 1, function ()
awful.spawn(user.browser.." "..url)
dashboard_hide()
end),
awful.button({ }, 3, function ()
awful.spawn(user.browser.." -new-window "..url, { switch_to_tags = true })
dashboard_hide()
end)
))
petal:connect_signal("mouse::enter", function ()
petal_container.bg = hover_color
end)
petal:connect_signal("mouse::leave", function ()
petal_container.bg = bg_color
end)
return petal
end
-- Create the containers
local petal_top_left = create_url_petal("GH", x.color4, x.color12, "https://github.com/elenapan/dotfiles", true, true, false, true)
local petal_top_right = create_url_petal("YT", x.color1, x.color9, "https://youtube.com/", true, true, true, false)
local petal_bottom_right = create_url_petal("4C", x.color2, x.color10, "https://4chan.org/",false, true, true, true)
local petal_bottom_left = create_url_petal("RD", x.color3, x.color11, "https://reddit.com/",true, false, true, true)
-- Add clickable effects on hover
helpers.add_hover_cursor(petal_top_left, "hand1")
helpers.add_hover_cursor(petal_top_right, "hand1")
helpers.add_hover_cursor(petal_bottom_left, "hand1")
helpers.add_hover_cursor(petal_bottom_right, "hand1")
local url_petals = wibox.widget {
petal_top_left,
petal_top_right,
petal_bottom_left,
petal_bottom_right,
forced_num_cols = 2,
spacing = box_gap * 2,
layout = wibox.layout.grid
}
local url_petals_box = create_boxed_widget(url_petals, dpi(150), dpi(150), "#00000000")
local icon_size = dpi(40)
-- Uptime
local uptime_text = wibox.widget.textbox()
awful.widget.watch("uptime -p | sed 's/^...//'", 60, function(_, stdout)
-- Remove trailing whitespaces
local out = stdout:gsub('^%s*(.-)%s*$', '%1')
uptime_text.text = out
end)
local uptime = wibox.widget {
{
align = "center",
valign = "center",
font = "icomoon 20",
markup = helpers.colorize_text("", x.color3),
widget = wibox.widget.textbox()
},
{
align = "center",
valign = "center",
font = "sans medium 11",
widget = uptime_text
},
spacing = dpi(10),
layout = wibox.layout.fixed.horizontal
}
local uptime_box = create_boxed_widget(uptime, dpi(300), dpi(80), x.background)
uptime_box:buttons(gears.table.join(
awful.button({ }, 1, function ()
exit_screen_show()
gears.timer.delayed_call(function()
dashboard_hide()
end)
end)
))
helpers.add_hover_cursor(uptime_box, "hand1")
local notification_state = wibox.widget {
align = "center",
valign = "center",
font = "icomoon 25",
widget = wibox.widget.textbox("")
}
local function update_notification_state_icon()
if naughty.suspended then
notification_state.markup = helpers.colorize_text(notification_state.text, x.color8)
else
notification_state.markup = helpers.colorize_text(notification_state.text, x.color2)
end
end
update_notification_state_icon()
local notification_state_box = create_boxed_widget(notification_state, dpi(150), dpi(78), x.background)
notification_state_box:buttons(gears.table.join(
-- Left click - Toggle notification state
awful.button({ }, 1, function ()
naughty.suspended = not naughty.suspended
update_notification_state_icon()
end)
))
helpers.add_hover_cursor(notification_state_box, "hand1")
local screenshot = wibox.widget {
align = "center",
valign = "center",
font = "icomoon 25",
markup = helpers.colorize_text("", x.color3),
widget = wibox.widget.textbox()
}
local screenshot_box = create_boxed_widget(screenshot, dpi(150), dpi(78), x.background)
screenshot_box:buttons(gears.table.join(
-- Left click - Take screenshot
awful.button({ }, 1, function ()
apps.screenshot("full")
end),
-- Right click - Take screenshot in 5 seconds
awful.button({ }, 3, function ()
naughty.notify({title = "Say cheese!", text = "Taking shot in 5 seconds", timeout = 4, icon = icons.image.screenshot})
apps.screenshot("full", 5)
end)
))
helpers.add_hover_cursor(screenshot_box, "hand1")
-- Item placement
dashboard:setup {
-- Center boxes vertically
nil,
{
-- Center boxes horizontally
nil,
{
-- Column container
{
-- Column 1
user_box,
fortune_box,
layout = wibox.layout.fixed.vertical
},
{
-- Column 2
url_petals_box,
notification_state_box,
screenshot_box,
disk_box,
layout = wibox.layout.fixed.vertical
},
{
-- Column 3
bookmarks_box,
corona_box,
layout = wibox.layout.fixed.vertical
},
{
-- Column 4
calendar_box,
uptime_box,
layout = wibox.layout.fixed.vertical
},
layout = wibox.layout.fixed.horizontal
},
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
nil,
expand = "none",
layout = wibox.layout.align.vertical
}
local dashboard_grabber
function dashboard_hide()
awful.keygrabber.stop(dashboard_grabber)
set_visibility(false)
end
local original_cursor = "left_ptr"
function dashboard_show()
-- Fix cursor sometimes turning into "hand1" right after showing the dashboard
-- Sigh... This fix does not always work
local w = mouse.current_wibox
if w then
w.cursor = original_cursor
end
-- naughty.notify({text = "starting the keygrabber"})
dashboard_grabber = awful.keygrabber.run(function(_, key, event)
if event == "release" then return end
-- Press Escape or q or F1 to hide it
if key == 'Escape' or key == 'q' or key == 'F1' then
dashboard_hide()
end
end)
set_visibility(true)
end

View File

@@ -1,494 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
local helpers = require("helpers")
local apps = require("apps")
local icons = require("icons")
local keygrabber = require("awful.keygrabber")
-- Appearance
local box_radius = beautiful.dashboard_box_border_radius or dpi(12)
local box_gap = dpi(6)
-- Get screen geometry
local screen_width = awful.screen.focused().geometry.width
local screen_height = awful.screen.focused().geometry.height
-- Create the widget
dashboard = wibox({visible = false, ontop = true, type = "dock", screen = screen.primary})
awful.placement.maximize(dashboard)
dashboard.bg = beautiful.dashboard_bg or beautiful.exit_screen_bg or beautiful.wibar_bg or "#111111"
dashboard.fg = beautiful.dashboard_fg or beautiful.exit_screen_fg or beautiful.wibar_fg or "#FEFEFE"
-- Add dashboard or mask to each screen
awful.screen.connect_for_each_screen(function(s)
if s == screen.primary then
s.dashboard = dashboard
else
s.dashboard = helpers.screen_mask(s, dashboard.bg)
end
end)
local function set_visibility(v)
for s in screen do
s.dashboard.visible = v
end
end
dashboard:buttons(gears.table.join(
-- Middle click - Hide dashboard
awful.button({ }, 2, function ()
dashboard_hide()
end)
))
-- Helper function that puts a widget inside a box with a specified background color
-- Invisible margins are added so that the boxes created with this function are evenly separated
-- The widget_to_be_boxed is vertically and horizontally centered inside the box
local function create_boxed_widget(widget_to_be_boxed, width, height, bg_color)
local box_container = wibox.container.background()
box_container.bg = bg_color
box_container.forced_height = height
box_container.forced_width = width
box_container.shape = helpers.rrect(box_radius)
-- box_container.shape = helpers.prrect(20, true, true, true, true)
-- box_container.shape = helpers.prrect(30, true, true, false, true)
local boxed_widget = wibox.widget {
-- Add margins
{
-- Add background color
{
-- Center widget_to_be_boxed horizontally
nil,
{
-- Center widget_to_be_boxed vertically
nil,
-- The actual widget goes here
widget_to_be_boxed,
layout = wibox.layout.align.vertical,
expand = "none"
},
layout = wibox.layout.align.horizontal,
expand = "none"
},
widget = box_container,
},
margins = box_gap,
color = "#FF000000",
widget = wibox.container.margin
}
return boxed_widget
end
-- User widget
local user_picture_container = wibox.container.background()
user_picture_container.shape = gears.shape.circle
user_picture_container.forced_height = dpi(140)
user_picture_container.forced_width = dpi(140)
local user_picture = wibox.widget {
wibox.widget.imagebox(user.profile_picture),
widget = user_picture_container
}
local username = os.getenv("USER")
local user_text = wibox.widget.textbox(username)
-- Capitalize username
-- local user_text = wibox.widget.textbox(username:upper())
-- local user_text = wibox.widget.textbox(username:sub(1,1):upper()..username:sub(2))
user_text.font = "sans bold 18"
user_text.align = "center"
user_text.valign = "center"
local host_text = wibox.widget.textbox()
awful.spawn.easy_async_with_shell("hostname", function(out)
-- Remove trailing whitespaces
out = out:gsub('^%s*(.-)%s*$', '%1')
host_text.markup = helpers.colorize_text("@"..out, x.color8)
end)
-- host_text.markup = "<span foreground='" .. x.color8 .."'>" .. minutes.text .. "</span>"
host_text.font = "sans italic 18"
host_text.align = "center"
host_text.valign = "center"
local user_widget = wibox.widget {
user_picture,
helpers.vertical_pad(dpi(30)),
user_text,
host_text,
layout = wibox.layout.fixed.vertical
}
local user_box = create_boxed_widget(user_widget, dpi(300), dpi(340), x.background)
-- Calendar
local calendar = require("noodle.calendar")
-- Update calendar whenever dashboard is shown
dashboard:connect_signal("property::visible", function ()
if dashboard.visible then
calendar.date = os.date('*t')
end
end)
local calendar_box = create_boxed_widget(calendar, dpi(300), dpi(400), x.background)
-- local calendar_box = create_boxed_widget(calendar, 380, 540, x.color0)
-- Time widget
local hours = wibox.widget.textclock("%H ")
hours.font = "sans bold 30"
hours.align = "center"
hours.valign = "center"
local minutes = wibox.widget.textclock("<span foreground='" .. x.color14 .."'> %M</span>")
minutes.font = "sans 30"
minutes.align = "center"
minutes.valign = "center"
-- Time
local time = wibox.widget {
hours,
minutes,
layout = wibox.layout.fixed.vertical
}
local time_box = create_boxed_widget(time, dpi(150), dpi(150), x.background)
-- Date
local day_of_the_week = wibox.widget.textclock("%A")
day_of_the_week.font = "sans italic 20"
day_of_the_week.fg = x.color0
day_of_the_week.align = "center"
day_of_the_week.valign = "center"
day_of_the_week.align = "center"
day_of_the_week.valign = "center"
local day_of_the_month = wibox.widget.textclock("<span foreground='" .. x.color1 .."'>%d</span>")
day_of_the_month.font = "sans bold 30"
day_of_the_month.fg = x.color0
day_of_the_month.align = "center"
day_of_the_month.valign = "center"
local date = wibox.widget {
day_of_the_week,
day_of_the_month,
layout = wibox.layout.align.vertical
}
local date_box = create_boxed_widget(date, dpi(150), dpi(150), x.background)
-- File system bookmarks
local function create_bookmark(name, path)
local original_color = x.color1
local hover_color = x.color9
local bookmark = wibox.widget.textbox()
bookmark.font = "sans bold 16"
-- bookmark.text = wibox.widget.textbox(name:sub(1,1):upper()..name:sub(2))
bookmark.markup = helpers.colorize_text(name, original_color)
bookmark.align = "center"
bookmark.valign = "center"
-- Buttons
bookmark:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell(user.file_manager.." "..path)
dashboard_hide()
end),
awful.button({ }, 3, function ()
awful.spawn.with_shell(user.terminal.." -e 'ranger' "..path)
dashboard_hide()
end)
))
-- Hover effect
bookmark:connect_signal("mouse::enter", function ()
bookmark.markup = helpers.colorize_text(name, hover_color)
end)
bookmark:connect_signal("mouse::leave", function ()
bookmark.markup = helpers.colorize_text(name, original_color)
end)
helpers.add_hover_cursor(bookmark, "hand1")
return bookmark
end
local bookmarks = wibox.widget {
create_bookmark("HOME", os.getenv("HOME")),
create_bookmark("DOWNLOADS", user.dirs.downloads),
create_bookmark("MUSIC", user.dirs.music),
create_bookmark("PICTURES", user.dirs.pictures),
create_bookmark("WALLPAPERS", user.dirs.wallpapers),
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
}
local bookmarks_box = create_boxed_widget(bookmarks, dpi(200), dpi(300), x.background)
-- URLs
local function create_url(name, path)
local original_color = x.color4
local hover_color = x.color12
local url = wibox.widget.textbox()
url.font = "sans bold 16"
-- url.text = wibox.widget.textbox(name:sub(1,1):upper()..name:sub(2))
url.markup = helpers.colorize_text(name, original_color)
url.align = "center"
url.valign = "center"
-- Buttons
url:buttons(
gears.table.join(
awful.button({ }, 1, function ()
awful.spawn(user.browser.." "..path)
dashboard_hide()
end),
awful.button({ }, 3, function ()
awful.spawn(user.browser.." -new-window "..path)
dashboard_hide()
end)
))
-- Hover effect
url:connect_signal("mouse::enter", function ()
url.markup = helpers.colorize_text(name, hover_color)
end)
url:connect_signal("mouse::leave", function ()
url.markup = helpers.colorize_text(name, original_color)
end)
helpers.add_hover_cursor(url, "hand1")
return url
end
local urls = wibox.widget {
create_url("4CHAN", "4chan.org"),
create_url("REDDIT", "reddit.com"),
create_url("GITHUB", "github.com/elenapan"),
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
}
local urls_box = create_boxed_widget(urls, dpi(200), dpi(180), x.background)
-- Fortune
local fortune_command = "fortune -n 140 -s"
-- local fortune_command = "fortune -n 140 -s computers"
local fortune = wibox.widget {
font = "sans italic 12",
text = "Loading your cookie...",
widget = wibox.widget.textbox
}
local fortune_update_interval = 3600
awful.widget.watch(fortune_command, fortune_update_interval, function(widget, stdout)
-- Remove trailing whitespaces
stdout = stdout:gsub('^%s*(.-)%s*$', '%1')
fortune.text = stdout
end)
local fortune_widget = wibox.widget {
{
nil,
fortune,
layout = wibox.layout.align.horizontal,
},
margins = box_gap * 4,
color = "#00000000",
widget = wibox.container.margin
}
local fortune_box = create_boxed_widget(fortune_widget, dpi(300), dpi(140), x.background)
fortune_box:buttons(gears.table.join(
-- Left click - New fortune
awful.button({ }, 1, function ()
awful.spawn.easy_async_with_shell(fortune_command, function(out)
-- Remove trailing whitespaces
out = out:gsub('^%s*(.-)%s*$', '%1')
fortune.markup = "<i>"..out.."</i>"
end)
end)
))
helpers.add_hover_cursor(fortune_box, "hand1")
local icon_size = dpi(40)
local brightness_icon = wibox.widget.imagebox(icons.image.redshift)
brightness_icon.resize = true
brightness_icon.forced_width = icon_size
brightness_icon.forced_height = icon_size
-- local brightness_icon = wibox.widget.textbox("")
-- brightness_icon.font = "Material Design Icons 30"
local brightness_bar = wibox.widget{
max_value = 100,
value = 50,
forced_height = dpi(10),
margins = {
top = dpi(8),
bottom = dpi(8),
},
forced_width = dpi(210),
shape = gears.shape.rounded_bar,
bar_shape = gears.shape.rounded_bar,
color = beautiful.brightness_bar_active_color or "#5AA3CC",
background_color = beautiful.brightness_bar_background_color or "#222222",
border_width = 0,
border_color = beautiful.border_color,
widget = wibox.widget.progressbar,
}
awesome.connect_signal("evil::brightness", function (value)
brightness_bar.value = value
end)
local brightness = wibox.widget {
brightness_icon,
brightness_bar,
spacing = dpi(5),
layout = wibox.layout.fixed.horizontal
}
local brightness_box = create_boxed_widget(brightness, dpi(300), dpi(80), x.background)
brightness_box:buttons(
gears.table.join(
-- Left click - Toggle redshift
awful.button({ }, 1, apps.night_mode),
-- Right click - Reset brightness (Set to max)
awful.button({ }, 3, function ()
awful.spawn.with_shell("light -S 100")
end),
-- Scroll up - Increase brightness
awful.button({ }, 4, function ()
awful.spawn.with_shell("light -A 10")
end),
-- Scroll down - Decrease brightness
awful.button({ }, 5, function ()
awful.spawn.with_shell("light -U 10")
end)
))
helpers.add_hover_cursor(brightness_box, "hand1")
local notification_state = wibox.widget.imagebox(icons.image.alarm)
notification_state.resize = true
notification_state.forced_width = icon_size
notification_state.forced_height = icon_size
-- local notification_state = wibox.widget.textbox()
-- notification_state.font = "Material Design Icons 30"
local function update_notification_state_icon()
if naughty.suspended then
notification_state.image = icons.image.alarm_off
else
notification_state.image = icons.image.alarm
end
end
update_notification_state_icon()
local notification_state_box = create_boxed_widget(notification_state, dpi(150), dpi(78), x.background)
notification_state_box:buttons(gears.table.join(
-- Left click - Toggle notification state
awful.button({ }, 1, function ()
naughty.suspended = not naughty.suspended
update_notification_state_icon()
end)
))
helpers.add_hover_cursor(notification_state_box, "hand1")
local screenshot = wibox.widget.imagebox(icons.image.screenshot)
screenshot.resize = true
screenshot.forced_width = icon_size
screenshot.forced_height = icon_size
-- local screenshot = wibox.widget.textbox("")
-- screenshot.font = "Material Design Icons 30"
local screenshot_box = create_boxed_widget(screenshot, dpi(150), dpi(78), x.background)
screenshot_box:buttons(gears.table.join(
-- Left click - Take screenshot
awful.button({ }, 1, function ()
apps.screenshot("full")
end),
-- Right click - Take screenshot in 5 seconds
awful.button({ }, 3, function ()
naughty.notify({title = "Say cheese!", text = "Taking shot in 5 seconds", timeout = 4, icon = icons.image.screenshot})
apps.screenshot("full", 5)
end)
))
helpers.add_hover_cursor(screenshot_box, "hand1")
-- Item placement
dashboard:setup {
-- Center boxes vertically
nil,
{
-- Center boxes horizontally
nil,
{
-- Column container
{
-- Column 1
user_box,
fortune_box,
layout = wibox.layout.fixed.vertical
},
{
-- Column 2
time_box,
notification_state_box,
screenshot_box,
date_box,
layout = wibox.layout.fixed.vertical
},
{
-- Column 3
bookmarks_box,
urls_box,
layout = wibox.layout.fixed.vertical
},
{
-- Column 4
calendar_box,
brightness_box,
layout = wibox.layout.fixed.vertical
},
layout = wibox.layout.fixed.horizontal
},
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
nil,
expand = "none",
layout = wibox.layout.align.vertical
}
local dashboard_grabber
function dashboard_hide()
awful.keygrabber.stop(dashboard_grabber)
set_visibility(false)
end
local original_cursor = "left_ptr"
function dashboard_show()
-- Fix cursor sometimes turning into "hand1" right after showing the dashboard
-- Sigh... This fix does not always work
local w = mouse.current_wibox
if w then
w.cursor = original_cursor
end
-- naughty.notify({text = "starting the keygrabber"})
dashboard_grabber = awful.keygrabber.run(function(_, key, event)
if event == "release" then return end
-- Press Escape or q or F1 to hide it
if key == 'Escape' or key == 'q' or key == 'F1' then
dashboard_hide()
end
end)
set_visibility(true)
end

View File

@@ -1,191 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
-- local naughty = require("naughty")
local helpers = require("helpers")
-- Appearance
-- icomoon symbols
local icon_font = "icomoon bold 45"
local poweroff_text_icon = ""
local reboot_text_icon = ""
local suspend_text_icon = ""
local exit_text_icon = ""
-- local exit_text_icon = ""
-- local poweroff_text_icon = ""
-- local reboot_text_icon = ""
-- local suspend_text_icon = ""
-- local exit_text_icon = ""
local lock_text_icon = ""
-- Typicons symbols
-- local icon_font = "Typicons 90"
-- local poweroff_text_icon = ""
-- local reboot_text_icon = ""
-- local suspend_text_icon = ""
-- local exit_text_icon = ""
-- local lock_text_icon = ""
local button_bg = x.color0
local button_size = dpi(120)
-- Commands
local poweroff_command = function()
awful.spawn.with_shell("poweroff")
end
local reboot_command = function()
awful.spawn.with_shell("reboot")
end
local suspend_command = function()
lock_screen_show()
awful.spawn.with_shell("systemctl suspend")
end
local exit_command = function()
awesome.quit()
end
local lock_command = function()
lock_screen_show()
end
-- Helper function that generates the clickable buttons
local create_button = function(symbol, hover_color, text, command)
local icon = wibox.widget {
forced_height = button_size,
forced_width = button_size,
align = "center",
valign = "center",
font = icon_font,
text = symbol,
-- markup = helpers.colorize_text(symbol, color),
widget = wibox.widget.textbox()
}
local button = wibox.widget {
{
nil,
icon,
expand = "none",
layout = wibox.layout.align.horizontal
},
forced_height = button_size,
forced_width = button_size,
border_width = dpi(8),
border_color = button_bg,
shape = helpers.rrect(dpi(20)),
bg = button_bg,
widget = wibox.container.background
}
-- Bind left click to run the command
button:buttons(gears.table.join(
awful.button({ }, 1, function ()
command()
end)
))
-- Change color on hover
button:connect_signal("mouse::enter", function ()
icon.markup = helpers.colorize_text(icon.text, hover_color)
button.border_color = hover_color
end)
button:connect_signal("mouse::leave", function ()
icon.markup = helpers.colorize_text(icon.text, x.foreground)
button.border_color = button_bg
end)
-- Use helper function to change the cursor on hover
helpers.add_hover_cursor(button, "hand1")
return button
end
-- Create the buttons
local poweroff = create_button(poweroff_text_icon, x.color1, "Poweroff", poweroff_command)
local reboot = create_button(reboot_text_icon, x.color2, "Reboot", reboot_command)
local suspend = create_button(suspend_text_icon, x.color3, "Suspend", suspend_command)
local exit = create_button(exit_text_icon, x.color4, "Exit", exit_command)
local lock = create_button(lock_text_icon, x.color5, "Lock", lock_command)
-- Create the exit screen wibox
exit_screen = wibox({visible = false, ontop = true, type = "dock"})
awful.placement.maximize(exit_screen)
exit_screen.bg = beautiful.exit_screen_bg or beautiful.wibar_bg or "#111111"
exit_screen.fg = beautiful.exit_screen_fg or beautiful.wibar_fg or "#FEFEFE"
local exit_screen_grabber
function exit_screen_hide()
awful.keygrabber.stop(exit_screen_grabber)
exit_screen.visible = false
end
local keybinds = {
['escape'] = exit_screen_hide,
['q'] = exit_screen_hide,
['x'] = exit_screen_hide,
['s'] = function () suspend_command(); exit_screen_hide() end,
['e'] = exit_command,
['p'] = poweroff_command,
['r'] = reboot_command,
['l'] = function ()
lock_command()
-- Kinda fixes the "white" (undimmed) flash that appears between
-- exit screen disappearing and lock screen appearing
gears.timer.delayed_call(function()
exit_screen_hide()
end)
end
}
function exit_screen_show()
exit_screen_grabber = awful.keygrabber.run(function(_, key, event)
-- Ignore case
key = key:lower()
if event == "release" then return end
if keybinds[key] then
keybinds[key]()
end
end)
exit_screen.visible = true
end
exit_screen:buttons(gears.table.join(
-- Left click - Hide exit_screen
awful.button({ }, 1, function ()
exit_screen_hide()
end),
-- Middle click - Hide exit_screen
awful.button({ }, 2, function ()
exit_screen_hide()
end),
-- Right click - Hide exit_screen
awful.button({ }, 3, function ()
exit_screen_hide()
end)
))
-- Item placement
exit_screen:setup {
nil,
{
nil,
{
poweroff,
reboot,
suspend,
exit,
lock,
spacing = dpi(50),
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal
},
expand = "none",
layout = wibox.layout.align.vertical
}

View File

@@ -1,288 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local icons = require("icons")
-- local naughty = require("naughty")
local helpers = require("helpers")
-- Appearance
local icon_size = beautiful.exit_screen_icon_size or dpi(140)
local text_font = beautiful.exit_screen_font or "sans 14"
-- Commands
local poweroff_command = function()
awful.spawn.with_shell("poweroff")
-- awful.keygrabber.stop(exit_screen_grabber)
end
local reboot_command = function()
awful.spawn.with_shell("reboot")
-- awful.keygrabber.stop(exit_screen_grabber)
end
local suspend_command = function()
exit_screen_hide()
lock_screen_show()
awful.spawn.with_shell("systemctl suspend")
end
local exit_command = function()
awesome.quit()
end
local lock_command = function()
lock_screen_show()
exit_screen_hide()
end
local username = os.getenv("USER")
-- Capitalize username
local goodbye_widget = wibox.widget.textbox("Goodbye " .. username:sub(1,1):upper()..username:sub(2))
goodbye_widget.font = "sans 70"
local poweroff_icon = wibox.widget.imagebox(icons.image.poweroff)
poweroff_icon.resize = true
poweroff_icon.forced_width = icon_size
poweroff_icon.forced_height = icon_size
local poweroff_text = wibox.widget.textbox("Poweroff")
poweroff_text.font = text_font
local poweroff = wibox.widget{
{
nil,
poweroff_icon,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
poweroff_text,
expand = "none",
layout = wibox.layout.align.horizontal
},
-- forced_width = 100,
layout = wibox.layout.fixed.vertical
}
poweroff:buttons(gears.table.join(
awful.button({ }, 1, function ()
poweroff_command()
end)
))
local reboot_icon = wibox.widget.imagebox(icons.image.reboot)
reboot_icon.resize = true
reboot_icon.forced_width = icon_size
reboot_icon.forced_height = icon_size
local reboot_text = wibox.widget.textbox("Reboot")
reboot_text.font = text_font
local reboot = wibox.widget{
{
nil,
reboot_icon,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
reboot_text,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
-- forced_width = 100,
layout = wibox.layout.fixed.vertical
}
reboot:buttons(gears.table.join(
awful.button({ }, 1, function ()
reboot_command()
end)
))
local suspend_icon = wibox.widget.imagebox(icons.image.suspend)
suspend_icon.resize = true
suspend_icon.forced_width = icon_size
suspend_icon.forced_height = icon_size
local suspend_text = wibox.widget.textbox("Suspend")
suspend_text.font = text_font
local suspend = wibox.widget{
{
nil,
suspend_icon,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
suspend_text,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
-- forced_width = 100,
layout = wibox.layout.fixed.vertical
}
suspend:buttons(gears.table.join(
awful.button({ }, 1, function ()
suspend_command()
end)
))
local exit_icon = wibox.widget.imagebox(icons.image.exit)
exit_icon.resize = true
exit_icon.forced_width = icon_size
exit_icon.forced_height = icon_size
local exit_text = wibox.widget.textbox("Exit")
exit_text.font = text_font
local exit = wibox.widget{
{
nil,
exit_icon,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
exit_text,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
-- forced_width = 100,
layout = wibox.layout.fixed.vertical
}
exit:buttons(gears.table.join(
awful.button({ }, 1, function ()
exit_command()
end)
))
local lock_icon = wibox.widget.imagebox(icons.image.lock)
lock_icon.resize = true
lock_icon.forced_width = icon_size
lock_icon.forced_height = icon_size
local lock_text = wibox.widget.textbox("Lock")
lock_text.font = text_font
local lock = wibox.widget{
{
nil,
lock_icon,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
lock_text,
expand = "none",
layout = wibox.layout.align.horizontal
},
-- forced_width = 100,
layout = wibox.layout.fixed.vertical
}
lock:buttons(gears.table.join(
awful.button({ }, 1, function ()
lock_command()
end)
))
-- Create the widget
exit_screen = wibox({visible = false, ontop = true, type = "dock"})
awful.placement.maximize(exit_screen)
exit_screen.bg = beautiful.exit_screen_bg or beautiful.wibar_bg or "#111111"
exit_screen.fg = beautiful.exit_screen_fg or beautiful.wibar_fg or "#FEFEFE"
-- Create an container box
-- local exit_screen_box = wibox.container.background()
-- exit_screen_box.bg = exit_screen.bg
-- exit_screen_box.shape = gears.shape.rounded_rect
-- exit_screen_box.shape_border_radius = 20
local exit_screen_grabber
function exit_screen_hide()
awful.keygrabber.stop(exit_screen_grabber)
exit_screen.visible = false
end
local keybinds = {
['escape'] = exit_screen_hide,
['q'] = exit_screen_hide,
['x'] = exit_screen_hide,
['s'] = function () suspend_command(); exit_screen_hide() end,
['e'] = exit_command,
['p'] = poweroff_command,
['r'] = reboot_command,
['l'] = function ()
lock_command()
-- Kinda fixes the "white" (undimmed) flash that appears between
-- exit screen disappearing and lock screen appearing
gears.timer.delayed_call(function()
exit_screen_hide()
end)
end
}
function exit_screen_show()
-- naughty.notify({text = "starting the keygrabber"})
exit_screen_grabber = awful.keygrabber.run(function(_, key, event)
-- Ignore case
key = key:lower()
if event == "release" then return end
if keybinds[key] then
keybinds[key]()
end
end)
exit_screen.visible = true
end
exit_screen:buttons(gears.table.join(
-- Middle click - Hide exit_screen
awful.button({ }, 2, function ()
exit_screen_hide()
end),
-- Right click - Hide exit_screen
awful.button({ }, 3, function ()
exit_screen_hide()
end)
))
-- Item placement
exit_screen:setup {
nil,
{
{
nil,
goodbye_widget,
nil,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
{
poweroff,
reboot,
suspend,
exit,
lock,
spacing = dpi(20),
layout = wibox.layout.fixed.horizontal
},
nil,
expand = "none",
layout = wibox.layout.align.horizontal
-- layout = wibox.layout.fixed.horizontal
},
layout = wibox.layout.fixed.vertical
},
nil,
expand = "none",
layout = wibox.layout.align.vertical
}

View File

@@ -1,31 +0,0 @@
local awful = require("awful")
local lock_screen = {}
local lua_pam_path = os.getenv("HOME").."/.config/awesome/liblua_pam.so"
lock_screen.init = function ()
-- Initialize authentication method based on whether lua-pam has been
-- installed or not
awful.spawn.easy_async_with_shell("stat "..lua_pam_path.." >/dev/null 2>&1", function (_, __, ___, exitcode)
if exitcode == 0 then
local pam = require("liblua_pam")
-- lua-pam was installed.
-- Authenticate with PAM
lock_screen.authenticate = function (password)
return pam.auth_current_user(password)
end
else
-- lua-pam was NOT installed.
-- Authenticate with user.lock_screen_custom_password
lock_screen.authenticate = function (password)
return password == user.lock_screen_custom_password
end
end
-- Load the lock_screen element
require("elemental.lock_screen.lock_screen")
end)
end
return lock_screen

View File

@@ -1,293 +0,0 @@
-- Disclaimer:
-- This lock screen was not designed with security in mind. There is
-- no guarantee that it will protect you against someone that wants to
-- gain access to your computer.
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
local helpers = require("helpers")
local lock_screen = require("elemental.lock_screen")
local lock_screen_symbol = ""
local lock_screen_fail_symbol = ""
local lock_animation_icon = wibox.widget {
-- Set forced size to prevent flickering when the icon rotates
forced_height = dpi(80),
forced_width = dpi(80),
font = "icomoon 40",
align = "center",
valign = "center",
widget = wibox.widget.textbox(lock_screen_symbol)
}
-- A dummy textbox needed to get user input.
-- It will not be visible anywhere.
local some_textbox = wibox.widget.textbox()
-- Create the lock screen wibox
-- Set the type to "splash" and set all "splash" windows to be blurred in your
-- compositor configuration file
lock_screen_box = wibox({visible = false, ontop = true, type = "splash", screen = screen.primary})
awful.placement.maximize(lock_screen_box)
lock_screen_box.bg = beautiful.lock_screen_bg or beautiful.exit_screen_bg or beautiful.wibar_bg or "#111111"
lock_screen_box.fg = beautiful.lock_screen_fg or beautiful.exit_screen_fg or beautiful.wibar_fg or "#FEFEFE"
-- Add lockscreen to each screen
awful.screen.connect_for_each_screen(function(s)
if s == screen.primary then
s.mylockscreen = lock_screen_box
else
s.mylockscreen = helpers.screen_mask(s, beautiful.lock_screen_bg or beautiful.exit_screen_bg or x.background)
end
end)
local function set_visibility(v)
for s in screen do
s.mylockscreen.visible = v
end
end
-- Items
local day_of_the_week = wibox.widget {
-- Fancy font
font = "Scriptina Bold 80",
-- font = "Space Craft 50",
-- font = "Razed Galerie 70",
-- font = "A-15-BIT 70",
-- font = "Kill The Noise 90",
-- Set forced width in order to keep it from getting cut off
forced_width = dpi(1000),
align = "center",
valign = "center",
widget = wibox.widget.textclock(helpers.colorize_text("%A", x.color3))
}
local month = wibox.widget {
font = "San Francisco Display Heavy 100",
align = "center",
valign = "center",
widget = wibox.widget.textclock("%B %d")
}
local function update_month()
month.markup = helpers.colorize_text(month.text:upper(), x.foreground.."25")
end
update_month()
month:connect_signal("widget::redraw_needed", function ()
update_month()
end)
-- Month + Day of the week stacked on top of each other
local fancy_date = wibox.widget {
month,
day_of_the_week,
-- Set forced width in order to keep it from getting cut off
forced_width = dpi(1000),
layout = wibox.layout.stack
}
local time = {
{
font = "sans bold 16",
widget = wibox.widget.textclock("%H")
},
{
font = "sans 16",
widget = wibox.widget.textclock("%M")
},
spacing = dpi(2),
layout = wibox.layout.fixed.horizontal
}
-- Lock animation
local lock_animation_widget_rotate = wibox.container.rotate()
local arc = function()
return function(cr, width, height)
gears.shape.arc(cr, width, height, dpi(5), 0, math.pi/2, true, true)
end
end
local lock_animation_arc = wibox.widget {
shape = arc(),
bg = "#00000000",
forced_width = dpi(100),
forced_height = dpi(100),
widget = wibox.container.background
}
local lock_animation_widget = {
{
lock_animation_arc,
widget = lock_animation_widget_rotate
},
lock_animation_icon,
layout = wibox.layout.stack
}
-- Lock helper functions
local characters_entered = 0
local function reset()
characters_entered = 0;
lock_animation_icon.markup = helpers.colorize_text(lock_screen_symbol, x.color7)
lock_animation_widget_rotate.direction = "north"
lock_animation_arc.bg = "#00000000"
end
local function fail()
characters_entered = 0;
lock_animation_icon.text = lock_screen_fail_symbol
lock_animation_widget_rotate.direction = "north"
lock_animation_arc.bg = "#00000000"
end
local animation_colors = {
-- Rainbow sequence =)
x.color1,
x.color5,
x.color4,
x.color6,
x.color2,
x.color3,
}
local animation_directions = {"north", "west", "south", "east"}
-- Function that "animates" every key press
local function key_animation(char_inserted)
local color
local direction = animation_directions[(characters_entered % 4) + 1]
if char_inserted then
color = animation_colors[(characters_entered % 6) + 1]
lock_animation_icon.text = lock_screen_symbol
else
if characters_entered == 0 then
reset()
else
color = x.color7 .. "55"
end
end
lock_animation_arc.bg = color
lock_animation_widget_rotate.direction = direction
end
-- Get input from user
local function grab_password()
awful.prompt.run {
hooks = {
-- Custom escape behaviour: Do not cancel input with Escape
-- Instead, this will just clear any input received so far.
{{ }, 'Escape',
function(_)
reset()
grab_password()
end
},
-- Fix for Control+Delete crashing the keygrabber
{{ 'Control' }, 'Delete', function ()
reset()
grab_password()
end}
},
keypressed_callback = function(mod, key, cmd)
-- Only count single character keys (thus preventing
-- "Shift", "Escape", etc from triggering the animation)
if #key == 1 then
characters_entered = characters_entered + 1
key_animation(true)
elseif key == "BackSpace" then
if characters_entered > 0 then
characters_entered = characters_entered - 1
end
key_animation(false)
end
-- Debug
-- naughty.notify { title = 'You pressed:', text = key }
end,
exe_callback = function(input)
-- Check input
if lock_screen.authenticate(input) then
-- YAY
reset()
set_visibility(false)
else
-- NAY
fail()
grab_password()
end
end,
textbox = some_textbox,
}
end
function lock_screen_show()
set_visibility(true)
grab_password()
end
-- Item placement
lock_screen_box:setup {
-- Horizontal centering
nil,
{
-- Vertical centering
nil,
{
{
{
{
month,
day_of_the_week,
layout = wibox.layout.stack
},
{
nil,
{
-- Small circle
{
forced_height = dpi(5),
forced_width = dpi(5),
shape = gears.shape.circle,
bg = x.color3,
widget = wibox.container.background
},
time,
-- Small circle
{
forced_height = dpi(5),
forced_width = dpi(5),
shape = gears.shape.circle,
bg = x.color3,
widget = wibox.container.background
},
spacing = dpi(4),
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal
},
spacing = dpi(20),
-- spacing = dpi(10),
layout = wibox.layout.fixed.vertical
},
lock_animation_widget,
spacing = dpi(40),
layout = wibox.layout.fixed.vertical
},
bottom = dpi(60),
widget = wibox.container.margin
},
expand = "none",
layout = wibox.layout.align.vertical
},
expand = "none",
layout = wibox.layout.align.horizontal
}

View File

@@ -1,40 +0,0 @@
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local microphone_icon = ""
local muted_color = x.color8
local active_color = x.color1
local microphone_overlay = wibox({
bg = x.color0.."99",
width = dpi(50),
height = dpi(50),
visible = false,
ontop = true,
type = "dock",
input_passthrough = true,
shape = helpers.rrect(beautiful.border_radius),
})
awful.placement.top_left(microphone_overlay, { margins = beautiful.useless_gap * 2 })
local indicator = wibox.widget {
font = "icomoon 20",
align = "center",
valign = "center",
widget = wibox.widget.textbox(microphone_icon)
}
microphone_overlay:setup {
widget = indicator
}
awesome.connect_signal("evil::microphone", function(muted)
indicator.markup = helpers.colorize_text(microphone_icon, muted and muted_color or active_color)
end)
function microphone_overlay_toggle()
microphone_overlay.visible = not microphone_overlay.visible
end

View File

@@ -1,554 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local apps = require("apps")
local helpers = require("helpers")
-- Helper function that changes the appearance of progress bars and their icons
local function format_progress_bar(bar)
-- Since we will rotate the bars 90 degrees, width and height are reversed
bar.forced_width = dpi(70)
bar.forced_height = dpi(30)
bar.shape = gears.shape.rounded_bar
bar.bar_shape = gears.shape.rectangle
local w = wibox.widget{
bar,
direction = 'east',
layout = wibox.container.rotate,
}
return w
end
-- Item configuration
-- ==================
-- Weather widget with text icons
local weather_widget = require("noodle.text_weather")
local weather_widget_icon = weather_widget:get_all_children()[1]
-- weather_widget_icon.font = "Typicons 18"
weather_widget_icon.font = "icomoon 16"
weather_widget_icon.align = "center"
weather_widget_icon.valign = "center"
-- So that content does not get cropped
-- weather_widget_icon.forced_width = dpi(50)
local weather_widget_description = weather_widget:get_all_children()[2]
weather_widget_description.font = "sans medium 14"
local weather_widget_temperature = weather_widget:get_all_children()[3]
weather_widget_temperature.font = "sans medium 14"
local weather = wibox.widget{
{
nil,
weather_widget_description,
expand = "none",
layout = wibox.layout.align.horizontal
},
{
nil,
{
weather_widget_icon,
weather_widget_temperature,
spacing = dpi(5),
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal
},
spacing = dpi(5),
layout = wibox.layout.fixed.vertical
-- nil,
-- weather_widget,
-- layout = wibox.layout.align.horizontal,
-- expand = "none"
}
local temperature_bar = require("noodle.temperature_bar")
local temperature = format_progress_bar(temperature_bar)
temperature:buttons(
gears.table.join(
awful.button({ }, 1, apps.temperature_monitor)
))
local cpu_bar = require("noodle.cpu_bar")
local cpu = format_progress_bar(cpu_bar)
cpu:buttons(
gears.table.join(
awful.button({ }, 1, apps.process_monitor),
awful.button({ }, 3, apps.process_monitor_gui)
))
local ram_bar = require("noodle.ram_bar")
local ram = format_progress_bar(ram_bar)
ram:buttons(
gears.table.join(
awful.button({ }, 1, apps.process_monitor),
awful.button({ }, 3, apps.process_monitor_gui)
))
local brightness_bar = require("noodle.brightness_bar")
local brightness = format_progress_bar(brightness_bar)
brightness:buttons(
gears.table.join(
-- Left click - Toggle redshift
awful.button({ }, 1, apps.night_mode),
-- Right click - Reset brightness (Set to max)
awful.button({ }, 3, function ()
awful.spawn.with_shell("light -S 100")
end),
-- Scroll up - Increase brightness
awful.button({ }, 4, function ()
awful.spawn.with_shell("light -A 10")
end),
-- Scroll down - Decrease brightness
awful.button({ }, 5, function ()
awful.spawn.with_shell("light -U 10")
end)
))
local hours = wibox.widget.textclock("%H")
local minutes = wibox.widget.textclock("%M")
local make_little_dot = function (color)
return wibox.widget{
bg = color,
forced_width = dpi(10),
forced_height = dpi(10),
shape = helpers.rrect(dpi(2)),
widget = wibox.container.background
}
end
local time = {
{
font = "biotif extra bold 44",
align = "right",
valign = "top",
widget = hours
},
{
nil,
{
make_little_dot(x.color1),
make_little_dot(x.color4),
make_little_dot(x.color5),
spacing = dpi(10),
widget = wibox.layout.fixed.vertical
},
expand = "none",
widget = wibox.layout.align.vertical
},
{
font = "biotif extra bold 44",
align = "left",
valign = "top",
widget = minutes
},
spacing = dpi(20),
layout = wibox.layout.fixed.horizontal
}
-- Day of the week (dotw)
local dotw = require("noodle.day_of_the_week")
local day_of_the_week = wibox.widget {
nil,
dotw,
expand = "none",
layout = wibox.layout.align.horizontal
}
-- Mpd
local mpd_buttons = require("noodle.mpd_buttons")
local mpd_song = require("noodle.mpd_song")
local mpd_widget_children = mpd_song:get_all_children()
local mpd_title = mpd_widget_children[1]
local mpd_artist = mpd_widget_children[2]
mpd_title.font = "sans medium 14"
mpd_artist.font = "sans medium 10"
-- Set forced height in order to limit the widgets to one line.
-- Might need to be adjusted depending on the font.
mpd_title.forced_height = dpi(22)
mpd_artist.forced_height = dpi(16)
mpd_song:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc -q toggle")
end),
awful.button({ }, 3, apps.music),
awful.button({ }, 4, function ()
awful.spawn.with_shell("mpc -q prev")
end),
awful.button({ }, 5, function ()
awful.spawn.with_shell("mpc -q next")
end)
))
local search_icon = wibox.widget {
font = "icomoon bold 10",
align = "center",
valign = "center",
widget = wibox.widget.textbox()
}
local reset_search_icon = function ()
search_icon.markup = helpers.colorize_text("", x.color3)
end
reset_search_icon()
local search_text = wibox.widget {
-- markup = helpers.colorize_text("Search", x.color8),
align = "center",
valign = "center",
font = "sans 9",
widget = wibox.widget.textbox()
}
local search_bar = wibox.widget {
shape = gears.shape.rounded_bar,
bg = x.color0,
widget = wibox.container.background()
}
local search = wibox.widget{
-- search_bar,
{
{
search_icon,
{
search_text,
bottom = dpi(2),
widget = wibox.container.margin
},
layout = wibox.layout.fixed.horizontal
},
left = dpi(15),
widget = wibox.container.margin
},
forced_height = dpi(35),
forced_width = dpi(200),
shape = gears.shape.rounded_bar,
bg = x.color0,
widget = wibox.container.background()
-- layout = wibox.layout.stack
}
local function generate_prompt_icon(icon, color)
return "<span font='icomoon 10' foreground='" .. color .."'>" .. icon .. "</span> "
end
function sidebar_activate_prompt(action)
sidebar.visible = true
search_icon.visible = false
local prompt
if action == "run" then
prompt = generate_prompt_icon("", x.color2)
elseif action == "web_search" then
prompt = generate_prompt_icon("", x.color4)
end
helpers.prompt(action, search_text, prompt, function()
search_icon.visible = true
if mouse.current_wibox ~= sidebar then
sidebar.visible = false
end
end)
end
local prompt_is_active = function ()
-- The search icon is hidden and replaced by other icons
-- when the prompt is running
return not search_icon.visible
end
search:buttons(gears.table.join(
awful.button({ }, 1, function ()
sidebar_activate_prompt("run")
end),
awful.button({ }, 3, function ()
sidebar_activate_prompt("web_search")
end)
))
local volume_bar = require("noodle.volume_bar")
local volume = format_progress_bar(volume_bar)
volume:buttons(gears.table.join(
-- Left click - Mute / Unmute
awful.button({ }, 1, function ()
helpers.volume_control(0)
end),
-- Right click - Run or raise pavucontrol
awful.button({ }, 3, apps.volume),
-- Scroll - Increase / Decrease volume
awful.button({ }, 4, function ()
helpers.volume_control(2)
end),
awful.button({ }, 5, function ()
helpers.volume_control(-2)
end)
))
-- Battery
local cute_battery_face = require("noodle.cute_battery_face")
cute_battery_face:buttons(gears.table.join(
awful.button({ }, 1, apps.battery_monitor)
))
-- Create tooltip widget
-- It should change depending on what the user is hovering over
local adaptive_tooltip = wibox.widget {
visible = false,
top_only = true,
layout = wibox.layout.stack
}
-- Create tooltip for widget w
local tooltip_counter = 0
local create_tooltip = function(w)
local tooltip = wibox.widget {
font = "sans medium 10",
align = "center",
valign = "center",
widget = wibox.widget.textbox
}
tooltip_counter = tooltip_counter + 1
local index = tooltip_counter
adaptive_tooltip:insert(index, tooltip)
w:connect_signal("mouse::enter", function()
-- Raise tooltip to the top of the stack
adaptive_tooltip:set(1, tooltip)
adaptive_tooltip.visible = true
end)
w:connect_signal("mouse::leave", function ()
adaptive_tooltip.visible = false
end)
return tooltip
end
local brightness_tooltip = create_tooltip(brightness_bar)
awesome.connect_signal("evil::brightness", function(value)
brightness_tooltip.markup = "Your screen is <span foreground='" .. beautiful.brightness_bar_active_color .."'><b>" .. tostring(value) .. "%</b></span> bright"
end)
local cpu_tooltip = create_tooltip(cpu_bar)
awesome.connect_signal("evil::cpu", function(value)
cpu_tooltip.markup = "You are using <span foreground='" .. beautiful.cpu_bar_active_color .."'><b>" .. tostring(value) .. "%</b></span> of CPU"
end)
local ram_tooltip = create_tooltip(ram_bar)
awesome.connect_signal("evil::ram", function(value, _)
ram_tooltip.markup = "You are using <span foreground='" .. beautiful.ram_bar_active_color .."'><b>" .. string.format("%.1f", value / 1000) .. "G</b></span> of memory"
end)
local volume_tooltip = create_tooltip(volume_bar)
awesome.connect_signal("evil::volume", function(value, muted)
volume_tooltip.markup = "The volume is at <span foreground='" .. beautiful.volume_bar_active_color .."'><b>" .. tostring(value) .. "%</b></span>"
if muted then
volume_tooltip.markup = volume_tooltip.markup.." and <span foreground='" .. beautiful.volume_bar_active_color .."'><b>muted</b></span>"
end
end)
local temperature_tooltip = create_tooltip(temperature_bar)
awesome.connect_signal("evil::temperature", function(value)
temperature_tooltip.markup = "Your CPU temperature is at <span foreground='" .. beautiful.temperature_bar_active_color .."'><b>" .. tostring(value) .. "°C</b></span>"
end)
local battery_tooltip = create_tooltip(cute_battery_face)
awesome.connect_signal("evil::battery", function(value)
battery_tooltip.markup = "Your battery is at <span foreground='" .. beautiful.battery_bar_active_color .."'><b>" .. tostring(value) .. "%</b></span>"
end)
-- Add clickable mouse effects on some widgets
helpers.add_hover_cursor(cpu, "hand1")
helpers.add_hover_cursor(ram, "hand1")
helpers.add_hover_cursor(temperature, "hand1")
helpers.add_hover_cursor(volume, "hand1")
helpers.add_hover_cursor(brightness, "hand1")
helpers.add_hover_cursor(mpd_song, "hand1")
helpers.add_hover_cursor(search, "xterm")
helpers.add_hover_cursor(cute_battery_face, "hand1")
-- Create the sidebar
sidebar = wibox({visible = false, ontop = true, type = "dock", screen = screen.primary})
sidebar.bg = "#00000000" -- For anti aliasing
sidebar.fg = beautiful.sidebar_fg or beautiful.wibar_fg or "#FFFFFF"
sidebar.opacity = beautiful.sidebar_opacity or 1
sidebar.height = screen.primary.geometry.height
sidebar.width = beautiful.sidebar_width or dpi(300)
sidebar.y = beautiful.sidebar_y or 0
local radius = beautiful.sidebar_border_radius or 0
if beautiful.sidebar_position == "right" then
awful.placement.top_right(sidebar)
else
awful.placement.top_left(sidebar)
end
awful.placement.maximize_vertically(sidebar, { honor_workarea = true, margins = { top = beautiful.useless_gap * 2 } })
sidebar:buttons(gears.table.join(
-- Middle click - Hide sidebar
awful.button({ }, 2, function ()
sidebar_hide()
end)
))
sidebar_show = function()
sidebar.visible = true
end
sidebar_hide = function()
-- Do not hide it if prompt is active
if not prompt_is_active() then
sidebar.visible = false
end
end
sidebar_toggle = function()
if sidebar.visible then
sidebar_hide()
else
sidebar.visible = true
end
end
-- Hide sidebar when mouse leaves
if user.sidebar.hide_on_mouse_leave then
sidebar:connect_signal("mouse::leave", function ()
sidebar_hide()
end)
end
-- Activate sidebar by moving the mouse at the edge of the screen
if user.sidebar.show_on_mouse_screen_edge then
local sidebar_activator = wibox({y = sidebar.y, width = 1, visible = true, ontop = false, opacity = 0, below = true, screen = screen.primary})
sidebar_activator.height = sidebar.height
sidebar_activator:connect_signal("mouse::enter", function ()
sidebar.visible = true
end)
if beautiful.sidebar_position == "right" then
awful.placement.right(sidebar_activator)
else
awful.placement.left(sidebar_activator)
end
sidebar_activator:buttons(
gears.table.join(
awful.button({ }, 4, function ()
awful.tag.viewprev()
end),
awful.button({ }, 5, function ()
awful.tag.viewnext()
end)
))
end
-- Item placement
sidebar:setup {
{
{ ----------- TOP GROUP -----------
{
helpers.vertical_pad(dpi(30)),
{
nil,
{
time,
spacing = dpi(12),
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal
},
helpers.vertical_pad(dpi(20)),
day_of_the_week,
helpers.vertical_pad(dpi(25)),
{
nil,
cute_battery_face,
expand = "none",
layout = wibox.layout.align.horizontal,
},
helpers.vertical_pad(dpi(30)),
layout = wibox.layout.fixed.vertical
},
layout = wibox.layout.fixed.vertical
},
{ ----------- MIDDLE GROUP -----------
{
helpers.vertical_pad(dpi(30)),
weather,
{
{
mpd_buttons,
mpd_song,
spacing = dpi(5),
layout = wibox.layout.fixed.vertical
},
top = dpi(40),
bottom = dpi(60),
left = dpi(20),
right = dpi(20),
widget = wibox.container.margin
},
{
nil,
{
volume,
cpu,
temperature,
ram,
brightness,
spacing = dpi(5),
-- layout = wibox.layout.fixed.vertical
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal
},
helpers.vertical_pad(dpi(25)),
layout = wibox.layout.fixed.vertical
},
shape = helpers.prrect(beautiful.sidebar_border_radius, false, true, false, false),
bg = x.color0.."66",
widget = wibox.container.background
},
{ ----------- BOTTOM GROUP -----------
{
{
{
nil,
adaptive_tooltip,
expand = "none",
layout = wibox.layout.align.horizontal,
},
helpers.vertical_pad(dpi(30)),
{
nil,
search,
expand = "none",
layout = wibox.layout.align.horizontal,
},
layout = wibox.layout.fixed.vertical
},
left = dpi(20),
right = dpi(20),
bottom = dpi(30),
widget = wibox.container.margin
},
bg = x.color0.."66",
widget = wibox.container.background
},
layout = wibox.layout.align.vertical,
},
shape = helpers.prrect(beautiful.sidebar_border_radius, false, true, false, false),
bg = beautiful.sidebar_bg or beautiful.wibar_bg or "#111111",
widget = wibox.container.background
}

View File

@@ -1,422 +0,0 @@
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local icons = require("icons")
local apps = require("apps")
local helpers = require("helpers")
-- Some commonly used variables
local playerctl_button_size = dpi(48)
local icon_size = dpi(36)
local progress_bar_width = dpi(215)
-- local progress_bar_margins = dpi(9)
-- Helper function that changes the appearance of progress bars and their icons
-- Create horizontal rounded bars
local function format_progress_bar(bar, icon)
icon.forced_height = icon_size
icon.forced_width = icon_size
icon.resize = true
bar.forced_width = progress_bar_width
bar.shape = gears.shape.rounded_bar
bar.bar_shape = gears.shape.rounded_bar
-- bar.forced_height = dpi(30)
-- bar.paddings = dpi(4)
-- bar.border_width = dpi(2)
-- bar.border_color = x.color8
local w = wibox.widget{
nil,
{
icon,
bar,
spacing = dpi(10),
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal
}
return w
end
-- Item configuration
local exit_icon = wibox.widget.imagebox(icons.image.poweroff)
exit_icon.resize = true
exit_icon.forced_width = icon_size
exit_icon.forced_height = icon_size
local exit_text = wibox.widget.textbox("Exit")
exit_text.font = "sans 14"
local exit = wibox.widget{
exit_icon,
exit_text,
layout = wibox.layout.fixed.horizontal
}
exit:buttons(gears.table.join(
awful.button({ }, 1, function ()
exit_screen_show()
sidebar.visible = false
end)
))
-- Weather widget with image icons
-- local weather_widget = require("noodle.weather")
-- local weather_widget_icon = weather_widget:get_all_children()[1]
-- weather_widget_icon.forced_width = icon_size
-- weather_widget_icon.forced_height = icon_size
-- local weather_widget_text = weather_widget:get_all_children()[2]
-- weather_widget_text.font = "sans 14"
-- Weather widget with text icons
local weather_widget = require("noodle.text_weather")
local weather_widget_icon = weather_widget:get_all_children()[1]
weather_widget_icon.font = "Typicons 25"
local weather_widget_text = weather_widget:get_all_children()[2]
weather_widget_text.font = "sans 14"
local weather = wibox.widget{
nil,
weather_widget,
nil,
layout = wibox.layout.align.horizontal,
expand = "none"
}
local temperature_icon = wibox.widget.imagebox(icons.image.temperature)
local temperature_bar = require("noodle.temperature_bar")
local temperature = format_progress_bar(temperature_bar, temperature_icon)
temperature:buttons(
gears.table.join(
awful.button({ }, 1, apps.temperature_monitor)
))
local battery_icon = wibox.widget.imagebox(icons.image.battery)
awesome.connect_signal("evil::charger", function(plugged)
if plugged then
battery_icon.image = icons.image.battery_charging
else
battery_icon.image = icons.image.battery
end
end)
local battery_bar = require("noodle.battery_bar")
local battery = format_progress_bar(battery_bar, battery_icon)
local cpu_icon = wibox.widget.imagebox(icons.image.cpu)
local cpu_bar = require("noodle.cpu_bar")
local cpu = format_progress_bar(cpu_bar, cpu_icon)
cpu:buttons(
gears.table.join(
awful.button({ }, 1, apps.process_monitor),
awful.button({ }, 3, apps.process_monitor_gui)
))
local ram_icon = wibox.widget.imagebox(icons.image.ram)
local ram_bar = require("noodle.ram_bar")
local ram = format_progress_bar(ram_bar, ram_icon)
ram:buttons(
gears.table.join(
awful.button({ }, 1, apps.process_monitor),
awful.button({ }, 3, apps.process_monitor_gui)
))
local playerctl_toggle_icon = wibox.widget.imagebox(icons.image.playerctl_toggle)
playerctl_toggle_icon.resize = true
playerctl_toggle_icon.forced_width = playerctl_button_size
playerctl_toggle_icon.forced_height = playerctl_button_size
playerctl_toggle_icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc -q toggle")
end),
awful.button({ }, 3, function ()
awful.spawn.with_shell("mpvc toggle")
end)
))
local playerctl_prev_icon = wibox.widget.imagebox(icons.image.playerctl_prev)
playerctl_prev_icon.resize = true
playerctl_prev_icon.forced_width = playerctl_button_size
playerctl_prev_icon.forced_height = playerctl_button_size
playerctl_prev_icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc -q prev")
end),
awful.button({ }, 3, function ()
awful.spawn.with_shell("mpvc prev")
end)
))
local playerctl_next_icon = wibox.widget.imagebox(icons.image.playerctl_next)
playerctl_next_icon.resize = true
playerctl_next_icon.forced_width = playerctl_button_size
playerctl_next_icon.forced_height = playerctl_button_size
playerctl_next_icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc -q next")
end),
awful.button({ }, 3, function ()
awful.spawn.with_shell("mpvc next")
end)
))
local playerctl_buttons = wibox.widget {
nil,
{
playerctl_prev_icon,
playerctl_toggle_icon,
playerctl_next_icon,
spacing = dpi(10),
layout = wibox.layout.fixed.horizontal
},
expand = "none",
layout = wibox.layout.align.horizontal,
}
local time = wibox.widget.textclock("%H %M")
time.align = "center"
time.valign = "center"
time.font = "sans 55"
local date = wibox.widget.textclock("%B %d")
-- local date = wibox.widget.textclock("%A, %B %d")
-- local date = wibox.widget.textclock("%A, %B %d, %Y")
date.align = "center"
date.valign = "center"
date.font = "sans medium 16"
-- local fancy_date = wibox.widget.textclock("%-j days around the sun")
local fancy_date = wibox.widget.textclock("Knowing that today is %A fills you with determination.")
fancy_date.align = "center"
fancy_date.valign = "center"
fancy_date.font = "sans italic 11"
local mpd_song = require("noodle.mpd_song")
local mpd_widget_children = mpd_song:get_all_children()
local mpd_title = mpd_widget_children[1]
local mpd_artist = mpd_widget_children[2]
mpd_title.font = "sans medium 14"
mpd_artist.font = "sans 11"
-- Set forced height in order to limit the widgets to one line.
-- Might need to be adjusted depending on the font.
mpd_title.forced_height = dpi(24)
mpd_artist.forced_height = dpi(18)
mpd_song:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc -q toggle")
end),
awful.button({ }, 3, function ()
-- Spawn music terminal
awful.spawn(user.music_client)
end),
awful.button({ }, 4, function ()
awful.spawn.with_shell("mpc -q prev")
end),
awful.button({ }, 5, function ()
awful.spawn.with_shell("mpc -q next")
end)
))
local disk_space = require("noodle.disk")
disk_space.font = "sans 14"
local disk_icon = wibox.widget.imagebox(icons.image.files)
disk_icon.resize = true
disk_icon.forced_width = icon_size
disk_icon.forced_height = icon_size
local disk = wibox.widget{
nil,
{
disk_icon,
disk_space,
layout = wibox.layout.fixed.horizontal
},
nil,
expand = "none",
layout = wibox.layout.align.horizontal
}
disk:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn(user.file_manager, {floating = true})
end),
awful.button({ }, 3, function ()
awful.spawn(user.file_manager .. " /data", {floating = true})
end)
))
local search_icon = wibox.widget.imagebox(icons.image.search)
search_icon.resize = true
search_icon.forced_width = icon_size
search_icon.forced_height = icon_size
local search_text = wibox.widget.textbox("Search")
search_text.font = "sans 14"
local search = wibox.widget{
search_icon,
search_text,
layout = wibox.layout.fixed.horizontal
}
search:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("rofi -matching fuzzy -show combi")
sidebar.visible = false
end),
awful.button({ }, 3, function ()
awful.spawn.with_shell("rofi -matching fuzzy -show run")
sidebar.visible = false
end)
))
local volume_icon = wibox.widget.imagebox(icons.image.volume)
local volume_bar = require("noodle.volume_bar")
local volume = format_progress_bar(volume_bar, volume_icon)
volume:buttons(gears.table.join(
-- Left click - Mute / Unmute
awful.button({ }, 1, function ()
helpers.volume_control(0)
end),
-- Right click - Run or raise pavucontrol
awful.button({ }, 3, apps.volume),
-- Scroll - Increase / Decrease volume
awful.button({ }, 4, function ()
helpers.volume_control(2)
end),
awful.button({ }, 5, function ()
helpers.volume_control(-2)
end)
))
-- Add clickable effects on some widgets
helpers.add_hover_cursor(cpu, "hand1")
helpers.add_hover_cursor(ram, "hand1")
helpers.add_hover_cursor(temperature, "hand1")
helpers.add_hover_cursor(volume, "hand1")
-- Create the sidebar
sidebar = wibox({visible = false, ontop = true, type = "dock", screen = screen.primary})
sidebar.bg = beautiful.sidebar_bg or beautiful.wibar_bg or "#111111"
sidebar.fg = beautiful.sidebar_fg or beautiful.wibar_fg or "#FFFFFF"
sidebar.opacity = beautiful.sidebar_opacity or 1
sidebar.height = screen.primary.geometry.height
sidebar.width = beautiful.sidebar_width or dpi(300)
sidebar.y = beautiful.sidebar_y or 0
local radius = beautiful.sidebar_border_radius or 0
if beautiful.sidebar_position == "right" then
awful.placement.right(sidebar)
sidebar.shape = helpers.prrect(radius, true, false, false, true)
else
awful.placement.left(sidebar)
sidebar.shape = helpers.prrect(radius, false, true, true, false)
end
-- sidebar.shape = helpers.rrect(radius)
sidebar_show = function()
sidebar.visible = true
end
sidebar_hide = function()
sidebar.visible = false
end
sidebar_toggle = function()
sidebar.visible = not sidebar.visible
end
sidebar:buttons(gears.table.join(
-- Middle click - Hide sidebar
awful.button({ }, 2, function ()
sidebar.visible = false
end)
))
-- Hide sidebar when mouse leaves
if user.sidebar.hide_on_mouse_leave then
sidebar:connect_signal("mouse::leave", function ()
sidebar.visible = false
end)
end
-- Activate sidebar by moving the mouse at the edge of the screen
if user.sidebar.show_on_mouse_screen_edge then
local sidebar_activator = wibox({y = sidebar.y, width = 1, visible = true, ontop = false, opacity = 0, below = true, screen = screen.primary})
sidebar_activator.height = sidebar.height
sidebar_activator:connect_signal("mouse::enter", function ()
sidebar.visible = true
end)
if beautiful.sidebar_position == "right" then
awful.placement.right(sidebar_activator)
else
awful.placement.left(sidebar_activator)
end
sidebar_activator:buttons(
gears.table.join(
awful.button({ }, 4, function ()
awful.tag.viewprev()
end),
awful.button({ }, 5, function ()
awful.tag.viewnext()
end)
))
end
-- Item placement
sidebar:setup {
{ ----------- TOP GROUP -----------
helpers.vertical_pad(40),
time,
date,
helpers.vertical_pad(20),
weather,
helpers.vertical_pad(40),
layout = wibox.layout.fixed.vertical
},
{ ----------- MIDDLE GROUP -----------
playerctl_buttons,
{
-- Put some margins at the left and right edge so that
-- it looks better with extremely long titles/artists
mpd_song,
left = dpi(10),
right = dpi(10),
widget = wibox.container.margin
},
helpers.vertical_pad(40),
volume,
cpu,
temperature,
ram,
battery,
helpers.vertical_pad(20),
disk,
helpers.vertical_pad(40),
layout = wibox.layout.fixed.vertical
},
{ ----------- BOTTOM GROUP -----------
nil,
{
{
search,
exit,
spacing = dpi(50),
layout = wibox.layout.fixed.horizontal
},
left = dpi(20),
right = dpi(20),
bottom = dpi(20),
widget = wibox.container.margin
},
nil,
layout = wibox.layout.align.horizontal,
expand = "none"
},
layout = wibox.layout.align.vertical,
-- expand = "none"
}

View File

@@ -1,255 +0,0 @@
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local keys = require("keys")
local gears = require("gears")
local capi = { screen = screen, client = client }
local icons = require("icons")
local class_icons = icons.text.by_class
-- TODO ability to switch to specific minimized clients without using the mouse:
-- Might need to ditch the "easy" tasklist approach for something manual
local window_switcher_margin = dpi(10)
local item_height = dpi(50)
local item_width = dpi(500)
local window_switcher_hide
local get_num_clients
awful.screen.connect_for_each_screen(function(s)
-- Helper function that sets/updates the icon of a task
-- according to its class
local function set_icon(item, c)
local i = class_icons[c.class] or class_icons['_']
item:get_children_by_id('text_icon')[1].markup = helpers.colorize_text(i.symbol, i.color)
end
-- Tasklist
s.window_switcher_tasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = keys.tasklist_buttons,
style = {
font = beautiful.tasklist_font,
-- font = "sans 10 medium",
bg = x.color0,
},
layout = {
layout = wibox.layout.fixed.vertical
},
widget_template = {
{
-- Standard icon (from beautiful.icon_theme)
-- {
-- awful.widget.clienticon,
-- margins = 5,
-- widget = wibox.container.margin
-- },
-- Text icon
{
id = 'text_icon',
font = 'icomoon 25',
forced_width = dpi(50),
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
id = 'text_role',
align = "center",
widget = wibox.widget.textbox,
},
left = dpi(6),
right = dpi(14),
-- Add margins to top and bottom in order to force the
-- text to be on a single line, if needed. Might need
-- to adjust them according to font size.
top = dpi(14),
bottom = dpi(14),
widget = wibox.container.margin
},
layout = wibox.layout.fixed.horizontal
},
forced_height = item_height,
id = "bg_role",
widget = wibox.container.background,
create_callback = function(self, c, _, __)
set_icon(self, c)
-- Handle clients which change their own class
c:connect_signal("property::class", function() set_icon(self, c) end)
end,
},
}
s.window_switcher = awful.popup({
visible = false,
ontop = true,
screen = s,
bg = "#00000000",
fg = x.foreground,
widget = {
{
s.window_switcher_tasklist,
forced_width = item_width,
margins = window_switcher_margin,
widget = wibox.container.margin
},
bg = x.color0,
shape = helpers.rrect(beautiful.border_radius),
widget = wibox.container.background
}
})
-- Center window switcher whenever its height changes
s.window_switcher:connect_signal("property::height", function()
awful.placement.centered(s.window_switcher, { honor_workarea = true, honor_padding = true })
if s.window_switcher.visible and get_num_clients(s) == 0 then
window_switcher_hide()
end
end)
end)
get_num_clients = function(s)
local minimized_clients_in_tag = 0
local matcher = function(c)
return awful.rules.match(c,
{ minimized = true, skip_taskbar = false, hidden = false, first_tag = s.selected_tag })
end
for c in awful.client.iterate(matcher) do
minimized_clients_in_tag = minimized_clients_in_tag + 1
end
return minimized_clients_in_tag + #s.clients
end
-- The client that was focused when the window_switcher was activated
local window_switcher_first_client
-- The clients that were minimized when the window switcher was
-- activated
local window_switcher_minimized_clients = {}
-- Keygrabber configuration
-- Helper functions for keybinds
local window_switcher_grabber
window_switcher_hide = function()
-- Add currently focused client to history
if client.focus then
local window_switcher_last_client = client.focus
awful.client.focus.history.add(window_switcher_last_client)
-- Raise client that was focused originally
-- Then raise last focused client
if window_switcher_first_client and window_switcher_first_client.valid then
window_switcher_first_client:raise()
window_switcher_last_client:raise()
end
end
-- Minimize originally minimized clients
local s = awful.screen.focused()
local clients = s.selected_tag:clients()
for _, c in pairs(window_switcher_minimized_clients) do
if c and c.valid and not (client.focus and client.focus == c) then
c.minimized = true
end
end
-- Reset helper table
window_switcher_minimized_clients = {}
-- Resume recording focus history
awful.client.focus.history.enable_tracking()
-- Stop and hide window_switcher
awful.keygrabber.stop(window_switcher_grabber)
s.window_switcher.visible = false
end
local window_search = function()
window_switcher_hide()
awful.spawn.with_shell("rofi_awesome_window")
end
local unminimize = function()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
end
end
local close = function()
if client.focus then client.focus:kill() end
end
-- Set up keybinds
-- Single keys only
local keybinds = {
['Escape'] = window_switcher_hide,
['Tab'] = function() awful.client.focus.byidx(1) end,
-- (Un)Minimize
['n'] = function() if client.focus then client.focus.minimized = true end end,
['N'] = unminimize,
['u'] = unminimize, -- `u` for up
-- Close
['d'] = close,
['q'] = close,
-- Move with vim keys
['j'] = function() awful.client.focus.byidx(1) end,
['k'] = function() awful.client.focus.byidx(-1) end,
-- Move with arrow keys
['Down'] = function() awful.client.focus.byidx(1) end,
['Up'] = function() awful.client.focus.byidx(-1) end,
-- Space
[' '] = window_search
}
function window_switcher_show(s)
if get_num_clients(s) == 0 then
return
end
-- Store client that is focused in a variable
window_switcher_first_client = client.focus
-- Stop recording focus history
awful.client.focus.history.disable_tracking()
-- Go to previously focused client (in the tag)
awful.client.focus.history.previous()
-- Track minimized clients
-- Unminimize them
-- Lower them so that they are always below other
-- originally unminimized windows
local clients = s.selected_tag:clients()
for _, c in pairs(clients) do
if c.minimized then
table.insert(window_switcher_minimized_clients, c)
c.minimized = false
c:lower()
end
end
-- Start the keygrabber
window_switcher_grabber = awful.keygrabber.run(function(_, key, event)
if event == "release" then
-- Hide if the modifier was released
-- We try to match Super or Alt or Control since we do not know which keybind is
-- used to activate the window switcher (the keybind is set by the user in keys.lua)
if key:match("Super") or key:match("Alt") or key:match("Control") then
window_switcher_hide()
end
-- Do nothing
return
end
-- Run function attached to key, if it exists
if keybinds[key] then
keybinds[key]()
end
end)
gears.timer.delayed_call(function()
-- Finally make the window switcher wibox visible after
-- a small delay, to allow the popup size to update
s.window_switcher.visible = true
end)
end

View File

@@ -1,58 +0,0 @@
-- Provides:
-- evil::battery
-- percentage (integer)
-- evil::charger
-- plugged (boolean)
local awful = require("awful")
local update_interval = 30
-- Subscribe to power supply status changes with acpi_listen
local charger_script = [[
sh -c '
acpi_listen | grep --line-buffered ac_adapter
'
]]
-- First get battery file path
-- If there are multiple, only get the first one
-- TODO support multiple batteries
awful.spawn.easy_async_with_shell("sh -c 'out=\"$(find /sys/class/power_supply/BAT?/capacity)\" && (echo \"$out\" | head -1) || false' ", function (battery_file, _, __, exit_code)
-- No battery file found
if not (exit_code == 0) then
return
end
-- Periodically get battery info
awful.widget.watch("cat "..battery_file, update_interval, function(_, stdout)
awesome.emit_signal("evil::battery", tonumber(stdout))
end)
end)
-- First get charger file path
awful.spawn.easy_async_with_shell("sh -c 'out=\"$(find /sys/class/power_supply/*/online)\" && (echo \"$out\" | head -1) || false' ", function (charger_file, _, __, exit_code)
-- No charger file found
if not (exit_code == 0) then
return
end
-- Then initialize function that emits charger info
local emit_charger_info = function()
awful.spawn.easy_async_with_shell("cat "..charger_file, function (out)
local status = tonumber(out) == 1
awesome.emit_signal("evil::charger", status)
end)
end
-- Run once to initialize widgets
emit_charger_info()
-- Kill old acpi_listen process
awful.spawn.easy_async_with_shell("ps x | grep \"acpi_listen\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Update charger status with each line printed
awful.spawn.with_line_callback(charger_script, {
stdout = function(_)
emit_charger_info()
end
})
end)
end)

View File

@@ -1,38 +0,0 @@
-- Provides:
-- evil::brightness
-- percentage (integer)
local awful = require("awful")
-- Subscribe to backlight changes
-- Requires inotify-tools
local brightness_subscribe_script = [[
bash -c "
while (inotifywait -e modify /sys/class/backlight/?*/brightness -qq) do echo; done
"]]
local brightness_script = [[
sh -c "
light -G
"]]
local emit_brightness_info = function()
awful.spawn.with_line_callback(brightness_script, {
stdout = function(line)
percentage = math.floor(tonumber(line))
awesome.emit_signal("evil::brightness", percentage)
end
})
end
-- Run once to initialize widgets
emit_brightness_info()
-- Kill old inotifywait process
awful.spawn.easy_async_with_shell("ps x | grep \"inotifywait -e modify /sys/class/backlight\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Update brightness status with each line printed
awful.spawn.with_line_callback(brightness_subscribe_script, {
stdout = function(_)
emit_brightness_info()
end
})
end)

View File

@@ -1,43 +0,0 @@
-- Provides:
-- evil::coronavirus
-- cases_total (integer)
-- cases_today (integer)
-- deaths_total (integer)
-- deaths_today (integer)
local awful = require("awful")
local helpers = require("helpers")
local naughty = require("naughty")
local update_interval = 60 * 60 * 12 -- 12 hours
local country = user.coronavirus_country or "germany"
local temp_file = "/tmp/awesomewm-evil-coronavirus-"..country
local coronavirus_script = [[
sh -c '
country="]]..country..[["
stats=$(curl "https://corona-stats.online/$country?format=json" 2>/dev/null)
cases_total="$(echo $stats | jq ".data[0].cases")"
cases_today="$(echo $stats | jq ".data[0].todayCases")"
deaths_total="$(echo $stats | jq ".data[0].deaths")"
deaths_today="$(echo $stats | jq ".data[0].todayDeaths")"
echo CTOTAL@$cases_total@CTODAY@$cases_today@DTOTAL@$deaths_total@DTODAY@$deaths_today@
']]
helpers.remote_watch(coronavirus_script, update_interval, temp_file, function(stdout)
local cases_total = stdout:match('^CTOTAL@(.*)@CTODAY')
local cases_today = stdout:match('CTODAY@(.*)@DTOTAL')
local deaths_total = stdout:match('DTOTAL@(.*)@DTODAY')
local deaths_today = stdout:match('DTODAY@(.*)@')
-- If it is found, we assume the command succeeded
if cases_total then
awesome.emit_signal("evil::coronavirus", cases_total, cases_today, deaths_total, deaths_today)
else
-- Remove temp_file to force an update the next time
awful.spawn.with_shell("rm "..temp_file)
awesome.emit_signal("evil::coronavirus", -1, -1, -1, -1)
end
end)

View File

@@ -1,18 +0,0 @@
-- Provides:
-- evil::cpu
-- used percentage (integer)
local awful = require("awful")
local update_interval = 5
local cpu_idle_script = [[
sh -c "
vmstat 1 2 | tail -1 | awk '{printf \"%d\", $15}'
"]]
-- Periodically get cpu info
awful.widget.watch(cpu_idle_script, update_interval, function(widget, stdout)
-- local cpu_idle = stdout:match('+(.*)%.%d...(.*)%(')
local cpu_idle = stdout
cpu_idle = string.gsub(cpu_idle, '^%s*(.-)%s*$', '%1')
awesome.emit_signal("evil::cpu", 100 - tonumber(cpu_idle))
end)

View File

@@ -1,25 +0,0 @@
-- Provides:
-- evil::disk
-- used (integer - mega bytes)
-- total (integer - mega bytes)
local awful = require("awful")
local helpers = require("helpers")
local update_interval = 180 -- every 3 minutes
-- Use /dev/sdxY according to your setup
local disk_script = [[
bash -c "
df -kH -B 1MB /dev/sda1 | tail -1 | awk '{printf \"%d@%d\", $4, $3}'
"
]]
-- Periodically get disk space info
awful.widget.watch(disk_script, update_interval, function(_, stdout)
-- Get `available` and `used` instead of `used` and `total`,
-- since the total size reported by the `df` command includes
-- the 5% storage reserved for `root`, which is misleading.
local available = tonumber(stdout:match('^(.*)@')) / 1000
local used = tonumber(stdout:match('@(.*)$')) / 1000
awesome.emit_signal("evil::disk", used, used + available)
end)

View File

@@ -1,21 +0,0 @@
-- Monitoring
require("evil.cpu")
require("evil.ram")
require("evil.temperature")
require("evil.battery")
require("evil.disk")
-- User controlled
require("evil.volume")
require("evil.microphone")
require("evil.mpd")
require("evil.brightness")
-- require("evil.spotify")
-- Internet access required
-- Note: These daemons use a temp file to store the retrieved values in order
-- to check its modification time and decide if it is time to update or not.
-- No need to worry that you will be updating too often when restarting AwesomeWM :)
-- This is useful because some APIs have a limit on the number of calls per hour.
require("evil.coronavirus")
require("evil.weather")

View File

@@ -1,36 +0,0 @@
-- Provides:
-- evil::microphone
-- muted (boolean)
local awful = require("awful")
local muted_old = -1
local function emit_microphone_info()
-- See evil/volume.lua for the reason why we print the +7 and +11 lines after '* index'
awful.spawn.easy_async_with_shell("pacmd list-sources | awk '/\\* index: /{nr[NR+7];nr[NR+11]}; NR in nr'", function(stdout)
local muted = stdout:match('muted:(%s+)[yes]')
local muted_int = muted and 1 or 0
if not (muted_int == muted_old) then
awesome.emit_signal("evil::microphone", muted)
muted_old = muted_int
end
end)
end
-- Run once to initialize widgets
emit_microphone_info()
-- Sleeps until pactl detects an event (microphone volume up / down / (un)mute)
local microphone_script = [[
bash -c '
pactl subscribe 2> /dev/null | grep --line-buffered "source #"
']]
-- Kill old pactl subscribe processes
awful.spawn.easy_async_with_shell("ps x | grep \"pactl subscribe\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Run emit_microphone_info() with each line printed
awful.spawn.with_line_callback(microphone_script, {
stdout = function(line)
emit_microphone_info()
end
})
end)

View File

@@ -1,121 +0,0 @@
-- Provides:
-- evil::mpd
-- artist (string)
-- song (string)
-- paused (boolean)
-- evil::mpd_volume
-- value (integer from 0 to 100)
-- evil::mpd_options
-- loop (boolean)
-- random (boolean)
local awful = require("awful")
local function emit_info()
awful.spawn.easy_async_with_shell("sh -c 'mpc -f ARTIST@%artist%@TITLE@%title%@FILE@%file%@'",
function(stdout)
local artist = stdout:match('^ARTIST@(.*)@TITLE')
local title = stdout:match('@TITLE@(.*)@FILE')
local status = stdout:match('\n%[(.*)%]')
if not artist or artist == "" then
artist = "N/A"
end
if not title or title == "" then
title = stdout:match('@FILE@(.*)@')
if not title or title == "" then
title = "N/A"
end
end
local paused
if status == "playing" then
paused = false
else
paused = true
end
awesome.emit_signal("evil::mpd", artist, title, paused)
end
)
end
-- Run once to initialize widgets
emit_info()
-- Sleeps until mpd changes state (pause/play/next/prev)
local mpd_script = [[
sh -c '
mpc idleloop player
']]
-- Kill old mpc idleloop player process
awful.spawn.easy_async_with_shell("ps x | grep \"mpc idleloop player\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Emit song info with each line printed
awful.spawn.with_line_callback(mpd_script, {
stdout = function()
emit_info()
end
})
end)
----------------------------------------------------------
-- MPD Volume
local function emit_volume_info()
awful.spawn.easy_async_with_shell("mpc volume | awk '{print substr($2, 1, length($2)-1)}'",
function(stdout)
awesome.emit_signal("evil::mpd_volume", tonumber(stdout))
end
)
end
-- Run once to initialize widgets
emit_volume_info()
-- Sleeps until mpd volume changes
-- >> We use `sed '1~2d'` to remove every other line since the mixer event
-- is printed twice for every volume update.
-- >> The `-u` option forces sed to work in unbuffered mode in order to print
-- without waiting for `mpc idleloop mixer` to finish
local mpd_volume_script = [[
sh -c "
mpc idleloop mixer | sed -u '1~2d'
"]]
-- Kill old mpc idleloop mixer process
awful.spawn.easy_async_with_shell("ps x | grep \"mpc idleloop mixer\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Emit song info with each line printed
awful.spawn.with_line_callback(mpd_volume_script, {
stdout = function()
emit_volume_info()
end
})
end)
local mpd_options_script = [[
sh -c "
mpc idleloop options
"]]
local function emit_options_info()
awful.spawn.easy_async_with_shell("mpc | tail -1",
function(stdout)
local loop = stdout:match('repeat: (.*)')
local random = stdout:match('random: (.*)')
awesome.emit_signal("evil::mpd_options", loop:sub(1, 2) == "on", random:sub(1, 2) == "on")
end
)
end
-- Run once to initialize widgets
emit_options_info()
-- Kill old mpc idleloop options process
awful.spawn.easy_async_with_shell("ps x | grep \"mpc idleloop options\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Emit song info with each line printed
awful.spawn.with_line_callback(mpd_options_script, {
stdout = function()
emit_options_info()
end
})
end)

View File

@@ -1,23 +0,0 @@
-- Provides:
-- evil::ram
-- used (integer - mega bytes)
-- total (integer - mega bytes)
local awful = require("awful")
local update_interval = 20
-- Returns the used amount of ram in percentage
-- TODO output of free is affected by system language. The following command
-- works for any language:
-- free -m | sed -n '2p' | awk '{printf "%d available out of %d\n", $7, $2}'
local ram_script = [[
sh -c "
free -m | grep 'Mem:' | awk '{printf \"%d@@%d@\", $7, $2}'
"]]
-- Periodically get ram info
awful.widget.watch(ram_script, update_interval, function(widget, stdout)
local available = stdout:match('(.*)@@')
local total = stdout:match('@@(.*)@')
local used = tonumber(total) - tonumber(available)
awesome.emit_signal("evil::ram", used, tonumber(total))
end)

View File

@@ -1,32 +0,0 @@
-- Provides:
-- evil::spotify
-- artist (string)
-- song (string)
-- status (string) [playing | paused | stopped]
local awful = require("awful")
local function emit_info(playerctl_output)
local artist = playerctl_output:match('artist_start(.*)title_start')
local title = playerctl_output:match('title_start(.*)status_start')
-- Use the lower case of status
local status = playerctl_output:match('status_start(.*)'):lower()
status = string.gsub(status, '^%s*(.-)%s*$', '%1')
awesome.emit_signal("evil::spotify", artist, title, status)
end
-- Sleeps until spotify changes state (pause/play/next/prev)
local spotify_script = [[
sh -c '
playerctl metadata --format 'artist_start{{artist}}title_start{{title}}status_start{{status}}' --follow
']]
-- Kill old playerctl process
awful.spawn.easy_async_with_shell("ps x | grep \"playerctl metadata\" | grep -v grep | awk '{print $1}' | xargs kill", function ()
-- Emit song info with each line printed
awful.spawn.with_line_callback(spotify_script, {
stdout = function(line)
emit_info(line)
end
})
end)

View File

@@ -1,15 +0,0 @@
-- Provides:
-- evil::temperature
-- temperature (integer - in Celcius)
local awful = require("awful")
local update_interval = 15
local temp_script = [[
sh -c "
sensors | grep Package | awk '{print $4}' | cut -c 2-3
"]]
-- Periodically get temperature info
awful.widget.watch(temp_script, update_interval, function(widget, stdout)
awesome.emit_signal("evil::temperature", tonumber(stdout))
end)

View File

@@ -1,54 +0,0 @@
-- Provides:
-- evil::volume
-- percentage (integer)
-- muted (boolean)
local awful = require("awful")
local volume_old = -1
local muted_old = -1
local function emit_volume_info()
-- Get volume info of the currently active sink
-- The currently active sink has a star `*` in front of its index
-- In the output of `pacmd list-sinks`, lines +7 and +11 after "* index:"
-- contain the volume level and muted state respectively
-- This is why we are using `awk` to print them.
awful.spawn.easy_async_with_shell("pacmd list-sinks | awk '/\\* index: /{nr[NR+7];nr[NR+11]}; NR in nr'", function(stdout)
local volume = stdout:match('(%d+)%% /')
local muted = stdout:match('muted:(%s+)[yes]')
local muted_int = muted and 1 or 0
local volume_int = tonumber(volume)
-- Only send signal if there was a change
-- We need this since we use `pactl subscribe` to detect
-- volume events. These are not only triggered when the
-- user adjusts the volume through a keybind, but also
-- through `pavucontrol` or even without user intervention,
-- when a media file starts playing.
if volume_int ~= volume_old or muted_int ~= muted_old then
awesome.emit_signal("evil::volume", volume_int, muted)
volume_old = volume_int
muted_old = muted_int
end
end)
end
-- Run once to initialize widgets
emit_volume_info()
-- Sleeps until pactl detects an event (volume up/down/toggle mute)
local volume_script = [[
bash -c "
LANG=C pactl subscribe 2> /dev/null | grep --line-buffered \"Event 'change' on sink #\"
"]]
-- Kill old pactl subscribe processes
awful.spawn.easy_async({"pkill", "--full", "--uid", os.getenv("USER"), "^pactl subscribe"}, function ()
-- Run emit_volume_info() with each line printed
awful.spawn.with_line_callback(volume_script, {
stdout = function(line)
emit_volume_info()
end
})
end)

View File

@@ -1,53 +0,0 @@
-- Provides:
-- evil::weather
-- temperature (integer)
-- description (string)
-- icon_code (string)
local awful = require("awful")
local helpers = require("helpers")
-- Configuration
local key = user.openweathermap_key
local city_id = user.openweathermap_city_id
local units = user.weather_units
-- Don't update too often, because your requests might get blocked for 24 hours
local update_interval = 1200
local temp_file = "/tmp/awesomewm-evil-weather-"..city_id.."-"..units
local weather_details_script = [[
bash -c '
KEY="]]..key..[["
CITY="]]..city_id..[["
UNITS="]]..units..[["
weather=$(curl -sf "http://api.openweathermap.org/data/2.5/weather?APPID=$KEY&id=$CITY&units=$UNITS")
if [ ! -z "$weather" ]; then
weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1)
weather_icon=$(echo "$weather" | jq -r ".weather[].icon" | head -1)
weather_description=$(echo "$weather" | jq -r ".weather[].description" | head -1)
echo "$weather_icon" "$weather_description"@@"$weather_temp"
else
echo "..."
fi
']]
helpers.remote_watch(weather_details_script, update_interval, temp_file, function(stdout)
local icon_code = string.sub(stdout, 1, 3)
local weather_details = string.sub(stdout, 5)
weather_details = string.gsub(weather_details, '^%s*(.-)%s*$', '%1')
-- Replace "-0" with "0" degrees
weather_details = string.gsub(weather_details, '%-0', '0')
-- Capitalize first letter of the description
weather_details = weather_details:sub(1,1):upper()..weather_details:sub(2)
local description = weather_details:match('(.*)@@')
local temperature = weather_details:match('@@(.*)')
if icon_code == "..." then
-- Remove temp_file to force an update the next time
awful.spawn.with_shell("rm "..temp_file)
awesome.emit_signal("evil::weather", 999, "Weather unavailable", "")
else
awesome.emit_signal("evil::weather", tonumber(temperature), description, icon_code)
end
end)

View File

@@ -1,446 +0,0 @@
-- Functions that you use more than once and in different files would
-- be nice to define here.
local awful = require("awful")
local gears = require("gears")
local beautiful = require("beautiful")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
local wibox = require("wibox")
local icons = require("icons")
local notifications = require("notifications")
local naughty = require("naughty")
local helpers = {}
-- Create rounded rectangle shape (in one line)
helpers.rrect = function(radius)
return function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, radius)
end
end
helpers.prrect = function(radius, tl, tr, br, bl)
return function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, tl, tr, br, bl, radius)
end
end
helpers.squircle = function(rate, delta)
return function(cr, width, height)
gears.shape.squircle(cr, width, height, rate, delta)
end
end
helpers.psquircle = function(rate, delta, tl, tr, br, bl)
return function(cr, width, height)
gears.shape.partial_squircle(cr, width, height, tl, tr, br, bl, rate, delta)
end
end
helpers.colorize_text = function(text, color)
return "<span foreground='"..color.."'>"..text.."</span>"
end
function helpers.client_menu_toggle()
local instance = nil
return function ()
if instance and instance.wibox.visible then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ theme = { width = dpi(250) } })
end
end
end
-- Escapes a string so that it can be displayed inside pango markup
-- tags. Modified from:
-- https://github.com/kernelsauce/turbo/blob/master/turbo/escape.lua
function helpers.pango_escape(s)
return (string.gsub(s, "[&<>]", {
["&"] = "&amp;",
["<"] = "&lt;",
[">"] = "&gt;"
}))
end
function helpers.vertical_pad(height)
return wibox.widget{
forced_height = height,
layout = wibox.layout.fixed.vertical
}
end
function helpers.horizontal_pad(width)
return wibox.widget{
forced_width = width,
layout = wibox.layout.fixed.horizontal
}
end
local direction_translate = {
['up'] = 'top',
['down'] = 'bottom',
['left'] = 'left',
['right'] = 'right'
}
function helpers.move_to_edge(c, direction)
local old = c:geometry()
local new = awful.placement[direction_translate[direction]](c, {honor_padding = true, honor_workarea = true, margins = beautiful.useless_gap * 2, pretend = true})
if direction == "up" or direction == "down" then
c:geometry({ x = old.x, y = new.y })
else
c:geometry({ x = new.x, y = old.y })
end
end
local double_tap_timer = nil
function helpers.single_double_tap(single_tap_function, double_tap_function)
if double_tap_timer then
double_tap_timer:stop()
double_tap_timer = nil
double_tap_function()
-- naughty.notify({text = "We got a double tap"})
return
end
double_tap_timer =
gears.timer.start_new(0.20, function()
double_tap_timer = nil
-- naughty.notify({text = "We got a single tap"})
if single_tap_function then
single_tap_function()
end
return false
end)
end
-- Used as a custom command in rofi to move a window into the current tag
-- instead of following it.
-- Rofi has access to the X window id of the client.
function helpers.rofi_move_client_here(window)
local win = function (c)
return awful.rules.match(c, {window = window})
end
for c in awful.client.iterate(win) do
c.minimized = false
c:move_to_tag(mouse.screen.selected_tag)
client.focus = c
end
end
-- Add a hover cursor to a widget by changing the cursor on
-- mouse::enter and mouse::leave
-- You can find the names of the available cursors by opening any
-- cursor theme and looking in the "cursors folder"
-- For example: "hand1" is the cursor that appears when hovering over
-- links
function helpers.add_hover_cursor(w, hover_cursor)
local original_cursor = "left_ptr"
w:connect_signal("mouse::enter", function ()
local w = _G.mouse.current_wibox
if w then
w.cursor = hover_cursor
end
end)
w:connect_signal("mouse::leave", function ()
local w = _G.mouse.current_wibox
if w then
w.cursor = original_cursor
end
end)
end
-- Tag back and forth:
-- If you try to focus the tag you are already at, go back to the previous tag.
-- Useful for quick switching after for example checking an incoming chat
-- message at tag 2 and coming back to your work at tag 1 with the same
-- keypress.
function helpers.tag_back_and_forth(tag_index)
local s = mouse.screen
local tag = s.tags[tag_index]
if tag then
if tag == s.selected_tag then
awful.tag.history.restore()
else
tag:view_only()
end
end
end
-- Resize DWIM (Do What I Mean)
-- Resize client or factor
-- Constants --
local floating_resize_amount = dpi(20)
local tiling_resize_factor= 0.05
---------------
function helpers.resize_dwim(c, direction)
if 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
elseif awful.layout.get(mouse.screen) ~= awful.layout.suit.floating then
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
-- Move client DWIM (Do What I Mean)
-- Move to edge if the client / layout is floating
-- Swap by index if maximized
-- Else swap client by direction
function helpers.move_client_dwim(c, direction)
if c.floating or (awful.layout.get(mouse.screen) == awful.layout.suit.floating) then
helpers.move_to_edge(c, direction)
elseif awful.layout.get(mouse.screen) == awful.layout.suit.max then
if direction == "up" or direction == "left" then
awful.client.swap.byidx(-1, c)
elseif direction == "down" or direction == "right" then
awful.client.swap.byidx(1, c)
end
else
awful.client.swap.bydirection(direction, c, nil)
end
end
-- Make client floating and snap to the desired edge
local axis_translate = {
['up'] = 'horizontally',
['down'] = 'horizontally',
['left'] = 'vertically',
['right'] = 'vertically'
}
function helpers.float_and_edge_snap(c, direction)
c.maximized = false
c.maximized_vertical = false
c.maximized_horizontal = false
c.floating = true
local f = awful.placement.scale
+ awful.placement[direction_translate[direction]]
+ awful.placement['maximize_'..axis_translate[direction]]
f(c, {honor_padding = true, honor_workarea=true, to_percent = 0.5, margins = beautiful.useless_gap * 2 })
end
-- Rounds a number to any number of decimals
function helpers.round(number, decimals)
local power = 10 ^ decimals
return math.floor(number * power) / power
end
function helpers.volume_control(step)
local cmd
if step == 0 then
cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"
else
sign = step > 0 and "+" or ""
cmd = "pactl set-sink-mute @DEFAULT_SINK@ 0 && pactl set-sink-volume @DEFAULT_SINK@ "..sign..tostring(step).."%"
end
awful.spawn.with_shell(cmd)
end
function helpers.send_key(c, key)
awful.spawn.with_shell("xdotool key --window "..tostring(c.window).." "..key)
end
function helpers.send_key_sequence(c, seq)
awful.spawn.with_shell("xdotool type --delay 5 --window "..tostring(c.window).." "..seq)
end
function helpers.fake_escape()
root.fake_input('key_press', "Escape")
root.fake_input('key_release', "Escape")
end
local prompt_font = beautiful.prompt_font or "sans bold 8"
function helpers.prompt(action, textbox, prompt, callback)
if action == "run" then
awful.prompt.run {
prompt = prompt,
-- prompt = "<b>Run: </b>",
textbox = textbox,
font = prompt_font,
done_callback = callback,
exe_callback = awful.spawn,
completion_callback = awful.completion.shell,
history_path = awful.util.get_cache_dir() .. "/history"
}
elseif action == "web_search" then
awful.prompt.run {
prompt = prompt,
-- prompt = '<b>Web search: </b>',
textbox = textbox,
font = prompt_font,
history_path = awful.util.get_cache_dir() .. "/history_web",
done_callback = callback,
exe_callback = function(input)
if not input or #input == 0 then return end
awful.spawn.with_shell("noglob "..user.web_search_cmd.."'"..input.."'")
naughty.notify { title = "Searching the web for", text = input, icon = icons.image.firefox, urgency = "low" }
end
}
end
end
-- Given a `match` condition, returns an array with clients that match it, or
-- just the first found client if `first_only` is true
function helpers.find_clients(match, first_only)
local matcher = function (c)
return awful.rules.match(c, match)
end
if first_only then
for c in awful.client.iterate(matcher) do
return c
end
else
local clients = {}
for c in awful.client.iterate(matcher) do
table.insert(clients, c)
end
return clients
end
return nil
end
-- Given a `match` condition, calls the specified function `f_do` on all the
-- clients that match it
function helpers.find_clients_and_do(match, f_do)
local matcher = function (c)
return awful.rules.match(c, match)
end
for c in awful.client.iterate(matcher) do
f_do(c)
end
end
function helpers.run_or_raise(match, move, spawn_cmd, spawn_args)
local matcher = function (c)
return awful.rules.match(c, match)
end
-- Find and raise
local found = false
for c in awful.client.iterate(matcher) do
found = true
c.minimized = false
if move then
c:move_to_tag(mouse.screen.selected_tag)
client.focus = c
else
c:jump_to()
end
break
end
-- Spawn if not found
if not found then
awful.spawn(spawn_cmd, spawn_args)
end
end
-- Run raise or minimize a client (scratchpad style)
-- Depends on helpers.run_or_raise
-- If it not running, spawn it
-- If it is running, focus it
-- If it is focused, minimize it
function helpers.scratchpad(match, spawn_cmd, spawn_args)
local cf = client.focus
if cf and awful.rules.match(cf, match) then
cf.minimized = true
else
helpers.run_or_raise(match, true, spawn_cmd, spawn_args)
end
end
function helpers.float_and_resize(c, width, height)
c.maximized = false
c.width = width
c.height = height
awful.placement.centered(c,{honor_workarea=true, honor_padding = true})
awful.client.property.set(c, 'floating_geometry', c:geometry())
c.floating = true
c:raise()
end
-- Adds a maximized mask to a screen
function helpers.screen_mask(s, bg)
local mask = wibox({visible = false, ontop = true, type = "splash", screen = s})
awful.placement.maximize(mask)
mask.bg = bg
return mask
end
-- Useful for periodically checking the output of a command that
-- requires internet access.
-- Ensures that `command` will be run EXACTLY once during the desired
-- `interval`, even if awesome restarts multiple times during this time.
-- Saves output in `output_file` and checks its last modification
-- time to determine whether to run the command again or not.
-- Passes the output of `command` to `callback` function.
function helpers.remote_watch(command, interval, output_file, callback)
local run_the_thing = function()
-- Pass output to callback AND write it to file
awful.spawn.easy_async_with_shell(command.." | tee "..output_file, function(out) callback(out) end)
end
local timer
timer = gears.timer {
timeout = interval,
call_now = true,
autostart = true,
single_shot = false,
callback = function()
awful.spawn.easy_async_with_shell("date -r "..output_file.." +%s", function(last_update, _, __, exitcode)
-- Probably the file does not exist yet (first time
-- running after reboot)
if exitcode == 1 then
run_the_thing()
return
end
local diff = os.time() - tonumber(last_update)
if diff >= interval then
run_the_thing()
else
-- Pass the date saved in the file since it is fresh enough
awful.spawn.easy_async_with_shell("cat "..output_file, function(out) callback(out) end)
-- Schedule an update for when the remaining time to complete the interval passes
timer:stop()
gears.timer.start_new(interval - diff, function()
run_the_thing()
timer:again()
end)
end
end)
end
}
end
-- The directory of the currently executed lua script
-- Requires the `debug` library to be available in the build of Lua that is running
function helpers.this_dir()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)")
end
return helpers

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,163 +0,0 @@
local gears = require("gears")
local function file_exists(path)
-- Try to open it
local f = io.open(path)
if f then
f:close()
return true
end
return false
end
local icons = {}
icons.image = {}
icons.text = {}
-- TODO Set up weather text icons here instead of in ../noodle/text_weather.lua
-- icons.text.weather = {}
-- Set up text symbols and accent colors to be used in tasklists or docks
-- instead of awful.widget.clienticon
-- Based on the client's `class` property
-- TODO Ability to match using rules instead of just class
icons.text.by_class = {
-- Terminals
['kitty'] = { symbol = "", color = x.color5 },
['Alacritty'] = { symbol = "", color = x.color5 },
['Termite'] = { symbol = "", color = x.color5 },
['URxvt'] = { symbol = "", color = x.color5 },
['st'] = { symbol = "", color = x.color5 },
['st-256color'] = { symbol = "", color = x.color5 },
-- Image viewers
['feh'] = { symbol = "", color = x.color1 },
['Sxiv'] = { symbol = "", color = x.color1 },
-- General
['TelegramDesktop'] = { symbol = "", color = x.color4 },
['Firefox'] = { symbol = "", color = x.color3 },
['firefox'] = { symbol = "", color = x.color3 },
['Nightly'] = { symbol = "", color = x.color4 },
['Chromium'] = { symbol = "", color = x.color4 },
['Chromium-browser'] = { symbol = "", color = x.color4 },
['Steam'] = { symbol = "", color = x.color2 },
['Lutris'] = { symbol = "", color = x.color6 },
['editor'] = { symbol = "", color = x.color5 },
['Emacs'] = { symbol = "", color = x.color2 },
['email'] = { symbol = "", color = x.color6 },
['music'] = { symbol = "", color = x.color6 },
['mpv'] = { symbol = "", color = x.color6 },
['KeePassXC'] = { symbol = "", color = x.color1 },
['Gucharmap'] = { symbol = "", color = x.color6 },
['Pavucontrol'] = { symbol = "", color = x.color4 },
['htop'] = { symbol = "", color = x.color2 },
['Screenruler'] = { symbol = "", color = x.color3 },
['Galculator'] = { symbol = "", color = x.color2 },
['Zathura'] = { symbol = "", color = x.color2 },
['Qemu-system-x86_64'] = { symbol = "", color = x.color3 },
['Wine'] = { symbol = "", color = x.color1 },
['markdown_input'] = { symbol = "", color = x.color2 },
['scratchpad'] = { symbol = "", color = x.color1 },
['weechat'] = { symbol = "", color = x.color5 },
['discord'] = { symbol = "", color = x.color5 },
['6cord'] = { symbol = "", color = x.color3 },
['libreoffice-writer'] = { symbol = "", color = x.color4 },
['libreoffice-calc'] = { symbol = "", color = x.color2 },
['libreoffice-impress'] = { symbol = "", color = x.color1 },
['Godot'] = { symbol = "", color = x.color4 },
-- File managers
['Thunar'] = { symbol = "", color = x.color3 },
['Nemo'] = { symbol = "", color = x.color3 },
['files'] = { symbol = "", color = x.color3 },
['Gimp'] = { symbol = "", color = x.color4 },
['Inkscape'] = { symbol = "", color = x.color2 },
['Gpick'] = { symbol = "", color = x.color6 },
-- Default
['_'] = { symbol = "", color = x.color7.."99" }
}
-- Available icons
local image_icon_names = {
"playerctl_toggle",
"playerctl_prev",
"playerctl_next",
"stats",
"search",
"volume",
"muted",
"firefox",
"youtube",
"reddit",
"discord",
"telegram",
"steam",
"games",
"files",
"manual",
"keyboard",
"appearance",
"editor",
"redshift",
"gimp",
"terminal",
"mail",
"music",
"temperature",
"battery",
"battery_charging",
"cpu",
"compositor",
"start",
"ram",
"screenshot",
"home",
"alarm",
"alarm_off",
"alert",
"submenu",
-- Weather icons
"cloud",
"dcloud",
"ncloud",
"sun",
"star",
"rain",
"snow",
"mist",
"storm",
"whatever",
-- Exit screen icons
"exit",
"poweroff",
"reboot",
"suspend",
"lock",
}
-- Path to icons
local p
-- Assumes all the icon files end in .png
-- TODO maybe automatically detect icons in icon theme directory
local function set_image_icon(icon_name)
local i = p..icon_name..".png"
icons.image[icon_name] = i
end
-- Set all the icon variables
function icons.init(theme_name)
-- Set the path to image icons
p = gears.filesystem.get_configuration_dir().."icons/"..theme_name.."/"
for i = 1, #image_icon_names do
set_image_icon(image_icon_names[i])
end
-- Set symbols and accent colors for text icons
end
return icons

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Some files were not shown because too many files have changed in this diff Show More