diff --git a/awesome/.config/awesome/configuration/README.md b/awesome/.config/awesome/configuration/README.md new file mode 100644 index 000000000..abf1a44c4 --- /dev/null +++ b/awesome/.config/awesome/configuration/README.md @@ -0,0 +1,4 @@ +## Configuration + +Here you will find all the settings available. + diff --git a/awesome/.config/awesome/configuration/apps.lua b/awesome/.config/awesome/configuration/apps.lua new file mode 100644 index 000000000..2c6e35cef --- /dev/null +++ b/awesome/.config/awesome/configuration/apps.lua @@ -0,0 +1,43 @@ +local filesystem = require('gears.filesystem') + +-- Thanks to jo148 on github for making rofi dpi aware! +local with_dpi = require('beautiful').xresources.apply_dpi +local get_dpi = require('beautiful').xresources.get_dpi +local rofi_command = 'env /usr/bin/rofi -dpi ' .. get_dpi() .. ' -width ' .. with_dpi(400) .. ' -show drun -theme ' .. filesystem.get_configuration_dir() .. '/configuration/rofi.rasi -run-command "/bin/bash -c -i \'shopt -s expand_aliases; {cmd}\'"' + +return { + -- List of apps to start by default on some actions + default = { + terminal = 'terminator', + rofi = rofi_command, + lock = 'i3lock-fancy', + quake = 'terminator', + screenshot = 'flameshot full -p ~/Pictures', + region_screenshot = 'flameshot gui -p ~/Pictures', + delayed_screenshot = 'flameshot full -p ~/Pictures -d 5000', + browser = 'brave', + editor = 'gedit', -- gui text editor + social = 'discord', + game = rofi_command, + files = 'nautilus', + music = rofi_command + }, + -- List of apps to start once on start-up + run_on_start_up = { + 'picom --config ' .. filesystem.get_configuration_dir() .. '/configuration/picom.conf', + 'nm-applet --indicator', -- wifi + 'pnmixer', -- shows an audiocontrol applet in systray when installed. + --'blueberry-tray', -- Bluetooth tray icon + 'numlockx on', -- enable numlock + '/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager + 'xfce4-power-manager', -- Power manager + 'flameshot', + 'synology-drive -minimized', + 'steam -silent', + '/usr/bin/barrier', + '~/.local/bin/wallpaper', -- wallpaper-reddit script + -- Add applications that need to be killed between reloads + -- to avoid multipled instances, inside the awspawn script + '~/.config/awesome/configuration/awspawn' -- Spawn "dirty" apps that can linger between sessions + } +} diff --git a/awesome/.config/awesome/configuration/awspawn b/awesome/.config/awesome/configuration/awspawn new file mode 100755 index 000000000..6f57e8e29 --- /dev/null +++ b/awesome/.config/awesome/configuration/awspawn @@ -0,0 +1,34 @@ +#!/bin/bash +## This configuration file is meant for applications that +# still run in the background when a reload is triggered +# for awesome, this script just kills the running instance +# and starts a new one. +# Only add applications/scripts without parameters here +# (if you want to apply parameters then use a script file!) + +# List of applications to run +APPS=( + barrier + ) + +# Some applications start child applications that need to be killed on reload +KILL=( + barriers + ) + +# First kill lingering apps +for app in "${APPS[@]}" +do + kill -9 $(pidof $app) +done +for app in "${KILL[@]}" +do + kill -9 $(pidof $app) +done + +# Start new instances +for app in "${APPS[@]}" +do + env $app ${@:2} & +done + diff --git a/awesome/.config/awesome/configuration/client/buttons.lua b/awesome/.config/awesome/configuration/client/buttons.lua new file mode 100644 index 000000000..afb1b014e --- /dev/null +++ b/awesome/.config/awesome/configuration/client/buttons.lua @@ -0,0 +1,30 @@ +local awful = require('awful') + +local modkey = require('configuration.keys.mod').modKey + +return awful.util.table.join( + awful.button( + {}, + 1, + function(c) + _G.client.focus = c + c:raise() + end + ), + awful.button({modkey}, 1, awful.mouse.client.move), + awful.button({modkey}, 3, awful.mouse.client.resize), + awful.button( + {modkey}, + 4, + function() + awful.layout.inc(1) + end + ), + awful.button( + {modkey}, + 5, + function() + awful.layout.inc(-1) + end + ) +) diff --git a/awesome/.config/awesome/configuration/client/init.lua b/awesome/.config/awesome/configuration/client/init.lua new file mode 100644 index 000000000..bbd5480b9 --- /dev/null +++ b/awesome/.config/awesome/configuration/client/init.lua @@ -0,0 +1 @@ +require('configuration.client.rules') diff --git a/awesome/.config/awesome/configuration/client/keys.lua b/awesome/.config/awesome/configuration/client/keys.lua new file mode 100644 index 000000000..69d852ab2 --- /dev/null +++ b/awesome/.config/awesome/configuration/client/keys.lua @@ -0,0 +1,27 @@ +local awful = require('awful') +require('awful.autofocus') +local modkey = require('configuration.keys.mod').modKey +local altkey = require('configuration.keys.mod').altKey + +local clientKeys = + awful.util.table.join( + awful.key( + {modkey}, + 'f', + function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, + {description = 'toggle fullscreen', group = 'client'} + ), + awful.key( + {modkey}, + 'q', + function(c) + c:kill() + end, + {description = 'close', group = 'client'} + ) +) + +return clientKeys diff --git a/awesome/.config/awesome/configuration/client/rules.lua b/awesome/.config/awesome/configuration/client/rules.lua new file mode 100644 index 000000000..33b0099d0 --- /dev/null +++ b/awesome/.config/awesome/configuration/client/rules.lua @@ -0,0 +1,48 @@ +local awful = require('awful') +local gears = require('gears') +local client_keys = require('configuration.client.keys') +local client_buttons = require('configuration.client.buttons') + +-- Rules +awful.rules.rules = { + -- All clients will match this rule. + { + rule = {}, + properties = { + focus = awful.client.focus.filter, + raise = true, + keys = client_keys, + buttons = client_buttons, + screen = awful.screen.preferred, + placement = awful.placement.no_offscreen, + floating = false, + maximized = false, + above = false, + below = false, + ontop = false, + sticky = false, + maximized_horizontal = false, + maximized_vertical = false + } + }, + { + rule_any = {name = {'QuakeTerminal'}}, + properties = {skip_decoration = true} + }, + -- Titlebars + { + rule_any = {type = {'dialog'}, class = {'Wicd-client.py', 'calendar.google.com'}}, + properties = { + placement = awful.placement.centered, + ontop = true, + floating = true, + drawBackdrop = true, + shape = function() + return function(cr, w, h) + gears.shape.rounded_rect(cr, w, h, 8) + end + end, + skip_decoration = true + } + } +} diff --git a/awesome/.config/awesome/configuration/compton.conf b/awesome/.config/awesome/configuration/compton.conf new file mode 100644 index 000000000..d950410f5 --- /dev/null +++ b/awesome/.config/awesome/configuration/compton.conf @@ -0,0 +1,106 @@ + +#################################### +# Adapta specific picom settings # +#################################### + +# Shadow +shadow = true; +no-dnd-shadow = false; +no-dock-shadow = false; +shadow-radius = 7.5; +shadow-offset-x = -11; +shadow-offset-y = -4.5; +shadow-opacity = 0.36; +# shadow-red = 0.0; +# shadow-green = 0.0; +# shadow-blue = 0.0; +shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g = 'slop'", + "class_g = 'Rofi'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "_GTK_FRAME_EXTENTS@:c", + "window_type = 'splash'" +]; +# shadow-exclude = "n:e:Notification"; +# shadow-exclude-reg = "x10+0+0"; +# xinerama-shadow-crop = true; + +# Opacity +menu-opacity = 1.0; +inactive-opacity = 1.0; +active-opacity = 1.0; +frame-opacity = 1.0; +inactive-opacity-override = false; +alpha-step = 0.06; +# inactive-dim = 0.2; +# inactive-dim-fixed = true; +blur-background = true; +blur-background-frame = true; +blur-method = "kawase"; +blur-strength = 5; +blur-background-fixed = false; +blur-background-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "class_g = 'slop'", + "_GTK_FRAME_EXTENTS@:c" +]; +# opacity-rule = [ "80:class_g = 'URxvt'" ]; + +# Fading +fading = true; +fade-delta = 4; +fade-in-step = 0.03; +fade-out-step = 0.03; +no-fading-openclose = false; +# no-fading-destroyed-argb = true; +fade-exclude = [ ]; + +# Other +backend = "glx"; +mark-wmwin-focused = true; +mark-ovredir-focused = true; +# use-ewmh-active-win = true; +detect-rounded-corners = true; +detect-client-opacity = true; +#refresh-rate = 0; +#vsync = "none"; +dbe = false; +# sw-opti = true; +#unredir-if-possible = true; +# unredir-if-possible-delay = 5000; +# unredir-if-possible-exclude = [ ]; +focus-exclude = [ "class_g = 'Cairo-clock'" ]; +detect-transient = true; +detect-client-leader = true; +invert-color-include = [ ]; +# resize-damage = 1; + +# GLX backend +vsync="opengl-swc"; +unredir-if-possible=true; +#paint-on-overlay=true; +#glx-no-stencil=true; +glx-copy-from-front=false; +# glx-no-stencil = true; +# glx-copy-from-front = false; +# glx-use-copysubbuffermesa = true; +glx-no-rebind-pixmap = true; +#glx-swap-method = "exchange"; +#glx-use-gpushader4 = true; +# xrender-sync = true; +# xrender-sync-fence = true; + +# Window type settings +wintypes: +{ + tooltip = { + fade = true; + shadow = true; + opacity = 0.9; + focus = true; + }; +}; \ No newline at end of file diff --git a/awesome/.config/awesome/configuration/init.lua b/awesome/.config/awesome/configuration/init.lua new file mode 100644 index 000000000..8ea676f02 --- /dev/null +++ b/awesome/.config/awesome/configuration/init.lua @@ -0,0 +1,4 @@ +return { + keys = require('configuration.keys'), + apps = require('configuration.apps') +} diff --git a/awesome/.config/awesome/configuration/keys/global.lua b/awesome/.config/awesome/configuration/keys/global.lua new file mode 100644 index 000000000..0cd87eb04 --- /dev/null +++ b/awesome/.config/awesome/configuration/keys/global.lua @@ -0,0 +1,474 @@ +local awful = require('awful') +require('awful.autofocus') +local beautiful = require('beautiful') +local hotkeys_popup = require('awful.hotkeys_popup').widget + +local modkey = require('configuration.keys.mod').modKey +local altkey = require('configuration.keys.mod').altKey +local apps = require('configuration.apps') +-- Key bindings +local globalKeys = + awful.util.table.join( + -- Hotkeys + awful.key({modkey}, 'F1', hotkeys_popup.show_help, {description = 'show help', group = 'awesome'}), + -- Tag browsing + awful.key({modkey}, 'w', awful.tag.viewprev, {description = 'view previous', group = 'tag'}), + awful.key({modkey}, 's', awful.tag.viewnext, {description = 'view next', group = 'tag'}), + awful.key({altkey, 'Control'}, 'Up', awful.tag.viewprev, {description = 'view previous', group = 'tag'}), + awful.key({altkey, 'Control'}, 'Down', awful.tag.viewnext, {description = 'view next', group = 'tag'}), + awful.key({modkey}, 'Escape', awful.tag.history.restore, {description = 'go back', group = 'tag'}), + -- Default client focus + awful.key( + {modkey}, + 'd', + function() + awful.client.focus.byidx(1) + end, + {description = 'focus next by index', group = 'client'} + ), + awful.key( + {modkey}, + 'a', + function() + awful.client.focus.byidx(-1) + end, + {description = 'focus previous by index', group = 'client'} + ), + awful.key( + {modkey}, + 'r', + function() + _G.screen.primary.left_panel:toggle(true) + end, + {description = 'show main menu', group = 'awesome'} + ), + awful.key( + {altkey}, + 'space', + function() + _G.screen.primary.left_panel:toggle(true) + end, + {description = 'show main menu', group = 'awesome'} + ), + awful.key({modkey}, 'u', awful.client.urgent.jumpto, {description = 'jump to urgent client', group = 'client'}), + awful.key( + {altkey}, + 'Tab', + function() + --awful.client.focus.history.previous() + awful.client.focus.byidx(1) + if _G.client.focus then + _G.client.focus:raise() + end + end, + {description = 'Switch to next window', group = 'client'} + ), + awful.key( + {altkey, 'Shift'}, + 'Tab', + function() + --awful.client.focus.history.previous() + awful.client.focus.byidx(-1) + if _G.client.focus then + _G.client.focus:raise() + end + end, + {description = 'Switch to previous window', group = 'client'} + ), + -- Programms + awful.key( + {modkey}, + 'l', + function() + awful.spawn(apps.default.lock) + end, + {description = 'Lock the screen', group = 'awesome'} + ), + awful.key( + {modkey}, + 'Print', + function() + awful.util.spawn_with_shell(apps.default.delayed_screenshot) + end, + {description = 'Mark an area and screenshot it 10 seconds later (clipboard)', group = 'screenshots (clipboard)'} + ), + awful.key( + {modkey}, + 'p', + function() + awful.util.spawn_with_shell(apps.default.screenshot) + end, + {description = 'Take a screenshot of your active monitor and copy it to clipboard', group = 'screenshots (clipboard)'} + ), + awful.key( + {altkey, 'Shift'}, + 'p', + function() + awful.util.spawn_with_shell(apps.default.region_screenshot) + end, + {description = 'Mark an area and screenshot it to your clipboard', group = 'screenshots (clipboard)'} + ), + awful.key( + {modkey}, + 'c', + function() + awful.util.spawn(apps.default.editor) + end, + {description = 'open a text/code editor', group = 'launcher'} + ), + awful.key( + {modkey}, + 'b', + function() + awful.util.spawn(apps.default.browser) + end, + {description = 'open a browser', group = 'launcher'} + ), + -- Standard program + awful.key( + {modkey}, + 'x', + function() + awful.spawn(apps.default.terminal) + end, + {description = 'open a terminal', group = 'launcher'} + ), + awful.key({modkey, 'Control'}, 'r', _G.awesome.restart, {description = 'reload awesome', group = 'awesome'}), + awful.key({modkey, 'Control'}, 'q', _G.awesome.quit, {description = 'quit awesome', group = 'awesome'}), + awful.key( + {altkey, 'Shift'}, + 'Right', + function() + awful.tag.incmwfact(0.05) + end, + {description = 'increase master width factor', group = 'layout'} + ), + awful.key( + {altkey, 'Shift'}, + 'Left', + function() + awful.tag.incmwfact(-0.05) + end, + {description = 'decrease master width factor', group = 'layout'} + ), + awful.key( + {altkey, 'Shift'}, + 'Down', + function() + awful.client.incwfact(0.05) + end, + {description = 'decrease master height factor', group = 'layout'} + ), + awful.key( + {altkey, 'Shift'}, + 'Up', + function() + awful.client.incwfact(-0.05) + end, + {description = 'increase master height factor', group = 'layout'} + ), + awful.key( + {modkey, 'Shift'}, + 'Left', + function() + awful.tag.incnmaster(1, nil, true) + end, + {description = 'increase the number of master clients', group = 'layout'} + ), + awful.key( + {modkey, 'Shift'}, + 'Right', + function() + awful.tag.incnmaster(-1, nil, true) + end, + {description = 'decrease the number of master clients', group = 'layout'} + ), + awful.key( + {modkey, 'Control'}, + 'Left', + function() + awful.tag.incncol(1, nil, true) + end, + {description = 'increase the number of columns', group = 'layout'} + ), + awful.key( + {modkey, 'Control'}, + 'Right', + function() + awful.tag.incncol(-1, nil, true) + end, + {description = 'decrease the number of columns', group = 'layout'} + ), + awful.key( + {modkey}, + 'space', + function() + awful.layout.inc(1) + end, + {description = 'select next', group = 'layout'} + ), + awful.key( + {modkey, 'Shift'}, + 'space', + function() + awful.layout.inc(-1) + end, + {description = 'select previous', group = 'layout'} + ), + awful.key( + {modkey, 'Control'}, + 'n', + function() + local c = awful.client.restore() + -- Focus restored client + if c then + _G.client.focus = c + c:raise() + end + end, + {description = 'restore minimized', group = 'client'} + ), + -- Dropdown application + awful.key( + {modkey}, + 'z', + function() + _G.toggle_quake() + end, + {description = 'dropdown application', group = 'launcher'} + ), + -- Widgets popups + --[[awful.key( + {altkey}, + 'h', + function() + if beautiful.fs then + beautiful.fs.show(7) + end + end, + {description = 'show filesystem', group = 'widgets'} + ), + awful.key( + {altkey}, + 'w', + function() + if beautiful.weather then + beautiful.weather.show(7) + end + end, + {description = 'show weather', group = 'widgets'} + ),--]] + -- Brightness + awful.key( + {}, + 'XF86MonBrightnessUp', + function() + awful.spawn('xbacklight -inc 10') + end, + {description = '+10%', group = 'hotkeys'} + ), + awful.key( + {}, + 'XF86MonBrightnessDown', + function() + awful.spawn('xbacklight -dec 10') + end, + {description = '-10%', group = 'hotkeys'} + ), + -- ALSA volume control + awful.key( + {}, + 'XF86AudioRaiseVolume', + function() + awful.spawn('amixer -D pulse sset Master 5%+') + end, + {description = 'volume up', group = 'hotkeys'} + ), + awful.key( + {}, + 'XF86AudioLowerVolume', + function() + awful.spawn('amixer -D pulse sset Master 5%-') + end, + {description = 'volume down', group = 'hotkeys'} + ), + awful.key( + {}, + 'XF86AudioMute', + function() + awful.spawn('amixer -D pulse set Master 1+ toggle') + end, + {description = 'toggle mute', group = 'hotkeys'} + ), + awful.key( + {}, + 'XF86AudioNext', + function() + -- + end, + {description = 'toggle mute', group = 'hotkeys'} + ), + awful.key( + {}, + 'XF86PowerDown', + function() + -- + end, + {description = 'toggle mute', group = 'hotkeys'} + ), + awful.key( + {}, + 'XF86PowerOff', + function() + _G.exit_screen_show() + end, + {description = 'toggle mute', group = 'hotkeys'} + ), + -- Screen management + awful.key( + {modkey}, + 'o', + awful.client.movetoscreen, + {description = 'move window to next screen', group = 'client'} + ), + -- Open default program for tag + awful.key( + {modkey}, + 't', + function() + awful.spawn( + awful.screen.focused().selected_tag.defaultApp, + { + tag = _G.mouse.screen.selected_tag, + placement = awful.placement.bottom_right + } + ) + end, + {description = 'open default program for tag/workspace', group = 'tag'} + ), + -- Custom hotkeys + -- vfio integration + awful.key( + {'Control',altkey}, + 'space', + function() + awful.util.spawn_with_shell('vm-attach attach') + end + ), + -- Lutris hotkey + awful.key( + {modkey}, + 'g', + function() + awful.util.spawn_with_shell('lutris') + end + ), + -- System Monitor hotkey + awful.key( + {modkey}, + 'm', + function() + awful.util.spawn_with_shell('mate-system-monitor') + end + ), + -- Kill VLC + awful.key( + {modkey}, + 'v', + function() + awful.util.spawn_with_shell('killall -9 vlc') + end + ), + -- File Manager + awful.key( + {modkey}, + 'e', + function() + awful.util.spawn(apps.default.files) + end, + {description = 'filebrowser', group = 'hotkeys'} + ), + -- Emoji Picker + awful.key( + {modkey}, + 'a', + function() + awful.util.spawn_with_shell('ibus emoji') + end, + {description = 'Open the ibus emoji picker to copy an emoji to your clipboard', group = 'hotkeys'} + ) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + -- Hack to only show tags 1 and 9 in the shortcut window (mod+s) + local descr_view, descr_toggle, descr_move, descr_toggle_focus + if i == 1 or i == 9 then + descr_view = {description = 'view tag #', group = 'tag'} + descr_toggle = {description = 'toggle tag #', group = 'tag'} + descr_move = {description = 'move focused client to tag #', group = 'tag'} + descr_toggle_focus = {description = 'toggle focused client on tag #', group = 'tag'} + end + globalKeys = + awful.util.table.join( + globalKeys, + -- View tag only. + awful.key( + {modkey}, + '#' .. i + 9, + function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, + descr_view + ), + -- Toggle tag display. + awful.key( + {modkey, 'Control'}, + '#' .. i + 9, + function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, + descr_toggle + ), + -- Move client to tag. + awful.key( + {modkey, 'Shift'}, + '#' .. i + 9, + function() + if _G.client.focus then + local tag = _G.client.focus.screen.tags[i] + if tag then + _G.client.focus:move_to_tag(tag) + end + end + end, + descr_move + ), + -- Toggle tag on focused client. + awful.key( + {modkey, 'Control', 'Shift'}, + '#' .. i + 9, + function() + if _G.client.focus then + local tag = _G.client.focus.screen.tags[i] + if tag then + _G.client.focus:toggle_tag(tag) + end + end + end, + descr_toggle_focus + ) + ) +end + +return globalKeys diff --git a/awesome/.config/awesome/configuration/keys/init.lua b/awesome/.config/awesome/configuration/keys/init.lua new file mode 100644 index 000000000..959166741 --- /dev/null +++ b/awesome/.config/awesome/configuration/keys/init.lua @@ -0,0 +1,4 @@ +return { + mod = require('configuration.keys.mod'), + global = require('configuration.keys.global') +} diff --git a/awesome/.config/awesome/configuration/keys/mod.lua b/awesome/.config/awesome/configuration/keys/mod.lua new file mode 100644 index 000000000..1d9089723 --- /dev/null +++ b/awesome/.config/awesome/configuration/keys/mod.lua @@ -0,0 +1,4 @@ +return { + modKey = 'Mod4', + altKey = 'Mod1' +} \ No newline at end of file diff --git a/awesome/.config/awesome/configuration/picom.conf b/awesome/.config/awesome/configuration/picom.conf new file mode 100644 index 000000000..90612db10 --- /dev/null +++ b/awesome/.config/awesome/configuration/picom.conf @@ -0,0 +1,421 @@ +################################# +# Shadows # +################################# + + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +# shadow = false +shadow = true; + +# The blur radius for shadows, in pixels. (defaults to 12) +# shadow-radius = 12 +shadow-radius = 7; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +# shadow-opacity = .75 + +# The left offset for shadows, in pixels. (defaults to -15) +# shadow-offset-x = -15 +shadow-offset-x = -7; + +# The top offset for shadows, in pixels. (defaults to -15) +# shadow-offset-y = -15 +shadow-offset-y = -7; + +# Avoid drawing shadows on dock/panel windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dock-shadow = false + +# Don't draw shadows on drag-and-drop windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dnd-shadow = false + +# Red color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-red = 0 + +# Green color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-green = 0 + +# Blue color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-blue = 0 + +# Do not paint shadows on shaped windows. Note shaped windows +# here means windows setting its shape through X Shape extension. +# Those using ARGB background is beyond our control. +# Deprecated, use +# shadow-exclude = 'bounding_shaped' +# or +# shadow-exclude = 'bounding_shaped && !rounded_corners' +# instead. +# +# shadow-ignore-shaped = '' + +# Specify a list of conditions of windows that should have no shadow. +# +# examples: +# shadow-exclude = "n:e:Notification"; +# +# shadow-exclude = [] +shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "_GTK_FRAME_EXTENTS@:c" +]; + +# Specify a X geometry that describes the region in which shadow should not +# be painted in, such as a dock window region. Use +# shadow-exclude-reg = "x10+0+0" +# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. +# +# shadow-exclude-reg = "" + +# Crop shadow of a window fully on a particular Xinerama screen to the screen. +# xinerama-shadow-crop = false + + +################################# +# Fading # +################################# + + +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. +# fading = false +fading = true + +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +# fade-in-step = 0.028 +fade-in-step = 0.03; + +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +# fade-out-step = 0.03 +fade-out-step = 0.03; + +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 + +# Specify a list of conditions of windows that should not be faded. +# fade-exclude = [] + +# Do not fade on window open/close. +# no-fading-openclose = false + +# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. +# no-fading-destroyed-argb = false + + +################################# +# Transparency / Opacity # +################################# + + +# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) +# inactive-opacity = 1 +inactive-opacity = 1.0; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +frame-opacity = 0.95; + +# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) +# menu-opacity = 1.0 + +# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = true; + +# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) +active-opacity = 1.0 + +# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) +# inactive-dim = 0.0 + +# Specify a list of conditions of windows that should always be considered focused. +# focus-exclude = [] +#focus-exclude = [ "class_g = 'Termite'" ]; + +# Use fixed inactive dim value, instead of adjusting according to window opacity. +# inactive-dim-fixed = 1.0 + +# Specify a list of opacity rules, in the format `PERCENT:PATTERN`, +# like `50:name *= "Firefox"`. picom-trans is recommended over this. +# Note we don't make any guarantee about possible conflicts with other +# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. +# example: +# opacity-rule = [ "80:class_g = 'URxvt'" ]; + + +################################# +# Background-Blurring # +################################# + + +# Parameters for background blurring, see the *BLUR* section for more information. +# blur-method = +# blur-size = 12 +# +# blur-deviation = false + +# Blur background of semi-transparent / ARGB windows. +# Bad in performance, with driver-dependent behavior. +# The name of the switch may change without prior notifications. +# +# blur-background = false + +# Blur background of windows when the window frame is not opaque. +# Implies: +# blur-background +# Bad in performance, with driver-dependent behavior. The name may change. +# +# blur-background-frame = false + + +# Use fixed blur strength rather than adjusting according to window opacity. +# blur-background-fixed = false + + +# Specify the blur convolution kernel, with the following format: +# example: +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; +# +# blur-kern = '' +blur-kern = "3x3box"; + + +# Exclude conditions for background blur. +# blur-background-exclude = [] +blur-background-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; + +################################# +# General Settings # +################################# + +# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. +# daemon = false + +# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. +# `xrender` is the default one. +# +# backend = 'glx' +backend = "xrender"; + +# Enable/disable VSync. +# vsync = false +vsync = true + +# Enable remote control via D-Bus. See the *D-BUS API* section below for more details. +# dbus = false + +# Try to detect WM windows (a non-override-redirect window with no +# child that has 'WM_STATE') and mark them as active. +# +# mark-wmwin-focused = false +mark-wmwin-focused = true; + +# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. +# mark-ovredir-focused = false +mark-ovredir-focused = true; + +# Try to detect windows with rounded corners and don't consider them +# shaped windows. The accuracy is not very high, unfortunately. +# +# detect-rounded-corners = false +detect-rounded-corners = true; + +# Detect '_NET_WM_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_OPACITY' of client windows to frame windows. +# +# detect-client-opacity = false +detect-client-opacity = true; + +# Specify refresh rate of the screen. If not specified or 0, picom will +# try detecting this with X RandR extension. +# +# refresh-rate = 60 +refresh-rate = 60 + +# Limit picom to repaint at most once every 1 / 'refresh_rate' second to +# boost performance. This should not be used with +# vsync drm/opengl/opengl-oml +# as they essentially does sw-opti's job already, +# unless you wish to specify a lower refresh rate than the actual value. +# +# sw-opti = + +# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, +# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, +# provided that the WM supports it. +# +# use-ewmh-active-win = false + +# Unredirect all windows if a full-screen opaque window is detected, +# to maximize performance for full-screen windows. Known to cause flickering +# when redirecting/unredirecting windows. +# +# unredir-if-possible = false + +# Delay before unredirecting the window, in milliseconds. Defaults to 0. +# unredir-if-possible-delay = 0 + +# Conditions of windows that shouldn't be considered full-screen for unredirecting screen. +# unredir-if-possible-exclude = [] + +# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows +# in the same group focused at the same time. +# +# detect-transient = false +detect-transient = true + +# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same +# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if +# detect-transient is enabled, too. +# +# detect-client-leader = false +detect-client-leader = true + +# Resize damaged region by a specific number of pixels. +# A positive value enlarges it while a negative one shrinks it. +# If the value is positive, those additional pixels will not be actually painted +# to screen, only used in blur calculation, and such. (Due to technical limitations, +# with use-damage, those pixels will still be incorrectly painted to screen.) +# Primarily used to fix the line corruption issues of blur, +# in which case you should use the blur radius value here +# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, +# with a 5x5 one you use `--resize-damage 2`, and so on). +# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. +# +# resize-damage = 1 + +# Specify a list of conditions of windows that should be painted with inverted color. +# Resource-hogging, and is not well tested. +# +# invert-color-include = [] + +# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. +# Might cause incorrect opacity when rendering transparent content (but never +# practically happened) and may not work with blur-background. +# My tests show a 15% performance boost. Recommended. +# +# glx-no-stencil = false + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, +# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). +# Recommended if it works. +# +# glx-no-rebind-pixmap = false + +# Disable the use of damage information. +# This cause the whole screen to be redrawn everytime, instead of the part of the screen +# has actually changed. Potentially degrades the performance, but might fix some artifacts. +# The opposing option is use-damage +# +# no-use-damage = false +use-damage = true + +# Use X Sync fence to sync clients' draw calls, to make sure all draw +# calls are finished before picom starts drawing. Needed on nvidia-drivers +# with GLX backend for some users. +# +# xrender-sync-fence = false + +# GLX backend: Use specified GLSL fragment shader for rendering window contents. +# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` +# in the source tree for examples. +# +# glx-fshader-win = '' + +# Force all windows to be painted with blending. Useful if you +# have a glx-fshader-win that could turn opaque pixels transparent. +# +# force-win-blend = false + +# Do not use EWMH to detect fullscreen windows. +# Reverts to checking if a window is fullscreen based only on its size and coordinates. +# +# no-ewmh-fullscreen = false + +# Dimming bright windows so their brightness doesn't exceed this set value. +# Brightness of a window is estimated by averaging all pixels in the window, +# so this could comes with a performance hit. +# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) +# +# max-brightness = 1.0 + +# Make transparent windows clip other windows like non-transparent windows do, +# instead of blending on top of them. +# +# transparent-clipping = false + +# Set the log level. Possible values are: +# "trace", "debug", "info", "warn", "error" +# in increasing level of importance. Case doesn't matter. +# If using the "TRACE" log level, it's better to log into a file +# using *--log-file*, since it can generate a huge stream of logs. +# +# log-level = "debug" +log-level = "warn"; + +# Set the log file. +# If *--log-file* is never specified, logs will be written to stderr. +# Otherwise, logs will to written to the given file, though some of the early +# logs might still be written to the stderr. +# When setting this option from the config file, it is recommended to use an absolute path. +# +# log-file = '/path/to/your/log/file' + +# Show all X errors (for debugging) +# show-all-xerrors = false + +# Write process ID to a file. +# write-pid-path = '/path/to/your/log/file' + +# Window type settings +# +# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: +# "unknown", "desktop", "dock", "toolbar", "menu", "utility", +# "splash", "dialog", "normal", "dropdown_menu", "popup_menu", +# "tooltip", "notification", "combo", and "dnd". +# +# Following per window-type options are available: :: +# +# fade, shadow::: +# Controls window-type-specific shadow and fade settings. +# +# opacity::: +# Controls default opacity of the window type. +# +# focus::: +# Controls whether the window of this type is to be always considered focused. +# (By default, all window types except "normal" and "dialog" has this on.) +# +# full-shadow::: +# Controls whether shadow is drawn under the parts of the window that you +# normally won't be able to see. Useful when the window has parts of it +# transparent, and you want shadows in those areas. +# +# redir-ignore::: +# Controls whether this type of windows should cause screen to become +# redirected again after been unredirected. If you have unredir-if-possible +# set, and doesn't want certain window to cause unnecessary screen redirection, +# you can set this to `true`. +# +wintypes: +{ + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; } + dnd = { shadow = false; } + popup_menu = { opacity = 1.0; } + dropdown_menu = { opacity = 1.0; } +}; \ No newline at end of file diff --git a/awesome/.config/awesome/configuration/rofi.rasi b/awesome/.config/awesome/configuration/rofi.rasi new file mode 100644 index 000000000..105df28e9 --- /dev/null +++ b/awesome/.config/awesome/configuration/rofi.rasi @@ -0,0 +1,146 @@ +/** + * User: deadguy + * Copyright: deadguy + */ + +configuration { + display-drun: "Activate"; + display-run: "Execute"; + show-icons: true; + sidebar-mode: true; +} + +* { + background-color: rgb(18, 30, 37); + text-color: #d3d7cf; + selbg: rgb(0, 86, 136); + actbg: rgb(22, 37, 46); + urgbg: #e53935; + winbg: #26c6da; + + selected-normal-foreground: @winbg; + normal-foreground: @text-color; + selected-normal-background: @actbg; + normal-background: @background-color; + + selected-urgent-foreground: @background-color; + urgent-foreground: @text-color; + selected-urgent-background: @urgbg; + urgent-background: @background-color; + + selected-active-foreground: @winbg; + active-foreground: @text-color; + selected-active-background: @actbg; + active-background: @selbg; + + line-margin: 2; + line-padding: 2; + separator-style: "none"; + hide-scrollbar: "true"; + margin: 0px; + padding: 0px; + font: "Roboto medium 10"; +} + +window { + location: west; + anchor: west; + x-offset: 0px; + height: 100%; + margin-right: 60px; + orientation: horizontal; + children: [mainbox]; +} + +mainbox { + spacing: 0em; + padding: 0px; + width:200px; + children: [ inputbar, listview, sidebar ]; + expand: true; +} + +button { padding: 5px 2px; } + +button selected { + background-color: @active-background; + text-color: @background-color; +} + +inputbar { + children: [ entry ]; +} + +textbox-prompt-colon { + text-color: inherit; + expand: false; + margin: 0 0.3em 0em 0em; + } + +listview { + spacing: 0em; + dynamic: false; + cycle: true; +} + +element { + padding: 16px; + border: 0 0 0 5px solid; +} + +entry { + expand: true; + text-color: @normal-foreground; + background-color: rgb(25, 41, 51); + vertical-align: 1; + padding: 12px; + font: "Roboto medium 13"; +} + +element normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; + padding: 16px; + border: 0 0 0 5px solid; + border-color: @active-background; +} + +element selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element alternate.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element alternate.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element alternate.active { + background-color: @active-background; + text-color: @active-foreground; +} diff --git a/awesome/.config/awesome/configuration/tags/init.lua b/awesome/.config/awesome/configuration/tags/init.lua new file mode 100644 index 000000000..0454d1d96 --- /dev/null +++ b/awesome/.config/awesome/configuration/tags/init.lua @@ -0,0 +1,87 @@ +local awful = require('awful') +local gears = require('gears') +local icons = require('theme.icons') +local apps = require('configuration.apps') + +local tags = { + { + icon = icons.chrome, + type = 'chrome', + defaultApp = apps.default.browser, + screen = 1 + }, + { + icon = icons.code, + type = 'code', + defaultApp = apps.default.editor, + screen = 1 + }, + { + icon = icons.social, + type = 'social', + defaultApp = apps.default.social, + screen = 1 + }, + { + icon = icons.game, + type = 'game', + defaultApp = apps.default.game, + screen = 1 + }, + { + icon = icons.folder, + type = 'files', + defaultApp = apps.default.files, + screen = 1 + }, + { + icon = icons.music, + type = 'music', + defaultApp = apps.default.music, + screen = 1 + }, + { + icon = icons.lab, + type = 'any', + defaultApp = apps.default.rofi, + screen = 1 + } +} + +awful.layout.layouts = { + awful.layout.suit.tile, + awful.layout.suit.max, + awful.layout.suit.floating +} + +awful.screen.connect_for_each_screen( + function(s) + for i, tag in pairs(tags) do + awful.tag.add( + i, + { + icon = tag.icon, + icon_only = true, + layout = awful.layout.suit.tile, + gap_single_client = false, + gap = 4, + screen = s, + defaultApp = tag.defaultApp, + selected = i == 1 + } + ) + end + end +) + +_G.tag.connect_signal( + 'property::layout', + function(t) + local currentLayout = awful.tag.getproperty(t, 'layout') + if (currentLayout == awful.layout.suit.max) then + t.gap = 0 + else + t.gap = 4 + end + end +) diff --git a/awesome/.config/awesome/configuration/tags/layouts/single-maximized.lua b/awesome/.config/awesome/configuration/tags/layouts/single-maximized.lua new file mode 100644 index 000000000..25ad73e77 --- /dev/null +++ b/awesome/.config/awesome/configuration/tags/layouts/single-maximized.lua @@ -0,0 +1,56 @@ +--------------------------------------------------------------------------- +--- Maximized and fullscreen layouts module for awful +-- +-- @author Julien Danjou <julien@danjou.info> +-- @copyright 2008 Julien Danjou +-- @module awful.layout +--------------------------------------------------------------------------- + +-- Grab environment we need +local pairs = pairs + +local max = {} + +--- The max layout layoutbox icon. +-- @beautiful beautiful.layout_max +-- @param surface +-- @see gears.surface + +--- The fullscreen layout layoutbox icon. +-- @beautiful beautiful.layout_fullscreen +-- @param surface +-- @see gears.surface + +local function fmax(p, fs) + -- Fullscreen? + local area + if fs then + area = p.geometry + else + area = p.workarea + end + local focused_client = client.focus + for _, c in pairs(p.clients) do + local g = { + x = area.x, + y = area.y, + width = area.width, + height = area.height + } + p.geometries[c] = g + end +end + +--- Maximized layout. +-- @clientlayout awful.layout.suit.max.name +max.name = 'max' +function max.arrange(p) + return fmax(p, false) +end +function max.skip_gap(nclients, t) -- luacheck: no unused args + return true +end + +return max + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/awesome/.config/awesome/configuration/utils/screenshot b/awesome/.config/awesome/configuration/utils/screenshot new file mode 100755 index 000000000..3fdbb2965 --- /dev/null +++ b/awesome/.config/awesome/configuration/utils/screenshot @@ -0,0 +1,3 @@ +#!/bin/bash + +spectacle -b -n $@ -o ~/Pictures/Screenshot-$(date "+%Y.%m.%d-%H.%M.%S").png ; xclip -selection clipboard -target image/png -i ~/Pictures/Screenshot-$(date "+%Y.%m.%d-%H.%M.%S").png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga \ No newline at end of file diff --git a/awesome/.config/awesome/layout/README.md b/awesome/.config/awesome/layout/README.md new file mode 100644 index 000000000..b157692fa --- /dev/null +++ b/awesome/.config/awesome/layout/README.md @@ -0,0 +1 @@ +## Layout diff --git a/awesome/.config/awesome/layout/init.lua b/awesome/.config/awesome/layout/init.lua new file mode 100644 index 000000000..65e31d536 --- /dev/null +++ b/awesome/.config/awesome/layout/init.lua @@ -0,0 +1,57 @@ +local awful = require('awful') +local left_panel = require('layout.left-panel') +local top_panel = require('layout.top-panel') + +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen( + function(s) + if s.index == 1 then + -- Create the left_panel + s.left_panel = left_panel(s) + -- Create the Top bar + s.top_panel = top_panel(s, true) + else + -- Create the Top bar + s.top_panel = top_panel(s, false) + end + end +) + +-- Hide bars when app go fullscreen +function updateBarsVisibility() + for s in screen do + if s.selected_tag then + local fullscreen = s.selected_tag.fullscreenMode + -- Order matter here for shadow + s.top_panel.visible = not fullscreen + if s.left_panel then + s.left_panel.visible = not fullscreen + end + end + end +end + +_G.tag.connect_signal( + 'property::selected', + function(t) + updateBarsVisibility() + end +) + +_G.client.connect_signal( + 'property::fullscreen', + function(c) + c.screen.selected_tag.fullscreenMode = c.fullscreen + updateBarsVisibility() + end +) + +_G.client.connect_signal( + 'unmanage', + function(c) + if c.fullscreen then + c.screen.selected_tag.fullscreenMode = false + updateBarsVisibility() + end + end +) diff --git a/awesome/.config/awesome/layout/left-panel/action-bar.lua b/awesome/.config/awesome/layout/left-panel/action-bar.lua new file mode 100644 index 000000000..4dbbc2b76 --- /dev/null +++ b/awesome/.config/awesome/layout/left-panel/action-bar.lua @@ -0,0 +1,100 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local gears = require('gears') +local mat_icon = require('widget.material.icon') +local dpi = require('beautiful').xresources.apply_dpi +local icons = require('theme.icons') +local TagList = require('widget.tag-list') +local clickable_container = require('widget.material.clickable-container') + +return function(screen, panel, action_bar_width) + -- Clock / Calendar 24h format + local textclock = wibox.widget.textclock('%H\n%M') + + -- Clock / Calendar 12AM/PM fornat + -- local textclock = wibox.widget.textclock('%I\n%M\n%p') + -- textclock.forced_height = 56 + + -- Add a calendar (credits to kylekewley for the original code) + local month_calendar = awful.widget.calendar_popup.month({ + screen = s, + start_sunday = false, + week_numbers = true + }) + month_calendar:attach(textclock) + + local clock_widget = wibox.container.margin(textclock, dpi(13), dpi(13), dpi(8), dpi(8)) + local systray = wibox.widget.systray() + systray:set_horizontal(false) + systray:set_base_size(24) + + local menu_icon = + wibox.widget { + icon = icons.menu, + size = dpi(24), + widget = mat_icon + } + + local home_button = + wibox.widget { + wibox.widget { + menu_icon, + widget = clickable_container + }, + bg = beautiful.primary.hue_500, + widget = wibox.container.background + } + + home_button:buttons( + gears.table.join( + awful.button( + {}, + 1, + nil, + function() + panel:toggle() + end + ) + ) + ) + + panel:connect_signal( + 'opened', + function() + menu_icon.icon = icons.close + end + ) + + panel:connect_signal( + 'closed', + function() + menu_icon.icon = icons.menu + end + ) + + return wibox.widget { + id = 'action_bar', + layout = wibox.layout.align.vertical, + forced_width = action_bar_width, + { + -- Left widgets + layout = wibox.layout.fixed.vertical, + home_button, + -- Create a taglist widget + TagList(screen) + }, + --s.mytasklist, -- Middle widget + nil, + { + -- Right widgets + layout = wibox.layout.fixed.vertical, + wibox.container.margin(systray, dpi(10), dpi(10)), + --require('widget.package-updater'), + --require('widget.wifi'), + require('widget.battery'), + -- Clock + --clock_widget + } + } +end diff --git a/awesome/.config/awesome/layout/left-panel/dashboard/hardware-monitor.lua b/awesome/.config/awesome/layout/left-panel/dashboard/hardware-monitor.lua new file mode 100644 index 000000000..e052a5762 --- /dev/null +++ b/awesome/.config/awesome/layout/left-panel/dashboard/hardware-monitor.lua @@ -0,0 +1,18 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') + +return wibox.widget { + wibox.widget { + wibox.widget { + text = 'Hardware monitor', + font = 'Roboto medium 12', + widget = wibox.widget.textbox + }, + widget = mat_list_item + }, + require('widget.cpu.cpu-meter'), + require('widget.ram.ram-meter'), + require('widget.temperature.temperature-meter'), + require('widget.harddrive.harddrive-meter'), + layout = wibox.layout.fixed.vertical +} diff --git a/awesome/.config/awesome/layout/left-panel/dashboard/init.lua b/awesome/.config/awesome/layout/left-panel/dashboard/init.lua new file mode 100644 index 000000000..564041ac6 --- /dev/null +++ b/awesome/.config/awesome/layout/left-panel/dashboard/init.lua @@ -0,0 +1,96 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_icon = require('widget.material.icon') +local dpi = require('beautiful').xresources.apply_dpi +local icons = require('theme.icons') + +return function(_, panel) + local search_button = + wibox.widget { + wibox.widget { + icon = icons.search, + size = dpi(24), + widget = mat_icon + }, + wibox.widget { + text = 'Search Applications', + font = 'Roboto medium 13', + widget = wibox.widget.textbox + }, + clickable = true, + widget = mat_list_item + } + + search_button:buttons( + awful.util.table.join( + awful.button( + {}, + 1, + function() + panel:run_rofi() + end + ) + ) + ) + + local exit_button = + wibox.widget { + wibox.widget { + icon = icons.logout, + size = dpi(24), + widget = mat_icon + }, + wibox.widget { + text = 'End work session', + font = 'Roboto medium 13', + widget = wibox.widget.textbox + }, + clickable = true, + divider = true, + widget = mat_list_item + } + + exit_button:buttons( + awful.util.table.join( + awful.button( + {}, + 1, + function() + panel:toggle() + _G.exit_screen_show() + end + ) + ) + ) + + return wibox.widget { + layout = wibox.layout.align.vertical, + { + layout = wibox.layout.fixed.vertical, + { + search_button, + bg = beautiful.background.hue_800, + widget = wibox.container.background + }, + wibox.widget { + orientation = 'horizontal', + forced_height = 1, + opacity = 0.08, + widget = wibox.widget.separator + }, + require('layout.left-panel.dashboard.quick-settings'), + require('layout.left-panel.dashboard.hardware-monitor') + }, + nil, + { + layout = wibox.layout.fixed.vertical, + { + exit_button, + bg = beautiful.background.hue_800, + widget = wibox.container.background + } + } + } +end diff --git a/awesome/.config/awesome/layout/left-panel/dashboard/quick-settings.lua b/awesome/.config/awesome/layout/left-panel/dashboard/quick-settings.lua new file mode 100644 index 000000000..75506c362 --- /dev/null +++ b/awesome/.config/awesome/layout/left-panel/dashboard/quick-settings.lua @@ -0,0 +1,16 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') + +return wibox.widget { + wibox.widget { + wibox.widget { + text = 'Quick settings', + font = 'Roboto medium 12', + widget = wibox.widget.textbox + }, + widget = mat_list_item + }, + require('widget.volume.volume-slider'), + --require('widget.brightness.brightness-slider'), + layout = wibox.layout.fixed.vertical +} diff --git a/awesome/.config/awesome/layout/left-panel/init.lua b/awesome/.config/awesome/layout/left-panel/init.lua new file mode 100644 index 000000000..f7758f640 --- /dev/null +++ b/awesome/.config/awesome/layout/left-panel/init.lua @@ -0,0 +1,115 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local apps = require('configuration.apps') +local dpi = require('beautiful').xresources.apply_dpi + +local left_panel = function(screen) + local action_bar_width = dpi(48) + local panel_content_width = dpi(400) + + local panel = + wibox { + screen = screen, + width = action_bar_width, + height = screen.geometry.height, + x = screen.geometry.x, + y = screen.geometry.y, + ontop = true, + bg = beautiful.background.hue_800, + fg = beautiful.fg_normal + } + + panel.opened = false + + panel:struts( + { + left = action_bar_width + } + ) + + local backdrop = + wibox { + ontop = true, + screen = screen, + bg = '#00000000', + type = 'dock', + x = screen.geometry.x, + y = screen.geometry.y, + width = screen.geometry.width, + height = screen.geometry.height + } + + function panel:run_rofi() + _G.awesome.spawn( + apps.default.rofi, + false, + false, + false, + false, + function() + panel:toggle() + end + ) + end + + local openPanel = function(should_run_rofi) + panel.width = action_bar_width + panel_content_width + backdrop.visible = true + panel.visible = false + panel.visible = true + panel:get_children_by_id('panel_content')[1].visible = true + if should_run_rofi then + panel:run_rofi() + end + panel:emit_signal('opened') + end + + local closePanel = function() + panel.width = action_bar_width + panel:get_children_by_id('panel_content')[1].visible = false + backdrop.visible = false + panel:emit_signal('closed') + end + + function panel:toggle(should_run_rofi) + self.opened = not self.opened + if self.opened then + openPanel(should_run_rofi) + else + closePanel() + end + end + + backdrop:buttons( + awful.util.table.join( + awful.button( + {}, + 1, + function() + panel:toggle() + end + ) + ) + ) + + panel:setup { + layout = wibox.layout.align.horizontal, + nil, + { + id = 'panel_content', + bg = beautiful.background.hue_900, + widget = wibox.container.background, + visible = false, + forced_width = panel_content_width, + { + require('layout.left-panel.dashboard')(screen, panel), + layout = wibox.layout.stack + } + }, + require('layout.left-panel.action-bar')(screen, panel, action_bar_width) + } + return panel +end + +return left_panel diff --git a/awesome/.config/awesome/layout/top-panel.lua b/awesome/.config/awesome/layout/top-panel.lua new file mode 100644 index 000000000..15d6eef88 --- /dev/null +++ b/awesome/.config/awesome/layout/top-panel.lua @@ -0,0 +1,140 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local gears = require('gears') +local clickable_container = require('widget.material.clickable-container') +local mat_icon_button = require('widget.material.icon-button') +local mat_icon = require('widget.material.icon') + +local dpi = require('beautiful').xresources.apply_dpi + +local icons = require('theme.icons') + +-- Clock / Calendar 24h format +local textclock = wibox.widget.textclock('%d.%m.%Y\n %H:%M') + +-- Clock / Calendar 12AM/PM fornat +-- local textclock = wibox.widget.textclock('%d.%m.%Y\n %I:%M %p\n%p') +-- textclock.forced_height = 56 + +-- Add a calendar (credits to kylekewley for the original code) +local month_calendar = awful.widget.calendar_popup.month({ + screen = s, + start_sunday = false, + week_numbers = true +}) +month_calendar:attach(textclock) + +local clock_widget = wibox.container.margin(textclock, dpi(13), dpi(13), dpi(8), dpi(8)) + +local add_button = mat_icon_button(mat_icon(icons.plus, dpi(24))) +add_button:buttons( + gears.table.join( + awful.button( + {}, + 1, + nil, + function() + awful.spawn( + awful.screen.focused().selected_tag.defaultApp, + { + tag = _G.mouse.screen.selected_tag, + placement = awful.placement.bottom_right + } + ) + end + ) + ) +) + +-- Create an imagebox widget which will contains an icon indicating which layout we're using. +-- We need one layoutbox per screen. +local LayoutBox = function(s) + local layoutBox = clickable_container(awful.widget.layoutbox(s)) + layoutBox:buttons( + awful.util.table.join( + awful.button( + {}, + 1, + function() + awful.layout.inc(1) + end + ), + awful.button( + {}, + 3, + function() + awful.layout.inc(-1) + end + ), + awful.button( + {}, + 4, + function() + awful.layout.inc(1) + end + ), + awful.button( + {}, + 5, + function() + awful.layout.inc(-1) + end + ) + ) + ) + return layoutBox +end + +local TopPanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(48) + end + local panel = + wibox( + { + ontop = true, + screen = s, + height = dpi(48), + width = s.geometry.width - offsetx, + x = s.geometry.x + offsetx, + y = s.geometry.y, + stretch = false, + bg = beautiful.background.hue_800, + fg = beautiful.fg_normal, + struts = { + top = dpi(48) + } + } + ) + + panel:struts( + { + top = dpi(48) + } + ) + + panel:setup { + layout = wibox.layout.align.horizontal, + { + layout = wibox.layout.fixed.horizontal, + -- Create a taglist widget + TaskList(s), + add_button + }, + nil, + { + layout = wibox.layout.fixed.horizontal, + -- Clock + clock_widget, + -- Layout box + LayoutBox(s) + } + } + + return panel +end + +return TopPanel diff --git a/awesome/.config/awesome/module/README.md b/awesome/.config/awesome/module/README.md new file mode 100644 index 000000000..097d4f9f9 --- /dev/null +++ b/awesome/.config/awesome/module/README.md @@ -0,0 +1 @@ +## Module \ No newline at end of file diff --git a/awesome/.config/awesome/module/auto-start.lua b/awesome/.config/awesome/module/auto-start.lua new file mode 100644 index 000000000..8fc1769ee --- /dev/null +++ b/awesome/.config/awesome/module/auto-start.lua @@ -0,0 +1,18 @@ +-- MODULE AUTO-START +-- Run all the apps listed in configuration/apps.lua as run_on_start_up only once when awesome start + +local awful = require('awful') +local apps = require('configuration.apps') + +local function run_once(cmd) + local findme = cmd + local firstspace = cmd:find(' ') + if firstspace then + findme = cmd:sub(0, firstspace - 1) + end + awful.spawn.with_shell(string.format('pgrep -u $USER -x %s > /dev/null || (%s)', findme, cmd)) +end + +for _, app in ipairs(apps.run_on_start_up) do + run_once(app) +end diff --git a/awesome/.config/awesome/module/backdrop.lua b/awesome/.config/awesome/module/backdrop.lua new file mode 100644 index 000000000..396c3750a --- /dev/null +++ b/awesome/.config/awesome/module/backdrop.lua @@ -0,0 +1,83 @@ +local wibox = require('wibox') +local gears = require('gears') +local awful = require('awful') + +local function update_backdrop(w, c) + local cairo = require('lgi').cairo + local geo = c.screen.geometry + + w.x = geo.x + w.y = geo.y + w.width = geo.width + w.height = geo.height + + -- Create an image surface that is as large as the wibox + local shape = cairo.ImageSurface.create(cairo.Format.A1, geo.width, geo.height) + local cr = cairo.Context(shape) + + -- Fill with "completely opaque" + cr.operator = 'SOURCE' + cr:set_source_rgba(1, 1, 1, 1) + cr:paint() + + -- Remove the shape of the client + local c_geo = c:geometry() + local c_shape = gears.surface(c.shape_bounding) + cr:set_source_rgba(0, 0, 0, 0) + cr:mask_surface(c_shape, c_geo.x + c.border_width - geo.x, c_geo.y + c.border_width - geo.y) + c_shape:finish() + + w.shape_bounding = shape._native + shape:finish() + w:draw() +end + +local function backdrop(c) + local function update() + update_backdrop(c.backdrop, c) + end + if not c.backdrop then + c.backdrop = wibox {ontop = true, bg = '#00000054', type = 'splash'} + c.backdrop:buttons( + awful.util.table.join( + awful.button( + {}, + 1, + function() + c:kill() + end + ) + ) + ) + c:connect_signal('property::geometry', update) + c:connect_signal( + 'property::shape_client_bounding', + function() + gears.timer.delayed_call(update) + end + ) + c:connect_signal( + 'unmanage', + function() + c.backdrop.visible = false + end + ) + c:connect_signal( + 'property::shape_bounding', + function() + gears.timer.delayed_call(update) + end + ) + end + update() + c.backdrop.visible = true +end + +_G.client.connect_signal( + 'manage', + function(c) + if c.drawBackdrop == true then + backdrop(c) + end + end +) diff --git a/awesome/.config/awesome/module/decorate-client.lua b/awesome/.config/awesome/module/decorate-client.lua new file mode 100644 index 000000000..bd181c25e --- /dev/null +++ b/awesome/.config/awesome/module/decorate-client.lua @@ -0,0 +1,106 @@ +local awful = require('awful') +local gears = require('gears') +local beautiful = require('beautiful') + +local function renderClient(client, mode) + if client.skip_decoration or (client.rendering_mode == mode) then + return + end + + client.rendering_mode = mode + client.floating = false + client.maximized = false + client.above = false + client.below = false + client.ontop = false + client.sticky = false + client.maximized_horizontal = false + client.maximized_vertical = false + + if client.rendering_mode == 'maximized' then + client.border_width = 0 + client.shape = function(cr, w, h) + gears.shape.rectangle(cr, w, h) + end + elseif client.rendering_mode == 'tiled' then + client.border_width = beautiful.border_width + client.shape = function(cr, w, h) + gears.shape.rounded_rect(cr, w, h, 8) + end + end +end + +local changesOnScreenCalled = false + +local function changesOnScreen(currentScreen) + local tagIsMax = currentScreen.selected_tag ~= nil and currentScreen.selected_tag.layout == awful.layout.suit.max + local clientsToManage = {} + + for _, client in pairs(currentScreen.clients) do + if not client.skip_decoration and not client.hidden then + table.insert(clientsToManage, client) + end + end + + if (tagIsMax or #clientsToManage == 1) then + currentScreen.client_mode = 'maximized' + else + currentScreen.client_mode = 'tiled' + end + + for _, client in pairs(clientsToManage) do + renderClient(client, currentScreen.client_mode) + end + changesOnScreenCalled = false +end + +function clientCallback(client) + if not changesOnScreenCalled then + if not client.skip_decoration and client.screen then + changesOnScreenCalled = true + local screen = client.screen + gears.timer.delayed_call( + function() + changesOnScreen(screen) + end + ) + end + end +end + +function tagCallback(tag) + if not changesOnScreenCalled then + if tag.screen then + changesOnScreenCalled = true + local screen = tag.screen + gears.timer.delayed_call( + function() + changesOnScreen(screen) + end + ) + end + end +end + +_G.client.connect_signal('manage', clientCallback) + +_G.client.connect_signal('unmanage', clientCallback) + +_G.client.connect_signal('property::hidden', clientCallback) + +_G.client.connect_signal('property::minimized', clientCallback) + +_G.client.connect_signal( + 'property::fullscreen', + function(c) + if c.fullscreen then + renderClient(c, 'maximized') + else + clientCallback(c) + end + end +) + +_G.tag.connect_signal('property::selected', tagCallback) + +_G.tag.connect_signal('property::layout', tagCallback) diff --git a/awesome/.config/awesome/module/exit-screen.lua b/awesome/.config/awesome/module/exit-screen.lua new file mode 100644 index 000000000..49c8ad1c3 --- /dev/null +++ b/awesome/.config/awesome/module/exit-screen.lua @@ -0,0 +1,201 @@ +local awful = require('awful') +local gears = require('gears') +local wibox = require('wibox') +local beautiful = require('beautiful') +local icons = require('theme.icons') +local clickable_container = require('widget.material.clickable-container') +local apps = require('configuration.apps') +local dpi = require('beautiful').xresources.apply_dpi + +-- Appearance +local icon_size = beautiful.exit_screen_icon_size or dpi(140) + +local buildButton = function(icon) + local abutton = + wibox.widget { + wibox.widget { + wibox.widget { + wibox.widget { + image = icon, + widget = wibox.widget.imagebox + }, + top = dpi(16), + bottom = dpi(16), + left = dpi(16), + right = dpi(16), + widget = wibox.container.margin + }, + shape = gears.shape.circle, + forced_width = icon_size, + forced_height = icon_size, + widget = clickable_container + }, + left = dpi(24), + right = dpi(24), + widget = wibox.container.margin + } + + return abutton +end + +function suspend_command() + exit_screen_hide() + awful.spawn.with_shell(apps.default.lock .. ' & systemctl suspend') +end +function exit_command() + _G.awesome.quit() +end +function lock_command() + exit_screen_hide() + awful.spawn.with_shell('sleep 1 && ' .. apps.default.lock) +end +function poweroff_command() + awful.spawn.with_shell('poweroff') + awful.keygrabber.stop(_G.exit_screen_grabber) +end +function reboot_command() + awful.spawn.with_shell('reboot') + awful.keygrabber.stop(_G.exit_screen_grabber) +end + +local poweroff = buildButton(icons.power, 'Shutdown') +poweroff:connect_signal( + 'button::release', + function() + poweroff_command() + end +) + +local reboot = buildButton(icons.restart, 'Restart') +reboot:connect_signal( + 'button::release', + function() + reboot_command() + end +) + +local suspend = buildButton(icons.sleep, 'Sleep') +suspend:connect_signal( + 'button::release', + function() + suspend_command() + end +) + +local exit = buildButton(icons.logout, 'Logout') +exit:connect_signal( + 'button::release', + function() + exit_command() + end +) + +local lock = buildButton(icons.lock, 'Lock') +lock:connect_signal( + 'button::release', + function() + lock_command() + end +) + +-- Get screen geometry +local screen_geometry = awful.screen.focused().geometry + +-- Create the widget +exit_screen = + wibox( + { + x = screen_geometry.x, + y = screen_geometry.y, + visible = false, + ontop = true, + type = 'splash', + height = screen_geometry.height, + width = screen_geometry.width + } +) + +exit_screen.bg = beautiful.background.hue_800 .. 'dd' +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 + +function exit_screen_show() + -- naughty.notify({text = "starting the keygrabber"}) + exit_screen_grabber = + awful.keygrabber.run( + function(_, key, event) + if event == 'release' then + return + end + + if key == 's' then + suspend_command() + elseif key == 'e' then + exit_command() + elseif key == 'l' then + lock_command() + elseif key == 'p' then + poweroff_command() + elseif key == 'r' then + reboot_command() + elseif key == 'Escape' or key == 'q' or key == 'x' then + -- naughty.notify({text = "Cancel"}) + exit_screen_hide() + -- else awful.keygrabber.stop(exit_screen_grabber) + 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, + { + -- { + poweroff, + reboot, + suspend, + exit, + lock, + layout = wibox.layout.fixed.horizontal + -- }, + -- widget = exit_screen_box + }, + nil, + expand = 'none', + layout = wibox.layout.align.horizontal + }, + nil, + expand = 'none', + layout = wibox.layout.align.vertical +} diff --git a/awesome/.config/awesome/module/notifications.lua b/awesome/.config/awesome/module/notifications.lua new file mode 100644 index 000000000..46a8b3846 --- /dev/null +++ b/awesome/.config/awesome/module/notifications.lua @@ -0,0 +1,62 @@ +local naughty = require('naughty') +local beautiful = require('beautiful') +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi + +-- Naughty presets +naughty.config.padding = 8 +naughty.config.spacing = 8 + +naughty.config.defaults.timeout = 5 +naughty.config.defaults.screen = 1 +naughty.config.defaults.position = 'bottom_left' +naughty.config.defaults.margin = dpi(16) +naughty.config.defaults.ontop = true +naughty.config.defaults.font = 'Roboto Regular 10' +naughty.config.defaults.icon = nil +naughty.config.defaults.icon_size = dpi(32) +naughty.config.defaults.shape = gears.shape.rounded_rect +naughty.config.defaults.border_width = 0 +naughty.config.defaults.hover_timeout = nil + +-- Error handling +if _G.awesome.startup_errors then + naughty.notify( + { + preset = naughty.config.presets.critical, + title = 'Oops, there were errors during startup!', + text = _G.awesome.startup_errors + } + ) +end + +do + local in_error = false + _G.awesome.connect_signal( + 'debug::error', + function(err) + if in_error then + return + end + in_error = true + + naughty.notify( + { + preset = naughty.config.presets.critical, + title = 'Oops, an error happened!', + text = tostring(err) + } + ) + in_error = false + end + ) +end + +function log_this(title, txt) + naughty.notify( + { + title = 'log: ' .. title, + text = txt + } + ) +end diff --git a/awesome/.config/awesome/module/quake-terminal.lua b/awesome/.config/awesome/module/quake-terminal.lua new file mode 100644 index 000000000..0da83fefa --- /dev/null +++ b/awesome/.config/awesome/module/quake-terminal.lua @@ -0,0 +1,65 @@ +local spawn = require('awful.spawn') +local app = require('configuration.apps').default.quake + +local quake_id = 'notnil' +local quake_client +local opened = false +function create_shell() + quake_id = + spawn( + app, + { + skip_decoration = true + } + ) +end + +function open_quake() + quake_client.hidden = false +end + +function close_quake() + quake_client.hidden = true +end + +toggle_quake = function() + opened = not opened + if not quake_client then + create_shell() + else + if opened then + open_quake() + else + close_quake() + end + end +end + +_G.client.connect_signal( + 'manage', + function(c) + if (c.pid == quake_id) then + quake_client = c + c.opacity = 0.9 + c.floating = true + c.skip_taskbar = true + c.ontop = true + c.above = true + c.sticky = true + c.hidden = not opened + c.maximized_horizontal = true + end + end +) + +_G.client.connect_signal( + 'unmanage', + function(c) + if (c.pid == quake_id) then + opened = false + quake_client = nil + end + end +) + +-- create_shell() diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua new file mode 100644 index 000000000..2cdd60e49 --- /dev/null +++ b/awesome/.config/awesome/rc.lua @@ -0,0 +1,84 @@ +local gears = require('gears') +local awful = require('awful') +local wibox = require("wibox") +require('awful.autofocus') +local beautiful = require('beautiful') + +-- Theme +beautiful.init(require('theme')) + +-- Layout +require('layout') + +-- Init all modules +require('module.notifications') +require('module.auto-start') +require('module.decorate-client') +-- Backdrop causes bugs on some gtk3 applications +--require('module.backdrop') +require('module.exit-screen') +require('module.quake-terminal') + +-- Setup all configurations +require('configuration.client') +require('configuration.tags') +_G.root.keys(require('configuration.keys.global')) + +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen( + function(s) + -- If wallpaper is a function, call it with the screen + if beautiful.wallpaper then + if type(beautiful.wallpaper) == "string" then + if beautiful.wallpaper:sub(1, #"#") == "#" then + gears.wallpaper.set(beautiful.wallpaper) + elseif beautiful.wallpaper:sub(1, #"/") == "/" then + gears.wallpaper.maximized(beautiful.wallpaper, s) + end + else + beautiful.wallpaper(s) + end + end + end +) + +-- Signal function to execute when a new client appears. +_G.client.connect_signal( + 'manage', + function(c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + if not _G.awesome.startup then + awful.client.setslave(c) + end + + if _G.awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end + end +) + +-- Enable sloppy focus, so that focus follows mouse. +--[[ +_G.client.connect_signal( + 'mouse::enter', + function(c) + c:emit_signal('request::activate', 'mouse_enter', {raise = true}) + end +) +--]] + +-- Make the focused window have a glowing border +_G.client.connect_signal( + 'focus', + function(c) + c.border_color = beautiful.border_focus + end +) +_G.client.connect_signal( + 'unfocus', + function(c) + c.border_color = beautiful.border_normal + end +) diff --git a/awesome/.config/awesome/theme/PapyElGringo-theme/demo.gif b/awesome/.config/awesome/theme/PapyElGringo-theme/demo.gif new file mode 100644 index 000000000..88bf3b724 Binary files /dev/null and b/awesome/.config/awesome/theme/PapyElGringo-theme/demo.gif differ diff --git a/awesome/.config/awesome/theme/PapyElGringo-theme/init.lua b/awesome/.config/awesome/theme/PapyElGringo-theme/init.lua new file mode 100644 index 000000000..e637d4278 --- /dev/null +++ b/awesome/.config/awesome/theme/PapyElGringo-theme/init.lua @@ -0,0 +1,30 @@ +local filesystem = require('gears.filesystem') +local mat_colors = require('theme.mat-colors') +local theme_dir = filesystem.get_configuration_dir() .. '/theme' +local dpi = require('beautiful').xresources.apply_dpi + +local theme = {} +theme.icons = theme_dir .. '/icons/' +theme.font = 'Roboto medium 10' + +-- Colors Pallets + +-- Primary +theme.primary = mat_colors.indigo +theme.primary.hue_500 = '#003f6b' +-- Accent +theme.accent = mat_colors.pink + +-- Background +theme.background = mat_colors.blue_grey + +theme.background.hue_800 = '#192933' +theme.background.hue_900 = '#121e25' + +local awesome_overrides = function(theme) + -- +end +return { + theme = theme, + awesome_overrides = awesome_overrides +} diff --git a/awesome/.config/awesome/theme/README.md b/awesome/.config/awesome/theme/README.md new file mode 100644 index 000000000..6c558ebd9 --- /dev/null +++ b/awesome/.config/awesome/theme/README.md @@ -0,0 +1 @@ +## Theme \ No newline at end of file diff --git a/awesome/.config/awesome/theme/default-theme.lua b/awesome/.config/awesome/theme/default-theme.lua new file mode 100644 index 000000000..82386a229 --- /dev/null +++ b/awesome/.config/awesome/theme/default-theme.lua @@ -0,0 +1,109 @@ +local filesystem = require('gears.filesystem') +local mat_colors = require('theme.mat-colors') +local theme_dir = filesystem.get_configuration_dir() .. '/theme' +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi +local theme = {} +theme.icons = theme_dir .. '/icons/' +theme.font = 'Roboto medium 10' + +-- Colors Pallets + +-- Primary +theme.primary = mat_colors.deep_orange + +-- Accent +theme.accent = mat_colors.pink + +-- Background +theme.background = mat_colors.grey + +local awesome_overrides = + function(theme) + theme.dir = os.getenv('HOME') .. '/.config/awesome/theme' + + theme.icons = theme.dir .. '/icons/' + theme.wallpaper = theme.dir .. '/wallpapers/DarkCyan.png' + --theme.wallpaper = '#e0e0e0' + theme.font = 'Roboto medium 10' + theme.title_font = 'Roboto medium 14' + + theme.fg_normal = '#ffffffde' + + theme.fg_focus = '#e4e4e4' + theme.fg_urgent = '#CC9393' + theme.bat_fg_critical = '#232323' + + theme.bg_normal = theme.background.hue_800 + theme.bg_focus = '#5a5a5a' + theme.bg_urgent = '#3F3F3F' + theme.bg_systray = theme.background.hue_800 + + -- Borders + + theme.border_width = dpi(2) + theme.border_normal = theme.background.hue_800 + theme.border_focus = theme.primary.hue_300 + theme.border_marked = '#CC9393' + + -- Menu + + theme.menu_height = dpi(16) + theme.menu_width = dpi(160) + + -- Tooltips + theme.tooltip_bg = '#232323' + --theme.tooltip_border_color = '#232323' + theme.tooltip_border_width = 0 + theme.tooltip_shape = function(cr, w, h) + gears.shape.rounded_rect(cr, w, h, dpi(6)) + end + + -- Layout + + theme.layout_max = theme.icons .. 'layouts/arrow-expand-all.png' + theme.layout_tile = theme.icons .. 'layouts/view-quilt.png' + + -- Taglist + + theme.taglist_bg_empty = theme.background.hue_800 + theme.taglist_bg_occupied = theme.background.hue_800 + theme.taglist_bg_urgent = + 'linear:0,0:' .. + dpi(48) .. + ',0:0,' .. + theme.accent.hue_500 .. + ':0.08,' .. theme.accent.hue_500 .. ':0.08,' .. theme.background.hue_800 .. ':1,' .. theme.background.hue_800 + theme.taglist_bg_focus = + 'linear:0,0:' .. + dpi(48) .. + ',0:0,' .. + theme.primary.hue_500 .. + ':0.08,' .. theme.primary.hue_500 .. ':0.08,' .. theme.background.hue_800 .. ':1,' .. theme.background.hue_800 + + -- Tasklist + + theme.tasklist_font = 'Roboto medium 11' + theme.tasklist_bg_normal = theme.background.hue_800 + theme.tasklist_bg_focus = + 'linear:0,0:0,' .. + dpi(48) .. + ':0,' .. + theme.background.hue_800 .. + ':0.95,' .. theme.background.hue_800 .. ':0.95,' .. theme.fg_normal .. ':1,' .. theme.fg_normal + theme.tasklist_bg_urgent = theme.primary.hue_800 + theme.tasklist_fg_focus = '#DDDDDD' + theme.tasklist_fg_urgent = theme.fg_normal + theme.tasklist_fg_normal = '#AAAAAA' + + theme.icon_theme = 'Papirus-Dark' + + --Client + theme.border_width = dpi(2) + theme.border_focus = theme.primary.hue_500 + theme.border_normal = theme.background.hue_800 +end +return { + theme = theme, + awesome_overrides = awesome_overrides +} diff --git a/awesome/.config/awesome/theme/icons/brave.svg b/awesome/.config/awesome/theme/icons/brave.svg new file mode 100644 index 000000000..f4b0a6a00 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/brave.svg @@ -0,0 +1,60 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/awesome/.config/awesome/theme/icons/brightness-7.svg b/awesome/.config/awesome/theme/icons/brightness-7.svg new file mode 100644 index 000000000..fe7aa9d4a --- /dev/null +++ b/awesome/.config/awesome/theme/icons/brightness-7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/chart-areaspline.svg b/awesome/.config/awesome/theme/icons/chart-areaspline.svg new file mode 100644 index 000000000..9941ba53f --- /dev/null +++ b/awesome/.config/awesome/theme/icons/chart-areaspline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/close.svg b/awesome/.config/awesome/theme/icons/close.svg new file mode 100644 index 000000000..3f1f88c11 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/code-braces.svg b/awesome/.config/awesome/theme/icons/code-braces.svg new file mode 100644 index 000000000..6adb5669d --- /dev/null +++ b/awesome/.config/awesome/theme/icons/code-braces.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/flask.svg b/awesome/.config/awesome/theme/icons/flask.svg new file mode 100644 index 000000000..dba8a2f08 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/flask.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/folder.svg b/awesome/.config/awesome/theme/icons/folder.svg new file mode 100644 index 000000000..146c65b44 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/folder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/forum.svg b/awesome/.config/awesome/theme/icons/forum.svg new file mode 100644 index 000000000..08bd17e03 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/forum.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/google-chrome.svg b/awesome/.config/awesome/theme/icons/google-chrome.svg new file mode 100644 index 000000000..6c68b70fa --- /dev/null +++ b/awesome/.config/awesome/theme/icons/google-chrome.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/google-controller.svg b/awesome/.config/awesome/theme/icons/google-controller.svg new file mode 100644 index 000000000..12c686992 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/google-controller.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/harddisk.svg b/awesome/.config/awesome/theme/icons/harddisk.svg new file mode 100644 index 000000000..f0b97b92a --- /dev/null +++ b/awesome/.config/awesome/theme/icons/harddisk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/init.lua b/awesome/.config/awesome/theme/icons/init.lua new file mode 100644 index 000000000..8b3ec53fd --- /dev/null +++ b/awesome/.config/awesome/theme/icons/init.lua @@ -0,0 +1,28 @@ +local dir = os.getenv('HOME') .. '/.config/awesome/theme/icons' + +return { + --tags + chrome = dir .. '/brave.svg', + code = dir .. '/code-braces.svg', + social = dir .. '/forum.svg', + folder = dir .. '/folder.svg', + music = dir .. '/music.svg', + game = dir .. '/google-controller.svg', + lab = dir .. '/flask.svg', + --others + menu = dir .. '/menu.svg', + close = dir .. '/close.svg', + logout = dir .. '/logout.svg', + sleep = dir .. '/power-sleep.svg', + power = dir .. '/power.svg', + lock = dir .. '/lock.svg', + restart = dir .. '/restart.svg', + search = dir .. '/magnify.svg', + volume = dir .. '/volume-high.svg', + brightness = dir .. '/brightness-7.svg', + chart = dir .. '/chart-areaspline.svg', + memory = dir .. '/memory.svg', + harddisk = dir .. '/harddisk.svg', + thermometer = dir .. '/thermometer.svg', + plus = dir .. '/plus.svg' +} diff --git a/awesome/.config/awesome/theme/icons/layouts/arrow-expand-all.png b/awesome/.config/awesome/theme/icons/layouts/arrow-expand-all.png new file mode 100644 index 000000000..2837ec193 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/layouts/arrow-expand-all.png differ diff --git a/awesome/.config/awesome/theme/icons/layouts/view-quilt.png b/awesome/.config/awesome/theme/icons/layouts/view-quilt.png new file mode 100644 index 000000000..d2e8f5bb8 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/layouts/view-quilt.png differ diff --git a/awesome/.config/awesome/theme/icons/lock.svg b/awesome/.config/awesome/theme/icons/lock.svg new file mode 100644 index 000000000..be008aad4 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/logout.svg b/awesome/.config/awesome/theme/icons/logout.svg new file mode 100644 index 000000000..a21eba98e --- /dev/null +++ b/awesome/.config/awesome/theme/icons/logout.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/magnify.svg b/awesome/.config/awesome/theme/icons/magnify.svg new file mode 100644 index 000000000..bf673469c --- /dev/null +++ b/awesome/.config/awesome/theme/icons/magnify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/memory.svg b/awesome/.config/awesome/theme/icons/memory.svg new file mode 100644 index 000000000..f2ab11c9d --- /dev/null +++ b/awesome/.config/awesome/theme/icons/memory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/menu.svg b/awesome/.config/awesome/theme/icons/menu.svg new file mode 100644 index 000000000..a6c9c254b --- /dev/null +++ b/awesome/.config/awesome/theme/icons/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/music.svg b/awesome/.config/awesome/theme/icons/music.svg new file mode 100644 index 000000000..f9da5f060 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/music.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/plus.svg b/awesome/.config/awesome/theme/icons/plus.svg new file mode 100644 index 000000000..e3b65709f --- /dev/null +++ b/awesome/.config/awesome/theme/icons/plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/power-sleep.svg b/awesome/.config/awesome/theme/icons/power-sleep.svg new file mode 100644 index 000000000..18bb02692 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/power-sleep.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/power.svg b/awesome/.config/awesome/theme/icons/power.svg new file mode 100644 index 000000000..d0bc70031 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/power.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/restart.svg b/awesome/.config/awesome/theme/icons/restart.svg new file mode 100644 index 000000000..4a9877efb --- /dev/null +++ b/awesome/.config/awesome/theme/icons/restart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/ship-wheel.svg b/awesome/.config/awesome/theme/icons/ship-wheel.svg new file mode 100644 index 000000000..dc4ed3e74 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/ship-wheel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/tag-list/occupied.png b/awesome/.config/awesome/theme/icons/tag-list/occupied.png new file mode 100644 index 000000000..e7ccbf0c9 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/occupied.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/panel.png b/awesome/.config/awesome/theme/icons/tag-list/panel.png new file mode 100644 index 000000000..d7699ce59 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/panel.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/selected.png b/awesome/.config/awesome/theme/icons/tag-list/selected.png new file mode 100644 index 000000000..897f960bd Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/selected.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/close.png b/awesome/.config/awesome/theme/icons/tag-list/tag/close.png new file mode 100644 index 000000000..fc93da030 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/close.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/code-braces.png b/awesome/.config/awesome/theme/icons/tag-list/tag/code-braces.png new file mode 100644 index 000000000..c16729c7a Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/code-braces.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/flask.png b/awesome/.config/awesome/theme/icons/tag-list/tag/flask.png new file mode 100644 index 000000000..da0302552 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/flask.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/folder.png b/awesome/.config/awesome/theme/icons/tag-list/tag/folder.png new file mode 100644 index 000000000..f9565effb Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/folder.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/forum.png b/awesome/.config/awesome/theme/icons/tag-list/tag/forum.png new file mode 100644 index 000000000..d06a1975b Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/forum.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/google-chrome.png b/awesome/.config/awesome/theme/icons/tag-list/tag/google-chrome.png new file mode 100644 index 000000000..6f8f589db Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/google-chrome.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/google-controller.png b/awesome/.config/awesome/theme/icons/tag-list/tag/google-controller.png new file mode 100644 index 000000000..3d37722d6 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/google-controller.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/home.png b/awesome/.config/awesome/theme/icons/tag-list/tag/home.png new file mode 100644 index 000000000..d907479b5 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/home.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/tag/music.png b/awesome/.config/awesome/theme/icons/tag-list/tag/music.png new file mode 100644 index 000000000..d2ca843a1 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/tag/music.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/unselected.png b/awesome/.config/awesome/theme/icons/tag-list/unselected.png new file mode 100644 index 000000000..8e5563c90 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/unselected.png differ diff --git a/awesome/.config/awesome/theme/icons/tag-list/urgent.png b/awesome/.config/awesome/theme/icons/tag-list/urgent.png new file mode 100644 index 000000000..d943de1c3 Binary files /dev/null and b/awesome/.config/awesome/theme/icons/tag-list/urgent.png differ diff --git a/awesome/.config/awesome/theme/icons/thermometer.svg b/awesome/.config/awesome/theme/icons/thermometer.svg new file mode 100644 index 000000000..d901827d5 --- /dev/null +++ b/awesome/.config/awesome/theme/icons/thermometer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/icons/volume-high.svg b/awesome/.config/awesome/theme/icons/volume-high.svg new file mode 100644 index 000000000..9bee38d5c --- /dev/null +++ b/awesome/.config/awesome/theme/icons/volume-high.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/awesome/.config/awesome/theme/init.lua b/awesome/.config/awesome/theme/init.lua new file mode 100644 index 000000000..9ec1e5523 --- /dev/null +++ b/awesome/.config/awesome/theme/init.lua @@ -0,0 +1,12 @@ +local gtable = require('gears.table') +local default_theme = require('theme.default-theme') +-- PICK THEME HERE +local theme = require('theme.PapyElGringo-theme') + +local final_theme = {} +gtable.crush(final_theme, default_theme.theme) +gtable.crush(final_theme, theme.theme) +default_theme.awesome_overrides(final_theme) +theme.awesome_overrides(final_theme) + +return final_theme diff --git a/awesome/.config/awesome/theme/mat-colors.lua b/awesome/.config/awesome/theme/mat-colors.lua new file mode 100644 index 000000000..44748f64f --- /dev/null +++ b/awesome/.config/awesome/theme/mat-colors.lua @@ -0,0 +1,317 @@ +return { + -- Red + red = { + hue_50 = '#FFEBEE', + hue_100 = '#FFCDD2', + hue_200 = '#EF9A9A', + hue_300 = '#E57373', + hue_400 = '#EF5350', + hue_500 = '#F44336', + hue_600 = '#E53935', + hue_700 = '#D32F2F', + hue_800 = '#C62828', + hue_900 = '#B71C1C', + hue_A100 = '#FF8A80', + hue_A200 = '#FF5252', + hue_A400 = '#FF1744', + hue_A700 = '#D50000' + }, + -- Pink + pink = { + hue_50 = '#FCE4EC', + hue_100 = '#F8BBD0', + hue_200 = '#F48FB1', + hue_300 = '#F06292', + hue_400 = '#EC407A', + hue_500 = '#E91E63', + hue_600 = '#D81B60', + hue_700 = '#C2185B', + hue_800 = '#AD1457', + hue_900 = '#880E4F', + hue_A100 = '#FF80AB', + hue_A200 = '#FF4081', + hue_A400 = '#F50057', + hue_A700 = '#C51162' + }, + -- Purple + purle = { + hue_50 = '#F3E5F5', + hue_100 = '#E1BEE7', + hue_200 = '#CE93D8', + hue_300 = '#BA68C8', + hue_400 = '#AB47BC', + hue_500 = '#9C27B0', + hue_600 = '#8E24AA', + hue_700 = '#7B1FA2', + hue_800 = '#6A1B9A', + hue_900 = '#4A148C', + hue_A100 = '#EA80FC', + hue_A200 = '#E040FB', + hue_A400 = '#D500F9', + hue_A700 = '#AA00FF' + }, + -- Deep Purple + hue_purple = { + hue_50 = '#EDE7F6', + hue_100 = '#D1C4E9', + hue_200 = '#B39DDB', + hue_300 = '#9575CD', + hue_400 = '#7E57C2', + hue_500 = '#673AB7', + hue_600 = '#5E35B1', + hue_700 = '#512DA8', + hue_800 = '#4527A0', + hue_900 = '#311B92', + hue_A100 = '#B388FF', + hue_A200 = '#7C4DFF', + hue_A400 = '#651FFF', + hue_A700 = '#6200EA' + }, + -- Indigo + indigo = { + hue_50 = '#E8EAF6', + hue_100 = '#C5CAE9', + hue_200 = '#9FA8DA', + hue_300 = '#7986CB', + hue_400 = '#5C6BC0', + hue_500 = '#3F51B5', + hue_600 = '#3949AB', + hue_700 = '#303F9F', + hue_800 = '#283593', + hue_900 = '#1A237E', + hue_A100 = '#8C9EFF', + hue_A200 = '#536DFE', + hue_A400 = '#3D5AFE', + hue_A700 = '#304FFE' + }, + -- Blue + blue = { + hue_50 = '#E3F2FD', + hue_100 = '#BBDEFB', + hue_200 = '#90CAF9', + hue_300 = '#64B5F6', + hue_400 = '#42A5F5', + hue_500 = '#2196F3', + hue_600 = '#1E88E5', + hue_700 = '#1976D2', + hue_800 = '#1565C0', + hue_900 = '#0D47A1', + hue_A100 = '#82B1FF', + hue_A200 = '#448AFF', + hue_A400 = '#2979FF', + hue_A700 = '#2962FF' + }, + -- Light Blue + hue_blue = { + hue_50 = '#E1F5FE', + hue_100 = '#B3E5FC', + hue_200 = '#81D4FA', + hue_300 = '#4FC3F7', + hue_400 = '#29B6F6', + hue_500 = '#03A9F4', + hue_600 = '#039BE5', + hue_700 = '#0288D1', + hue_800 = '#0277BD', + hue_900 = '#01579B', + hue_A100 = '#80D8FF', + hue_A200 = '#40C4FF', + hue_A400 = '#00B0FF', + hue_A700 = '#0091EA' + }, + -- Cyan + cyan = { + hue_50 = '#E0F7FA', + hue_100 = '#B2EBF2', + hue_200 = '#80DEEA', + hue_300 = '#4DD0E1', + hue_400 = '#26C6DA', + hue_500 = '#00BCD4', + hue_600 = '#00ACC1', + hue_700 = '#0097A7', + hue_800 = '#00838F', + hue_900 = '#006064', + hue_A100 = '#84FFFF', + hue_A200 = '#18FFFF', + hue_A400 = '#00E5FF', + hue_A700 = '#00B8D4' + }, + -- Teal + teal = { + hue_50 = '#E0F2F1', + hue_100 = '#B2DFDB', + hue_200 = '#80CBC4', + hue_300 = '#4DB6AC', + hue_400 = '#26A69A', + hue_500 = '#009688', + hue_600 = '#00897B', + hue_700 = '#00796B', + hue_800 = '#00695C', + hue_900 = '#004D40', + hue_A100 = '#A7FFEB', + hue_A200 = '#64FFDA', + hue_A400 = '#1DE9B6', + hue_A700 = '#00BFA5' + }, + -- Green + green = { + hue_50 = '#E8F5E9', + hue_100 = '#C8E6C9', + hue_200 = '#A5D6A7', + hue_300 = '#81C784', + hue_400 = '#66BB6A', + hue_500 = '#4CAF50', + hue_600 = '#43A047', + hue_700 = '#388E3C', + hue_800 = '#2E7D32', + hue_900 = '#1B5E20', + hue_A100 = '#B9F6CA', + hue_A200 = '#69F0AE', + hue_A400 = '#00E676', + hue_A700 = '#00C853' + }, + -- Light Green + hue_green = { + hue_50 = '#F1F8E9', + hue_100 = '#DCEDC8', + hue_200 = '#C5E1A5', + hue_300 = '#AED581', + hue_400 = '#9CCC65', + hue_500 = '#8BC34A', + hue_600 = '#7CB342', + hue_700 = '#689F38', + hue_800 = '#558B2F', + hue_900 = '#33691E', + hue_A100 = '#CCFF90', + hue_A200 = '#B2FF59', + hue_A400 = '#76FF03', + hue_A700 = '#64DD17' + }, + -- Lime + lime = { + hue_50 = '#F9FBE7', + hue_100 = '#F0F4C3', + hue_200 = '#E6EE9C', + hue_300 = '#DCE775', + hue_400 = '#D4E157', + hue_500 = '#CDDC39', + hue_600 = '#C0CA33', + hue_700 = '#AFB42B', + hue_800 = '#9E9D24', + hue_900 = '#827717', + hue_A100 = '#F4FF81', + hue_A200 = '#EEFF41', + hue_A400 = '#C6FF00', + hue_A700 = '#AEEA00' + }, + -- Yellow + yellow = { + hue_50 = '#FFFDE7', + hue_100 = '#FFF9C4', + hue_200 = '#FFF59D', + hue_300 = '#FFF176', + hue_400 = '#FFEE58', + hue_500 = '#FFEB3B', + hue_600 = '#FDD835', + hue_700 = '#FBC02D', + hue_800 = '#F9A825', + hue_900 = '#F57F17', + hue_A100 = '#FFFF8D', + hue_A200 = '#FFFF00', + hue_A400 = '#FFEA00', + hue_A700 = '#FFD600' + }, + -- Amber + amber = { + hue_50 = '#FFF8E1', + hue_100 = '#FFECB3', + hue_200 = '#FFE082', + hue_300 = '#FFD54F', + hue_400 = '#FFCA28', + hue_500 = '#FFC107', + hue_600 = '#FFB300', + hue_700 = '#FFA000', + hue_800 = '#FF8F00', + hue_900 = '#FF6F00', + hue_A100 = '#FFE57F', + hue_A200 = '#FFD740', + hue_A400 = '#FFC400', + hue_A700 = '#FFAB00' + }, + -- Orange + orange = { + hue_50 = '#FFF3E0', + hue_100 = '#FFE0B2', + hue_200 = '#FFCC80', + hue_300 = '#FFB74D', + hue_400 = '#FFA726', + hue_500 = '#FF9800', + hue_600 = '#FB8C00', + hue_700 = '#F57C00', + hue_800 = '#EF6C00', + hue_900 = '#E65100', + hue_A100 = '#FFD180', + hue_A200 = '#FFAB40', + hue_A400 = '#FF9100', + hue_A700 = '#FF6D00' + }, + -- Deep Orange + deep_orange = { + hue_50 = '#FBE9E7', + hue_100 = '#FFCCBC', + hue_200 = '#FFAB91', + hue_300 = '#FF8A65', + hue_400 = '#FF7043', + hue_500 = '#FF5722', + hue_600 = '#F4511E', + hue_700 = '#E64A19', + hue_800 = '#D84315', + hue_900 = '#BF360C', + hue_A100 = '#FF9E80', + hue_A200 = '#FF6E40', + hue_A400 = '#FF3D00', + hue_A700 = '#DD2C00' + }, + -- Brown + brown = { + hue_50 = '#EFEBE9', + hue_100 = '#D7CCC8', + hue_200 = '#BCAAA4', + hue_300 = '#A1887F', + hue_400 = '#8D6E63', + hue_500 = '#795548', + hue_600 = '#6D4C41', + hue_700 = '#5D4037', + hue_800 = '#4E342E', + hue_900 = '#3E2723' + }, + -- Grey + grey = { + hue_50 = '#FAFAFA', + hue_100 = '#F5F5F5', + hue_200 = '#EEEEEE', + hue_300 = '#E0E0E0', + hue_400 = '#BDBDBD', + hue_500 = '#9E9E9E', + hue_600 = '#757575', + hue_700 = '#616161', + hue_800 = '#424242', + hue_900 = '#212121' + }, + -- Blue Grey + blue_grey = { + hue_50 = '#ECEFF1', + hue_100 = '#CFD8DC', + hue_200 = '#B0BEC5', + hue_300 = '#90A4AE', + hue_400 = '#78909C', + hue_500 = '#607D8B', + hue_600 = '#546E7A', + hue_700 = '#455A64', + hue_800 = '#37474F', + hue_900 = '#263238' + }, + -- Black + black = '#000000', + -- White + white = '#FFFFFF' +} diff --git a/awesome/.config/awesome/theme/wallpapers/DarkCyan.png b/awesome/.config/awesome/theme/wallpapers/DarkCyan.png new file mode 100644 index 000000000..d30202dd7 Binary files /dev/null and b/awesome/.config/awesome/theme/wallpapers/DarkCyan.png differ diff --git a/awesome/.config/awesome/widget/README.md b/awesome/.config/awesome/widget/README.md new file mode 100644 index 000000000..323b72bf4 --- /dev/null +++ b/awesome/.config/awesome/widget/README.md @@ -0,0 +1 @@ +## Widget \ No newline at end of file diff --git a/awesome/.config/awesome/widget/battery/icons/battery-10.svg b/awesome/.config/awesome/widget/battery/icons/battery-10.svg new file mode 100644 index 000000000..19cbf1bcf --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-10.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-20.svg b/awesome/.config/awesome/widget/battery/icons/battery-20.svg new file mode 100644 index 000000000..9f439009a --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-20.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-30.svg b/awesome/.config/awesome/widget/battery/icons/battery-30.svg new file mode 100644 index 000000000..7e24035d5 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-30.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-40.svg b/awesome/.config/awesome/widget/battery/icons/battery-40.svg new file mode 100644 index 000000000..6d5f15ac5 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-40.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-50.svg b/awesome/.config/awesome/widget/battery/icons/battery-50.svg new file mode 100644 index 000000000..e2d0db0bb --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-50.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-60.svg b/awesome/.config/awesome/widget/battery/icons/battery-60.svg new file mode 100644 index 000000000..29744798f --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-60.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-70.svg b/awesome/.config/awesome/widget/battery/icons/battery-70.svg new file mode 100644 index 000000000..d0ac91745 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-70.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-80.svg b/awesome/.config/awesome/widget/battery/icons/battery-80.svg new file mode 100644 index 000000000..a046a8f87 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-80.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-90.svg b/awesome/.config/awesome/widget/battery/icons/battery-90.svg new file mode 100644 index 000000000..2a4f44819 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-90.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-alert.svg b/awesome/.config/awesome/widget/battery/icons/battery-alert.svg new file mode 100644 index 000000000..1ff450fad --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-10.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-10.svg new file mode 100644 index 000000000..e5945c16c --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-10.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-100.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-100.svg new file mode 100644 index 000000000..9713fb3db --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-100.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-20.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-20.svg new file mode 100644 index 000000000..a7adc99a8 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-20.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-30.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-30.svg new file mode 100644 index 000000000..612cd6f5d --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-30.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-40.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-40.svg new file mode 100644 index 000000000..f0e3a0daf --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-40.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-50.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-50.svg new file mode 100644 index 000000000..f0e3a0daf --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-50.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-60.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-60.svg new file mode 100644 index 000000000..5cd577a74 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-60.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-70.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-70.svg new file mode 100644 index 000000000..6af3dbe71 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-70.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-80.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-80.svg new file mode 100644 index 000000000..e48879ae6 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-80.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-90.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-90.svg new file mode 100644 index 000000000..a045bb27c --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-90.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging-outline.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging-outline.svg new file mode 100644 index 000000000..4b2c7064d --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-charging.svg b/awesome/.config/awesome/widget/battery/icons/battery-charging.svg new file mode 100644 index 000000000..97e03c516 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-charging.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-minus.svg b/awesome/.config/awesome/widget/battery/icons/battery-minus.svg new file mode 100644 index 000000000..24b4dad6f --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-minus.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-negative.svg b/awesome/.config/awesome/widget/battery/icons/battery-negative.svg new file mode 100644 index 000000000..1c0da8f8a --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-negative.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-outline.svg b/awesome/.config/awesome/widget/battery/icons/battery-outline.svg new file mode 100644 index 000000000..75f5d3898 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-plus.svg b/awesome/.config/awesome/widget/battery/icons/battery-plus.svg new file mode 100644 index 000000000..532224768 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-plus.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-positive.svg b/awesome/.config/awesome/widget/battery/icons/battery-positive.svg new file mode 100644 index 000000000..bdc342c52 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-positive.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-standard.svg b/awesome/.config/awesome/widget/battery/icons/battery-standard.svg new file mode 100644 index 000000000..4e3dd165e --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-standard.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery-unknown.svg b/awesome/.config/awesome/widget/battery/icons/battery-unknown.svg new file mode 100644 index 000000000..8c4626889 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery-unknown.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/icons/battery.svg b/awesome/.config/awesome/widget/battery/icons/battery.svg new file mode 100644 index 000000000..7289a0b01 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/icons/battery.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/battery/init.lua b/awesome/.config/awesome/widget/battery/init.lua new file mode 100644 index 000000000..0c3efde02 --- /dev/null +++ b/awesome/.config/awesome/widget/battery/init.lua @@ -0,0 +1,145 @@ +------------------------------------------------- +-- Battery Widget for Awesome Window Manager +-- Shows the battery status using the ACPI tool +-- More details could be found here: +-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget + +-- @author Pavel Makhov +-- @copyright 2017 Pavel Makhov +------------------------------------------------- + +local awful = require('awful') +local naughty = require('naughty') +local watch = require('awful.widget.watch') +local wibox = require('wibox') +local clickable_container = require('widget.material.clickable-container') +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi + +-- acpi sample outputs +-- Battery 0: Discharging, 75%, 01:51:38 remaining +-- Battery 0: Charging, 53%, 00:57:43 until charged + +local HOME = os.getenv('HOME') +local PATH_TO_ICONS = HOME .. '/.config/awesome/widget/battery/icons/' + +local widget = + wibox.widget { + { + id = 'icon', + widget = wibox.widget.imagebox, + resize = true + }, + layout = wibox.layout.fixed.horizontal +} + +local widget_button = clickable_container(wibox.container.margin(widget, dpi(14), dpi(14), 4, 4)) +widget_button:buttons( + gears.table.join( + awful.button( + {}, + 1, + nil, + function() + awful.spawn('xfce4-power-manager-settings') + end + ) + ) +) +-- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one +local battery_popup = + awful.tooltip( + { + objects = {widget_button}, + mode = 'outside', + align = 'left', + preferred_positions = {'right', 'left', 'top', 'bottom'} + } +) + +-- To use colors from beautiful theme put +-- following lines in rc.lua before require("battery"): +--beautiful.tooltip_fg = beautiful.fg_normal +--beautiful.tooltip_bg = beautiful.bg_normal + +local function show_battery_warning() + naughty.notify { + icon = PATH_TO_ICONS .. 'battery-alert.svg', + icon_size = dpi(48), + text = 'Huston, we have a problem', + title = 'Battery is dying', + timeout = 5, + hover_timeout = 0.5, + position = 'bottom_left', + bg = '#d32f2f', + fg = '#EEE9EF', + width = 248 + } +end + +local last_battery_check = os.time() + +watch( + 'acpi -i', + 1, + function(_, stdout) + local batteryIconName = 'battery' + + local battery_info = {} + local capacities = {} + for s in stdout:gmatch('[^\r\n]+') do + local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?.*') + if status ~= nil then + table.insert(battery_info, {status = status, charge = tonumber(charge_str)}) + else + local cap_str = string.match(s, '.+:.+last full capacity (%d+)') + table.insert(capacities, tonumber(cap_str)) + end + end + + local capacity = 0 + for _, cap in ipairs(capacities) do + capacity = capacity + cap + end + + local charge = 0 + local status + for i, batt in ipairs(battery_info) do + if batt.charge >= charge then + status = batt.status -- use most charged battery status + -- this is arbitrary, and maybe another metric should be used + end + + charge = charge + batt.charge * capacities[i] + end + charge = charge / capacity + + if (charge >= 0 and charge < 15) then + if status ~= 'Charging' and os.difftime(os.time(), last_battery_check) > 300 then + -- if 5 minutes have elapsed since the last warning + last_battery_check = _G.time() + + show_battery_warning() + end + end + + if status == 'Charging' or status == 'Full' then + batteryIconName = batteryIconName .. '-charging' + end + + local roundedCharge = math.floor(charge / 10) * 10 + if (roundedCharge == 0) then + batteryIconName = batteryIconName .. '-outline' + elseif (roundedCharge ~= 100) then + batteryIconName = batteryIconName .. '-' .. roundedCharge + end + + widget.icon:set_image(PATH_TO_ICONS .. batteryIconName .. '.svg') + -- Update popup text + battery_popup.text = string.gsub(stdout, '\n$', '') + collectgarbage('collect') + end, + widget +) + +return widget_button diff --git a/awesome/.config/awesome/widget/bluetooth/icons/bluetooth-off.svg b/awesome/.config/awesome/widget/bluetooth/icons/bluetooth-off.svg new file mode 100644 index 000000000..f3e52ab19 --- /dev/null +++ b/awesome/.config/awesome/widget/bluetooth/icons/bluetooth-off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/bluetooth/icons/bluetooth.svg b/awesome/.config/awesome/widget/bluetooth/icons/bluetooth.svg new file mode 100644 index 000000000..32fbc3e70 --- /dev/null +++ b/awesome/.config/awesome/widget/bluetooth/icons/bluetooth.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/bluetooth/init.lua b/awesome/.config/awesome/widget/bluetooth/init.lua new file mode 100644 index 000000000..2126a4aa9 --- /dev/null +++ b/awesome/.config/awesome/widget/bluetooth/init.lua @@ -0,0 +1 @@ +-- TODO diff --git a/awesome/.config/awesome/widget/brightness/brightness-slider.lua b/awesome/.config/awesome/widget/brightness/brightness-slider.lua new file mode 100644 index 000000000..e67fc8b32 --- /dev/null +++ b/awesome/.config/awesome/widget/brightness/brightness-slider.lua @@ -0,0 +1,49 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_slider = require('widget.material.slider') +local mat_icon_button = require('widget.material.icon-button') +local clickable_container = require('widget.material.clickable-container') +local icons = require('theme.icons') +local watch = require('awful.widget.watch') +local spawn = require('awful.spawn') + +local slider = + wibox.widget { + read_only = false, + widget = mat_slider +} + +slider:connect_signal( + 'property::value', + function() + spawn('xbacklight -set ' .. math.max(slider.value, 5)) + end +) + +watch( + [[bash -c "xbacklight -get"]], + 1, + function(widget, stdout, stderr, exitreason, exitcode) + local brightness = string.match(stdout, '(%d+)') + + slider:set_value(tonumber(brightness)) + collectgarbage('collect') + end +) + +local icon = + wibox.widget { + image = icons.brightness, + widget = wibox.widget.imagebox +} + +local button = mat_icon_button(icon) + +local brightness_setting = + wibox.widget { + button, + slider, + widget = mat_list_item +} + +return brightness_setting diff --git a/awesome/.config/awesome/widget/cpu/cpu-meter.lua b/awesome/.config/awesome/widget/cpu/cpu-meter.lua new file mode 100644 index 000000000..f112e2a66 --- /dev/null +++ b/awesome/.config/awesome/widget/cpu/cpu-meter.lua @@ -0,0 +1,50 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_slider = require('widget.material.slider') +local mat_icon = require('widget.material.icon') +local icons = require('theme.icons') +local watch = require('awful.widget.watch') +local dpi = require('beautiful').xresources.apply_dpi + +local total_prev = 0 +local idle_prev = 0 + +local slider = + wibox.widget { + read_only = true, + widget = mat_slider +} + +watch( + [[bash -c "cat /proc/stat | grep '^cpu '"]], + 1, + function(_, stdout) + local user, nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice = + stdout:match('(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s') + + local total = user + nice + system + idle + iowait + irq + softirq + steal + + local diff_idle = idle - idle_prev + local diff_total = total - total_prev + local diff_usage = (1000 * (diff_total - diff_idle) / diff_total + 5) / 10 + + slider:set_value(diff_usage) + + total_prev = total + idle_prev = idle + collectgarbage('collect') + end +) + +local cpu_meter = + wibox.widget { + wibox.widget { + icon = icons.chart, + size = dpi(24), + widget = mat_icon + }, + slider, + widget = mat_list_item +} + +return cpu_meter diff --git a/awesome/.config/awesome/widget/harddrive/harddrive-meter.lua b/awesome/.config/awesome/widget/harddrive/harddrive-meter.lua new file mode 100644 index 000000000..6ca0f0946 --- /dev/null +++ b/awesome/.config/awesome/widget/harddrive/harddrive-meter.lua @@ -0,0 +1,36 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_slider = require('widget.material.slider') +local mat_icon = require('widget.material.icon') +local icons = require('theme.icons') +local watch = require('awful.widget.watch') +local dpi = require('beautiful').xresources.apply_dpi + +local slider = + wibox.widget { + read_only = true, + widget = mat_slider +} + +watch( + [[bash -c "df -h /home|grep '^/' | awk '{print $5}'"]], + 10, + function(_, stdout) + local space_consumed = stdout:match('(%d+)') + slider:set_value(tonumber(space_consumed)) + collectgarbage('collect') + end +) + +local harddrive_meter = + wibox.widget { + wibox.widget { + icon = icons.harddisk, + size = dpi(24), + widget = mat_icon + }, + slider, + widget = mat_list_item +} + +return harddrive_meter diff --git a/awesome/.config/awesome/widget/material/clickable-container.lua b/awesome/.config/awesome/widget/material/clickable-container.lua new file mode 100644 index 000000000..14b79c71f --- /dev/null +++ b/awesome/.config/awesome/widget/material/clickable-container.lua @@ -0,0 +1,52 @@ +local wibox = require('wibox') + +function build(widget) + local container = + wibox.widget { + widget, + widget = wibox.container.background + } + local old_cursor, old_wibox + + container:connect_signal( + 'mouse::enter', + function() + container.bg = '#ffffff11' + -- Hm, no idea how to get the wibox from this signal's arguments... + local w = _G.mouse.current_wibox + if w then + old_cursor, old_wibox = w.cursor, w + w.cursor = 'hand1' + end + end + ) + + container:connect_signal( + 'mouse::leave', + function() + container.bg = '#ffffff00' + if old_wibox then + old_wibox.cursor = old_cursor + old_wibox = nil + end + end + ) + + container:connect_signal( + 'button::press', + function() + container.bg = '#ffffff22' + end + ) + + container:connect_signal( + 'button::release', + function() + container.bg = '#ffffff11' + end + ) + + return container +end + +return build diff --git a/awesome/.config/awesome/widget/material/icon-button.lua b/awesome/.config/awesome/widget/material/icon-button.lua new file mode 100644 index 000000000..d0c64a872 --- /dev/null +++ b/awesome/.config/awesome/widget/material/icon-button.lua @@ -0,0 +1,29 @@ +local wibox = require('wibox') +local gears = require('gears') +local clickable_container = require('widget.material.clickable-container') +local dpi = require('beautiful').xresources.apply_dpi + +function build(imagebox, args) + -- return wibox.container.margin(container, 6, 6, 6, 6) + return wibox.widget { + wibox.widget { + wibox.widget { + imagebox, + top = dpi(6), + left = dpi(6), + right = dpi(6), + bottom = dpi(6), + widget = wibox.container.margin + }, + shape = gears.shape.circle, + widget = clickable_container + }, + top = dpi(6), + left = dpi(6), + right = dpi(6), + bottom = dpi(6), + widget = wibox.container.margin + } +end + +return build diff --git a/awesome/.config/awesome/widget/material/icon.lua b/awesome/.config/awesome/widget/material/icon.lua new file mode 100644 index 000000000..82ce50fa0 --- /dev/null +++ b/awesome/.config/awesome/widget/material/icon.lua @@ -0,0 +1,80 @@ +-- Default widget requirements +local base = require('wibox.widget.base') +local gtable = require('gears.table') +local setmetatable = setmetatable + +-- Commons requirements +local wibox = require('wibox') + +-- Local declarations + +local mat_list_item = {mt = {}} + +function mat_list_item:layout(_, width, height) + local layout = {} + + -- Add divider if present + if self._private.icon then + table.insert( + layout, + base.place_widget_at( + self._private.imagebox, + width / 2 - self._private.size / 2, + height / 2 - self._private.size / 2, + self._private.size, + self._private.size + ) + ) + end + return layout +end + +function mat_list_item:fit(_, width, height) + local min = math.min(width, height) + return min, min +end + +function mat_list_item:set_icon(icon) + self._private.icon = icon + self._private.imagebox.image = icon +end + +function mat_list_item:get_icon() + return self._private.icon +end + +function mat_list_item:set_size(size) + self._private.size = size + self:emit_signal('widget::layout_changed') +end + +function mat_list_item:get_size() + return self._private.size +end + +local function new(icon, size) + local ret = + base.make_widget( + nil, + nil, + { + enable_properties = true + } + ) + + gtable.crush(ret, mat_list_item, true) + ret._private.icon = icon + ret._private.imagebox = wibox.widget.imagebox(icon) + ret._private.size = size + return ret +end + +function mat_list_item.mt:__call(...) + return new(...) +end + +--@DOC_widget_COMMON@ + +--@DOC_object_COMMON@ + +return setmetatable(mat_list_item, mat_list_item.mt) diff --git a/awesome/.config/awesome/widget/material/list-item.lua b/awesome/.config/awesome/widget/material/list-item.lua new file mode 100644 index 000000000..616ce6806 --- /dev/null +++ b/awesome/.config/awesome/widget/material/list-item.lua @@ -0,0 +1,191 @@ +-- Default widget requirements +local base = require('wibox.widget.base') +local gtable = require('gears.table') +local setmetatable = setmetatable +local dpi = require('beautiful').xresources.apply_dpi + +-- Commons requirements +local wibox = require('wibox') +local clickable_container = require('widget.material.clickable-container') +-- Local declarations + +local mat_list_item = {mt = {}} + +function mat_list_item:build_separator() + self._private.separator = + wibox.widget { + orientation = 'horizontal', + forced_height = 1, + opacity = 0.08, + widget = wibox.widget.separator + } + self:emit_signal('widget::layout_changed') +end + +function mat_list_item:build_clickable_container() + self._private.clickable_container = + wibox.widget { + wibox.widget { + widget = wibox.widget.textbox + }, + widget = clickable_container + } + self:emit_signal('widget::layout_changed') +end + +function mat_list_item:layout(_, width, height) + local content_width = width - dpi(32) + local content_x = dpi(dpi(16)) + local layout = {} + + -- Add divider if present + if self._private.divider then + table.insert(layout, base.place_widget_at(self._private.separator, 0, 0, width, 1)) + end + + -- Add clickable_container if clickable + if self._private.clickable then + table.insert(layout, base.place_widget_at(self._private.clickable_container, 0, 0, width, height)) + end + + if self._private.prefix then + content_x = content_x + dpi(54) + content_width = content_width - dpi(54) + table.insert(layout, base.place_widget_at(self._private.prefix, dpi(16), 0, dpi(48), height)) + end + + if self._private.suffix then + content_width = content_width - dpi(54) + table.insert(layout, base.place_widget_at(self._private.suffix, width - dpi(40), dpi(12), width, height)) + end + table.insert(layout, base.place_widget_at(self._private.content, content_x, 0, content_width, height)) + return layout +end + +function mat_list_item:fit(_, width) + return width, dpi(48) +end + +---- Properties ---- + +-- Property clickable +function mat_list_item:set_clickable(value) + if self._private.clickable ~= value then + self._private.clickable = value + self:emit_signal('property::clickable') + self:emit_signal('widget::layout_changed') + + if self._private.clickable and not self._private.clickable_container then + self:build_clickable_container() + end + end +end + +function mat_list_item:get_clickable() + return self._private.clickable +end + +-- Property divider + +function mat_list_item:set_divider(value) + if self._private.divider ~= value then + self._private.divider = value + self:emit_signal('property::divider') + self:emit_signal('widget::layout_changed') + + if self._private.divider and not self._private.separator then + self:build_separator() + end + end +end + +function mat_list_item:get_divider() + return self._private.divider +end + +function mat_list_item:set_prefix(widget) + if widget then + base.check_widget(widget) + end + self._private.prefix = widget + self:emit_signal('widget::layout_changed') +end + +function mat_list_item:get_prefix() + return self._private.prefix +end + +function mat_list_item:set_suffix(widget) + if widget then + base.check_widget(widget) + end + self._private.suffix = widget + self:emit_signal('widget::layout_changed') +end + +function mat_list_item:get_suffix() + return self._private.suffix +end + +--- The widget who will be the content. +-- @property content +-- @tparam widget widget The widget + +function mat_list_item:set_content(widget) + if widget then + base.check_widget(widget) + end + self._private.content = widget + self:emit_signal('widget::layout_changed') +end + +function mat_list_item:get_content() + return self._private.content +end + +-- Get the number of children element +-- @treturn table The children +function mat_list_item:get_children() + return {self._private.widget} +end + +-- Replace the layout children +-- This layout only accept one children, all others will be ignored +-- @tparam table children A table composed of valid widgets +function mat_list_item:set_children(children) + if not children[2] then + self:set_content(children[1]) + else + self:set_prefix(children[1]) + self:set_content(children[2]) + end + if children[3] then + self:set_suffix(children[3]) + end +end + +local function new(widget) + local ret = + base.make_widget( + nil, + nil, + { + enable_properties = true + } + ) + + gtable.crush(ret, mat_list_item, true) + + ret._private.content = widget + return ret +end + +function mat_list_item.mt:__call(...) + return new(...) +end + +--@DOC_widget_COMMON@ + +--@DOC_object_COMMON@ + +return setmetatable(mat_list_item, mat_list_item.mt) diff --git a/awesome/.config/awesome/widget/material/slider.lua b/awesome/.config/awesome/widget/material/slider.lua new file mode 100644 index 000000000..7e71d8482 --- /dev/null +++ b/awesome/.config/awesome/widget/material/slider.lua @@ -0,0 +1,125 @@ +-- Default widget requirements +local base = require('wibox.widget.base') +local gtable = require('gears.table') +local setmetatable = setmetatable +local dpi = require('beautiful').xresources.apply_dpi + +-- Commons requirements +local wibox = require('wibox') +local gears = require('gears') +local beautiful = require('beautiful') +local mat_colors = require('theme.mat-colors') +-- Local declarations + +local mat_slider = {mt = {}} + +local properties = { + read_only = false +} + +function mat_slider:set_value(value) + if self._private.value ~= value then + self._private.value = value + self._private.progress_bar:set_value(self._private.value) + self._private.slider:set_value(self._private.value) + self:emit_signal('property::value') + --self:emit_signal('widget::layout_changed') + end +end + +function mat_slider:get_value(value) + return self._private.value +end + +function mat_slider:set_read_only(value) + if self._private.read_only ~= value then + self._private.read_only = value + self:emit_signal('property::read_only') + self:emit_signal('widget::layout_changed') + end +end + +function mat_slider:get_read_only(value) + return self._private.read_only +end + +function mat_slider:layout(_, width, height) + local layout = {} + table.insert(layout, base.place_widget_at(self._private.progress_bar, 0, dpi(21), width, height - dpi(42))) + if (not self._private.read_only) then + table.insert(layout, base.place_widget_at(self._private.slider, 0, dpi(6), width, height - dpi(12))) + end + return layout +end + +function mat_slider:draw(_, cr, width, height) + if (self._private.read_only) then + self._private.slider.forced_height = 0 + end +end + +function mat_slider:fit(_, width, height) + return width, height +end + +local function new(args) + local ret = + base.make_widget( + nil, + nil, + { + enable_properties = true + } + ) + + gtable.crush(ret._private, args or {}) + + gtable.crush(ret, mat_slider, true) + + ret._private.progress_bar = + wibox.widget { + max_value = 100, + value = 25, + forced_height = dpi(6), + paddings = 0, + shape = gears.shape.rounded_rect, + background_color = beautiful.background.hue_800, + color = beautiful.primary.hue_500, + widget = wibox.widget.progressbar + } + + ret._private.slider = + wibox.widget { + forced_height = dpi(8), + bar_shape = gears.shape.rounded_rect, + bar_height = 0, + bar_color = beautiful.primary.hue_500, + handle_color = beautiful.primary.hue_300, + handle_shape = gears.shape.circle, + handle_border_color = '#00000012', + handle_border_width = dpi(3), + value = 25, + widget = wibox.widget.slider + } + + ret._private.slider:connect_signal( + 'property::value', + function() + ret:set_value(ret._private.slider.value) + end + ) + + ret._private.read_only = false + + return ret +end + +function mat_slider.mt:__call(...) + return new(...) +end + +--@DOC_widget_COMMON@ + +--@DOC_object_COMMON@ + +return setmetatable(mat_slider, mat_slider.mt) diff --git a/awesome/.config/awesome/widget/package-updater/icons/package-up.svg b/awesome/.config/awesome/widget/package-updater/icons/package-up.svg new file mode 100644 index 000000000..0d6ac4c31 --- /dev/null +++ b/awesome/.config/awesome/widget/package-updater/icons/package-up.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/package-updater/icons/package.svg b/awesome/.config/awesome/widget/package-updater/icons/package.svg new file mode 100644 index 000000000..aaa79af8c --- /dev/null +++ b/awesome/.config/awesome/widget/package-updater/icons/package.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/package-updater/init.lua b/awesome/.config/awesome/widget/package-updater/init.lua new file mode 100644 index 000000000..bbfe686f1 --- /dev/null +++ b/awesome/.config/awesome/widget/package-updater/init.lua @@ -0,0 +1,112 @@ +------------------------------------------------- +-- Battery Widget for Awesome Window Manager +-- Shows the battery status using the ACPI tool +-- More details could be found here: +-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget + +-- @author Pavel Makhov +-- @copyright 2017 Pavel Makhov +------------------------------------------------- + +local awful = require('awful') +local naughty = require('naughty') +local watch = require('awful.widget.watch') +local wibox = require('wibox') +local clickable_container = require('widget.material.clickable-container') +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi + +-- acpi sample outputs +-- Battery 0: Discharging, 75%, 01:51:38 remaining +-- Battery 0: Charging, 53%, 00:57:43 until charged + +local HOME = os.getenv('HOME') +local PATH_TO_ICONS = HOME .. '/.config/awesome/widget/package-updater/icons/' +local updateAvailable = false +local numOfUpdatesAvailable + +local widget = + wibox.widget { + { + id = 'icon', + widget = wibox.widget.imagebox, + resize = true + }, + layout = wibox.layout.align.horizontal +} + +local widget_button = clickable_container(wibox.container.margin(widget, dpi(14), dpi(14), dpi(4), dpi(4))) +widget_button:buttons( + gears.table.join( + awful.button( + {}, + 1, + nil, + function() + if updateAvailable then + awful.spawn('pamac-manager --updates') + else + awful.spawn('pamac-manager') + end + end + ) + ) +) +-- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one +awful.tooltip( + { + objects = {widget_button}, + mode = 'outside', + align = 'right', + timer_function = function() + if updateAvailable then + return numOfUpdatesAvailable .. ' updates are available' + else + return 'We are up-to-date!' + end + end, + preferred_positions = {'right', 'left', 'top', 'bottom'} + } +) + +-- To use colors from beautiful theme put +-- following lines in rc.lua before require("battery"): +--beautiful.tooltip_fg = beautiful.fg_normal +--beautiful.tooltip_bg = beautiful.bg_normal + +local function show_battery_warning() + naughty.notify { + icon = PATH_TO_ICONS .. 'battery-alert.svg', + icon_size = dpi(48), + text = 'Huston, we have a problem', + title = 'Battery is dying', + timeout = 5, + hover_timeout = 0.5, + position = 'bottom_left', + bg = '#d32f2f', + fg = '#EEE9EF', + width = 248 + } +end + +local last_battery_check = os.time() +watch( + 'pamac checkupdates', + 60, + function(_, stdout) + numOfUpdatesAvailable = tonumber(stdout:match('.-\n'):match('%d*')) + local widgetIconName + if (numOfUpdatesAvailable ~= nil) then + updateAvailable = true + widgetIconName = 'package-up' + else + updateAvailable = false + widgetIconName = 'package' + end + widget.icon:set_image(PATH_TO_ICONS .. widgetIconName .. '.svg') + collectgarbage('collect') + end, + widget +) + +return widget_button diff --git a/awesome/.config/awesome/widget/ram/ram-meter.lua b/awesome/.config/awesome/widget/ram/ram-meter.lua new file mode 100644 index 000000000..970e185f0 --- /dev/null +++ b/awesome/.config/awesome/widget/ram/ram-meter.lua @@ -0,0 +1,37 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_slider = require('widget.material.slider') +local mat_icon = require('widget.material.icon') +local icons = require('theme.icons') +local watch = require('awful.widget.watch') +local dpi = require('beautiful').xresources.apply_dpi + +local slider = + wibox.widget { + read_only = true, + widget = mat_slider +} + +watch( + 'bash -c "free | grep -z Mem.*Swap.*"', + 1, + function(_, stdout) + local total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap = + stdout:match('(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*Swap:%s*(%d+)%s*(%d+)%s*(%d+)') + slider:set_value(used / total * 100) + collectgarbage('collect') + end +) + +local ram_meter = + wibox.widget { + wibox.widget { + icon = icons.memory, + size = dpi(24), + widget = mat_icon + }, + slider, + widget = mat_list_item +} + +return ram_meter diff --git a/awesome/.config/awesome/widget/tag-list.lua b/awesome/.config/awesome/widget/tag-list.lua new file mode 100644 index 000000000..6891eb8a6 --- /dev/null +++ b/awesome/.config/awesome/widget/tag-list.lua @@ -0,0 +1,163 @@ +local awful = require('awful') +local wibox = require('wibox') +local dpi = require('beautiful').xresources.apply_dpi +local capi = {button = _G.button} +local clickable_container = require('widget.material.clickable-container') +local modkey = require('configuration.keys.mod').modKey +--- Common method to create buttons. +-- @tab buttons +-- @param object +-- @treturn table +local function create_buttons(buttons, object) + if buttons then + local btns = {} + for _, b in ipairs(buttons) do + -- Create a proxy button object: it will receive the real + -- press and release events, and will propagate them to the + -- button object the user provided, but with the object as + -- argument. + local btn = capi.button {modifiers = b.modifiers, button = b.button} + btn:connect_signal( + 'press', + function() + b:emit_signal('press', object) + end + ) + btn:connect_signal( + 'release', + function() + b:emit_signal('release', object) + end + ) + btns[#btns + 1] = btn + end + + return btns + end +end + +local function list_update(w, buttons, label, data, objects) + -- update the widgets, creating them if needed + w:reset() + for i, o in ipairs(objects) do + local cache = data[o] + local ib, tb, bgb, tbm, ibm, l, bg_clickable + if cache then + ib = cache.ib + tb = cache.tb + bgb = cache.bgb + tbm = cache.tbm + ibm = cache.ibm + else + ib = wibox.widget.imagebox() + tb = wibox.widget.textbox() + bgb = wibox.container.background() + tbm = wibox.container.margin(tb, dpi(4), dpi(16)) + ibm = wibox.container.margin(ib, dpi(12), dpi(12), dpi(12), dpi(12)) + l = wibox.layout.fixed.horizontal() + bg_clickable = clickable_container() + + -- All of this is added in a fixed widget + l:fill_space(true) + l:add(ibm) + -- l:add(tbm) + bg_clickable:set_widget(l) + + -- And all of this gets a background + bgb:set_widget(bg_clickable) + + bgb:buttons(create_buttons(buttons, o)) + + data[o] = { + ib = ib, + tb = tb, + bgb = bgb, + tbm = tbm, + ibm = ibm + } + end + + local text, bg, bg_image, icon, args = label(o, tb) + args = args or {} + + -- The text might be invalid, so use pcall. + if text == nil or text == '' then + tbm:set_margins(0) + else + if not tb:set_markup_silently(text) then + tb:set_markup('<Invalid text>') + end + end + bgb:set_bg(bg) + if type(bg_image) == 'function' then + -- TODO: Why does this pass nil as an argument? + bg_image = bg_image(tb, o, nil, objects, i) + end + bgb:set_bgimage(bg_image) + if icon then + ib.image = icon + else + ibm:set_margins(0) + end + + bgb.shape = args.shape + bgb.shape_border_width = args.shape_border_width + bgb.shape_border_color = args.shape_border_color + + w:add(bgb) + end +end + +local TagList = function(s) + return awful.widget.taglist( + s, + awful.widget.taglist.filter.all, + awful.util.table.join( + awful.button( + {}, + 1, + function(t) + t:view_only() + end + ), + awful.button( + {modkey}, + 1, + function(t) + if _G.client.focus then + _G.client.focus:move_to_tag(t) + t:view_only() + end + end + ), + awful.button({}, 3, awful.tag.viewtoggle), + awful.button( + {modkey}, + 3, + function(t) + if _G.client.focus then + _G.client.focus:toggle_tag(t) + end + end + ), + awful.button( + {}, + 4, + function(t) + awful.tag.viewprev(t.screen) + end + ), + awful.button( + {}, + 5, + function(t) + awful.tag.viewnext(t.screen) + end + ) + ), + {}, + list_update, + wibox.layout.fixed.vertical() + ) +end +return TagList diff --git a/awesome/.config/awesome/widget/task-list.lua b/awesome/.config/awesome/widget/task-list.lua new file mode 100644 index 000000000..23e6012c4 --- /dev/null +++ b/awesome/.config/awesome/widget/task-list.lua @@ -0,0 +1,212 @@ +local awful = require('awful') +local wibox = require('wibox') +local dpi = require('beautiful').xresources.apply_dpi +local capi = {button = _G.button} +local gears = require('gears') +local clickable_container = require('widget.material.clickable-container') +--- Common method to create buttons. +-- @tab buttons +-- @param object +-- @treturn table +local function create_buttons(buttons, object) + if buttons then + local btns = {} + for _, b in ipairs(buttons) do + -- Create a proxy button object: it will receive the real + -- press and release events, and will propagate them to the + -- button object the user provided, but with the object as + -- argument. + local btn = capi.button {modifiers = b.modifiers, button = b.button} + btn:connect_signal( + 'press', + function() + b:emit_signal('press', object) + end + ) + btn:connect_signal( + 'release', + function() + b:emit_signal('release', object) + end + ) + btns[#btns + 1] = btn + end + + return btns + end +end + +local function list_update(w, buttons, label, data, objects) + -- update the widgets, creating them if needed + w:reset() + for i, o in ipairs(objects) do + local cache = data[o] + local ib, cb, tb, cbm, bgb, tbm, ibm, tt, l, ll, bg_clickable + if cache then + ib = cache.ib + tb = cache.tb + bgb = cache.bgb + tbm = cache.tbm + ibm = cache.ibm + tt = cache.tt + else + ib = wibox.widget.imagebox() + tb = wibox.widget.textbox() + cb = + clickable_container( + wibox.container.margin( + wibox.widget.imagebox(os.getenv('HOME') .. '/.config/awesome/theme/icons/tag-list/tag/close.png'), + 4, + 4, + 4, + 4 + ) + ) + cb.shape = gears.shape.circle + cbm = wibox.container.margin(cb, dpi(4), dpi(8), dpi(12), dpi(12)) + cbm:buttons( + gears.table.join( + awful.button( + {}, + 1, + nil, + function() + o.kill(o) + end + ) + ) + ) + bg_clickable = clickable_container() + bgb = wibox.container.background() + tbm = wibox.container.margin(tb, dpi(4), dpi(4)) + ibm = wibox.container.margin(ib, dpi(12), dpi(12), dpi(12), dpi(12)) + l = wibox.layout.fixed.horizontal() + ll = wibox.layout.fixed.horizontal() + + -- All of this is added in a fixed widget + l:fill_space(true) + l:add(ibm) + l:add(tbm) + ll:add(l) + ll:add(cbm) + + bg_clickable:set_widget(ll) + -- And all of this gets a background + bgb:set_widget(bg_clickable) + + l:buttons(create_buttons(buttons, o)) + + -- Tooltip to display whole title, if it was truncated + tt = awful.tooltip({ + objects = {tb}, + mode = 'outside', + align = 'bottom', + delay_show = 1, + }) + + data[o] = { + ib = ib, + tb = tb, + bgb = bgb, + tbm = tbm, + ibm = ibm, + tt = tt + } + end + + local text, bg, bg_image, icon, args = label(o, tb) + args = args or {} + + -- The text might be invalid, so use pcall. + if text == nil or text == '' then + tbm:set_margins(0) + else + -- truncate when title is too long + local textOnly = text:match('>(.-)<') + if (textOnly:len() > 24) then + text = text:gsub('>(.-)<', '>' .. textOnly:sub(1, 21) .. '...<') + tt:set_text(textOnly) + tt:add_to_object(tb) + else + tt:remove_from_object(tb) + end + if not tb:set_markup_silently(text) then + tb:set_markup('<Invalid text>') + end + end + bgb:set_bg(bg) + if type(bg_image) == 'function' then + -- TODO: Why does this pass nil as an argument? + bg_image = bg_image(tb, o, nil, objects, i) + end + bgb:set_bgimage(bg_image) + if icon then + ib.image = icon + else + ibm:set_margins(0) + end + + bgb.shape = args.shape + bgb.shape_border_width = args.shape_border_width + bgb.shape_border_color = args.shape_border_color + + w:add(bgb) + end +end +local tasklist_buttons = + awful.util.table.join( + awful.button( + {}, + 1, + function(c) + if c == _G.client.focus then + c.minimized = true + else + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() and c.first_tag then + c.first_tag:view_only() + end + -- This will also un-minimize + -- the client, if needed + _G.client.focus = c + c:raise() + end + end + ), + awful.button( + {}, + 2, + function(c) + c.kill(c) + end + ), + awful.button( + {}, + 4, + function() + awful.client.focus.byidx(1) + end + ), + awful.button( + {}, + 5, + function() + awful.client.focus.byidx(-1) + end + ) +) + +local TaskList = function(s) + return awful.widget.tasklist( + s, + awful.widget.tasklist.filter.currenttags, + tasklist_buttons, + {}, + list_update, + wibox.layout.fixed.horizontal() + ) +end + +return TaskList diff --git a/awesome/.config/awesome/widget/temperature/temperature-meter.lua b/awesome/.config/awesome/widget/temperature/temperature-meter.lua new file mode 100644 index 000000000..52162c262 --- /dev/null +++ b/awesome/.config/awesome/widget/temperature/temperature-meter.lua @@ -0,0 +1,37 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_slider = require('widget.material.slider') +local mat_icon = require('widget.material.icon') +local icons = require('theme.icons') +local watch = require('awful.widget.watch') +local dpi = require('beautiful').xresources.apply_dpi + +local slider = + wibox.widget { + read_only = true, + widget = mat_slider +} + +local max_temp = 80 +watch( + 'bash -c "cat /sys/class/thermal/thermal_zone0/temp"', + 1, + function(_, stdout) + local temp = stdout:match('(%d+)') + slider:set_value((temp / 1000) / max_temp * 100) + collectgarbage('collect') + end +) + +local temperature_meter = + wibox.widget { + wibox.widget { + icon = icons.thermometer, + size = dpi(24), + widget = mat_icon + }, + slider, + widget = mat_list_item +} + +return temperature_meter diff --git a/awesome/.config/awesome/widget/volume/volume-slider.lua b/awesome/.config/awesome/widget/volume/volume-slider.lua new file mode 100644 index 000000000..704278068 --- /dev/null +++ b/awesome/.config/awesome/widget/volume/volume-slider.lua @@ -0,0 +1,48 @@ +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local mat_slider = require('widget.material.slider') +local mat_icon_button = require('widget.material.icon-button') +local icons = require('theme.icons') +local watch = require('awful.widget.watch') +local spawn = require('awful.spawn') + +local slider = + wibox.widget { + read_only = false, + widget = mat_slider +} + +slider:connect_signal( + 'property::value', + function() + spawn('amixer -D pulse sset Master ' .. slider.value .. '%') + end +) + +watch( + [[bash -c "amixer -D pulse sget Master"]], + 1, + function(_, stdout) + local mute = string.match(stdout, '%[(o%D%D?)%]') + local volume = string.match(stdout, '(%d?%d?%d)%%') + slider:set_value(tonumber(volume)) + collectgarbage('collect') + end +) + +local icon = + wibox.widget { + image = icons.volume, + widget = wibox.widget.imagebox +} + +local button = mat_icon_button(icon) + +local volume_setting = + wibox.widget { + button, + slider, + widget = mat_list_item +} + +return volume_setting diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-off.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-off.svg new file mode 100644 index 000000000..dbcbc7a82 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1-alert.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1-alert.svg new file mode 100644 index 000000000..0864095f1 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1-lock.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1-lock.svg new file mode 100644 index 000000000..39302089f --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1.svg new file mode 100644 index 000000000..e6f582d18 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2-alert.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2-alert.svg new file mode 100644 index 000000000..bc112f524 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2-lock.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2-lock.svg new file mode 100644 index 000000000..9bfd2301e --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2.svg new file mode 100644 index 000000000..4934b1705 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3-alert.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3-alert.svg new file mode 100644 index 000000000..0ffe697b9 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3-lock.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3-lock.svg new file mode 100644 index 000000000..d84dc47c0 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3.svg new file mode 100644 index 000000000..85e2ef1bc --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-3.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4-alert.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4-alert.svg new file mode 100644 index 000000000..1eabecc77 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4-lock.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4-lock.svg new file mode 100644 index 000000000..f01ec4db1 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4.svg new file mode 100644 index 000000000..700229a9e --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-4.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-alert-outline.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-alert-outline.svg new file mode 100644 index 000000000..0f469283b --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-alert-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-lock-outline.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-lock-outline.svg new file mode 100644 index 000000000..3edc63601 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-lock-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-off-outline.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-off-outline.svg new file mode 100644 index 000000000..b297a3ddf --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-off-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-off.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-off.svg new file mode 100644 index 000000000..6be11e04d --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi-strength-outline.svg b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-outline.svg new file mode 100644 index 000000000..00fcd2614 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi-strength-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/icons/wifi.svg b/awesome/.config/awesome/widget/wifi/icons/wifi.svg new file mode 100644 index 000000000..78878680a --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/icons/wifi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/awesome/.config/awesome/widget/wifi/init.lua b/awesome/.config/awesome/widget/wifi/init.lua new file mode 100644 index 000000000..752428ba9 --- /dev/null +++ b/awesome/.config/awesome/widget/wifi/init.lua @@ -0,0 +1,115 @@ +------------------------------------------------- +-- Battery Widget for Awesome Window Manager +-- Shows the battery status using the ACPI tool +-- More details could be found here: +-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget + +-- @author Pavel Makhov +-- @copyright 2017 Pavel Makhov +------------------------------------------------- + +local awful = require('awful') +local watch = require('awful.widget.watch') +local wibox = require('wibox') +local clickable_container = require('widget.material.clickable-container') +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi + +-- acpi sample outputs +-- Battery 0: Discharging, 75%, 01:51:38 remaining +-- Battery 0: Charging, 53%, 00:57:43 until charged + +local HOME = os.getenv('HOME') +local PATH_TO_ICONS = HOME .. '/.config/awesome/widget/wifi/icons/' +local interface = 'wlp3s0' +local connected = false +local essid = 'N/A' + +local widget = + wibox.widget { + { + id = 'icon', + widget = wibox.widget.imagebox, + resize = true + }, + layout = wibox.layout.align.horizontal +} + +local widget_button = clickable_container(wibox.container.margin(widget, dpi(14), dpi(14), dpi(4), dpi(4))) +widget_button:buttons( + gears.table.join( + awful.button( + {}, + 1, + nil, + function() + awful.spawn('wicd-client -n') + end + ) + ) +) +-- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one +awful.tooltip( + { + objects = {widget_button}, + mode = 'outside', + align = 'right', + timer_function = function() + if connected then + return 'Connected to ' .. essid + else + return 'Wireless network is disconnected' + end + end, + preferred_positions = {'right', 'left', 'top', 'bottom'}, + margin_leftright = dpi(8), + margin_topbottom = dpi(8) + } +) + +local function grabText() + if connected then + awful.spawn.easy_async( + 'iw dev ' .. interface .. ' link', + function(stdout) + essid = stdout:match('SSID:(.-)\n') + if (essid == nil) then + essid = 'N/A' + end + end + ) + end +end + +watch( + "awk 'NR==3 {printf \"%3.0f\" ,($3/70)*100}' /proc/net/wireless", + 5, + function(_, stdout) + local widgetIconName = 'wifi-strength' + local wifi_strength = tonumber(stdout) + if (wifi_strength ~= nil) then + connected = true + -- Update popup text + local wifi_strength_rounded = math.floor(wifi_strength / 25 + 0.5) + widgetIconName = widgetIconName .. '-' .. wifi_strength_rounded + widget.icon:set_image(PATH_TO_ICONS .. widgetIconName .. '.svg') + else + connected = false + widget.icon:set_image(PATH_TO_ICONS .. widgetIconName .. '-off' .. '.svg') + end + if (connected and (essid == 'N/A' or essid == nil)) then + grabText() + end + collectgarbage('collect') + end, + widget +) + +widget:connect_signal( + 'mouse::enter', + function() + grabText() + end +) + +return widget_button