commit 995ecbb5bfacfb73ffeb853f53903d84cd3e67c8 Author: purhan Date: Fri Aug 28 22:50:04 2020 +0530 refactor diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c128092 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 purhan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..034ead4 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# Gallery + +### Awesome + +|Lucid|Werewolf|Redhound| +|-|-|-| +|![Lucid](https://gist.githubusercontent.com/Purhan/56da0def1de841ec07b65137f8cd587c/raw/8e0942bcd9bc35ab4af169dbce51bc9de80c2949/lucid.png)|![Werewolf](https://gist.githubusercontent.com/Purhan/56da0def1de841ec07b65137f8cd587c/raw/8e0942bcd9bc35ab4af169dbce51bc9de80c2949/werewolf.png)|![Redhound](https://gist.githubusercontent.com/Purhan/56da0def1de841ec07b65137f8cd587c/raw/8e0942bcd9bc35ab4af169dbce51bc9de80c2949/redhound.png)| + +# Usage + +First, clone this repository: +Since I use the same repository to host a number of things across different +branches, it can become quite large. Download only the relevant branch: + +```bash +git clone -b old --single-branch --depth=1 https://github.com/purhan/dotfiles +``` + +Select your favourite window manager and follow the guide for it given below. + +### Awesome + +- Install the following packages: + - [Awesome window manager](https://github.com/awesomeWM/awesome) (Required): + The window manager itself. + - [Picom/Compton](https://github.com/yshui/picom) (Optional): A compositor to + avoid screen tearing. + - [Nitrogen](https://github.com/l3ib/nitrogen) (Optional): To setup the wallpaper + - [Rofi](https://github.com/davatorium/rofi) (Optional): A Dmenu replacement (to + launch your applications). + +- Create a backup of your old configuration (if it exists). + +- Choose your favourite setup from the [gallery](#gallery). Copy the contents + of `$REPO/src/.config/awesome//` to your config directory (`~/.config/awesome/`) + +- Go through `~/.config/awesome/configuration/apps.lua` and replace the default apps + with the ones you use. + +- Go through `~/.config/awesome/theme/` and replace the fonts with your favourite ones, or + install the ones already listed. + +- [Optional] Copy `$REPO/src/.config/compton.conf` and `$REPO/src/.config/rofi/` to your + `~/.config` directory. + +- [Optional] Launch `nitrogen` and select your favourite wallpaper. The configurations run + `nitrogen --restore` to setup the wallpaper on startup. diff --git a/src/.config/awesome/lucid/configuration/apps.lua b/src/.config/awesome/lucid/configuration/apps.lua new file mode 100644 index 0000000..4e28785 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/apps.lua @@ -0,0 +1,39 @@ +local filesystem = require('gears.filesystem') +local beautiful = require('beautiful') + +-- 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 -show drun -display-drun -run-command "/bin/bash -c -i \'shopt -s expand_aliases; {cmd}\'"' + +return { + -- List of apps to start by default on some actions + default = { + terminal = 'kitty', + rofi = rofi_command, + lock = 'i3lock-fancy', + splash = 'kitty -T SplashTerminal -o background_opacity=0.95', + power_command = '~/.config/awesome/configuration/utils/rofi-power', + screenshot = '~/.config/awesome/configuration/utils/screenshot -m', + region_screenshot = '~/.config/awesome/configuration/utils/screenshot -r', + delayed_screenshot = '~/.config/awesome/configuration/utils/screenshot --delayed -r', + browser = 'env firefox', + editor = 'gvim', + social = 'env discord', + files = 'nautilus', + power_manager = 'gnome-power-statistics' + }, + -- List of commands to start once on start-up + run_on_start_up = { + '~/.config/awesome/configuration/awspawn', + 'compton', + 'nm-applet --indicator', + 'nitrogen --restore', + 'ibus-daemon --xim --daemonize', + 'scream-start', + 'numlockx on', + '/usr/lib/xfce-polkit/xfce-polkit & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager + 'blueman-tray' + } +} + diff --git a/src/.config/awesome/lucid/configuration/autostart b/src/.config/awesome/lucid/configuration/autostart new file mode 100755 index 0000000..be2130f --- /dev/null +++ b/src/.config/awesome/lucid/configuration/autostart @@ -0,0 +1,53 @@ +#!/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 +# the script $HOME/.config/awesomestart +# is intended to be a copy of this file +# to allow out of tree autostart programs +APPS=( + # keepassxc + # kdeconnect-indicator + radeon-profile + $HOME/.config/awesomestart + ) +# Some applications start child applications that need to be killed on reload +KILL=( + synergyc + nextcloud + ) +# Some applications need to be started without GUI +SILENT=( + gnome-clocks + ) + +#Kill the polkit +killall xfce-polkit + +# 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 + +# Run silent apps +Xvfb :99 & +for silentapp in "${SILENT[@]}" +do + DISPLAY=:99 $silentapp & +done diff --git a/src/.config/awesome/lucid/configuration/client/buttons.lua b/src/.config/awesome/lucid/configuration/client/buttons.lua new file mode 100644 index 0000000..2ac6111 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/client/buttons.lua @@ -0,0 +1,13 @@ +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/src/.config/awesome/lucid/configuration/client/init.lua b/src/.config/awesome/lucid/configuration/client/init.lua new file mode 100644 index 0000000..bbd5480 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/client/init.lua @@ -0,0 +1 @@ +require('configuration.client.rules') diff --git a/src/.config/awesome/lucid/configuration/client/keys.lua b/src/.config/awesome/lucid/configuration/client/keys.lua new file mode 100644 index 0000000..410b01e --- /dev/null +++ b/src/.config/awesome/lucid/configuration/client/keys.lua @@ -0,0 +1,24 @@ +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, 'Shift'}, 'q', function(c) + c:kill() +end, { + description = 'close', + group = 'client' +}), awful.key({modkey, 'Shift'}, 'c', function(c) + c:kill() +end, { + description = 'close', + group = 'client' +})) + +return clientKeys diff --git a/src/.config/awesome/lucid/configuration/client/rules.lua b/src/.config/awesome/lucid/configuration/client/rules.lua new file mode 100644 index 0000000..fa85474 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/client/rules.lua @@ -0,0 +1,74 @@ +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 = {{ + 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 = { + 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 + } +}, { + rule_any = { + type = {'modal'} + }, + properties = { + titlebars_enabled = true, + floating = true, + above = true, + skip_decoration = true, + placement = awful.placement.centered + } +}, { + rule_any = { + type = {'utility'} + }, + properties = { + titlebars_enabled = false, + floating = true, + skip_decoration = true, + placement = awful.placement.centered + } +}, { + rule_any = { + type = {'splash'}, + name = {'Discord Updater'} + }, + properties = { + floating = true, + above = true, + skip_decoration = true, + placement = awful.placement.centered + } +}} diff --git a/src/.config/awesome/lucid/configuration/init.lua b/src/.config/awesome/lucid/configuration/init.lua new file mode 100644 index 0000000..8ea676f --- /dev/null +++ b/src/.config/awesome/lucid/configuration/init.lua @@ -0,0 +1,4 @@ +return { + keys = require('configuration.keys'), + apps = require('configuration.apps') +} diff --git a/src/.config/awesome/lucid/configuration/keys/global.lua b/src/.config/awesome/lucid/configuration/keys/global.lua new file mode 100644 index 0000000..5d9dccc --- /dev/null +++ b/src/.config/awesome/lucid/configuration/keys/global.lua @@ -0,0 +1,381 @@ +require('awful.autofocus') +local awful = require('awful') +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') +local dpi = require('beautiful').xresources.apply_dpi +local theme = require('theme') + +-- Key bindings +local globalKeys = awful.util.table.join( -- Hotkeys +awful.key({modkey}, 'h', hotkeys_popup.show_help, { + description = 'show help', + group = 'awesome' +}), awful.key({modkey}, 'F1', hotkeys_popup.show_help, { + description = 'show help', + group = 'awesome' +}), -- Tag browsing +awful.key({modkey}, 'Left', function() + awful.tag.viewprev() + _G._splash_to_current_tag() +end, { + description = 'go to previous workspace', + group = 'tag' +}), awful.key({modkey}, 'Right', function() + awful.tag.viewnext() + _G._splash_to_current_tag() +end, { + description = 'go to next workspace', + group = 'tag' +}), awful.key({modkey}, 'Escape', function() + awful.tag.history.restore() + _G._splash_to_current_tag() +end, { + 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.awesome.spawn(apps.default.rofi) +end, { + description = 'show rofi menu', + group = 'awesome' +}), awful.key({modkey}, 'u', function() + awful.client.urgent.jumpto() + _G._splash_to_current_tag() +end, { + description = 'jump to urgent client', + group = 'client' +}), awful.key({altkey}, 'Tab', function() + 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({modkey}, 'm', function() + focus = not _G.client.focus + if not focus then + _G.client.focus.minimized = true + else + for _, c in ipairs(mouse.screen.selected_tag:clients()) do + c.minimized = false + end + end +end, { + description = 'minimize window in focus / unminimize all', + group = 'client' +}), awful.key({altkey, 'Shift'}, 'Tab', function() + awful.client.focus.byidx(-1) + if _G.client.focus then + _G.client.focus:raise() + end +end, { + description = 'switch to previous window', + group = 'client' +}), awful.key({modkey}, 'l', function() + awful.spawn(apps.default.lock) +end, { + description = 'lock the screen', + group = 'awesome' +}), awful.key({'Control', 'Shift'}, 'Print', function() + awful.util.spawn_with_shell(apps.default.delayed_screenshot) +end, { + description = 'mark an area and screenshot it (clipboard)', + group = 'screenshots (clipboard)' +}), awful.key({altkey}, 'Print', 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({'Control'}, 'Print', 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' +}), awful.key({modkey}, 'Return', function() + awful.util.spawn_with_shell(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({modkey, 'Shift'}, 'g', function(t) + t = t or awful.screen.focused().selected_tag + local current_gap = t.gap + local new_gap + if current_gap == 0 then + new_gap = beautiful.gaps + else + new_gap = 0 + end + t.gap = new_gap +end, { + description = 'toggle gaps', + group = 'awesome' +}), awful.key({modkey}, 'p', function() + awful.util.spawn_with_shell(apps.default.power_command) +end, { + description = 'end session menu', + 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 layout', + group = 'layout' +}), awful.key({modkey, 'Shift'}, 'space', function() + awful.layout.inc(-1) +end, { + description = 'select previous layout', + group = 'layout' +}), awful.key({altkey, 'Shift'}, 'l', function() + awful.tag.incmwfact(0.05) +end, { + description = 'increase master width factor', + group = 'layout' +}), awful.key({altkey, 'Shift'}, 'h', function() + awful.tag.incmwfact(-0.05) +end, { + description = 'decrease master width factor', + group = 'layout' +}), awful.key({altkey, 'Shift'}, 'j', function() + awful.client.incwfact(0.05) +end, { + description = 'decrease master height factor', + group = 'layout' +}), awful.key({altkey, 'Shift'}, 'k', function() + awful.client.incwfact(-0.05) +end, { + description = 'increase master height factor', + group = 'layout' +}), awful.key({modkey, 'Shift'}, 'h', function() + awful.tag.incnmaster(1, nil, true) +end, { + description = 'increase the number of master clients', + group = 'layout' +}), awful.key({modkey, 'Shift'}, 'l', function() + awful.tag.incnmaster(-1, nil, true) +end, { + description = 'decrease the number of master clients', + group = 'layout' +}), awful.key({modkey, 'Control'}, 'h', function() + awful.tag.incncol(1, nil, true) +end, { + description = 'increase the number of columns', + group = 'layout' +}), awful.key({modkey, 'Control'}, 'l', function() + awful.tag.incncol(-1, nil, true) +end, { + description = 'decrease the number of columns', + 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' +}), awful.key({modkey}, 'k', function() + _G.toggle_splash() +end, { + description = 'toggle splash terminal', + group = 'launcher' +}), awful.key({modkey}, 'j', function() + _G.toggle_splash_height() +end, { + description = 'toggle splash terminal height', + group = 'launcher' +}), 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({altkey}, 'k', function() + awful.spawn.easy_async('amixer -D pulse sset Master 5%+', function() + _G.update_volume() + end) +end, { + description = 'volume up', + group = 'hotkeys' +}), awful.key({}, 'XF86AudioRaiseVolume', function() + awful.spawn.easy_async('amixer -D pulse sset Master 5%+', function() + _G.update_volume() + end) +end, { + description = 'volume up', + group = 'hotkeys' +}), awful.key({}, 'XF86AudioLowerVolume', function() + awful.spawn.easy_async('amixer -D pulse sset Master 5%-', function() + _G.update_volume() + end) +end, { + description = 'volume down', + group = 'hotkeys' +}), awful.key({altkey}, 'j', function() + awful.spawn.easy_async('amixer -D pulse sset Master 5%-', function() + _G.update_volume() + end) +end, { + description = 'volume down', + group = 'hotkeys' +}), awful.key({altkey}, 'm', function() + awful.spawn('amixer -D pulse set Master 1+ toggle') + _G.update_volume() +end, { + description = 'toggle mute', + group = 'hotkeys' +}), awful.key({}, 'XF86AudioMute', function() + awful.spawn('amixer -D pulse set Master 1+ toggle') + _G.update_volume() +end, { + description = 'toggle mute', + group = 'hotkeys' +}), awful.key({modkey}, 'o', awful.client.movetoscreen, { + description = 'move window to next screen', + group = 'client' +}), awful.key({modkey}, 'n', 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' +}), awful.key({'Control', altkey}, 'space', function() + awful.util.spawn_with_shell('vm-attach attach') +end)) + +-- 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() + _G._splash_to_current_tag() + 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/src/.config/awesome/lucid/configuration/keys/init.lua b/src/.config/awesome/lucid/configuration/keys/init.lua new file mode 100644 index 0000000..9591667 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/keys/init.lua @@ -0,0 +1,4 @@ +return { + mod = require('configuration.keys.mod'), + global = require('configuration.keys.global') +} diff --git a/src/.config/awesome/lucid/configuration/keys/mod.lua b/src/.config/awesome/lucid/configuration/keys/mod.lua new file mode 100644 index 0000000..1d90897 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/keys/mod.lua @@ -0,0 +1,4 @@ +return { + modKey = 'Mod4', + altKey = 'Mod1' +} \ No newline at end of file diff --git a/src/.config/awesome/lucid/configuration/rofi.rasi b/src/.config/awesome/lucid/configuration/rofi.rasi new file mode 100644 index 0000000..e158e40 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/rofi.rasi @@ -0,0 +1,148 @@ +/** + * User: deadguy + * Copyright: deadguy + */ + +configuration { + display-drun: "Activate"; + display-run: "Execute"; + show-icons: true; + sidebar-mode: false; +} + +* { + background-color: rgb(0, 0, 0, 0); + text-color: rgb(255, 255, 255); + selbg: rgb(255, 255, 255, 0.5); + urgbg: rgb(255, 255, 255); + actbg: rgb(255, 255, 255, 0.05); + winbg: rgb(255, 255, 255); + + 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: "FiraCode Nerd Font Mono Medium 10"; +} + +window { + location: west; + anchor: west; + x-offset: 0px; + height: 100%; + width: 30%; + padding: 0%; + orientation: horizontal; + children: [mainbox]; + background-color: rgb(20, 20, 20, 0.9); +} + +mainbox { + spacing: 0em; + padding: 0px; + width: 100%; + children: [ inputbar, listview ]; + 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: false; +} + +element { + padding: 16px; + border: 0 0 0 0 solid; +} + +entry { + expand: true; + text-color: @normal-foreground; + background-color: rgb(0, 0, 0, 0); + vertical-align: 1; + padding: 12px; + font: "FiraCode Nerd Font Mono Bold 18"; +} + +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 0 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/src/.config/awesome/lucid/configuration/tags/init.lua b/src/.config/awesome/lucid/configuration/tags/init.lua new file mode 100644 index 0000000..0d700f6 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/tags/init.lua @@ -0,0 +1,37 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local gears = require('gears') +local apps = require('configuration.apps') +local dpi = require('beautiful').xresources.apply_dpi + +local tags = { + {text = 'web', type = 'web', defaultApp = apps.default.browser, screen = 1}, + {text = 'dev', type = 'dev', defaultApp = apps.default.editor, screen = 1}, + { + text = 'term', + type = 'term', + defaultApp = apps.default.terminal, + screen = 1 + }, + {text = 'file', type = 'file', defaultApp = apps.default.files, screen = 1}, + {text = 'chat', type = 'chat', defaultApp = apps.default.social, screen = 1}, + {text = 'misc', type = 'misc', 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(tag.text, { + icon = tag.icon, + icon_only = false, + layout = awful.layout.suit.tile, + gap = beautiful.gaps, + screen = s, + defaultApp = tag.defaultApp, + selected = i == 1 + }) + end +end) diff --git a/src/.config/awesome/lucid/configuration/utils/rofi-power b/src/.config/awesome/lucid/configuration/utils/rofi-power new file mode 100755 index 0000000..b626d30 --- /dev/null +++ b/src/.config/awesome/lucid/configuration/utils/rofi-power @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# rofi-power +# Use rofi to call systemctl for shutdown, reboot, etc + +# 2016 Oliver Kraitschy - http://okraits.de + +OPTIONS="Poweroff\nExit\nReboot\nSuspend\nHibernate" + +config_path=$(dirname "$0") + +LAUNCHER="rofi -dmenu -i" +USE_LOCKER="false" +LOCKER="i3lock-fancy" + +option=`echo -e $OPTIONS | $LAUNCHER | awk '{print $1}' | tr -d '\r\n'` +case $option in + Exit) + kill -9 -1 + ;; + Reboot) + systemctl reboot + ;; + Poweroff) + systemctl poweroff + ;; + Suspend) + $($USE_LOCKER) && "$LOCKER"; systemctl suspend + ;; + Hibernate) + $($USE_LOCKER) && "$LOCKER"; systemctl hibernate + ;; + *) + ;; +esac diff --git a/src/.config/awesome/lucid/configuration/utils/screenshot b/src/.config/awesome/lucid/configuration/utils/screenshot new file mode 100755 index 0000000..d7f947e --- /dev/null +++ b/src/.config/awesome/lucid/configuration/utils/screenshot @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $1 == "--delayed" ]; then + spectacle -b -n ${@:2} -o /tmp/screenshot.png ; xclip -selection clipboard -target image/png -i /tmp/screenshot.png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga +else + spectacle -b -n $@ -o /tmp/screenshot.png ; xclip -selection clipboard -target image/png -i /tmp/screenshot.png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga +fi + + diff --git a/src/.config/awesome/lucid/layout/bottom-bar.lua b/src/.config/awesome/lucid/layout/bottom-bar.lua new file mode 100644 index 0000000..e42731e --- /dev/null +++ b/src/.config/awesome/lucid/layout/bottom-bar.lua @@ -0,0 +1,37 @@ +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local dpi = require('beautiful').xresources.apply_dpi + +local BottomBar = function(s, offset) + + -- BOTTOM BAR + -- ======= + local panel_height = dpi(16) + local panel = wibox({ + ontop = false, + screen = s, + height = panel_height, + width = s.geometry.width, + x = s.geometry.x, + y = s.geometry.height - panel_height, + stretch = false, + bg = beautiful.primary.hue_100, + fg = beautiful.fg_normal, + }) + + panel:struts({ + bottom = panel.height + }) + + panel:setup{ + layout = wibox.layout.align.horizontal, + nil, + TaskList(s), + nil, + } + + return panel +end + +return BottomBar diff --git a/src/.config/awesome/lucid/layout/init.lua b/src/.config/awesome/lucid/layout/init.lua new file mode 100644 index 0000000..34386d5 --- /dev/null +++ b/src/.config/awesome/lucid/layout/init.lua @@ -0,0 +1,43 @@ +local awful = require('awful') +local top_bar = require('layout.top-bar') +local bottom_bar = require('layout.bottom-bar') + +local key_grabber + +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen(function(s) + if s.index == 1 then + s.top_bar = top_bar(s, true) + s.bottom_bar = bottom_bar(s, true) + else + s.top_bar = top_bar(s, false) + s.bottom_bar = bottom_bar(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 + s.top_bar.visible = not fullscreen + s.bottom_bar.visible = not fullscreen + 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/src/.config/awesome/lucid/layout/top-bar.lua b/src/.config/awesome/lucid/layout/top-bar.lua new file mode 100644 index 0000000..558914c --- /dev/null +++ b/src/.config/awesome/lucid/layout/top-bar.lua @@ -0,0 +1,156 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local clickable_container = require('widget.material.clickable-container') +local mat_icon_button = require('widget.material.icon-button') +local wibox = require('wibox') +local TagList = require('widget.tag-list') +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi +local theme = require "theme" +local table = awful.util.table or gears.table + +local separator = wibox.container.margin(wibox.widget { + orientation = 'vertical', + forced_width = dpi(1), + opacity = 0.3, + widget = wibox.widget.separator +}, dpi(0), dpi(0), dpi(4), dpi(4)) + +local TopBar = function(s, offset) + + -- LAYOUT BOX + -- ========== + local function update_txt_layoutbox(s) + -- Writes a string representation of the current layout in a textbox widget + local txt_l = theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))] or "" + s.layoutbox:set_text(txt_l) + end + + s.layoutbox = wibox.widget.textbox(theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))]) + s.layoutbox.font = beautiful.icon_font + awful.tag.attached_connect_signal(s, "property::selected", function () update_txt_layoutbox(s) end) + awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end) + s.layoutbox:buttons(table.join( + awful.button({}, 1, function() awful.layout.inc(1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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))) + + -- SYSTEM TRAY + -- =========== + local systray = wibox.widget.systray() + systray:set_horizontal(true) + + -- SYSTEM DETAILS + -- ============== + local volume_widget = require('widget.volume') + local battery_widget = require('widget.battery') + local clock_widget = require('widget.clock') + local mem_widget = require('widget.memory') + local cpu_widget = require('widget.cpu') + local temprature_widget = require('widget.temprature') + local storage_widget = require('widget.storage') + local system_details = wibox.widget { + systray, + separator, + battery_widget, + separator, + wibox.widget{ + wibox.widget{ + text = '', + font = beautiful.icon_font, + widget = wibox.widget.textbox + }, + fg = beautiful.accent.hue_600, + widget = wibox.container.background + }, + mem_widget, + separator, + wibox.widget{ + wibox.widget{ + text = '﬙', + font = beautiful.icon_font, + widget = wibox.widget.textbox + }, + fg = beautiful.accent.hue_500, + widget = wibox.container.background + }, + cpu_widget, + separator, + wibox.widget{ + wibox.widget{ + text = '﨎', + font = beautiful.icon_font, + widget = wibox.widget.textbox + }, + fg = beautiful.accent.hue_400, + widget = wibox.container.background + }, + temprature_widget, + separator, + wibox.widget{ + wibox.widget{ + text = '', + font = beautiful.icon_font, + widget = wibox.widget.textbox + }, + fg = beautiful.accent.hue_200, + widget = wibox.container.background + }, + storage_widget, + separator, + volume_widget, + separator, + wibox.widget{ + wibox.widget{ + text = '', + font = beautiful.icon_font, + widget = wibox.widget.textbox + }, + fg = beautiful.accent.hue_400, + widget = wibox.container.background + }, + clock_widget, + wibox.widget{ + s.layoutbox, + fg = beautiful.primary.hue_100, + bg = beautiful.accent.hue_200, + widget = wibox.container.background + }, + spacing = dpi(4), + layout = wibox.layout.fixed.horizontal + } + + local calendar = require('widget.calendar') + calendar:attach(clock_widget) + + -- TOP BAR + -- ======= + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(20), + width = s.geometry.width, + x = s.geometry.x, + y = s.geometry.y, + stretch = false, + bg = beautiful.primary.hue_100, + fg = beautiful.fg_normal, + }) + + panel:struts({ + top = panel.height - panel.y + }) + + panel:setup{ + layout = wibox.layout.align.horizontal, + TagList(s), + nil, + system_details, + } + + return panel +end + +return TopBar diff --git a/src/.config/awesome/lucid/module/auto-start.lua b/src/.config/awesome/lucid/module/auto-start.lua new file mode 100644 index 0000000..b6d0746 --- /dev/null +++ b/src/.config/awesome/lucid/module/auto-start.lua @@ -0,0 +1,19 @@ +-- 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)) + --This broke compton ===> awful.spawn.single_instance(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/src/.config/awesome/lucid/module/decorate-client.lua b/src/.config/awesome/lucid/module/decorate-client.lua new file mode 100644 index 0000000..f5c2405 --- /dev/null +++ b/src/.config/awesome/lucid/module/decorate-client.lua @@ -0,0 +1,93 @@ +local awful = require('awful') +local gears = require('gears') +local beautiful = require('beautiful') +local dpi = require('beautiful').xresources.apply_dpi + +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 + + client.border_width = beautiful.border_width + client.shape = function(cr, w, h) + gears.shape.rectangle(cr, w, h) + 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/src/.config/awesome/lucid/module/notifications.lua b/src/.config/awesome/lucid/module/notifications.lua new file mode 100644 index 0000000..f7b83cd --- /dev/null +++ b/src/.config/awesome/lucid/module/notifications.lua @@ -0,0 +1,53 @@ +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 = 'top_right' +naughty.config.defaults.margin = dpi(16) +naughty.config.defaults.ontop = true +naughty.config.defaults.font = beautiful.font +naughty.config.defaults.icon = nil +naughty.config.defaults.icon_size = dpi(32) +naughty.config.defaults.shape = gears.shape.rectangle +naughty.config.defaults.border_width = dpi(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/src/.config/awesome/lucid/module/splash-terminal.lua b/src/.config/awesome/lucid/module/splash-terminal.lua new file mode 100644 index 0000000..b522970 --- /dev/null +++ b/src/.config/awesome/lucid/module/splash-terminal.lua @@ -0,0 +1,79 @@ +local awful = require('awful') +local app = require('configuration.apps').default.splash +local dpi = require('beautiful').xresources.apply_dpi +local beautiful = require('beautiful') +local screen = awful.screen.focused() + +-- Theme +beautiful.init(require('theme')) + +local splash_id = 'notnil' +local splash_client +local opened = false + +function create_shell() + splash_id = awful.spawn.with_shell(app) +end + +-- Dirty hack to prevent splash from showing up in occupied tags +function _splash_to_current_tag() + if splash_client then + splash_client:move_to_tag(screen.selected_tag) + end +end + +function open_splash() + splash_client.hidden = false +end + +function close_splash() + splash_client.hidden = true +end + +toggle_splash_height = function() + if splash_client and opened then + splash_client.maximized_vertical = not splash_client.maximized_vertical + end +end + +toggle_splash = function() + opened = not opened + if not splash_client then + create_shell() + else + if opened then + open_splash() + client.focus = splash_client + splash_client:raise() + else + close_splash() + end + end +end + +_G.client.connect_signal('manage', function(c) + if (c.pid == splash_id) then + splash_client = c + c.x = c.screen.geometry.x + c.height = (c.screen.geometry.height / 5) * 3 + c.y = c.screen.geometry.height - c.height - beautiful.border_width - dpi(16) + c.floating = true + c.skip_taskbar = true + c.skip_decoration = true + c.ontop = true + c.floating = true + c.above = true + c.sticky = true + c.type = 'splash' + c.hidden = not opened + c.border_width = beautiful.border_width + c.maximized_horizontal = true + end +end) + +_G.client.connect_signal('unmanage', function(c) + if (c.pid == splash_id) then + opened = false + splash_client = nil + end +end) diff --git a/src/.config/awesome/lucid/rc.lua b/src/.config/awesome/lucid/rc.lua new file mode 100644 index 0000000..5f333e8 --- /dev/null +++ b/src/.config/awesome/lucid/rc.lua @@ -0,0 +1,50 @@ +require('awful.autofocus') +local gears = require('gears') +local awful = require('awful') +local naughty = require('naughty') +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') +require('module.splash-terminal') + +-- Setup all configurations +require('configuration.client') +require('configuration.tags') +_G.root.keys(require('configuration.keys.global')) + +-- 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/src/.config/awesome/lucid/theme/color-schemes.lua b/src/.config/awesome/lucid/theme/color-schemes.lua new file mode 100644 index 0000000..0fb7617 --- /dev/null +++ b/src/.config/awesome/lucid/theme/color-schemes.lua @@ -0,0 +1,50 @@ +return { + dracula = { + primary = { + hue_100 = '#282a36', + hue_200 = '#44475a' + }, + accent = { + hue_100 = '#f1fa8c', + hue_200 = '#50fa7b', + hue_300 = '#8be9fd', + hue_400 = '#ff5555', + hue_500 = '#6272a4', + hue_600 = '#ff79c6', + hue_700 = '#ffb86c', + hue_800 = '#f8f8f2', + } + }, + gruvbox = { + primary = { + hue_100 = '#282828', + hue_200 = '#3c3c3c' + }, + accent = { + hue_100 = '#fe8019', + hue_200 = '#fabd2f', + hue_300 = '#8ec07c', + hue_400 = '#fb4934', + hue_500 = '#d3869b', + hue_600 = '#b8bb26', + hue_700 = '#458588', + hue_800 = '#fbf1c7', + } + }, + gruvbox_material = { + primary = { + hue_100 = '#212121', + hue_200 = '#3c3c3c' + }, + accent = { + hue_100 = '#e1be7f', + hue_200 = '#92c96a', + hue_300 = '#66aeea', + hue_400 = '#f35a5a', + hue_500 = '#4083bc', + hue_600 = '#c57cda', + hue_700 = '#cd996a', + hue_800 = '#d6d6d6', + } + } +} diff --git a/src/.config/awesome/lucid/theme/init.lua b/src/.config/awesome/lucid/theme/init.lua new file mode 100644 index 0000000..20c672b --- /dev/null +++ b/src/.config/awesome/lucid/theme/init.lua @@ -0,0 +1,10 @@ +local gtable = require('gears.table') +local theme = require('theme.theme') + +local final_theme = {} +gtable.crush(final_theme, theme.theme) +gtable.crush(final_theme, theme.theme) +theme.awesome_overrides(final_theme) +theme.awesome_overrides(final_theme) + +return final_theme diff --git a/src/.config/awesome/lucid/theme/theme.lua b/src/.config/awesome/lucid/theme/theme.lua new file mode 100644 index 0000000..0fe85f9 --- /dev/null +++ b/src/.config/awesome/lucid/theme/theme.lua @@ -0,0 +1,57 @@ +local filesystem = require('gears.filesystem') +local color_schemes = require('theme.color-schemes') +local theme_dir = filesystem.get_configuration_dir() .. '/theme' +local gears = require('gears') +local dpi = require('beautiful').xresources.apply_dpi +local theme = {} + +-- Color Scheme +theme.primary = color_schemes.gruvbox_material.primary +theme.accent = color_schemes.gruvbox_material.accent + +local awesome_overrides = function(theme) + theme.dir = os.getenv('HOME') .. '/.config/awesome/theme' + + theme.icons = theme.dir .. '/icons/' + theme.font = 'Robotomono nerd font bold 9' -- Glyphs don't work properly with this (#442) + theme.icon_font = 'furamono nerd font 11' -- Fira mono patched version + + -- Layout icons + theme.layout_txt_tile = "|舘|" + theme.layout_txt_max = "||" + theme.layout_txt_floating = "||" + + -- Taglist + theme.taglist_font = theme.font + theme.taglist_bg_empty = theme.primary.hue_100 + theme.taglist_bg_occupied = 'linear:0,0:0,' .. dpi(32) .. ':0,' .. + theme.primary.hue_200 .. ':0.1,' .. + theme.primary.hue_200 .. ':0.1,' .. + theme.primary.hue_100 .. ':0.9,' .. + theme.primary.hue_100 + theme.taglist_bg_urgent = 'linear:0,0:0,' .. dpi(48) .. ':0,' .. + theme.accent.hue_700 .. ':0.07,' .. + theme.accent.hue_700 .. ':0.07,' .. + theme.primary.hue_100 .. ':1,' .. + theme.primary.hue_100 + theme.taglist_bg_focus = theme.accent.hue_200 + theme.taglist_fg_focus = theme.primary.hue_100 + + -- Tasklist + theme.tasklist_font = theme.font + theme.tasklist_bg_normal = theme.primary.hue_200 + theme.tasklist_bg_focus = theme.primary.hue_100 + theme.tasklist_bg_urgent = theme.primary.hue_200 + + -- Icons + theme.icon_theme = 'Papirus' + + -- Client + theme.gaps = dpi(2) + theme.border_width = dpi(2) + theme.border_focus = theme.accent.hue_200 + theme.border_normal = theme.primary.hue_100 + theme.gap_single_client = false + theme.bg_normal = theme.primary.hue_100 +end +return {theme = theme, awesome_overrides = awesome_overrides} diff --git a/src/.config/awesome/lucid/theme/wallpapers/1.png b/src/.config/awesome/lucid/theme/wallpapers/1.png new file mode 100644 index 0000000..d0266a6 Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/1.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/10.png b/src/.config/awesome/lucid/theme/wallpapers/10.png new file mode 100644 index 0000000..d0ae5ff Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/10.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/11.png b/src/.config/awesome/lucid/theme/wallpapers/11.png new file mode 100644 index 0000000..a23a943 Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/11.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/12.png b/src/.config/awesome/lucid/theme/wallpapers/12.png new file mode 100644 index 0000000..6c3f5db Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/12.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/2.png b/src/.config/awesome/lucid/theme/wallpapers/2.png new file mode 100644 index 0000000..ac28a97 Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/2.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/3.png b/src/.config/awesome/lucid/theme/wallpapers/3.png new file mode 100644 index 0000000..623191c Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/3.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/4.png b/src/.config/awesome/lucid/theme/wallpapers/4.png new file mode 100644 index 0000000..23f35b8 Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/4.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/5.png b/src/.config/awesome/lucid/theme/wallpapers/5.png new file mode 100644 index 0000000..ebd1729 Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/5.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/6.png b/src/.config/awesome/lucid/theme/wallpapers/6.png new file mode 100644 index 0000000..5704a13 Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/6.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/6499ef5228c032a70c26e139ab60e6c0.jpeg b/src/.config/awesome/lucid/theme/wallpapers/6499ef5228c032a70c26e139ab60e6c0.jpeg new file mode 100644 index 0000000..25f1e3f Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/6499ef5228c032a70c26e139ab60e6c0.jpeg differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/7.png b/src/.config/awesome/lucid/theme/wallpapers/7.png new file mode 100644 index 0000000..45d6eab Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/7.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/8.png b/src/.config/awesome/lucid/theme/wallpapers/8.png new file mode 100644 index 0000000..ef821ca Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/8.png differ diff --git a/src/.config/awesome/lucid/theme/wallpapers/9.png b/src/.config/awesome/lucid/theme/wallpapers/9.png new file mode 100644 index 0000000..bb2595b Binary files /dev/null and b/src/.config/awesome/lucid/theme/wallpapers/9.png differ diff --git a/src/.config/awesome/lucid/widget/battery.lua b/src/.config/awesome/lucid/widget/battery.lua new file mode 100644 index 0000000..741e631 --- /dev/null +++ b/src/.config/awesome/lucid/widget/battery.lua @@ -0,0 +1,120 @@ +------------------------------------------------- +-- 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 beautiful = require('beautiful') +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 percentage = wibox.widget.textbox() +local battery_icon = wibox.widget.textbox() +battery_icon.font = beautiful.icon_font + +local battery_popup = awful.tooltip({ + objects = {percentage}, + mode = 'outside', + align = 'left', + preferred_positions = {'right', 'left', 'top', 'bottom'} +}) + +watch('acpi -i', 10, function(_, stdout) + 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 + + battery_popup.text = string.gsub(stdout, '\n$', '') + percentage.text = math.floor(charge) + + if status == 'Charging' then + battery_icon.text = '' + if math.floor(charge) <= 20 then + battery_icon.text = '' + elseif math.floor(charge) <= 30 then + battery_icon.text = '' + elseif math.floor(charge) <= 40 then + battery_icon.text = '' + elseif math.floor(charge) <= 60 then + battery_icon.text = '' + elseif math.floor(charge) <= 80 then + battery_icon.text = '' + elseif math.floor(charge) <= 90 then + battery_icon.text = '' + elseif math.floor(charge) <= 100 then + battery_icon.text = '' + end + elseif status == 'Full' then + battery_icon.text = '' + else + if math.floor(charge) <= 10 then + battery_icon.text = '' + elseif math.floor(charge) <= 20 then + battery_icon.text = '' + elseif math.floor(charge) <= 30 then + battery_icon.text = '' + elseif math.floor(charge) <= 40 then + battery_icon.text = '' + elseif math.floor(charge) <= 50 then + battery_icon.text = '' + elseif math.floor(charge) <= 60 then + battery_icon.text = '' + elseif math.floor(charge) <= 60 then + battery_icon.text = '' + elseif math.floor(charge) <= 80 then + battery_icon.text = '' + elseif math.floor(charge) <= 90 then + battery_icon.text = '' + elseif math.floor(charge) <= 100 then + battery_icon.text = '' + end + end + collectgarbage('collect') +end) + +return wibox.widget { + wibox.widget{ + battery_icon, + fg = beautiful.accent.hue_300, + widget = wibox.container.background + }, + percentage, + spacing = dpi(2), + layout = wibox.layout.fixed.horizontal +} diff --git a/src/.config/awesome/lucid/widget/calendar.lua b/src/.config/awesome/lucid/widget/calendar.lua new file mode 100644 index 0000000..c5e10b9 --- /dev/null +++ b/src/.config/awesome/lucid/widget/calendar.lua @@ -0,0 +1,31 @@ +local awful = require('awful') +local wibox = require('wibox') +local beautiful = require('beautiful') +local dpi = require('beautiful').xresources.apply_dpi + +local month_calendar = awful.widget.calendar_popup.month({ + start_sunday = true, + style_month = { + border_width = dpi(0), + bg_color = beautiful.primary.hue_100, + padding = dpi(20) + }, + style_header = { + border_width = 0, + fg_color = beautiful.accent.hue_400 + }, + style_weekday = { + border_width = 0 + }, + style_normal = { + border_width = 0 + }, + style_focus = { + border_width = dpi(0), + border_color = beautiful.fg_normal, + fg_color = beautiful.accent.hue_200, + bg_color = beautiful.primary.hue_100 + } +}) + +return month_calendar diff --git a/src/.config/awesome/lucid/widget/clock.lua b/src/.config/awesome/lucid/widget/clock.lua new file mode 100644 index 0000000..4cb7324 --- /dev/null +++ b/src/.config/awesome/lucid/widget/clock.lua @@ -0,0 +1,5 @@ +local wibox = require('wibox') +local beautiful = require('beautiful') + +local clock = wibox.widget.textclock('%d/%m %H:%M') +return clock diff --git a/src/.config/awesome/lucid/widget/cpu.lua b/src/.config/awesome/lucid/widget/cpu.lua new file mode 100644 index 0000000..5cd3d62 --- /dev/null +++ b/src/.config/awesome/lucid/widget/cpu.lua @@ -0,0 +1,27 @@ +local wibox = require('wibox') +local beautiful = require('beautiful') +local dpi = require('beautiful').xresources.apply_dpi +local watch = require('awful.widget.watch') + +local cpu = wibox.widget.textbox() +local total_prev = 0 +local idle_prev = 0 + +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 + + cpu.text = math.floor(diff_usage) .. '%' + + total_prev = total + idle_prev = idle + collectgarbage('collect') +end) + +return cpu diff --git a/src/.config/awesome/lucid/widget/material/clickable-container.lua b/src/.config/awesome/lucid/widget/material/clickable-container.lua new file mode 100644 index 0000000..1b466db --- /dev/null +++ b/src/.config/awesome/lucid/widget/material/clickable-container.lua @@ -0,0 +1,43 @@ +local wibox = require('wibox') + +function build(widget, label) + local container = wibox.widget { + -- widget, + wibox.widget { + text = label, + widget = wibox.widget.textbox, + }, + 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/src/.config/awesome/lucid/widget/material/icon-button.lua b/src/.config/awesome/lucid/widget/material/icon-button.lua new file mode 100644 index 0000000..c4a03bf --- /dev/null +++ b/src/.config/awesome/lucid/widget/material/icon-button.lua @@ -0,0 +1,14 @@ +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.widget { + imagebox, + shape = gears.shape.circle, + widget = clickable_container + } +end + +return build diff --git a/src/.config/awesome/lucid/widget/material/icon.lua b/src/.config/awesome/lucid/widget/material/icon.lua new file mode 100644 index 0000000..82ce50f --- /dev/null +++ b/src/.config/awesome/lucid/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/src/.config/awesome/lucid/widget/material/list-item.lua b/src/.config/awesome/lucid/widget/material/list-item.lua new file mode 100644 index 0000000..f549bf4 --- /dev/null +++ b/src/.config/awesome/lucid/widget/material/list-item.lua @@ -0,0 +1,186 @@ +-- 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/src/.config/awesome/lucid/widget/material/slider.lua b/src/.config/awesome/lucid/widget/material/slider.lua new file mode 100644 index 0000000..9dfe756 --- /dev/null +++ b/src/.config/awesome/lucid/widget/material/slider.lua @@ -0,0 +1,117 @@ +-- 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.primary.hue_100, + color = beautiful.accent.hue_400, + 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.accent.hue_500, + handle_color = beautiful.accent.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/src/.config/awesome/lucid/widget/memory.lua b/src/.config/awesome/lucid/widget/memory.lua new file mode 100644 index 0000000..9260f65 --- /dev/null +++ b/src/.config/awesome/lucid/widget/memory.lua @@ -0,0 +1,21 @@ +local wibox = require('wibox') +local beautiful = require('beautiful') +local watch = require('awful.widget.watch') + +local memory = wibox.widget.textbox() +memory.font = beautiful.font + +function round(exact, quantum) + local quant,frac = math.modf(exact/quantum) + return quantum * (quant + (frac > 0.5 and 1 or 0)) +end + +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+)') + + memory.text = round((used / 1048576), 0.01) .. 'GB' + collectgarbage('collect') +end) + +return memory diff --git a/src/.config/awesome/lucid/widget/storage.lua b/src/.config/awesome/lucid/widget/storage.lua new file mode 100644 index 0000000..af13fe9 --- /dev/null +++ b/src/.config/awesome/lucid/widget/storage.lua @@ -0,0 +1,12 @@ +local wibox = require('wibox') +local watch = require('awful.widget.watch') +local beautiful = require('beautiful') + +local storage = wibox.widget.textbox() +storage.font = beautiful.font + +watch('bash -c "df -h $HOME | awk \'/[0-9]/ {print $2-$3}\'"', 30, function(_, stdout) + storage.text = stdout +end) + +return storage diff --git a/src/.config/awesome/lucid/widget/tag-list.lua b/src/.config/awesome/lucid/widget/tag-list.lua new file mode 100644 index 0000000..399373d --- /dev/null +++ b/src/.config/awesome/lucid/widget/tag-list.lua @@ -0,0 +1,133 @@ +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(6), dpi(6), dpi(4), dpi(4)) + ibm = wibox.container.margin(ib, dpi(8), dpi(8), dpi(9), dpi(9)) + 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 {} + + 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 + 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 + + 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() + _G._splash_to_current_tag() + end), awful.button({modkey}, 1, function(t) + if _G.client.focus then + _G.client.focus:move_to_tag(t) + t:view_only() + end + _G._splash_to_current_tag() + end), awful.button({}, 3, function() + awful.tag.viewtoggle() + _G._splash_to_current_tag() + end), awful.button({modkey}, 3, function(t) + if _G.client.focus then + _G.client.focus:toggle_tag(t) + end + _G._splash_to_current_tag() + end), awful.button({}, 4, function(t) + awful.tag.viewprev(t.screen) + _G._splash_to_current_tag() + end), awful.button({}, 5, function(t) + awful.tag.viewnext(t.screen) + _G._splash_to_current_tag() + end)), {}, list_update, wibox.layout.fixed.horizontal()) +end +return TagList diff --git a/src/.config/awesome/lucid/widget/task-list.lua b/src/.config/awesome/lucid/widget/task-list.lua new file mode 100644 index 0000000..e905bf4 --- /dev/null +++ b/src/.config/awesome/lucid/widget/task-list.lua @@ -0,0 +1,147 @@ +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') +local tasklist_mode = 'text' +local beautiful = require('beautiful') +--- 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, ll, 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() + bg_clickable = clickable_container() + bgb = wibox.container.background() + tbm = wibox.container.margin(tb, dpi(4), dpi(4), dpi(1), dpi(1)) + ibm = wibox.container.margin(ib, dpi(1), dpi(1), dpi(1), dpi(1)) + l = wibox.layout.fixed.horizontal() + ll = wibox.layout.flex.horizontal() + + -- All of this is added in a fixed widget + l:fill_space(true) + l:add(ibm) + l:add(tbm) + ll:add(l) + + bg_clickable:set_widget(ll) + -- And all of this gets a background + bgb:set_widget(bg_clickable) + + l: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 tasklist_mode == 'icon' then + text = nil + elseif tasklist_mode == 'text' then + icon = nil + end + 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 + bg_image = bg_image(tb, o, nil, objects, i) + end + bgb:set_bgimage(bg_image) + if icon then + ib.image = icon + ib.resize = true + 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 + tb.align = 'center' + + 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({}, 4, function() + awful.client.focus.byidx(1) +end), awful.button({}, 5, function() + awful.client.focus.byidx(-1) +end), awful.button({}, 2, function(c) + c.kill(c) +end)) + +local TaskList = function(s) + return awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons, nil, list_update) +end + +return TaskList diff --git a/src/.config/awesome/lucid/widget/temprature.lua b/src/.config/awesome/lucid/widget/temprature.lua new file mode 100644 index 0000000..caeabf3 --- /dev/null +++ b/src/.config/awesome/lucid/widget/temprature.lua @@ -0,0 +1,12 @@ +local wibox = require('wibox') +local watch = require('awful.widget.watch') +local beautiful = require('beautiful') + +local temprature = wibox.widget.textbox() +temprature.font = beautiful.font + +watch('bash -c "sensors | awk \'/Core 0/ {print substr($3, 2) }\'"', 30, function(_, stdout) + temprature.text = stdout +end) + +return temprature diff --git a/src/.config/awesome/lucid/widget/volume.lua b/src/.config/awesome/lucid/widget/volume.lua new file mode 100644 index 0000000..aa3fe5d --- /dev/null +++ b/src/.config/awesome/lucid/widget/volume.lua @@ -0,0 +1,50 @@ +local awful = require("awful") +local wibox = require('wibox') +local mat_list_item = require('widget.material.list-item') +local dpi = require('beautiful').xresources.apply_dpi +local watch = require('awful.widget.watch') +local beautiful = require('beautiful') + +local volume_icon = wibox.widget.textbox() +volume_icon.font = beautiful.icon_font +local volume_widget = wibox.widget.textbox() +volume_widget.align = 'center' +volume_widget.valign = 'center' +volume_widget.font = beautiful.font + +local volume + +function update_volume() + awful.spawn.easy_async_with_shell("bash -c 'amixer -D pulse sget Master'", function(stdout) + volume = string.match(stdout, '(%d?%d?%d)%%') + awful.spawn.easy_async_with_shell("bash -c 'pacmd list-sinks | awk '/muted/ { print $2 }''", function(muted) + muted = string.gsub(muted, "%s+", "") + if muted == 'muted:no' and (volume > '50' or volume == '100') then + volume_icon.text = '墳' + elseif muted == 'muted:no' and volume <= '50' and volume > '0' then + volume_icon.text = '奔' + elseif muted == 'muted:yes' then + volume_icon.text = '婢' + elseif volume == '0' then + volume_icon.text = '奄' + end + volume_widget.text = volume + end) + collectgarbage('collect') + end) +end + +watch('bash -c', 3, function(_, stdout) + update_volume() +end) + +return wibox.widget { + wibox.widget{ + volume_icon, + fg = beautiful.accent.hue_100, + widget = wibox.container.background + }, + volume_widget, + spacing = dpi(2), + layout = wibox.layout.fixed.horizontal +} diff --git a/src/.config/awesome/redhound/configuration/README.md b/src/.config/awesome/redhound/configuration/README.md new file mode 100644 index 0000000..abf1a44 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/README.md @@ -0,0 +1,4 @@ +## Configuration + +Here you will find all the settings available. + diff --git a/src/.config/awesome/redhound/configuration/apps.lua b/src/.config/awesome/redhound/configuration/apps.lua new file mode 100644 index 0000000..0f8b5f3 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/apps.lua @@ -0,0 +1,40 @@ +local filesystem = require('gears.filesystem') +local with_dpi = require('beautiful').xresources.apply_dpi +local get_dpi = require('beautiful').xresources.get_dpi +local rofi_command = 'env /usr/bin/rofi -show drun -display-drun -run-command "/bin/bash -c -i \'shopt -s expand_aliases; {cmd}\'"' + +return { + -- List of apps to start by default on some actions + default = { + terminal = 'env kitty', + rofi = rofi_command, + lock = 'i3lock-fancy', + quake = 'kitty', + screenshot = '~/.config/awesome/configuration/utils/screenshot -m', + region_screenshot = '~/.config/awesome/configuration/utils/screenshot -r', + delayed_screenshot = '~/.config/awesome/configuration/utils/screenshot --delayed -r', + + -- Editing these also edits the default program + -- associated with each tag/workspace + browser = 'env firefox', + editor = 'gvim', -- gui text editor + social = 'env discord', + game = rofi_command, + files = 'thunar', + }, + -- List of apps to start once on start-up + run_on_start_up = { + -- Add applications that need to be killed between reloads + -- to avoid multipled instances, inside the autostart script + '~/.config/awesome/configuration/autostart', -- Spawn "dirty" apps that can linger between sessions + 'compton', + 'nitrogen --restore', + 'nm-applet --indicator', -- wifi + 'xfce4-power-manager', -- Power manager + 'ibus-daemon --xim --daemonize', -- Ibus daemon for keyboard + 'scream-start', -- scream audio sink + 'numlockx on', -- enable numlock + '/usr/lib/xfce-polkit/xfce-polkit & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager + 'blueman-tray', -- bluetooth tray + } +} diff --git a/src/.config/awesome/redhound/configuration/autostart b/src/.config/awesome/redhound/configuration/autostart new file mode 100755 index 0000000..30fb586 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/autostart @@ -0,0 +1,43 @@ +#!/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 +# the script $HOME/.config/awesomestart +# is intended to be a copy of this file +# to allow out of tree autostart programs +APPS=( + keepassxc + kdeconnect-indicator + radeon-profile + $HOME/.config/awesomestart + ) +# Some applications start child applications that need to be killed on reload +KILL=( + synergyc + nextcloud + ) + +#Kill the polkit +killall xfce-polkit + +# 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/src/.config/awesome/redhound/configuration/client/buttons.lua b/src/.config/awesome/redhound/configuration/client/buttons.lua new file mode 100644 index 0000000..afb1b01 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/configuration/client/init.lua b/src/.config/awesome/redhound/configuration/client/init.lua new file mode 100644 index 0000000..bbd5480 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/client/init.lua @@ -0,0 +1 @@ +require('configuration.client.rules') diff --git a/src/.config/awesome/redhound/configuration/client/keys.lua b/src/.config/awesome/redhound/configuration/client/keys.lua new file mode 100644 index 0000000..0a8502f --- /dev/null +++ b/src/.config/awesome/redhound/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, 'Shift'}, + 'q', + function(c) + c:kill() + end, + {description = 'close', group = 'client'} + ) +) + +return clientKeys diff --git a/src/.config/awesome/redhound/configuration/client/rules.lua b/src/.config/awesome/redhound/configuration/client/rules.lua new file mode 100644 index 0000000..2413369 --- /dev/null +++ b/src/.config/awesome/redhound/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 = { + { + rule_any = {name = {'Konsole'}}, + properties = {skip_decoration = true} + }, + -- 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 + } + }, + -- 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/src/.config/awesome/redhound/configuration/init.lua b/src/.config/awesome/redhound/configuration/init.lua new file mode 100644 index 0000000..8ea676f --- /dev/null +++ b/src/.config/awesome/redhound/configuration/init.lua @@ -0,0 +1,4 @@ +return { + keys = require('configuration.keys'), + apps = require('configuration.apps') +} diff --git a/src/.config/awesome/redhound/configuration/keys/global.lua b/src/.config/awesome/redhound/configuration/keys/global.lua new file mode 100644 index 0000000..a44723a --- /dev/null +++ b/src/.config/awesome/redhound/configuration/keys/global.lua @@ -0,0 +1,481 @@ +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') + +function poweroff_command() + awful.spawn.with_shell('poweroff') + awful.keygrabber.stop(_G.exit_screen_grabber) +end + +-- 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'}, 'Left', awful.tag.viewprev, {description = 'view previous', group = 'tag'}), + awful.key({altkey, 'Control'}, 'Right', 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.awesome.spawn(apps.default.rofi) + end, + {description = 'show main menu', group = 'awesome'} + ), + awful.key( + {modkey}, + 'd', + function() + local flag = false + for _, c in ipairs(mouse.screen.selected_tag:clients()) do + if c.minimized == true then + flag = true + end + c.minimized = true + end + for _, c in ipairs(mouse.screen.selected_tag:clients()) do + if flag == true then + c.minimized = false + end + end + end, + {description = 'minimize all clients', 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( + {'Control','Shift'}, + '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( + {altkey}, + 'Print', + 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( + {'Control'}, + 'Print', + 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'} + ), + -- Open private browser/brave + awful.key( + {modkey}, + 'p', + function() + awful.util.spawn_with_shell('brave-browser') + end, + {description = 'Open Brave', group = 'launcher'} + ), + -- Standard program + awful.key( + {modkey}, + 't', + function() + awful.util.spawn_with_shell(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({modkey, 'Shift'}, 'p', + function() + _G.exit_screen_show() + end, + {description = 'end session menu', 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}, + 'n', + 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 + ), + -- Emoji typing + -- setup info at https://gist.github.com/HikariKnight/8562837d28dec3674dba027c7892e6a5 + awful.key( + {modkey}, + 'e', + function() + awful.util.spawn_with_shell('emoji-toggle') + end, + {description = 'Toggle the ibus unimoji engine for writing emojis', 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/src/.config/awesome/redhound/configuration/keys/init.lua b/src/.config/awesome/redhound/configuration/keys/init.lua new file mode 100644 index 0000000..9591667 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/keys/init.lua @@ -0,0 +1,4 @@ +return { + mod = require('configuration.keys.mod'), + global = require('configuration.keys.global') +} diff --git a/src/.config/awesome/redhound/configuration/keys/mod.lua b/src/.config/awesome/redhound/configuration/keys/mod.lua new file mode 100644 index 0000000..1d90897 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/keys/mod.lua @@ -0,0 +1,4 @@ +return { + modKey = 'Mod4', + altKey = 'Mod1' +} \ No newline at end of file diff --git a/src/.config/awesome/redhound/configuration/tags/init.lua b/src/.config/awesome/redhound/configuration/tags/init.lua new file mode 100644 index 0000000..8a8e2ec --- /dev/null +++ b/src/.config/awesome/redhound/configuration/tags/init.lua @@ -0,0 +1,81 @@ +local awful = require('awful') +local gears = require('gears') +local icons = require('theme.icons') +local apps = require('configuration.apps') + +local tags = { + { + icon = icons.firefox, + type = 'firefox', + defaultApp = apps.default.browser, + screen = 1 + }, + { + icon = icons.code, + type = 'code', + defaultApp = apps.default.editor, + screen = 1 + }, + { + icon = icons.folder, + type = 'files', + defaultApp = apps.default.files, + screen = 1 + }, + { + icon = icons.console, + type = 'console', + defaultApp = apps.default.terminal, + screen = 1 + }, + { + icon = icons.social, + type = 'social', + defaultApp = apps.default.social, + 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 = true, + 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 = 4 + else + t.gap = 4 + end + end +) diff --git a/src/.config/awesome/redhound/configuration/tags/layouts/single-maximized.lua b/src/.config/awesome/redhound/configuration/tags/layouts/single-maximized.lua new file mode 100644 index 0000000..25ad73e --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/configuration/utils/screenshot b/src/.config/awesome/redhound/configuration/utils/screenshot new file mode 100755 index 0000000..b8c09e3 --- /dev/null +++ b/src/.config/awesome/redhound/configuration/utils/screenshot @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $1 == "--delayed" ]; then + sleep 10 ; spectacle -b -n ${@:2} -o /tmp/screenshot.png ; xclip -selection clipboard -target image/png -i /tmp/screenshot.png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga +else + spectacle -b -n $@ -o /tmp/screenshot.png ; xclip -selection clipboard -target image/png -i /tmp/screenshot.png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga +fi + + diff --git a/src/.config/awesome/redhound/layout/README.md b/src/.config/awesome/redhound/layout/README.md new file mode 100644 index 0000000..b157692 --- /dev/null +++ b/src/.config/awesome/redhound/layout/README.md @@ -0,0 +1 @@ +## Layout diff --git a/src/.config/awesome/redhound/layout/clock-panel.lua b/src/.config/awesome/redhound/layout/clock-panel.lua new file mode 100644 index 0000000..1daebe4 --- /dev/null +++ b/src/.config/awesome/redhound/layout/clock-panel.lua @@ -0,0 +1,63 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local TagList = require('widget.tag-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('%H:%M') + +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(8), dpi(8), dpi(8), dpi(8)) + +local ClockPanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsety = dpi(4) + end + local panel = + wibox( + { + ontop = false, + screen = s, + height = dpi(32), + width = dpi(48), + x = s.geometry.width - dpi(184), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = { + top = dpi(32) + } + } + ) + + panel:struts( + { + top = dpi(0) + } + ) + + panel:setup { + layout = wibox.layout.fixed.horizontal, + clock_widget, + } + + return panel +end + +return ClockPanel diff --git a/src/.config/awesome/redhound/layout/date-panel.lua b/src/.config/awesome/redhound/layout/date-panel.lua new file mode 100644 index 0000000..b4bf85a --- /dev/null +++ b/src/.config/awesome/redhound/layout/date-panel.lua @@ -0,0 +1,60 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local gears = require('gears') +local clickable_container = require('widget.material.clickable-container') + +local dpi = require('beautiful').xresources.apply_dpi + +local icons = require('theme.icons') + +local textclock = wibox.widget.textclock('%d.%m.%Y\n %H:%M') + +local month_calendar = awful.widget.calendar_popup.month({ + screen = s, + start_sunday = false, + week_numbers = true +}) +month_calendar:attach(textclock) + +local date_widget = wibox.container.margin(textclock, dpi(8), dpi(8), dpi(8), dpi(8)) + +local DatePanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(128) + offsety = dpi(4) + end + local panel = + wibox( + { + ontop = false, + screen = s, + height = dpi(32), + width = dpi(80), + x = s.geometry.width - dpi(130), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_500, + fg = beautiful.fg_normal, + struts = { + top = dpi(32) + } + } + ) + + panel:struts( + { + top = dpi(0) + } + ) + + panel:setup { + layout = wibox.layout.fixed.horizontal, + date_widget, + } + + return panel +end + +return DatePanel diff --git a/src/.config/awesome/redhound/layout/init.lua b/src/.config/awesome/redhound/layout/init.lua new file mode 100644 index 0000000..a134ef2 --- /dev/null +++ b/src/.config/awesome/redhound/layout/init.lua @@ -0,0 +1,74 @@ +local awful = require('awful') +local left_panel = require('layout.left-panel') +local workspace_panel = require('layout.workspace-panel') +local tasklist_panel = require('layout.tasklist-panel') +local mode_panel = require('layout.mode-panel') +local date_panel = require('layout.date-panel') +local clock_panel = require('layout.clock-panel') +local systemtray_panel = require('layout.systemtray-panel') + +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen( + function(s) + if s.index == 1 then + s.left_panel = left_panel(s) + s.mode_panel = mode_panel(s, true) + s.tasklist_panel = tasklist_panel(s, true) + s.workspace_panel = workspace_panel(s, true) + s.date_panel = date_panel(s, true) + s.clock_panel = clock_panel(s, true) + s.systemtray_panel = systemtray_panel(s, true) + else + s.mode_panel = mode_panel(s, false) + s.workspace_panel = workspace_panel(s, false) + s.tasklist_panel = tasklist_panel(s, false) + s.date_panel = date_panel(s, false) + s.clock_panel = clock_panel(s, false) + s.systemtray_panel = systemtray_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.workspace_panel.visible = not fullscreen + s.mode_panel.visible = not fullscreen + s.tasklist_panel.visible = not fullscreen + s.date_panel.visible = not fullscreen + s.clock_panel.visible = not fullscreen + s.systemtray_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/src/.config/awesome/redhound/layout/left-panel/action-bar.lua b/src/.config/awesome/redhound/layout/left-panel/action-bar.lua new file mode 100644 index 0000000..b02b9b0 --- /dev/null +++ b/src/.config/awesome/redhound/layout/left-panel/action-bar.lua @@ -0,0 +1,68 @@ +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) + 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 + }, + visible = true, + 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 + home_button.visible = false + end + ) + + panel:connect_signal( + 'closed', + function() + menu_icon.icon = icons.menu + home_button.visible = true + end + ) + + return wibox.widget { + id = 'action_bar', + layout = wibox.layout.align.horizontal, + forced_width = action_bar_width, + { + layout = wibox.layout.fixed.horizontal, + home_button, + } + } +end diff --git a/src/.config/awesome/redhound/layout/left-panel/dashboard/hardware-monitor.lua b/src/.config/awesome/redhound/layout/left-panel/dashboard/hardware-monitor.lua new file mode 100644 index 0000000..e052a57 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/layout/left-panel/dashboard/init.lua b/src/.config/awesome/redhound/layout/left-panel/dashboard/init.lua new file mode 100644 index 0000000..b7076af --- /dev/null +++ b/src/.config/awesome/redhound/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.primary.hue_800, + widget = wibox.container.background + }, + wibox.widget { + orientation = 'horizontal', + forced_height = 0.8, + opacity = 0.3, + 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.primary.hue_800, + widget = wibox.container.background + } + } + } +end diff --git a/src/.config/awesome/redhound/layout/left-panel/dashboard/quick-settings.lua b/src/.config/awesome/redhound/layout/left-panel/dashboard/quick-settings.lua new file mode 100644 index 0000000..d85529c --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/layout/left-panel/init.lua b/src/.config/awesome/redhound/layout/left-panel/init.lua new file mode 100644 index 0000000..e590316 --- /dev/null +++ b/src/.config/awesome/redhound/layout/left-panel/init.lua @@ -0,0 +1,122 @@ +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(32) + local panel_content_width = dpi(400) + + local panel = + wibox { + screen = screen, + width = dpi(32), + height = dpi(32), + x = screen.geometry.x + 12, + y = screen.geometry.y + 4, + ontop = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal + } + + panel.opened = false + + panel:struts( + { + left = dpi(0) + } + ) + + 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 = panel_content_width + panel.height = screen.geometry.height + backdrop.visible = true + panel.visible = false + panel.visible = true + panel.x = screen.geometry.x + panel.y = screen.geometry.y + panel.ontop = 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.height = dpi(32) + panel:get_children_by_id('panel_content')[1].visible = false + backdrop.visible = false + panel.ontop = false + panel.x = screen.geometry.x + 12 + panel.y = screen.geometry.y + 4 + 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 { + require('layout.left-panel.action-bar')(screen, panel, action_bar_width), + layout = wibox.layout.align.vertical, + { + id = 'panel_content', + bg = beautiful.primary.hue_900, + widget = wibox.container.background, + visible = false, + forced_width = panel_content_width, + { + require('layout.left-panel.dashboard')(screen, panel), + layout = wibox.layout.stack + } + }, + } + return panel +end + +return left_panel diff --git a/src/.config/awesome/redhound/layout/mode-panel.lua b/src/.config/awesome/redhound/layout/mode-panel.lua new file mode 100644 index 0000000..e5cb175 --- /dev/null +++ b/src/.config/awesome/redhound/layout/mode-panel.lua @@ -0,0 +1,93 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +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') + +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 ModePanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(512) + offsety = dpi(4) + end + local panel = + wibox( + { + ontop = false, + screen = s, + height = dpi(32), + width = dpi(32), + x = s.geometry.width - dpi(44), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = { + top = dpi(32) + } + } + ) + + panel:struts( + { + top = dpi(0) + } + ) + + panel:setup { + layout = wibox.layout.align.horizontal, + { + layout = wibox.layout.fixed.horizontal, + LayoutBox(s) + }, + nil, + nil + } + + return panel +end + +return ModePanel diff --git a/src/.config/awesome/redhound/layout/systemtray-panel.lua b/src/.config/awesome/redhound/layout/systemtray-panel.lua new file mode 100644 index 0000000..0adb834 --- /dev/null +++ b/src/.config/awesome/redhound/layout/systemtray-panel.lua @@ -0,0 +1,59 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local TagList = require('widget.tag-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') + +local systray = wibox.widget.systray() +systray:set_horizontal(true) +systray:set_base_size(32) + +local TopPanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(128) + offsety = dpi(4) + end + local panel = + wibox( + { + ontop = false, + screen = s, + height = dpi(32), + width = dpi(128), + x = s.geometry.width - dpi(318), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = { + top = dpi(32) + } + } + ) + + panel:struts( + { + top = dpi(0) + } + ) + + panel:setup { + layout = wibox.layout.align.horizontal, + wibox.container.margin(systray, dpi(4), dpi(4), dpi(4), dpi(4)), + nil, + require('widget.battery'), + } + + return panel +end + +return TopPanel diff --git a/src/.config/awesome/redhound/layout/tasklist-panel.lua b/src/.config/awesome/redhound/layout/tasklist-panel.lua new file mode 100644 index 0000000..5849499 --- /dev/null +++ b/src/.config/awesome/redhound/layout/tasklist-panel.lua @@ -0,0 +1,135 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local TagList = require('widget.tag-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 TasklistPanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(512) + offsety = dpi(4) + end + local panel = + wibox( + { + ontop = false, + screen = s, + height = dpi(32), + width = s.geometry.width - 2 * offsetx, + x = s.geometry.x + offsetx, + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = { + top = dpi(32) + } + } + ) + + panel:struts( + { + top = dpi(34) + } + ) + + panel:setup { + layout = wibox.layout.align.horizontal, + { + layout = wibox.layout.fixed.horizontal, + TaskList(s), + --add_button + }, + nil, + nil + } + + return panel +end + +return TasklistPanel diff --git a/src/.config/awesome/redhound/layout/workspace-panel.lua b/src/.config/awesome/redhound/layout/workspace-panel.lua new file mode 100644 index 0000000..cd43902 --- /dev/null +++ b/src/.config/awesome/redhound/layout/workspace-panel.lua @@ -0,0 +1,52 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TagList = require('widget.tag-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') + +local WorkspacePanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(50) + offsety = dpi(4) + end + local panel = + wibox( + { + ontop = false, + screen = s, + height = dpi(32), + width = dpi(180), + x = s.geometry.x + offsetx, + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = { + top = dpi(32) + } + } + ) + + panel:struts( + { + top = dpi(0) + } + ) + + panel:setup { + layout = wibox.layout.align.horizontal, + TagList(s) + } + + return panel +end + +return WorkspacePanel diff --git a/src/.config/awesome/redhound/module/README.md b/src/.config/awesome/redhound/module/README.md new file mode 100644 index 0000000..097d4f9 --- /dev/null +++ b/src/.config/awesome/redhound/module/README.md @@ -0,0 +1 @@ +## Module \ No newline at end of file diff --git a/src/.config/awesome/redhound/module/auto-start.lua b/src/.config/awesome/redhound/module/auto-start.lua new file mode 100644 index 0000000..b6d0746 --- /dev/null +++ b/src/.config/awesome/redhound/module/auto-start.lua @@ -0,0 +1,19 @@ +-- 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)) + --This broke compton ===> awful.spawn.single_instance(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/src/.config/awesome/redhound/module/backdrop.lua b/src/.config/awesome/redhound/module/backdrop.lua new file mode 100644 index 0000000..396c375 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/module/decorate-client.lua b/src/.config/awesome/redhound/module/decorate-client.lua new file mode 100644 index 0000000..de0cca0 --- /dev/null +++ b/src/.config/awesome/redhound/module/decorate-client.lua @@ -0,0 +1,107 @@ +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.border_width = 3 + client.shape = function(cr, w, h) + gears.shape.rectangle(cr, w, h) + 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/src/.config/awesome/redhound/module/exit-screen.lua b/src/.config/awesome/redhound/module/exit-screen.lua new file mode 100644 index 0000000..15a86ad --- /dev/null +++ b/src/.config/awesome/redhound/module/exit-screen.lua @@ -0,0 +1,200 @@ +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() + 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/src/.config/awesome/redhound/module/notifications.lua b/src/.config/awesome/redhound/module/notifications.lua new file mode 100644 index 0000000..6d49f4d --- /dev/null +++ b/src/.config/awesome/redhound/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.rectangle +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/src/.config/awesome/redhound/module/quake-terminal.lua b/src/.config/awesome/redhound/module/quake-terminal.lua new file mode 100644 index 0000000..1238a65 --- /dev/null +++ b/src/.config/awesome/redhound/module/quake-terminal.lua @@ -0,0 +1,72 @@ +local awful = require('awful') +local spawn = require('awful.spawn') +local app = require('configuration.apps').default.quake +local dpi = require('beautiful').xresources.apply_dpi + +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() + client.focus = quake_client + quake_client:raise() +-- awful.client.focus(quake_id) + else + close_quake() + end + end +end + +_G.client.connect_signal( + 'manage', + function(c) + if (c.pid == quake_id) then + quake_client = c + c.x = c.screen.geometry.x + c.y = c.screen.geometry.height - dpi(408) + 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/src/.config/awesome/redhound/rc.lua b/src/.config/awesome/redhound/rc.lua new file mode 100644 index 0000000..5e08fa0 --- /dev/null +++ b/src/.config/awesome/redhound/rc.lua @@ -0,0 +1,64 @@ +local gears = require('gears') +local awful = require('awful') +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') +require('module.quake-terminal') +-- Backdrop causes bugs on some gtk3 applications +--require('module.backdrop') +require('module.exit-screen') + +-- Setup all configurations +require('configuration.client') +require('configuration.tags') +_G.root.keys(require('configuration.keys.global')) + +-- 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/src/.config/awesome/redhound/theme/README.md b/src/.config/awesome/redhound/theme/README.md new file mode 100644 index 0000000..6c558eb --- /dev/null +++ b/src/.config/awesome/redhound/theme/README.md @@ -0,0 +1 @@ +## Theme \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/default-theme.lua b/src/.config/awesome/redhound/theme/default-theme.lua new file mode 100644 index 0000000..735c69d --- /dev/null +++ b/src/.config/awesome/redhound/theme/default-theme.lua @@ -0,0 +1,108 @@ +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.orange + +-- 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.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.primary.hue_900 + theme.bg_focus = '#5a5a5a' + theme.bg_urgent = '#3F3F3F' + theme.bg_systray = theme.primary.hue_900 + + -- Borders + + theme.border_width = dpi(1) + theme.border_normal = theme.primary.hue_900 + theme.border_focus = theme.primary.hue_500 + 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' + theme.layout_floating = theme.icons .. 'layouts/floating.png' + + -- Taglist + + theme.taglist_bg_empty = theme.primary.hue_900 + theme.taglist_bg_occupied = theme.primary.hue_900 + theme.taglist_bg_urgent = + 'linear:0,0:0,' .. + dpi(48) .. + ':0,' .. + theme.accent.hue_500 .. + ':0.07,' .. theme.accent.hue_500 .. ':0.07,' .. theme.primary.hue_900 .. ':1,' .. theme.primary.hue_900 + theme.taglist_bg_focus = + 'linear:0,0:0,' .. + dpi(32) .. + ':0,' .. + theme.primary.hue_900 .. + ':0.9,' .. theme.primary.hue_900 .. ':0.9,' .. theme.primary.hue_500 .. ':1,' .. theme.primary.hue_500 + + -- Tasklist + + theme.tasklist_font = 'Roboto medium 11' + theme.tasklist_bg_normal = theme.primary.hue_900 + theme.tasklist_bg_focus = + 'linear:0,0:0,' .. + dpi(32) .. + ':0,' .. + theme.primary.hue_900 .. + ':0.9,' .. theme.primary.hue_900 .. ':0.9,' .. theme.fg_normal .. ':1,' .. theme.fg_normal + theme.tasklist_bg_urgent = theme.primary.hue_900 + 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(1) + theme.border_focus = theme.primary.hue_500 + theme.border_normal = theme.primary.hue_900 +end +return { + theme = theme, + awesome_overrides = awesome_overrides +} diff --git a/src/.config/awesome/redhound/theme/icons/brightness-7.svg b/src/.config/awesome/redhound/theme/icons/brightness-7.svg new file mode 100644 index 0000000..fe7aa9d --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/brightness-7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/burn-solid.svg b/src/.config/awesome/redhound/theme/icons/burn-solid.svg new file mode 100644 index 0000000..5fac9ba --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/burn-solid.svg @@ -0,0 +1,60 @@ + + diff --git a/src/.config/awesome/redhound/theme/icons/chart-areaspline.svg b/src/.config/awesome/redhound/theme/icons/chart-areaspline.svg new file mode 100644 index 0000000..9941ba5 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/chart-areaspline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/close.svg b/src/.config/awesome/redhound/theme/icons/close.svg new file mode 100644 index 0000000..3f1f88c --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/code-braces.svg b/src/.config/awesome/redhound/theme/icons/code-braces.svg new file mode 100644 index 0000000..6adb566 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/code-braces.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/code-solid.svg b/src/.config/awesome/redhound/theme/icons/code-solid.svg new file mode 100644 index 0000000..4b02076 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/code-solid.svg @@ -0,0 +1,60 @@ + + diff --git a/src/.config/awesome/redhound/theme/icons/console.svg b/src/.config/awesome/redhound/theme/icons/console.svg new file mode 100644 index 0000000..900b48e --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/console.svg @@ -0,0 +1,54 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/src/.config/awesome/redhound/theme/icons/envelope-solid.svg b/src/.config/awesome/redhound/theme/icons/envelope-solid.svg new file mode 100644 index 0000000..41c1224 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/envelope-solid.svg @@ -0,0 +1,60 @@ + + diff --git a/src/.config/awesome/redhound/theme/icons/firefox.svg b/src/.config/awesome/redhound/theme/icons/firefox.svg new file mode 100644 index 0000000..3dee646 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/firefox.svg @@ -0,0 +1,54 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/src/.config/awesome/redhound/theme/icons/flask.svg b/src/.config/awesome/redhound/theme/icons/flask.svg new file mode 100644 index 0000000..dba8a2f --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/flask.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/folder-regular.svg b/src/.config/awesome/redhound/theme/icons/folder-regular.svg new file mode 100644 index 0000000..cd2be70 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/folder-regular.svg @@ -0,0 +1,60 @@ + + diff --git a/src/.config/awesome/redhound/theme/icons/folder.svg b/src/.config/awesome/redhound/theme/icons/folder.svg new file mode 100644 index 0000000..146c65b --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/folder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/forum.svg b/src/.config/awesome/redhound/theme/icons/forum.svg new file mode 100644 index 0000000..08bd17e --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/forum.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/google-chrome.svg b/src/.config/awesome/redhound/theme/icons/google-chrome.svg new file mode 100644 index 0000000..6c68b70 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/google-chrome.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/google-controller.svg b/src/.config/awesome/redhound/theme/icons/google-controller.svg new file mode 100644 index 0000000..12c6869 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/google-controller.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/harddisk.svg b/src/.config/awesome/redhound/theme/icons/harddisk.svg new file mode 100644 index 0000000..f0b97b9 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/harddisk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/init.lua b/src/.config/awesome/redhound/theme/icons/init.lua new file mode 100644 index 0000000..3a1e488 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/init.lua @@ -0,0 +1,30 @@ +local dir = os.getenv('HOME') .. '/.config/awesome/theme/icons' + +return { + --tags + chrome = dir .. '/google-chrome.svg', + firefox = dir .. '/firefox.svg', + console = dir .. '/console.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/src/.config/awesome/redhound/theme/icons/layouts/arrow-expand-all.png b/src/.config/awesome/redhound/theme/icons/layouts/arrow-expand-all.png new file mode 100644 index 0000000..2837ec1 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/layouts/arrow-expand-all.png differ diff --git a/src/.config/awesome/redhound/theme/icons/layouts/floating.png b/src/.config/awesome/redhound/theme/icons/layouts/floating.png new file mode 100644 index 0000000..5b1cab1 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/layouts/floating.png differ diff --git a/src/.config/awesome/redhound/theme/icons/layouts/view-quilt.png b/src/.config/awesome/redhound/theme/icons/layouts/view-quilt.png new file mode 100644 index 0000000..d2e8f5b Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/layouts/view-quilt.png differ diff --git a/src/.config/awesome/redhound/theme/icons/lock.svg b/src/.config/awesome/redhound/theme/icons/lock.svg new file mode 100644 index 0000000..be008aa --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/logout.svg b/src/.config/awesome/redhound/theme/icons/logout.svg new file mode 100644 index 0000000..a21eba9 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/logout.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/magnify.svg b/src/.config/awesome/redhound/theme/icons/magnify.svg new file mode 100644 index 0000000..bf67346 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/magnify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/memory.svg b/src/.config/awesome/redhound/theme/icons/memory.svg new file mode 100644 index 0000000..f2ab11c --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/memory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/menu.svg b/src/.config/awesome/redhound/theme/icons/menu.svg new file mode 100644 index 0000000..a6c9c25 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/music.svg b/src/.config/awesome/redhound/theme/icons/music.svg new file mode 100644 index 0000000..f9da5f0 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/music.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/plus.svg b/src/.config/awesome/redhound/theme/icons/plus.svg new file mode 100644 index 0000000..e3b6570 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/power-sleep.svg b/src/.config/awesome/redhound/theme/icons/power-sleep.svg new file mode 100644 index 0000000..18bb026 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/power-sleep.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/power.svg b/src/.config/awesome/redhound/theme/icons/power.svg new file mode 100644 index 0000000..d0bc700 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/power.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/restart.svg b/src/.config/awesome/redhound/theme/icons/restart.svg new file mode 100644 index 0000000..4a9877e --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/restart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/ship-wheel.svg b/src/.config/awesome/redhound/theme/icons/ship-wheel.svg new file mode 100644 index 0000000..dc4ed3e --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/ship-wheel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/occupied.png b/src/.config/awesome/redhound/theme/icons/tag-list/occupied.png new file mode 100644 index 0000000..e7ccbf0 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/occupied.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/panel.png b/src/.config/awesome/redhound/theme/icons/tag-list/panel.png new file mode 100644 index 0000000..d7699ce Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/panel.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/selected.png b/src/.config/awesome/redhound/theme/icons/tag-list/selected.png new file mode 100644 index 0000000..897f960 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/selected.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/close.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/close.png new file mode 100644 index 0000000..fc93da0 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/close.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/code-braces.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/code-braces.png new file mode 100644 index 0000000..c16729c Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/code-braces.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/flask.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/flask.png new file mode 100644 index 0000000..da03025 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/flask.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/folder.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/folder.png new file mode 100644 index 0000000..f9565ef Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/folder.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/forum.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/forum.png new file mode 100644 index 0000000..d06a197 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/forum.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/google-chrome.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/google-chrome.png new file mode 100644 index 0000000..6f8f589 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/google-chrome.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/google-controller.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/google-controller.png new file mode 100644 index 0000000..3d37722 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/google-controller.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/home.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/home.png new file mode 100644 index 0000000..d907479 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/home.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/tag/music.png b/src/.config/awesome/redhound/theme/icons/tag-list/tag/music.png new file mode 100644 index 0000000..d2ca843 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/tag/music.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/unselected.png b/src/.config/awesome/redhound/theme/icons/tag-list/unselected.png new file mode 100644 index 0000000..8e5563c Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/unselected.png differ diff --git a/src/.config/awesome/redhound/theme/icons/tag-list/urgent.png b/src/.config/awesome/redhound/theme/icons/tag-list/urgent.png new file mode 100644 index 0000000..d943de1 Binary files /dev/null and b/src/.config/awesome/redhound/theme/icons/tag-list/urgent.png differ diff --git a/src/.config/awesome/redhound/theme/icons/terminal-solid.svg b/src/.config/awesome/redhound/theme/icons/terminal-solid.svg new file mode 100644 index 0000000..a7aa008 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/terminal-solid.svg @@ -0,0 +1,60 @@ + + diff --git a/src/.config/awesome/redhound/theme/icons/thermometer.svg b/src/.config/awesome/redhound/theme/icons/thermometer.svg new file mode 100644 index 0000000..d901827 --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/thermometer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/icons/volume-high.svg b/src/.config/awesome/redhound/theme/icons/volume-high.svg new file mode 100644 index 0000000..9bee38d --- /dev/null +++ b/src/.config/awesome/redhound/theme/icons/volume-high.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/redhound/theme/init.lua b/src/.config/awesome/redhound/theme/init.lua new file mode 100644 index 0000000..d9cb5ab --- /dev/null +++ b/src/.config/awesome/redhound/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.redhound') + +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/src/.config/awesome/redhound/theme/mat-colors.lua b/src/.config/awesome/redhound/theme/mat-colors.lua new file mode 100644 index 0000000..44748f6 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/theme/redhound/init.lua b/src/.config/awesome/redhound/theme/redhound/init.lua new file mode 100644 index 0000000..fbb6983 --- /dev/null +++ b/src/.config/awesome/redhound/theme/redhound/init.lua @@ -0,0 +1,31 @@ +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.grey +theme.primary.hue_500 = '#d03c3f' +-- theme.primary = mat_colors.indigo +-- Accent +theme.accent = mat_colors.orange + +-- Background +theme.background = mat_colors.blue_grey + +theme.background.hue_800 = '#2e2e2e' +theme.background.hue_900 = '#1a1a1a' + +local awesome_overrides = function(theme) + -- +end +return { + theme = theme, + awesome_overrides = awesome_overrides +} diff --git a/src/.config/awesome/redhound/widget/README.md b/src/.config/awesome/redhound/widget/README.md new file mode 100644 index 0000000..323b72b --- /dev/null +++ b/src/.config/awesome/redhound/widget/README.md @@ -0,0 +1 @@ +## Widget \ No newline at end of file diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-10.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-10.svg new file mode 100644 index 0000000..19cbf1b --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-10.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-20.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-20.svg new file mode 100644 index 0000000..9f43900 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-20.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-30.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-30.svg new file mode 100644 index 0000000..7e24035 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-30.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-40.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-40.svg new file mode 100644 index 0000000..6d5f15a --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-40.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-50.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-50.svg new file mode 100644 index 0000000..e2d0db0 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-50.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-60.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-60.svg new file mode 100644 index 0000000..2974479 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-60.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-70.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-70.svg new file mode 100644 index 0000000..d0ac917 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-70.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-80.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-80.svg new file mode 100644 index 0000000..a046a8f --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-80.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-90.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-90.svg new file mode 100644 index 0000000..2a4f448 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-90.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-alert.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-alert.svg new file mode 100644 index 0000000..1ff450f --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-10.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-10.svg new file mode 100644 index 0000000..e5945c1 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-10.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-100.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-100.svg new file mode 100644 index 0000000..9713fb3 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-100.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-20.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-20.svg new file mode 100644 index 0000000..a7adc99 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-20.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-30.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-30.svg new file mode 100644 index 0000000..612cd6f --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-30.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-40.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-40.svg new file mode 100644 index 0000000..f0e3a0d --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-40.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-50.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-50.svg new file mode 100644 index 0000000..f0e3a0d --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-50.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-60.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-60.svg new file mode 100644 index 0000000..5cd577a --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-60.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-70.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-70.svg new file mode 100644 index 0000000..6af3dbe --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-70.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-80.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-80.svg new file mode 100644 index 0000000..e48879a --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-80.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-90.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-90.svg new file mode 100644 index 0000000..a045bb2 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-90.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging-outline.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-outline.svg new file mode 100644 index 0000000..4b2c706 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-charging.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-charging.svg new file mode 100644 index 0000000..97e03c5 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-charging.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-minus.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-minus.svg new file mode 100644 index 0000000..24b4dad --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-minus.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-negative.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-negative.svg new file mode 100644 index 0000000..1c0da8f --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-negative.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-outline.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-outline.svg new file mode 100644 index 0000000..75f5d38 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-plus.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-plus.svg new file mode 100644 index 0000000..5322247 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-plus.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-positive.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-positive.svg new file mode 100644 index 0000000..bdc342c --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-positive.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-standard.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-standard.svg new file mode 100644 index 0000000..4e3dd16 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-standard.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery-unknown.svg b/src/.config/awesome/redhound/widget/battery/icons/battery-unknown.svg new file mode 100644 index 0000000..8c46268 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery-unknown.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/icons/battery.svg b/src/.config/awesome/redhound/widget/battery/icons/battery.svg new file mode 100644 index 0000000..7289a0b --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/icons/battery.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/battery/init.lua b/src/.config/awesome/redhound/widget/battery/init.lua new file mode 100644 index 0000000..904c3e1 --- /dev/null +++ b/src/.config/awesome/redhound/widget/battery/init.lua @@ -0,0 +1,146 @@ +------------------------------------------------- +-- 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, + opacity = 0.8 +} + +local widget_button = clickable_container(wibox.container.margin(widget, dpi(0), dpi(8), dpi(8), dpi(8))) +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/src/.config/awesome/redhound/widget/bluetooth/icons/bluetooth-off.svg b/src/.config/awesome/redhound/widget/bluetooth/icons/bluetooth-off.svg new file mode 100644 index 0000000..f3e52ab --- /dev/null +++ b/src/.config/awesome/redhound/widget/bluetooth/icons/bluetooth-off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/bluetooth/icons/bluetooth.svg b/src/.config/awesome/redhound/widget/bluetooth/icons/bluetooth.svg new file mode 100644 index 0000000..32fbc3e --- /dev/null +++ b/src/.config/awesome/redhound/widget/bluetooth/icons/bluetooth.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/bluetooth/init.lua b/src/.config/awesome/redhound/widget/bluetooth/init.lua new file mode 100644 index 0000000..2126a4a --- /dev/null +++ b/src/.config/awesome/redhound/widget/bluetooth/init.lua @@ -0,0 +1 @@ +-- TODO diff --git a/src/.config/awesome/redhound/widget/brightness/brightness-slider.lua b/src/.config/awesome/redhound/widget/brightness/brightness-slider.lua new file mode 100644 index 0000000..e67fc8b --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/cpu/cpu-meter.lua b/src/.config/awesome/redhound/widget/cpu/cpu-meter.lua new file mode 100644 index 0000000..f112e2a --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/harddrive/harddrive-meter.lua b/src/.config/awesome/redhound/widget/harddrive/harddrive-meter.lua new file mode 100644 index 0000000..6ca0f09 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/material/clickable-container.lua b/src/.config/awesome/redhound/widget/material/clickable-container.lua new file mode 100644 index 0000000..14b79c7 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/material/icon-button.lua b/src/.config/awesome/redhound/widget/material/icon-button.lua new file mode 100644 index 0000000..d0c64a8 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/material/icon.lua b/src/.config/awesome/redhound/widget/material/icon.lua new file mode 100644 index 0000000..82ce50f --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/material/list-item.lua b/src/.config/awesome/redhound/widget/material/list-item.lua new file mode 100644 index 0000000..616ce68 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/material/slider.lua b/src/.config/awesome/redhound/widget/material/slider.lua new file mode 100644 index 0000000..7e71d84 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/package-updater/icons/package-up.svg b/src/.config/awesome/redhound/widget/package-updater/icons/package-up.svg new file mode 100644 index 0000000..0d6ac4c --- /dev/null +++ b/src/.config/awesome/redhound/widget/package-updater/icons/package-up.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/package-updater/icons/package.svg b/src/.config/awesome/redhound/widget/package-updater/icons/package.svg new file mode 100644 index 0000000..aaa79af --- /dev/null +++ b/src/.config/awesome/redhound/widget/package-updater/icons/package.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/package-updater/init.lua b/src/.config/awesome/redhound/widget/package-updater/init.lua new file mode 100644 index 0000000..bbfe686 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/ram/ram-meter.lua b/src/.config/awesome/redhound/widget/ram/ram-meter.lua new file mode 100644 index 0000000..970e185 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/tag-list.lua b/src/.config/awesome/redhound/widget/tag-list.lua new file mode 100644 index 0000000..79c4f93 --- /dev/null +++ b/src/.config/awesome/redhound/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(8), dpi(8), dpi(2), dpi(2)) + ibm = wibox.container.margin(ib, dpi(8), dpi(8), dpi(9), dpi(9)) + 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.horizontal() + ) +end +return TagList diff --git a/src/.config/awesome/redhound/widget/task-list.lua b/src/.config/awesome/redhound/widget/task-list.lua new file mode 100644 index 0000000..61c6821 --- /dev/null +++ b/src/.config/awesome/redhound/widget/task-list.lua @@ -0,0 +1,220 @@ +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') +local tasklist_mode = 'icon' --anything else = text +local tasklist_close = false +--- 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(8), dpi(8), dpi(8)) + 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) + if tasklist_close then + ll:add(cbm) + end + + 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 tasklist_mode == 'icon' then + text = nil + end + 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 + ib.resize = true + 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/src/.config/awesome/redhound/widget/temperature/temperature-meter.lua b/src/.config/awesome/redhound/widget/temperature/temperature-meter.lua new file mode 100644 index 0000000..52162c2 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/volume/volume-slider.lua b/src/.config/awesome/redhound/widget/volume/volume-slider.lua new file mode 100644 index 0000000..7042780 --- /dev/null +++ b/src/.config/awesome/redhound/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/src/.config/awesome/redhound/widget/wifi/icons/wifi-off.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-off.svg new file mode 100644 index 0000000..dbcbc7a --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1-alert.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1-alert.svg new file mode 100644 index 0000000..0864095 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1-lock.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1-lock.svg new file mode 100644 index 0000000..3930208 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1.svg new file mode 100644 index 0000000..e6f582d --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2-alert.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2-alert.svg new file mode 100644 index 0000000..bc112f5 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2-lock.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2-lock.svg new file mode 100644 index 0000000..9bfd230 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2.svg new file mode 100644 index 0000000..4934b17 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3-alert.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3-alert.svg new file mode 100644 index 0000000..0ffe697 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3-lock.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3-lock.svg new file mode 100644 index 0000000..d84dc47 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3.svg new file mode 100644 index 0000000..85e2ef1 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-3.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4-alert.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4-alert.svg new file mode 100644 index 0000000..1eabecc --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4-alert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4-lock.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4-lock.svg new file mode 100644 index 0000000..f01ec4d --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4-lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4.svg new file mode 100644 index 0000000..700229a --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-4.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-alert-outline.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-alert-outline.svg new file mode 100644 index 0000000..0f46928 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-alert-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-lock-outline.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-lock-outline.svg new file mode 100644 index 0000000..3edc636 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-lock-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-off-outline.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-off-outline.svg new file mode 100644 index 0000000..b297a3d --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-off-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-off.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-off.svg new file mode 100644 index 0000000..6be11e0 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-outline.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-outline.svg new file mode 100644 index 0000000..00fcd26 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi-strength-outline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/icons/wifi.svg b/src/.config/awesome/redhound/widget/wifi/icons/wifi.svg new file mode 100644 index 0000000..7887868 --- /dev/null +++ b/src/.config/awesome/redhound/widget/wifi/icons/wifi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/.config/awesome/redhound/widget/wifi/init.lua b/src/.config/awesome/redhound/widget/wifi/init.lua new file mode 100644 index 0000000..752428b --- /dev/null +++ b/src/.config/awesome/redhound/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 diff --git a/src/.config/awesome/werewolf/configuration/README.md b/src/.config/awesome/werewolf/configuration/README.md new file mode 100644 index 0000000..abf1a44 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/README.md @@ -0,0 +1,4 @@ +## Configuration + +Here you will find all the settings available. + diff --git a/src/.config/awesome/werewolf/configuration/apps.lua b/src/.config/awesome/werewolf/configuration/apps.lua new file mode 100644 index 0000000..7526bec --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/apps.lua @@ -0,0 +1,41 @@ +local filesystem = require('gears.filesystem') +local with_dpi = require('beautiful').xresources.apply_dpi +local get_dpi = require('beautiful').xresources.get_dpi +local rofi_command = 'env /usr/bin/rofi -show drun -display-drun -run-command "/bin/bash -c -i \'shopt -s expand_aliases; {cmd}\'"' + +return { + -- List of apps to start by default on some actions + default = { + terminal = 'env termite', + rofi = rofi_command, + lock = 'i3lock-fancy', + quake = 'termite', + screenshot = '~/.config/awesome/configuration/utils/screenshot -m', + region_screenshot = '~/.config/awesome/configuration/utils/screenshot -r', + delayed_screenshot = '~/.config/awesome/configuration/utils/screenshot --delayed -r', + + -- Editing these also edits the default program + -- associated with each tag/workspace + browser = 'env firefox', + editor = 'gvim', -- gui text editor + social = 'env discord', + game = rofi_command, + files = 'dolphin', + music = rofi_command + }, + -- List of apps to start once on start-up + run_on_start_up = { + -- Add applications that need to be killed between reloads + -- to avoid multipled instances, inside the autostart script + '~/.config/awesome/configuration/autostart', -- Spawn "dirty" apps that can linger between sessions + 'compton', + 'nitrogen --restore', + 'nm-applet --indicator', -- wifi + 'xfce4-power-manager', -- Power manager + 'ibus-daemon --xim --daemonize', -- Ibus daemon for keyboard + 'scream-start', -- scream audio sink + 'numlockx on', -- enable numlock + '/usr/lib/xfce-polkit/xfce-polkit & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)', -- credential manager + 'blueman-tray' -- bluetooth tray + } +} diff --git a/src/.config/awesome/werewolf/configuration/autostart b/src/.config/awesome/werewolf/configuration/autostart new file mode 100755 index 0000000..30fb586 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/autostart @@ -0,0 +1,43 @@ +#!/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 +# the script $HOME/.config/awesomestart +# is intended to be a copy of this file +# to allow out of tree autostart programs +APPS=( + keepassxc + kdeconnect-indicator + radeon-profile + $HOME/.config/awesomestart + ) +# Some applications start child applications that need to be killed on reload +KILL=( + synergyc + nextcloud + ) + +#Kill the polkit +killall xfce-polkit + +# 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/src/.config/awesome/werewolf/configuration/client/buttons.lua b/src/.config/awesome/werewolf/configuration/client/buttons.lua new file mode 100644 index 0000000..afb1b01 --- /dev/null +++ b/src/.config/awesome/werewolf/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/src/.config/awesome/werewolf/configuration/client/init.lua b/src/.config/awesome/werewolf/configuration/client/init.lua new file mode 100644 index 0000000..bbd5480 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/client/init.lua @@ -0,0 +1 @@ +require('configuration.client.rules') diff --git a/src/.config/awesome/werewolf/configuration/client/keys.lua b/src/.config/awesome/werewolf/configuration/client/keys.lua new file mode 100644 index 0000000..0a8502f --- /dev/null +++ b/src/.config/awesome/werewolf/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, 'Shift'}, + 'q', + function(c) + c:kill() + end, + {description = 'close', group = 'client'} + ) +) + +return clientKeys diff --git a/src/.config/awesome/werewolf/configuration/client/rules.lua b/src/.config/awesome/werewolf/configuration/client/rules.lua new file mode 100644 index 0000000..76351e6 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/client/rules.lua @@ -0,0 +1,47 @@ +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 = { + {rule_any = {name = {'Termite'}}, properties = {skip_decoration = true}}, + -- 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 + } + }, -- 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/src/.config/awesome/werewolf/configuration/init.lua b/src/.config/awesome/werewolf/configuration/init.lua new file mode 100644 index 0000000..8ea676f --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/init.lua @@ -0,0 +1,4 @@ +return { + keys = require('configuration.keys'), + apps = require('configuration.apps') +} diff --git a/src/.config/awesome/werewolf/configuration/keys/global.lua b/src/.config/awesome/werewolf/configuration/keys/global.lua new file mode 100644 index 0000000..f67ef78 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/keys/global.lua @@ -0,0 +1,251 @@ +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') + +function poweroff_command() + awful.spawn.with_shell('poweroff') + awful.keygrabber.stop(_G.exit_screen_grabber) +end + +-- 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'}, 'Left', awful.tag.viewprev, + {description = 'view previous', group = 'tag'}), +awful.key({altkey, 'Control'}, 'Right', 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.awesome.spawn(apps.default.rofi) end, + {description = 'show rofi menu', group = 'awesome'}), +awful.key({modkey}, 'd', function() + local flag = false + for _, c in ipairs(mouse.screen.selected_tag:clients()) do + if c.minimized == true then flag = true end + c.minimized = true + end + for _, c in ipairs(mouse.screen.selected_tag:clients()) do + if flag == true then c.minimized = false end + end +end, {description = 'minimize all clients', 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({'Control', 'Shift'}, 'Print', function() + awful.util.spawn_with_shell(apps.default.delayed_screenshot) +end, { + description = 'Mark an area and screenshot it (clipboard)', + group = 'screenshots (clipboard)' +}), awful.key({altkey}, 'Print', 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({'Control'}, 'Print', 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'}), +-- Open private browser/brave +awful.key({modkey}, 'p', + function() awful.util.spawn_with_shell('brave-browser') end, + {description = 'Open Brave', group = 'launcher'}), +-- Standard program +awful.key({modkey}, 't', + function() awful.util.spawn_with_shell(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({modkey}, 'm', function() _G.dashboard_show() end, + {description = 'toggle main menu', group = 'awesome'}), +awful.key({modkey, 'Shift'}, 'p', function() _G.exit_screen_show() end, + {description = 'end session menu', 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({altkey, 'Control'}, 'k', 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.easy_async('amixer -D pulse sset Master 5%+', function() + _G.update_volume() + end) +end, {description = 'volume up', group = 'hotkeys'}), +awful.key({}, 'XF86AudioLowerVolume', function() + awful.spawn.easy_async('amixer -D pulse sset Master 5%-', function() + _G.update_volume() + end) +end, {description = 'volume down', group = 'hotkeys'}), +awful.key({}, 'XF86AudioMute', function() + awful.spawn('amixer -D pulse set Master 1+ toggle') + _G.update_volume() +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}, 'n', 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), +-- Emoji typing +-- setup info at https://gist.github.com/HikariKnight/8562837d28dec3674dba027c7892e6a5 +awful.key({modkey}, 'e', + function() awful.util.spawn_with_shell('emoji-toggle') end, { + description = 'Toggle the ibus unimoji engine for writing emojis', + 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/src/.config/awesome/werewolf/configuration/keys/init.lua b/src/.config/awesome/werewolf/configuration/keys/init.lua new file mode 100644 index 0000000..9591667 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/keys/init.lua @@ -0,0 +1,4 @@ +return { + mod = require('configuration.keys.mod'), + global = require('configuration.keys.global') +} diff --git a/src/.config/awesome/werewolf/configuration/keys/mod.lua b/src/.config/awesome/werewolf/configuration/keys/mod.lua new file mode 100644 index 0000000..1d90897 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/keys/mod.lua @@ -0,0 +1,4 @@ +return { + modKey = 'Mod4', + altKey = 'Mod1' +} \ No newline at end of file diff --git a/src/.config/awesome/werewolf/configuration/tags/init.lua b/src/.config/awesome/werewolf/configuration/tags/init.lua new file mode 100644 index 0000000..dd62a18 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/tags/init.lua @@ -0,0 +1,62 @@ +local awful = require('awful') +local gears = require('gears') +local icons = require('theme.icons') +local apps = require('configuration.apps') + +local tags = { + { + icon = icons.firefox, + type = 'firefox', + defaultApp = apps.default.browser, + screen = 1 + }, { + icon = icons.code, + type = 'code', + defaultApp = apps.default.editor, + screen = 1 + }, { + icon = icons.folder, + type = 'files', + defaultApp = apps.default.files, + screen = 1 + }, { + icon = icons.console, + type = 'console', + defaultApp = apps.default.terminal, + screen = 1 + }, { + icon = icons.social, + type = 'social', + defaultApp = apps.default.social, + 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 = true, + 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 = 4 + else + t.gap = 4 + end +end) diff --git a/src/.config/awesome/werewolf/configuration/tags/layouts/single-maximized.lua b/src/.config/awesome/werewolf/configuration/tags/layouts/single-maximized.lua new file mode 100644 index 0000000..25ad73e --- /dev/null +++ b/src/.config/awesome/werewolf/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/src/.config/awesome/werewolf/configuration/utils/screenshot b/src/.config/awesome/werewolf/configuration/utils/screenshot new file mode 100755 index 0000000..b8c09e3 --- /dev/null +++ b/src/.config/awesome/werewolf/configuration/utils/screenshot @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $1 == "--delayed" ]; then + sleep 10 ; spectacle -b -n ${@:2} -o /tmp/screenshot.png ; xclip -selection clipboard -target image/png -i /tmp/screenshot.png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga +else + spectacle -b -n $@ -o /tmp/screenshot.png ; xclip -selection clipboard -target image/png -i /tmp/screenshot.png ; paplay /usr/share/sounds/freedesktop/stereo/camera-shutter.oga +fi + + diff --git a/src/.config/awesome/werewolf/layout/README.md b/src/.config/awesome/werewolf/layout/README.md new file mode 100644 index 0000000..b157692 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/README.md @@ -0,0 +1 @@ +## Layout diff --git a/src/.config/awesome/werewolf/layout/clock-panel.lua b/src/.config/awesome/werewolf/layout/clock-panel.lua new file mode 100644 index 0000000..c999f5f --- /dev/null +++ b/src/.config/awesome/werewolf/layout/clock-panel.lua @@ -0,0 +1,34 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local dpi = require('beautiful').xresources.apply_dpi + +-- Clock / Calendar 24h format +local textclock = wibox.widget.textclock( + '%H:%M') + +local clock_widget = wibox.container.margin(textclock, dpi(8), dpi(8), dpi(8), + dpi(8)) + +local ClockPanel = function(s, offset) + local offsetx = 0 + if offset == true then offsety = dpi(12) end + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = dpi(48), + x = s.geometry.width - dpi(184), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = {top = dpi(32)} + }) + + panel:setup{layout = wibox.layout.fixed.horizontal, clock_widget} + + return panel +end + +return ClockPanel diff --git a/src/.config/awesome/werewolf/layout/date-panel.lua b/src/.config/awesome/werewolf/layout/date-panel.lua new file mode 100644 index 0000000..d18431d --- /dev/null +++ b/src/.config/awesome/werewolf/layout/date-panel.lua @@ -0,0 +1,38 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local gears = require('gears') +local clickable_container = require('widget.material.clickable-container') + +local dpi = require('beautiful').xresources.apply_dpi + +local icons = require('theme.icons') + +local textclock = wibox.widget.textclock( + '%d.%m.%Y\n %H:%M') + +local date_widget = wibox.container.margin(textclock, dpi(8), dpi(8), dpi(8), + dpi(8)) + +local DatePanel = function(s, offset) + local offsetx = dpi(128) + local offsety = dpi(12) + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = dpi(80), + x = s.geometry.width - dpi(130), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_200, + fg = beautiful.primary.hue_900, + struts = {top = dpi(32)} + }) + + panel:setup{layout = wibox.layout.fixed.horizontal, date_widget} + + return panel +end + +return DatePanel diff --git a/src/.config/awesome/werewolf/layout/init.lua b/src/.config/awesome/werewolf/layout/init.lua new file mode 100644 index 0000000..0ba0826 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/init.lua @@ -0,0 +1,66 @@ +local awful = require('awful') +local left_panel = require('layout.left-panel') +local workspace_panel = require('layout.workspace-panel') +local tasklist_panel = require('layout.tasklist-panel') +local mode_panel = require('layout.mode-panel') +local date_panel = require('layout.date-panel') +local clock_panel = require('layout.clock-panel') +local systemtray_panel = require('layout.systemtray-panel') +local volume_panel = require('layout.volume-panel') + +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen(function(s) + if s.index == 1 then + s.left_panel = left_panel(s) + s.mode_panel = mode_panel(s, true) + s.tasklist_panel = tasklist_panel(s, true) + s.workspace_panel = workspace_panel(s, true) + s.date_panel = date_panel(s, true) + s.clock_panel = clock_panel(s, true) + s.systemtray_panel = systemtray_panel(s, true) + s.volume_panel = volume_panel(s, true) + else + s.mode_panel = mode_panel(s, false) + s.workspace_panel = workspace_panel(s, false) + s.tasklist_panel = tasklist_panel(s, false) + s.date_panel = date_panel(s, false) + s.clock_panel = clock_panel(s, false) + s.systemtray_panel = systemtray_panel(s, false) + s.volume_panel = volume_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.workspace_panel.visible = not fullscreen + s.mode_panel.visible = not fullscreen + s.tasklist_panel.visible = not fullscreen + s.date_panel.visible = not fullscreen + s.clock_panel.visible = not fullscreen + s.systemtray_panel.visible = not fullscreen + s.volume_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/src/.config/awesome/werewolf/layout/left-panel/action-bar.lua b/src/.config/awesome/werewolf/layout/left-panel/action-bar.lua new file mode 100644 index 0000000..db2a612 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/left-panel/action-bar.lua @@ -0,0 +1,34 @@ +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 clickable_container = require('widget.material.clickable-container') + +return function(screen, panel, action_bar_width) + local menu_icon = wibox.widget { + icon = icons.menu, + size = dpi(16), + widget = mat_icon + } + + local home_button = wibox.widget { + wibox.widget {menu_icon, widget = clickable_container}, + visible = true, + bg = beautiful.primary.hue_700, + widget = wibox.container.background + } + + home_button:buttons(gears.table.join( + awful.button({}, 1, nil, + function() _G.dashboard_show() end))) + + return wibox.widget { + id = 'action_bar', + layout = wibox.layout.align.horizontal, + forced_width = action_bar_width, + {layout = wibox.layout.fixed.horizontal, home_button} + } +end diff --git a/src/.config/awesome/werewolf/layout/left-panel/dashboard/hardware-monitor.lua b/src/.config/awesome/werewolf/layout/left-panel/dashboard/hardware-monitor.lua new file mode 100644 index 0000000..41f9930 --- /dev/null +++ b/src/.config/awesome/werewolf/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/src/.config/awesome/werewolf/layout/left-panel/dashboard/init.lua b/src/.config/awesome/werewolf/layout/left-panel/dashboard/init.lua new file mode 100644 index 0000000..e4c77a8 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/left-panel/dashboard/init.lua @@ -0,0 +1,71 @@ +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.primary.hue_800, + widget = wibox.container.background + }, + wibox.widget { + orientation = 'horizontal', + forced_height = 0.8, + opacity = 0.3, + 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.primary.hue_800, + widget = wibox.container.background + } + } + } +end diff --git a/src/.config/awesome/werewolf/layout/left-panel/dashboard/quick-settings.lua b/src/.config/awesome/werewolf/layout/left-panel/dashboard/quick-settings.lua new file mode 100644 index 0000000..4f7139f --- /dev/null +++ b/src/.config/awesome/werewolf/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/src/.config/awesome/werewolf/layout/left-panel/init.lua b/src/.config/awesome/werewolf/layout/left-panel/init.lua new file mode 100644 index 0000000..5decf78 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/left-panel/init.lua @@ -0,0 +1,98 @@ +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(32) + local panel_content_width = dpi(400) + local offsety = dpi(12) + + local panel = wibox { + screen = screen, + width = dpi(32), + height = dpi(32), + x = screen.geometry.x + 12, + y = screen.geometry.y + offsety, + ontop = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal + } + + panel.opened = false + + panel:struts({left = dpi(0), top = dpi(48)}) + + local backdrop = wibox { + ontop = true, + screen = screen, + bg = '#00000000', + type = 'dock', + x = screen.geometry.x, + y = screen.geometry.y + offsety, + 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 = panel_content_width + panel.height = screen.geometry.height + backdrop.visible = true + panel.visible = false + panel.visible = true + panel.x = screen.geometry.x + panel.y = screen.geometry.y + panel.ontop = 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.height = dpi(32) + panel:get_children_by_id('panel_content')[1].visible = false + backdrop.visible = false + panel.ontop = false + panel.x = screen.geometry.x + 12 + panel.y = screen.geometry.y + offsety + 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{ + require('layout.left-panel.action-bar')(screen, panel, action_bar_width), + layout = wibox.layout.align.vertical, + { + id = 'panel_content', + bg = beautiful.primary.hue_900, + widget = wibox.container.background, + visible = false, + forced_width = panel_content_width, + { + require('layout.left-panel.dashboard')(screen, panel), + layout = wibox.layout.stack + } + } + } + return panel +end + +return left_panel diff --git a/src/.config/awesome/werewolf/layout/mode-panel.lua b/src/.config/awesome/werewolf/layout/mode-panel.lua new file mode 100644 index 0000000..62db873 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/mode-panel.lua @@ -0,0 +1,54 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +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') + +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 ModePanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(512) + offsety = dpi(12) + end + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = dpi(32), + x = s.geometry.width - dpi(44), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = {top = dpi(32)} + }) + + panel:setup{ + layout = wibox.layout.align.horizontal, + {layout = wibox.layout.fixed.horizontal, LayoutBox(s)}, + nil, + nil + } + + return panel +end + +return ModePanel diff --git a/src/.config/awesome/werewolf/layout/systemtray-panel.lua b/src/.config/awesome/werewolf/layout/systemtray-panel.lua new file mode 100644 index 0000000..323f7bc --- /dev/null +++ b/src/.config/awesome/werewolf/layout/systemtray-panel.lua @@ -0,0 +1,48 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local TagList = require('widget.tag-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') + +local systray = wibox.widget.systray() +systray:set_horizontal(true) +systray:set_base_size(32) + +local TopPanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(128) + offsety = dpi(12) + end + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = dpi(128), + x = s.geometry.width - dpi(318), + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = {top = dpi(32)} + }) + + panel:setup{ + layout = wibox.layout.align.horizontal, + wibox.container.margin(systray, dpi(4), dpi(4), dpi(4), dpi(4)), + nil, + require('widget.battery') + } + + return panel +end + +return TopPanel diff --git a/src/.config/awesome/werewolf/layout/tasklist-panel.lua b/src/.config/awesome/werewolf/layout/tasklist-panel.lua new file mode 100644 index 0000000..ea6f146 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/tasklist-panel.lua @@ -0,0 +1,76 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TaskList = require('widget.task-list') +local TagList = require('widget.tag-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))) + +local TasklistPanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(512) + offsety = dpi(12) + end + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = s.geometry.width - 2 * offsetx, + x = s.geometry.x + offsetx, + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = {top = dpi(32)} + }) + + panel:setup{ + layout = wibox.layout.align.horizontal, + nil, + { + TaskList(s), + layout = wibox.layout.fixed.horizontal + -- add_button + }, + nil + } + + return panel +end + +return TasklistPanel diff --git a/src/.config/awesome/werewolf/layout/volume-panel.lua b/src/.config/awesome/werewolf/layout/volume-panel.lua new file mode 100644 index 0000000..6ab3bc2 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/volume-panel.lua @@ -0,0 +1,44 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local dpi = require('beautiful').xresources.apply_dpi +local icons = require('theme.icons') + +local icon = wibox.widget { + { + {image = icons.volume_dark, widget = wibox.widget.imagebox}, + margins = dpi(6), + layout = wibox.container.margin + }, + bg = beautiful.primary.hue_200, + widget = wibox.container.background +} + +local volume_percentage_widget = wibox.container.background( + require('widget.volume.volume-percentage')) + +local VolumePanel = function(s, offset) + local offsetx = dpi(236) + if offset == true then offsety = dpi(12) end + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = dpi(64), + x = s.geometry.x + offsetx, + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal + }) + + panel:setup{ + layout = wibox.layout.fixed.horizontal, + icon, + volume_percentage_widget + } + + return panel +end + +return VolumePanel diff --git a/src/.config/awesome/werewolf/layout/workspace-panel.lua b/src/.config/awesome/werewolf/layout/workspace-panel.lua new file mode 100644 index 0000000..fd82557 --- /dev/null +++ b/src/.config/awesome/werewolf/layout/workspace-panel.lua @@ -0,0 +1,33 @@ +local awful = require('awful') +local beautiful = require('beautiful') +local wibox = require('wibox') +local TagList = require('widget.tag-list') +local gears = require('gears') + +local dpi = require('beautiful').xresources.apply_dpi + +local WorkspacePanel = function(s, offset) + local offsetx = 0 + if offset == true then + offsetx = dpi(50) + offsety = dpi(12) + end + local panel = wibox({ + ontop = false, + screen = s, + height = dpi(32), + width = dpi(180), + x = s.geometry.x + offsetx, + y = s.geometry.y + offsety, + stretch = false, + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + struts = {top = dpi(32)} + }) + + panel:setup{layout = wibox.layout.align.horizontal, TagList(s)} + + return panel +end + +return WorkspacePanel diff --git a/src/.config/awesome/werewolf/module/README.md b/src/.config/awesome/werewolf/module/README.md new file mode 100644 index 0000000..097d4f9 --- /dev/null +++ b/src/.config/awesome/werewolf/module/README.md @@ -0,0 +1 @@ +## Module \ No newline at end of file diff --git a/src/.config/awesome/werewolf/module/auto-start.lua b/src/.config/awesome/werewolf/module/auto-start.lua new file mode 100644 index 0000000..b6d0746 --- /dev/null +++ b/src/.config/awesome/werewolf/module/auto-start.lua @@ -0,0 +1,19 @@ +-- 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)) + --This broke compton ===> awful.spawn.single_instance(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/src/.config/awesome/werewolf/module/backdrop.lua b/src/.config/awesome/werewolf/module/backdrop.lua new file mode 100644 index 0000000..396c375 --- /dev/null +++ b/src/.config/awesome/werewolf/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/src/.config/awesome/werewolf/module/dashboard.lua b/src/.config/awesome/werewolf/module/dashboard.lua new file mode 100644 index 0000000..82d591d --- /dev/null +++ b/src/.config/awesome/werewolf/module/dashboard.lua @@ -0,0 +1,545 @@ +local awful = require('awful') +local gears = require('gears') +local wibox = require('wibox') +local beautiful = require('beautiful') +local icons = require('theme.icons') +local mat_list_item = require('widget.material.list-item') +local mat_icon = require('widget.material.icon') +local clickable_container = require('widget.material.clickable-container') +local apps = require('configuration.apps') +local dpi = require('beautiful').xresources.apply_dpi + +local icon_size = beautiful.dashboard_icon_size or dpi(140) +local username = os.getenv("USER") +local panel_style = gears.shape.rounded_rect + +local buildButton = function(icon, name) + local button_text = wibox.widget { + text = name, + font = beautiful.font, + align = 'center', + valign = 'center', + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + widget = wibox.widget.textbox + } + + local a_button = wibox.widget { + { + { + { + {image = icon, widget = wibox.widget.imagebox}, + margins = dpi(16), + widget = wibox.container.margin + }, + bg = beautiful.groups_bg, + widget = wibox.container.background + }, + shape = panel_style, + forced_width = dpi(60), + forced_height = dpi(60), + visible = true, + -- bg = beautiful.bg_normal, + widget = clickable_container + + }, + visible = true, + -- bg = beautiful.bg_normal, + shape = panel_style, + widget = wibox.container.background + } + + local build_a_button = wibox.widget { + layout = wibox.layout.fixed.horizontal, + spacing = dpi(5), + a_button + -- button_text + } + + return build_a_button +end + +local buildLabel = function(name) + local label_text = wibox.widget { + { + text = name, + font = 'Roboto 11', + align = 'center', + valign = 'center', + bg = beautiful.primary.hue_900, + fg = beautiful.fg_normal, + widget = wibox.widget.textbox + }, + shape = panel_style, + forced_height = dpi(56), + visible = true, + -- bg = beautiful.bg_normal, + widget = clickable_container + } + + local build_a_label = wibox.widget { + layout = wibox.layout.flex.horizontal, + spacing = dpi(5), + label_text + } + + return build_a_label +end + +function suspend_command() + dashboard_hide() + awful.spawn.with_shell(apps.default.lock .. ' & systemctl suspend') +end +function exit_command() _G.awesome.quit() end +function lock_command() + dashboard_hide() + awful.spawn.with_shell('sleep 1 && ' .. apps.default.lock) +end +function poweroff_command() + awful.spawn.with_shell('poweroff') + awful.keygrabber.stop(_G.dashboard_grabber) +end +function reboot_command() + awful.spawn.with_shell('reboot') + awful.keygrabber.stop(_G.dashboard_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) + +local search = buildButton(icons.search, 'Search') +search:connect_signal('button::release', function() + -- rofi_command() + dashboard_hide() + _G.awesome.spawn(apps.default.rofi) +end) + +local close = buildButton(icons.close_dark, 'Close') +close:connect_signal('button::release', function() dashboard_hide() end) + +-- Get screen geometry +local screen_geometry = awful.screen.focused().geometry + +-- Create the widget +dashboard = wibox({ + x = screen_geometry.x, + y = screen_geometry.y, + visible = false, + ontop = true, + type = 'splash', + bg = beautiful.primary.hue_800 .. '66', + height = screen_geometry.height, + width = screen_geometry.width +}) + +local dashboard_grabber + +function dashboard_hide() + awful.keygrabber.stop(dashboard_grabber) + dashboard.visible = false +end + +function dashboard_show() + dashboard_grabber = awful.keygrabber.run( + function(_, key, event) + if event == 'release' then return end + + if key == 'Escape' or key == 'q' or key == 'x' or key == 'm' then + dashboard_hide() + end + end) + dashboard.visible = true +end + +dashboard:buttons(gears.table.join( -- Middle click - Hide dashboard +awful.button({}, 2, function() dashboard_hide() end), +awful.button({}, 3, function() dashboard_hide() end))) + +local profile_picture = os.getenv("HOME") .. + "/.config/awesome/user_picture_curved.png" + +local profile = wibox.widget { + wibox.widget { + { + { + { + { + image = profile_picture, + resize = true, + widget = wibox.widget.imagebox + }, + resize = true, + top = dpi(12), + right = dpi(12), + left = dpi(12), + widget = wibox.container.margin + }, + bg = beautiful.groups_bg, + shape = panel_style, + widget = wibox.container.background + }, + forced_width = dpi(244), + forced_height = dpi(244), + visible = true, + bg = beautiful.bg_normal, + shape = panel_style, + widget = wibox.container.background + }, + wibox.widget { + { + wibox.widget { + text = '@' .. username, + font = "Roboto Regular 12", + align = 'center', + valign = 'center', + widget = wibox.widget.textbox + }, + bottom = dpi(8), + widget = wibox.container.margin + }, + fg = beautiful.primary.hue_500, + widget = wibox.container.background + }, + layout = wibox.layout.fixed.vertical + }, + visible = true, + bg = beautiful.bg_normal, + shape = panel_style, + widget = wibox.container.background +} + +local power_options = wibox.widget { + { + poweroff, + reboot, + suspend, + exit, + lock, + layout = wibox.layout.flex.horizontal + }, + visible = true, + bg = beautiful.primary.hue_900, + shape = panel_style, + widget = wibox.container.background +} + +local search_button = wibox.widget { + { + search, + bg = beautiful.primary.hue_600, + layout = wibox.layout.fixed.vertical + }, + visible = true, + bg = beautiful.primary.hue_200, + shape = panel_style, + widget = wibox.container.background +} + +local close_button = wibox.widget { + { + close, + bg = beautiful.primary.hue_600, + layout = wibox.layout.fixed.vertical + }, + visible = true, + bg = beautiful.primary.hue_350, + shape = panel_style, + widget = wibox.container.background +} + +local quick_settings = wibox.widget { + { + { + require('layout.left-panel.dashboard.quick-settings'), + right = dpi(16), + bottom = dpi(12), + top = dpi(12), + widget = wibox.container.margin + }, + visible = true, + bg = beautiful.bg_normal, + shape = panel_style, + widget = wibox.container.background + }, + bg = beautiful.bg_normal, + shape = panel_style, + widget = wibox.container.background +} + +local hardware_monitor = wibox.widget { + { + require('layout.left-panel.dashboard.hardware-monitor'), + right = dpi(16), + bottom = dpi(12), + top = dpi(12), + widget = wibox.container.margin + }, + visible = true, + bg = beautiful.bg_normal, + shape = panel_style, + widget = wibox.container.background +} + +local cal = require('widget.calendar') + +local calWidget = wibox.widget { + { + nil, + {cal, margins = dpi(16), widget = wibox.container.margin}, + nil, + layout = wibox.layout.flex.horizontal + }, + resize = true, + shape = panel_style, + bg = beautiful.bg_normal, + widget = wibox.container.background +} + +-- Fortune widget Credits: u/EmpressNoodle, github/elenapan +local fortune_command = "fortune -n 140 -s" +local fortune_update_interval = 3600 +-- local fortune_command = "fortune -n 140 -s computers" +local fortune = wibox.widget { + font = "Roboto 11", + text = "You so poor you don't even have a cookie yet...", + widget = wibox.widget.textbox +} + +local update_fortune = function() + awful.spawn.easy_async_with_shell(fortune_command, function(out) + -- Remove trailing whitespaces + out = out:gsub('^%s*(.-)%s*$', '%1') + fortune.markup = "" .. out .. "" + end) +end + +gears.timer { + autostart = true, + timeout = fortune_update_interval, + single_shot = false, + call_now = true, + callback = update_fortune +} + +local fortune_widget = wibox.widget { + { + {fortune, layout = wibox.layout.flex.horizontal}, + margins = dpi(16), + widget = wibox.container.margin + }, + bg = beautiful.primary.hue_700, + fg = beautiful.primary.hue_900, + shape = panel_style, + forced_height = dpi(112), + widget = wibox.container.background +} + +local uptime_text = wibox.widget.textbox() +uptime_text.font = "Roboto 10" +uptime_text.valign = "center" +awful.widget.watch("uptime -p | sed 's/^...//'", 60, function(_, stdout) + local out = stdout:gsub('^%s*(.-)%s*up', '%1') + uptime_text.text = out +end) + +local uptime_widget = wibox.widget { + { + { + { + image = icons.uptime, + resize = true, + forced_width = dpi(24), + widget = wibox.widget.imagebox + }, + uptime_text, + spacing = dpi(8), + layout = wibox.layout.fixed.horizontal + }, + margins = dpi(16), + widget = wibox.container.margin + }, + bg = beautiful.bg_normal, + shape = panel_style, + forced_height = dpi(48), + forced_width = dpi(182), + widget = wibox.container.background +} + +-- Bookmarks +function reddit_command() + dashboard_hide() + awful.spawn(apps.default.browser .. " " .. "reddit.com") +end + +function youtube_command() + dashboard_hide() + awful.spawn(apps.default.browser .. " " .. "youtube.com") +end + +function linkedin_command() + dashboard_hide() + awful.spawn(apps.default.browser .. " " .. "linkedin.com") +end + +function github_command() + dashboard_hide() + awful.spawn(apps.default.browser .. " " .. "github.com") +end + +function deviantart_command() + dashboard_hide() + awful.spawn(apps.default.browser .. " " .. "deviantart.com") +end + +function codeforces_command() + dashboard_hide() + awful.spawn(apps.default.browser .. " " .. "codeforces.com") +end + +function files_command(directory) + dashboard_hide() + awful.spawn(apps.default.files .. " " .. directory) +end + +local reddit = buildButton(icons.reddit, 'Reddit') +reddit:connect_signal('button::release', function() reddit_command() end) + +local youtube = buildButton(icons.youtube, 'Youtube') +youtube:connect_signal('button::release', function() youtube_command() end) + +local linkedin = buildButton(icons.linkedin, 'Linkedin') +linkedin:connect_signal('button::release', function() linkedin_command() end) + +local github = buildButton(icons.github, 'Github') +github:connect_signal('button::release', function() github_command() end) + +local deviantart = buildButton(icons.deviantart, 'Deviantart') +deviantart:connect_signal('button::release', function() deviantart_command() end) + +local codeforces = buildButton(icons.codeforces, 'Codeforces') +codeforces:connect_signal('button::release', function() codeforces_command() end) + +local home = buildLabel('Home') +home:connect_signal('button::release', function() files_command(".") end) + +local downloads = buildLabel('Downloads') +downloads:connect_signal('button::release', + function() files_command("Downloads") end) + +local desktop = buildLabel('Desktop') +desktop:connect_signal('button::release', + function() files_command("Desktop") end) + +local pictures = buildLabel('Pictures') +pictures:connect_signal('button::release', + function() files_command("Pictures") end) + +local videos = buildLabel('Videos') +videos:connect_signal('button::release', function() files_command("Videos") end) + +local documents = buildLabel('Documents') +documents:connect_signal('button::release', + function() files_command("Documents") end) + +local bookmarks = wibox.widget { + { + {reddit, youtube, linkedin, layout = wibox.layout.flex.horizontal}, + {github, deviantart, codeforces, layout = wibox.layout.ratio.horizontal}, + layout = wibox.layout.fixed.vertical + }, + visible = true, + bg = beautiful.bg_normal, + shape = panel_style, + forced_width = dpi(182), + widget = wibox.container.background +} + +local places = wibox.widget { + { + { + home, + desktop, + downloads, + pictures, + documents, + videos, + layout = wibox.layout.fixed.vertical + }, + layout = wibox.layout.fixed.vertical + }, + visible = true, + bg = beautiful.bg_normal, + shape = panel_style, + forced_width = dpi(182), + widget = wibox.container.background +} + +-- Item placement +dashboard:setup{ + nil, + { + nil, + { + { + search_button, + close_button, + spacing = dpi(10), + layout = wibox.layout.fixed.vertical + }, + { + { + { + quick_settings, + hardware_monitor, + fortune_widget, + forced_width = dpi(300), + spacing = dpi(10), + layout = wibox.layout.fixed.vertical + }, + { + bookmarks, + places, + spacing = dpi(10), + layout = wibox.layout.fixed.vertical + }, + spacing = dpi(10), + layout = wibox.layout.fixed.horizontal + }, + { + power_options, + uptime_widget, + spacing = dpi(10), + layout = wibox.layout.fixed.horizontal + }, + spacing = dpi(10), + layout = wibox.layout.fixed.vertical + }, + { + profile, + calWidget, + spacing = dpi(10), + layout = wibox.layout.fixed.vertical + }, + spacing = dpi(10), + layout = wibox.layout.fixed.horizontal + }, + nil, + expand = 'none', + layout = wibox.layout.align.horizontal + }, + {nil, expand = 'none', layout = wibox.layout.align.horizontal}, + expand = 'none', + layout = wibox.layout.align.vertical +} diff --git a/src/.config/awesome/werewolf/module/decorate-client.lua b/src/.config/awesome/werewolf/module/decorate-client.lua new file mode 100644 index 0000000..96c42ac --- /dev/null +++ b/src/.config/awesome/werewolf/module/decorate-client.lua @@ -0,0 +1,108 @@ +local awful = require('awful') +local gears = require('gears') +local beautiful = require('beautiful') +local dpi = require('beautiful').xresources.apply_dpi + +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 = dpi(1) + 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.border_width = dpi(1) + client.shape = function(cr, w, h) + gears.shape.rectangle(cr, w, h) + 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/src/.config/awesome/werewolf/module/exit-screen.lua b/src/.config/awesome/werewolf/module/exit-screen.lua new file mode 100644 index 0000000..861ef17 --- /dev/null +++ b/src/.config/awesome/werewolf/module/exit-screen.lua @@ -0,0 +1,145 @@ +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_900 .. '55' + +local exit_screen_grabber + +function exit_screen_hide() + awful.keygrabber.stop(exit_screen_grabber) + exit_screen.visible = false +end + +function exit_screen_show() + 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/src/.config/awesome/werewolf/module/notifications.lua b/src/.config/awesome/werewolf/module/notifications.lua new file mode 100644 index 0000000..6d49f4d --- /dev/null +++ b/src/.config/awesome/werewolf/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.rectangle +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/src/.config/awesome/werewolf/module/quake-terminal.lua b/src/.config/awesome/werewolf/module/quake-terminal.lua new file mode 100644 index 0000000..e388890 --- /dev/null +++ b/src/.config/awesome/werewolf/module/quake-terminal.lua @@ -0,0 +1,58 @@ +local awful = require('awful') +local spawn = require('awful.spawn') +local app = require('configuration.apps').default.quake +local dpi = require('beautiful').xresources.apply_dpi +local beautiful = require('beautiful') + +-- Theme +beautiful.init(require('theme')) + +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() + client.focus = quake_client + quake_client:raise() + -- awful.client.focus(quake_id) + else + close_quake() + end + end +end + +_G.client.connect_signal('manage', function(c) + if (c.pid == quake_id) then + quake_client = c + c.x = c.screen.geometry.x + c.y = c.screen.geometry.height - c.height + c.opacity = 0.9 + c.floating = true + c.skip_taskbar = true + c.ontop = true + c.above = true + c.sticky = true + c.type = 'dock' + c.hidden = not opened + c.maximized_horizontal = true + c.border_width = dpi(1) + end +end) + +_G.client.connect_signal('unmanage', function(c) + if (c.pid == quake_id) then + opened = false + quake_client = nil + end +end) diff --git a/src/.config/awesome/werewolf/rc.lua b/src/.config/awesome/werewolf/rc.lua new file mode 100644 index 0000000..28036ba --- /dev/null +++ b/src/.config/awesome/werewolf/rc.lua @@ -0,0 +1,67 @@ +local gears = require('gears') +local awful = require('awful') +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') +require('module.quake-terminal') +-- Backdrop causes bugs on some gtk3 applications +-- require('module.backdrop') +require('module.exit-screen') +require('module.dashboard') + +-- 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/src/.config/awesome/werewolf/theme/README.md b/src/.config/awesome/werewolf/theme/README.md new file mode 100644 index 0000000..6c558eb --- /dev/null +++ b/src/.config/awesome/werewolf/theme/README.md @@ -0,0 +1 @@ +## Theme \ No newline at end of file diff --git a/src/.config/awesome/werewolf/theme/default-theme.lua b/src/.config/awesome/werewolf/theme/default-theme.lua new file mode 100644 index 0000000..cfb5556 --- /dev/null +++ b/src/.config/awesome/werewolf/theme/default-theme.lua @@ -0,0 +1,100 @@ +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.orange + +-- 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.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.primary.hue_900 + theme.bg_focus = '#5a5a5a' + theme.bg_urgent = '#3F3F3F' + theme.bg_systray = theme.primary.hue_900 + + -- Borders + + theme.border_width = dpi(1) + theme.border_normal = theme.primary.hue_900 + theme.border_focus = theme.primary.hue_500 + 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' + theme.layout_floating = theme.icons .. 'layouts/floating.png' + + -- Taglist + + theme.taglist_bg_empty = theme.primary.hue_900 + theme.taglist_bg_occupied = theme.primary.hue_900 + theme.taglist_bg_urgent = 'linear:0,0:0,' .. dpi(48) .. ':0,' .. + theme.accent.hue_500 .. ':0.07,' .. + theme.accent.hue_500 .. ':0.07,' .. + theme.primary.hue_900 .. ':1,' .. + theme.primary.hue_900 + theme.taglist_bg_focus = 'linear:0,0:0,' .. dpi(32) .. ':0,' .. + theme.primary.hue_900 .. ':0.9,' .. + theme.primary.hue_900 .. ':0.9,' .. + theme.primary.hue_500 .. ':1,' .. + theme.primary.hue_500 + + -- Tasklist + + theme.tasklist_font = 'Roboto medium 11' + theme.tasklist_bg_normal = theme.primary.hue_900 + theme.tasklist_bg_focus = 'linear:0,0:0,' .. dpi(32) .. ':0,' .. + theme.primary.hue_900 .. ':0.9,' .. + theme.primary.hue_900 .. ':0.9,' .. + theme.fg_normal .. ':1,' .. theme.fg_normal + theme.tasklist_bg_urgent = theme.primary.hue_900 + theme.tasklist_fg_focus = '#DDDDDD' + theme.tasklist_fg_urgent = theme.fg_normal + theme.tasklist_fg_normal = '#AAAAAA' + + theme.icon_theme = 'Tela circle purple dark' + + -- Client + theme.border_width = dpi(1) + theme.border_focus = theme.primary.hue_100 + theme.border_normal = theme.primary.hue_900 +end +return {theme = theme, awesome_overrides = awesome_overrides} diff --git a/src/.config/awesome/werewolf/theme/icons/brightness-7.svg b/src/.config/awesome/werewolf/theme/icons/brightness-7.svg new file mode 100644 index 0000000..fe7aa9d --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/brightness-7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/werewolf/theme/icons/chart-areaspline.svg b/src/.config/awesome/werewolf/theme/icons/chart-areaspline.svg new file mode 100644 index 0000000..9941ba5 --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/chart-areaspline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/werewolf/theme/icons/close.svg b/src/.config/awesome/werewolf/theme/icons/close.svg new file mode 100644 index 0000000..3f1f88c --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/werewolf/theme/icons/close_dark.svg b/src/.config/awesome/werewolf/theme/icons/close_dark.svg new file mode 100644 index 0000000..881ca51 --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/close_dark.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/.config/awesome/werewolf/theme/icons/code-braces.svg b/src/.config/awesome/werewolf/theme/icons/code-braces.svg new file mode 100644 index 0000000..6adb566 --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/code-braces.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.config/awesome/werewolf/theme/icons/code-solid.svg b/src/.config/awesome/werewolf/theme/icons/code-solid.svg new file mode 100644 index 0000000..4b02076 --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/code-solid.svg @@ -0,0 +1,60 @@ + + diff --git a/src/.config/awesome/werewolf/theme/icons/codeforces.svg b/src/.config/awesome/werewolf/theme/icons/codeforces.svg new file mode 100644 index 0000000..408990a --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/codeforces.svg @@ -0,0 +1,95 @@ + +image/svg+xml + + + + + + + + + + + + diff --git a/src/.config/awesome/werewolf/theme/icons/coffee.svg b/src/.config/awesome/werewolf/theme/icons/coffee.svg new file mode 100644 index 0000000..9b7f297 --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/coffee.svg @@ -0,0 +1,67 @@ + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/.config/awesome/werewolf/theme/icons/computer.svg b/src/.config/awesome/werewolf/theme/icons/computer.svg new file mode 100644 index 0000000..51a6ced --- /dev/null +++ b/src/.config/awesome/werewolf/theme/icons/computer.svg @@ -0,0 +1,88 @@ + + + + + + image/svg+xml + + + + + + + + + + + + +