├── README.md
├── configurations
├── default-apps.lua
├── keybindings
│ ├── client.lua
│ └── global.lua
├── picom.conf
├── rofi-dark.rasi
├── rofi-glassy.rasi
├── rules.lua
└── settings.lua
├── debian
└── menu.lua
├── libs
├── helpers.lua
└── redshift.lua
├── module
├── autostart.lua
├── json.lua
├── network.lua
├── notification.lua
└── signals.lua
├── rc.lua
├── rc.lua.test
├── screen-shots
├── dark1.png
├── dark2.png
├── dark3.png
├── dark4.png
├── glassy1.png
├── glassy2.png
├── glassy3.png
├── glassy4.png
├── glassy5.png
├── icon-only-tasklist.png
├── multi-head.png
└── tasklist.png
├── scripts
├── apt-update.sh
├── battery_status.sh
├── i3lock-blur
├── light-mode.sh
└── xinput-tab
├── themes
└── default
│ ├── background.png
│ ├── icons
│ ├── 48x48
│ │ ├── airplane-mode.svg
│ │ ├── battery-caution.svg
│ │ ├── battery-empty.svg
│ │ ├── battery-full-charged.svg
│ │ ├── bluetooth-active.svg
│ │ ├── bluetooth-disabled.svg
│ │ ├── camera-on.svg
│ │ ├── dialog-error.svg
│ │ ├── dialog-information.svg
│ │ ├── dialog-warning.svg
│ │ ├── notification-audio-volume-high.svg
│ │ ├── notification-audio-volume-muted.svg
│ │ ├── notification-battery-low.svg
│ │ ├── notification-disabled.svg
│ │ ├── notification-microphone-sensitivity-medium.svg
│ │ ├── notification-microphone-sensitivity-muted.svg
│ │ ├── notification-network-ethernet-connected.svg
│ │ ├── notification-network-ethernet-disconnected.svg
│ │ ├── notification-network-wireless-disconnected.svg
│ │ └── notification-network-wireless.svg
│ ├── 64x64
│ │ ├── battery.svg
│ │ ├── bluetooth.svg
│ │ ├── camera-photo.svg
│ │ └── network-wireless.svg
│ ├── add.svg
│ ├── airplane-mode.svg
│ ├── audio-input-microphone.svg
│ ├── awesome.svg
│ ├── battery
│ │ ├── ac.svg
│ │ ├── battery-charging.svg
│ │ └── battery-normal.svg
│ ├── brightness.svg
│ ├── camera-photo.svg
│ ├── clear-all.svg
│ ├── computer.svg
│ ├── contrast.svg
│ ├── floating-mode1.svg
│ ├── go-next.svg
│ ├── go-previous.svg
│ ├── image-crop.svg
│ ├── kdenlive-show-video.svg
│ ├── lock.svg
│ ├── mail-receive.svg
│ ├── minus.svg
│ ├── network-bluetooth.svg
│ ├── network-wired-activated.svg
│ ├── network-wired-unavailable.svg
│ ├── network-wireless-connected.svg
│ ├── network-wireless-disconnected.svg
│ ├── notifications.svg
│ ├── redshift-status-on.svg
│ ├── remove.svg
│ ├── system
│ │ ├── default.png
│ │ ├── devops.png
│ │ ├── system-lock-screen.svg
│ │ ├── system-log-out.svg
│ │ ├── system-restart.svg
│ │ ├── system-shutdown.svg
│ │ └── system-suspend.svg
│ ├── update-low.svg
│ ├── update-none.svg
│ ├── utilities-terminal.svg
│ ├── view-fullscreen.svg
│ ├── volume
│ │ ├── audio-volume-high.svg
│ │ ├── audio-volume-low.svg
│ │ ├── audio-volume-medium.svg
│ │ └── audio-volume-muted.svg
│ ├── weather
│ │ ├── weather-clear-night.svg
│ │ ├── weather-clear-sky.svg
│ │ ├── weather-clouds-night.svg
│ │ ├── weather-clouds.svg
│ │ ├── weather-few-clouds-night.svg
│ │ ├── weather-few-clouds.svg
│ │ ├── weather-fog.svg
│ │ ├── weather-freezing-rain.svg
│ │ ├── weather-overcast-symbolic.svg
│ │ ├── weather-overcast.svg
│ │ ├── weather-severe-alert.svg
│ │ ├── weather-showers-scattered.svg
│ │ ├── weather-showers.svg
│ │ ├── weather-snow-rain.svg
│ │ ├── weather-snow-scattered.svg
│ │ ├── weather-snow.svg
│ │ ├── weather-storm.svg
│ │ └── weather-windy.svg
│ └── window.svg
│ ├── layouts
│ ├── dwindle.svg
│ ├── floating.svg
│ ├── fullscreen.svg
│ ├── max.svg
│ └── tile.svg
│ ├── submenu.png
│ ├── taglist
│ ├── squarefw.png
│ ├── squarefw_back.png
│ └── squarew.png
│ ├── theme.lua
│ ├── theme_back.lua
│ └── titlebar
│ ├── go-down.svg
│ ├── go-up.svg
│ ├── window-close-normal.svg
│ └── window-close.svg
├── utilities
└── profile-image
└── widgets
├── brightness-slider.lua
├── button-active-container.lua
├── buttons
├── airplane.lua
├── battery.lua
├── bluetooth-button.lua
├── create-button.lua
├── dnd.lua
├── global-floating-mode.lua
├── microphone.lua
├── network-button.lua
├── redshift.lua
├── screen-shot.lua
└── software-update.lua
├── calender.lua
├── clickable-container
└── init.lua
├── clock.lua
├── control-center.lua
├── exit-screen.lua
├── noti-center.lua
├── panel
├── icon-only-tasklist.lua
├── layoutbox.lua
├── menu.lua
├── systray-no-toggle.lua
├── systray.lua
├── taglist.lua
└── tasklist.lua
├── separator.lua
├── volume-slider-and-indicator.lua
└── weather.lua
/README.md:
--------------------------------------------------------------------------------
1 |
✨ AwesomeShell
2 |
3 | This is a collection of [awesome wm](https://awesomewm.org/) configuration files
4 |
5 | 
6 |
7 | ## ✔️ Requirements
8 | 0. Any linux distribution. (Please change the software update notification as your package manager)
9 | 1. [awesomewm git version](https://awesomewm.org/) window manager
10 | 2. [picom-ibhagwan-git](https://github.com/ibhagwan/picom) compositor
11 | 3. [rofi > 1.6.0](https://github.com/davatorium/rofi) application launcher
12 | 4. [Ubuntu font](https://archlinux.org/packages/community/any/ttf-ubuntu-font-family/)
13 | 5. [Ubuntu Nerd Font](https://www.nerdfonts.com/font-downloads)
14 | 6. [bluez-utils](https://archlinux.org/packages/extra/x86_64/bluez-utils/) (if you use bluetooth)
15 | 7. [maim](https://archlinux.org/packages/community/x86_64/scrot/) for screen shots
16 | 8. ffmpeg
17 | 9. [iw](https://archlinux.org/packages/core/x86_64/iw/) for networks
18 | 10. [xidlehook](https://github.com/jD91mZM2/xidlehook) (for autometic lock and suspend)
19 | 11. [i3lock-fancy](https://github.com/meskarune/i3lock-fancy)
20 | 12. curl
21 |
22 | ## ⬇️ Installation
23 | Clone the this repository
24 |
25 | ```
26 | git clone https://github.com/Mofiqul/awesome-shell.git ~/.config/awesome
27 | ```
28 |
29 | ### ⚙️ Settings
30 | Change your settings in `configurations/settings.lua`
31 |
32 | ```lua
33 | settings.openweathermap_api_key = ""
34 | settings.openweathermap_coordinates = {
35 | "", -- lat
36 | "" -- lng
37 | }
38 | ```
39 |
40 |
41 | ### 🚀 Startup programs
42 | Add your startup program in `module/autostart.lua`
43 |
44 | ## 🦄 Changing theme
45 |
46 | Theme can changed to glassy or dark (see screen shot below)
47 |
48 | Change in `theme.lua`
49 | ```lua
50 | -- For glassy theme
51 | theme.mode = "glassy"
52 |
53 | -- For dark theme
54 | theme.mode = "dark"
55 | ```
56 |
57 | ## 💕 Features
58 | Control center and Notification center
59 |
60 | 
61 |
62 | Calendar and weather widget
63 |
64 | 
65 |
66 |
67 | App Launcher
68 |
69 | 
70 |
71 | Exit Screen
72 |
73 | 
74 |
75 | Lock Screen
76 |
77 | 
78 |
79 | Kde plasma style task manager
80 |
81 | 
82 |
83 | Icon only task manager
84 |
85 | 
86 |
87 | Screen shot and Recording tool(very basic)
88 |
89 | 
90 |
91 | ### Other features
92 | - Support for multi head
93 | - Two theme
94 |
95 |
96 |
97 | ## 🌈 Dark theme
98 | > A less transpatent theme for better readability, My personal preference
99 |
100 | 
101 | 
102 | 
103 |
104 | **My other dotfiles (terminal, nvim, applications etc) is [Here](https://github.com/Mofiqul/Dotfiles)**
105 |
106 | Thanks to [The glorious dotfiles](https://github.com/manilarome/the-glorious-dotfiles) for the inspirations
--------------------------------------------------------------------------------
/configurations/default-apps.lua:
--------------------------------------------------------------------------------
1 | local filesystem = require("gears.filesystem")
2 | local beautiful = require("beautiful")
3 | local config_dir = filesystem.get_configuration_dir()
4 | local default_apps = {}
5 |
6 | default_apps.screeh_shot = "spectacle"
7 | default_apps.lock_screen = config_dir .. "scripts/i3lock-blur "
8 | default_apps.software_updater = "kitty --title 'System upgrade' -e sudo pacman -Syu"
9 | default_apps.bluetooth_manager = "kitty -e bluetoothctl"
10 | default_apps.network_manager = "kitty -e nmtui"
11 | default_apps.app_menu = "rofi -dpi " .. screen.primary.dpi ..
12 | " -show drun -theme " .. config_dir ..
13 | "configurations/rofi-".. beautiful.mode ..".rasi -icon-theme " ..
14 | beautiful.icon_theme
15 |
16 | return default_apps
17 |
--------------------------------------------------------------------------------
/configurations/keybindings/client.lua:
--------------------------------------------------------------------------------
1 | local gears = require("gears")
2 | local awful = require("awful")
3 |
4 |
5 | local clientkeys = gears.table.join(
6 | -- Toggle fullscreen
7 | awful.key(
8 | { modkey,},
9 | "f",
10 | function (c)
11 | c.fullscreen = not c.fullscreen
12 | c:raise()
13 | end,
14 | {description = "toggle fullscreen", group = "client"}
15 | ),
16 |
17 | -- Kill program
18 | awful.key(
19 | { modkey, "Shift"},
20 | "q",
21 | function (c) c:kill() end,
22 | {description = "close", group = "client"}
23 | ),
24 |
25 | -- Toggle floating
26 | awful.key(
27 | { modkey, "Shift" },
28 | "space",
29 | awful.client.floating.toggle ,
30 | {description = "toggle floating", group = "client"}
31 | ),
32 | -- Swap with master
33 | awful.key(
34 | { modkey, "Control" },
35 | "Return",
36 | function (c) c:swap(awful.client.getmaster()) end,
37 | {description = "move to master", group = "client"}
38 | ),
39 |
40 | awful.key(
41 | { modkey,},
42 | "o",
43 | function (c) c:move_to_screen() end,
44 | {description = "move to screen", group = "client"}
45 | ),
46 | -- Toggle on top
47 | awful.key(
48 | { modkey,},
49 | "t",
50 | function (c) c.ontop = not c.ontop end,
51 | {description = "toggle keep on top", group = "client"}
52 | ),
53 | awful.key({ modkey,},
54 | "n",
55 | function (c)
56 | -- The client currently has the input focus, so it cannot be
57 | -- minimized, since minimized clients can't have the focus.
58 | c.minimized = true
59 | end ,
60 | {description = "minimize", group = "client"}
61 | ),
62 | awful.key({ modkey,},
63 | "m",
64 | function (c)
65 | c.maximized = not c.maximized
66 | c:raise()
67 | end ,
68 | {description = "(un)maximize", group = "client"}
69 | ),
70 | awful.key(
71 | { modkey, "Control" },
72 | "m",
73 | function (c)
74 | c.maximized_vertical = not c.maximized_vertical
75 | c:raise()
76 | end ,
77 | {description = "(un)maximize vertically", group = "client"}
78 | ),
79 | awful.key(
80 | { modkey, "Shift"},
81 | "m",
82 | function (c)
83 | c.maximized_horizontal = not c.maximized_horizontal
84 | c:raise()
85 | end ,
86 | {description = "(un)maximize horizontally", group = "client"}
87 | )
88 | )
89 |
90 | return clientkeys
91 |
--------------------------------------------------------------------------------
/configurations/picom.conf:
--------------------------------------------------------------------------------
1 | shadow = true;
2 | shadow-radius = 20;
3 | shadow-opacity = 0.85;
4 | shadow-offset-x = -20;
5 | shadow-offset-y = -20;
6 |
7 | # shadow-red = 0
8 | # shadow-green = 0
9 | # shadow-blue = 0
10 | shadow-color = "#000000";
11 |
12 | shadow-exclude = [
13 | "name = 'Notification'",
14 | "class_g = 'Conky'",
15 | "class_g = 'awesome'",
16 | "class_g = 'Rofi'",
17 | "class_g ?= 'Notify-osd'",
18 | "class_g = 'Cairo-clock'",
19 | "class_g = 'slop'",
20 | "class_g = 'Firefox' && argb",
21 | "_GTK_FRAME_EXTENTS@:c",
22 | "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
23 | "_COMPTON_SHADOW@:32c = 0"
24 | ];
25 | shadow-ignore-shaped = false
26 | # shadow-exclude-reg = "x10+0+0";
27 | # xinerama-shadow-crop = true;
28 |
29 | fading = true;
30 | fade-in-step = 0.03;
31 | fade-out-step = 0.03;
32 | fade-delta = 3;
33 |
34 | fade-exclude = [];
35 |
36 | no-fading-openclose = false;
37 | no-fading-destroyed-argb = true;
38 | inactive-opacity = 1;
39 | frame-opacity = 1;
40 | inactive-opacity-override = false;
41 | active-opacity = 1.0;
42 | inactive-dim = 0.0;
43 |
44 | focus-exclude = [
45 | "class_g = 'Cairo-clock'",
46 | "class_g ?= 'rofi'",
47 | "class_g ?= 'slop'",
48 | "class_g ?= 'Steam'"
49 | ];
50 |
51 | # inactive-dim-fixed = 1.0;
52 |
53 | opacity-rule = [
54 | "80:class_g = 'URxvt'",
55 | "80:class_g = 'UXTerm'",
56 | "80:class_g = 'XTerm'"
57 | ]
58 |
59 | blur: {
60 | method = "dual_kawase";
61 | strength = 4.0;
62 | deviation = 1.0;
63 | kernel = "11x11gaussian";
64 | }
65 |
66 | blur-background = false;
67 | blur-background-frame = true;
68 | blur-background-fixed = true;
69 | #blur-kern = "3x3box";
70 |
71 | blur-background-exclude = [
72 | "class_g = 'slop'",
73 | # "class_g = 'awesome'",
74 | # "class_g = 'Rofi'",
75 | # "class_g = 'Firefox' && argb",
76 | "_GTK_FRAME_EXTENTS@:c"
77 | ];
78 |
79 | daemon = false;
80 | backend = "glx";
81 | vsync = true;
82 | dbus = false;
83 | mark-wmwin-focused = true;
84 | mark-ovredir-focused = true;
85 | detect-rounded-corners = true;
86 | detect-client-opacity = true;
87 | refresh-rate = 0;
88 | # use-ewmh-active-win = true;
89 | # unredir-if-possible = false;
90 | # unredir-if-possible-delay = 0;
91 |
92 | unredir-if-possible-exclude = [];
93 |
94 | detect-transient = true;
95 | detect-client-leader = true;
96 | resize-damage = 1;
97 |
98 | invert-color-include = [];
99 |
100 | glx-no-stencil = true;
101 | # glx-no-rebind-pixmap = false;
102 | use-damage = true;
103 | # xrender-sync-fence = true;
104 |
105 | # glx-fshader-win = "";
106 | # force-win-blend = false;
107 |
108 | # no-ewmh-fullscreen = false;
109 | # max-brightness = 1.0;
110 |
111 | transparent-clipping = false;
112 |
113 | show-all-xerrors = true;
114 |
115 | round-borders = 1;
116 | corner-radius = 10
117 | rounded-corners-exclude = [
118 | "window_type *= 'dock'",
119 | "class_g = '*'",
120 | "class_g != 'awesome'",
121 | "class_g = 'Rofi'",
122 | "window_type = 'menu'",
123 | "window_type = 'tooltip'",
124 | "window_type = 'popup_menu'",
125 | "window_type = 'dropdown_menu'"
126 | ];
127 |
128 |
129 | wintypes: {
130 | tooltip = { fade = true; shadow = false; focus = false; opacity: 0.80 };
131 | normal = {full-shadow = false;};
132 | dock = { shadow = false; };
133 | dnd = { shadow = false; };
134 | popup_menu = { shadow = true; focus = false; opacity = 0.80; };
135 | dropdown_menu = { shadow = false; focus = false; };
136 | above = { shadow = true; };
137 | splash = { shadow = false; };
138 | utility = { focus = false; shadow = false; blur-background = false; };
139 | notification = { shadow = false; };
140 | desktop = { shadow = false; blur-background = false; };
141 | menu = { focus = false; opacity: 0.80};
142 | dialog = { shadow = true; };
143 | };
144 |
145 |
--------------------------------------------------------------------------------
/configurations/rofi-dark.rasi:
--------------------------------------------------------------------------------
1 | configuration {
2 | font: "Ubuntu Nerd font 12";
3 | show-icons: true;
4 | display-drun: "";
5 | drun-display-format: "{name}";
6 | disable-history: false;
7 | fullscreen: false;
8 | hide-scrollbar: true;
9 | sidebar-mode: false;
10 | }
11 |
12 | * {
13 | background: #212126EE;
14 | background-alt: #00000000;
15 | background-bar: #3B3B42EE;
16 | foreground: #ffffff;
17 | }
18 |
19 | window {
20 | transparency: "real";
21 | background-color: @background;
22 | text-color: @foreground;
23 | border: 0px;
24 | border-color: @border;
25 | border-radius: 0px;
26 | width: 100%;
27 | height: 80%;
28 | anchor: south;
29 | location: south;
30 | y-offset: -30px;
31 | }
32 |
33 | prompt {
34 | enabled: true;
35 | padding: 0.30% 0.5% 0% 0%;
36 | background-color: @background-alt;
37 | text-color: @foreground;
38 | }
39 |
40 | entry {
41 | background-color: @background-alt;
42 | text-color: @foreground;
43 | placeholder-color: @foreground;
44 | expand: true;
45 | horizontal-align: 0;
46 | font: "Ubuntu light 10";
47 | placeholder: "Type to search";
48 | padding: 0.30% 0% 0% 0.25%;
49 | blink: true;
50 | }
51 |
52 | inputbar {
53 | children: [ prompt, entry ];
54 | background-color: @background-bar;
55 | text-color: @foreground;
56 | expand: false;
57 | border: 0px;
58 | border-radius: 50%;
59 | border-color: @accent;
60 | margin: 0% 15% 0% 15%;
61 | padding: 1.0% 10% 1.0% 10%;
62 | }
63 |
64 | scrollbar{
65 | background-color: @background-alt;
66 | handle-color: @background-bar;
67 | }
68 |
69 | listview {
70 | background-color: @background-alt;
71 | columns: 5;
72 | lines: 3;
73 | spacing: 2%;
74 | cycle: false;
75 | dynamic: true;
76 | layout: vertical;
77 | scrollbar: false;
78 | }
79 |
80 | mainbox {
81 | background-color: @background-alt;
82 | border: 0% 0% 0% 0%;
83 | border-radius: 0% 0% 0% 0%;
84 | border-color: @accent;
85 | children: [ inputbar, listview ];
86 | spacing: 5%;
87 | padding: 5% 20% 10% 20%;
88 | }
89 |
90 | element {
91 | background-color: @background-alt;
92 | text-color: @foreground;
93 | orientation: vertical;
94 | border-radius: 0%;
95 | padding: 2% 0% 2% 0%;
96 | }
97 |
98 | element-icon {
99 | size: 64px;
100 | border: 0px;
101 | }
102 |
103 | element-text {
104 | expand: true;
105 | horizontal-align: 0.5;
106 | vertical-align: 0.5;
107 | margin: 0.5% 0.5% -0.5% 0.5%;
108 | font: "Ubuntu 9";
109 | }
110 |
111 | element selected {
112 | background-color: @background-bar;
113 | text-color: @foreground;
114 | border: 0px;
115 | border-radius: 8px;
116 | border-color: @accent;
117 | }
118 |
--------------------------------------------------------------------------------
/configurations/rofi-glassy.rasi:
--------------------------------------------------------------------------------
1 | configuration {
2 | font: "Ubuntu Nerd font 12";
3 | show-icons: true;
4 | display-drun: "";
5 | drun-display-format: "{name}";
6 | disable-history: false;
7 | fullscreen: false;
8 | hide-scrollbar: true;
9 | sidebar-mode: false;
10 | }
11 |
12 | * {
13 | background: #11111199;
14 | background-alt: #00000000;
15 | background-bar: #000000AA;
16 | foreground: #ffffff;
17 | }
18 |
19 | window {
20 | transparency: "real";
21 | background-color: @background;
22 | text-color: @foreground;
23 | border: 0px;
24 | border-color: @border;
25 | border-radius: 0px;
26 | width: 100%;
27 | height: 80%;
28 | anchor: south;
29 | location: south;
30 | y-offset: -30px;
31 | }
32 |
33 | prompt {
34 | enabled: true;
35 | padding: 0.30% 0.5% 0% 0%;
36 | background-color: @background-alt;
37 | text-color: @foreground;
38 | }
39 |
40 | entry {
41 | background-color: @background-alt;
42 | text-color: @foreground;
43 | placeholder-color: @foreground;
44 | expand: true;
45 | horizontal-align: 0;
46 | font: "Ubuntu light 10";
47 | placeholder: "Type to search";
48 | padding: 0.30% 0% 0% 0.25%;
49 | blink: true;
50 | }
51 |
52 | inputbar {
53 | children: [ prompt, entry ];
54 | background-color: @background-bar;
55 | text-color: @foreground;
56 | expand: false;
57 | border: 0px;
58 | border-radius: 50%;
59 | border-color: @accent;
60 | margin: 0% 15% 0% 15%;
61 | padding: 1.0% 10% 1.0% 10%;
62 | }
63 |
64 | scrollbar{
65 | background-color: @background-alt;
66 | handle-color: @background-bar;
67 | }
68 |
69 | listview {
70 | background-color: @background-alt;
71 | columns: 5;
72 | lines: 3;
73 | spacing: 2%;
74 | cycle: false;
75 | dynamic: true;
76 | layout: vertical;
77 | scrollbar: false;
78 | }
79 |
80 | mainbox {
81 | background-color: @background-alt;
82 | border: 0% 0% 0% 0%;
83 | border-radius: 0% 0% 0% 0%;
84 | border-color: @accent;
85 | children: [ inputbar, listview ];
86 | spacing: 5%;
87 | padding: 5% 20% 10% 20%;
88 | }
89 |
90 | element {
91 | background-color: @background-alt;
92 | text-color: @foreground;
93 | orientation: vertical;
94 | border-radius: 0%;
95 | padding: 2% 0% 2% 0%;
96 | }
97 |
98 | element-icon {
99 | size: 64px;
100 | border: 0px;
101 | }
102 |
103 | element-text {
104 | expand: true;
105 | horizontal-align: 0.5;
106 | vertical-align: 0.5;
107 | margin: 0.5% 0.5% -0.5% 0.5%;
108 | font: "Ubuntu 9";
109 | }
110 |
111 | element selected {
112 | background-color: @background-bar;
113 | text-color: @foreground;
114 | border: 0px;
115 | border-radius: 8px;
116 | border-color: @accent;
117 | }
118 |
--------------------------------------------------------------------------------
/configurations/rules.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | -- Rules to apply to new clients (through the "manage" signal).
4 | awful.rules.rules = {
5 | -- All clients will match this rule.
6 | {
7 | rule = { },
8 | properties = {
9 | border_width = beautiful.border_width,
10 | border_color = beautiful.border_normal,
11 | focus = awful.client.focus.filter,
12 | raise = true,
13 | keys = clientkeys,
14 | buttons = clientbuttons,
15 | screen = awful.screen.preferred,
16 | --placement = awful.placement.no_overlap+awful.placement.no_offscreen
17 | }
18 | },
19 |
20 | -- Floating clients.
21 | {
22 | rule_any = {
23 | instance = {
24 | "DTA", -- Firefox addon DownThemAll.
25 | "copyq", -- Includes session name in class.
26 | "pinentry",
27 | },
28 | class = {
29 | "Arandr",
30 | "Blueman-manager",
31 | "Gpick",
32 | "Kruler",
33 | "MessageWin", -- kalarm.
34 | "Sxiv",
35 | "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
36 | "Wpa_gui",
37 | "veromix",
38 | "xtightvncviewer"},
39 |
40 | -- Note that the name property shown in xprop might be set slightly after creation of the client
41 | -- and the name shown there might not match defined rules here.
42 | name = {
43 | "Event Tester", -- xev.
44 | },
45 | role = {
46 | "AlarmWindow", -- Thunderbird's calendar.
47 | "ConfigManager", -- Thunderbird's about:config.
48 | "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
49 | }
50 | },
51 | properties = { floating = true }
52 | },
53 |
54 | -- Add titlebars to normal clients and dialogs
55 | {
56 | rule_any = {
57 | type = { "normal", "dialog" }
58 | },
59 | properties = { titlebars_enabled = true }
60 | },
61 |
62 | -- Set Firefox to always map on the tag named "1" on screen 1.
63 | {
64 | rule = { class = "firefox" },
65 | properties = { screen = 1, tag = "WEB" }
66 | },
67 | {
68 | rule = { instance = "plugin-container" },
69 | roperties = { floating = true }
70 | },
71 | {
72 | rule = { role = "_NET_WM_STATE_FULLSCREEN" },
73 | roperties = { floating = true }
74 | },
75 | {
76 | rule = { class= "Simple-scan" },
77 | properties = { titlebars_enabled = false}
78 | },
79 | {
80 | rule = { class= "feh" },
81 | properties = { width = 800, height = 600}
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/configurations/settings.lua:
--------------------------------------------------------------------------------
1 | local settings = {}
2 |
3 | settings.wlan_interface = "wlp7s0"
4 | settings.lan_interface = "enp19s0"
5 | -- Turn this to false if you have no bluetooth available, otherwise your dbus will get polutate with bluetoothctl
6 | settings.is_bluetooth_presence = true
7 | settings.script_dir = "/home/devops/.config/awesome/scripts/"
8 | settings.openweathermap_api_key = ""
9 | settings.openweathermap_coordinates = {
10 | "", -- lat
11 | "" -- lng
12 | }
13 | return settings
14 |
--------------------------------------------------------------------------------
/debian/menu.lua:
--------------------------------------------------------------------------------
1 | -- automatically generated file. Do not edit (see /usr/share/doc/menu/html)
2 |
3 | local awesome = awesome
4 |
5 | Debian_menu = {}
6 |
7 | Debian_menu["Debian_Applications_Accessibility"] = {
8 | {"Xmag","xmag"},
9 | }
10 | Debian_menu["Debian_Applications_Editors"] = {
11 | {"Xedit","xedit"},
12 | }
13 | Debian_menu["Debian_Applications_Emulators"] = {
14 | {"VirtualBox","/usr/bin/virtualbox","/usr/share/pixmaps/virtualbox.xpm"},
15 | }
16 | Debian_menu["Debian_Applications_Graphics"] = {
17 | {"xcb","/usr/bin/xcb"},
18 | {"X Window Snapshot","xwd | xwud"},
19 | }
20 | Debian_menu["Debian_Applications_Network_Communication"] = {
21 | {"Telnet", "x-terminal-emulator -e ".."/usr/bin/telnet.netkit"},
22 | {"Xbiff","xbiff"},
23 | }
24 | Debian_menu["Debian_Applications_Network_Monitoring"] = {
25 | {"netwatch", "x-terminal-emulator -e ".."/usr/sbin/netwatch"},
26 | {"statnet", "x-terminal-emulator -e ".."/usr/bin/statnet"},
27 | {"trafshow", "x-terminal-emulator -e ".."/usr/sbin/trafshow"},
28 | }
29 | Debian_menu["Debian_Applications_Network_Web_Browsing"] = {
30 | {"Google Chrome","/opt/google/chrome/google-chrome","/opt/google/chrome/product_logo_32.xpm"},
31 | {"Opera","/usr/bin/opera","/usr/share/pixmaps/opera.xpm"},
32 | {"Qutebrowser","qutebrowser","/usr/share/pixmaps/qutebrowser.xpm"},
33 | {"w3m", "x-terminal-emulator -e ".."/usr/bin/w3m /usr/share/doc/w3m/MANUAL.html"},
34 | }
35 | Debian_menu["Debian_Applications_Network"] = {
36 | { "Communication", Debian_menu["Debian_Applications_Network_Communication"] },
37 | { "Monitoring", Debian_menu["Debian_Applications_Network_Monitoring"] },
38 | { "Web Browsing", Debian_menu["Debian_Applications_Network_Web_Browsing"] },
39 | }
40 | Debian_menu["Debian_Applications_Programming"] = {
41 | {"GDB", "x-terminal-emulator -e ".."/usr/bin/gdb"},
42 | {"Tclsh8.6", "x-terminal-emulator -e ".."/usr/bin/tclsh8.6"},
43 | {"TkWish8.6","x-terminal-emulator -e /usr/bin/wish8.6"},
44 | }
45 | Debian_menu["Debian_Applications_Science_Mathematics"] = {
46 | {"Bc", "x-terminal-emulator -e ".."/usr/bin/bc"},
47 | {"Dc", "x-terminal-emulator -e ".."/usr/bin/dc"},
48 | {"Xcalc","xcalc"},
49 | }
50 | Debian_menu["Debian_Applications_Science"] = {
51 | { "Mathematics", Debian_menu["Debian_Applications_Science_Mathematics"] },
52 | }
53 | Debian_menu["Debian_Applications_Shells"] = {
54 | {"Bash", "x-terminal-emulator -e ".."/bin/bash --login"},
55 | {"Dash", "x-terminal-emulator -e ".."/bin/dash -i"},
56 | {"fish", "x-terminal-emulator -e ".."/usr/bin/fish"},
57 | {"Sh", "x-terminal-emulator -e ".."/bin/sh --login"},
58 | {"Zsh", "x-terminal-emulator -e ".."/bin/zsh"},
59 | }
60 | Debian_menu["Debian_Applications_Sound"] = {
61 | {"ncmpcpp", "x-terminal-emulator -e ".."/usr/bin/ncmpcpp"},
62 | }
63 | Debian_menu["Debian_Applications_System_Administration"] = {
64 | {"Editres","editres"},
65 | {"Xclipboard","xclipboard"},
66 | {"Xfontsel","xfontsel"},
67 | {"Xkill","xkill"},
68 | {"Xrefresh","xrefresh"},
69 | }
70 | Debian_menu["Debian_Applications_System_Hardware"] = {
71 | {"Xvidtune","xvidtune"},
72 | }
73 | Debian_menu["Debian_Applications_System_Monitoring"] = {
74 | {"Pstree", "x-terminal-emulator -e ".."/usr/bin/pstree.x11","/usr/share/pixmaps/pstree16.xpm"},
75 | {"Top", "x-terminal-emulator -e ".."/usr/bin/top"},
76 | {"Xconsole","xconsole -file /dev/xconsole"},
77 | {"Xev","x-terminal-emulator -e xev"},
78 | {"Xload","xload"},
79 | }
80 | Debian_menu["Debian_Applications_System_Package_Management"] = {
81 | {"Aptitude Package Manager (text)", "x-terminal-emulator -e ".."/usr/bin/aptitude-curses"},
82 | }
83 | Debian_menu["Debian_Applications_System"] = {
84 | { "Administration", Debian_menu["Debian_Applications_System_Administration"] },
85 | { "Hardware", Debian_menu["Debian_Applications_System_Hardware"] },
86 | { "Monitoring", Debian_menu["Debian_Applications_System_Monitoring"] },
87 | { "Package Management", Debian_menu["Debian_Applications_System_Package_Management"] },
88 | }
89 | Debian_menu["Debian_Applications_Viewers"] = {
90 | {"Wordview","/usr/bin/wordview"},
91 | {"Xditview","xditview"},
92 | }
93 | Debian_menu["Debian_Applications"] = {
94 | { "Accessibility", Debian_menu["Debian_Applications_Accessibility"] },
95 | { "Editors", Debian_menu["Debian_Applications_Editors"] },
96 | { "Emulators", Debian_menu["Debian_Applications_Emulators"] },
97 | { "Graphics", Debian_menu["Debian_Applications_Graphics"] },
98 | { "Network", Debian_menu["Debian_Applications_Network"] },
99 | { "Programming", Debian_menu["Debian_Applications_Programming"] },
100 | { "Science", Debian_menu["Debian_Applications_Science"] },
101 | { "Shells", Debian_menu["Debian_Applications_Shells"] },
102 | { "Sound", Debian_menu["Debian_Applications_Sound"] },
103 | { "System", Debian_menu["Debian_Applications_System"] },
104 | { "Viewers", Debian_menu["Debian_Applications_Viewers"] },
105 | }
106 | Debian_menu["Debian_Games_Toys"] = {
107 | {"Oclock","oclock"},
108 | {"Xclock (analog)","xclock -analog"},
109 | {"Xclock (digital)","xclock -digital -update 1"},
110 | {"Xeyes","xeyes"},
111 | {"Xlogo","xlogo"},
112 | }
113 | Debian_menu["Debian_Games"] = {
114 | { "Toys", Debian_menu["Debian_Games_Toys"] },
115 | }
116 | Debian_menu["Debian_Help"] = {
117 | {"Xman","xman"},
118 | }
119 | Debian_menu["Debian_Window_Managers"] = {
120 | {"awesome",function () awesome.exec("/usr/bin/awesome") end,"/usr/share/pixmaps/awesome.xpm"},
121 | {"Bspwm",function () awesome.exec("/usr/bin/bspwm") end},
122 | {"Herbstluftwm",function () awesome.exec("/usr/bin/herbstluftwm") end,"/usr/share/pixmaps/herbstluftwm.xpm"},
123 | }
124 | Debian_menu["Debian"] = {
125 | { "Applications", Debian_menu["Debian_Applications"] },
126 | { "Games", Debian_menu["Debian_Games"] },
127 | { "Help", Debian_menu["Debian_Help"] },
128 | { "Window Managers", Debian_menu["Debian_Window_Managers"] },
129 | }
130 |
131 | debian = { menu = { Debian_menu = Debian_menu } }
132 | return debian
--------------------------------------------------------------------------------
/libs/helpers.lua:
--------------------------------------------------------------------------------
1 | local module = {}
2 |
3 | module.sleep = function(n)
4 | local t = os.clock()
5 | while os.clock() - t <= n do
6 | -- nothing
7 | end
8 | end
9 | return module
10 |
--------------------------------------------------------------------------------
/libs/redshift.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 |
3 | local redshift = {}
4 | redshift.redshift = "/usr/bin/redshift" -- binary path
5 | redshift.method = "randr" -- randr or vidmode
6 | redshift.state = 1 -- 1 for screen dimming, 0 for none
7 |
8 | redshift.dim = function()
9 | awful.util.spawn("pkill -USR1 redshift")
10 | redshift.state = 1
11 | end
12 |
13 | redshift.undim = function()
14 | awful.util.spawn("pkill -USR1 redshift")
15 | redshift.state = 0
16 | end
17 | redshift.toggle = function()
18 | if redshift.state == 1
19 | then
20 | redshift.undim()
21 | else
22 | redshift.dim()
23 | end
24 | end
25 | redshift.init = function(initState)
26 | if initState == 1
27 | then
28 | redshift.dim()
29 | else
30 | redshift.undim()
31 | end
32 | end
33 |
34 | return redshift
35 |
--------------------------------------------------------------------------------
/module/autostart.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local filesystem = require("gears.filesystem")
3 | local beautiful = require("beautiful")
4 | local naughty = require("naughty")
5 | local config_dir = filesystem.get_configuration_dir()
6 | local default_apps = require("configurations.default-apps")
7 | local startup_apps = {
8 | "picom -b --experimental-backends --config " .. config_dir .. "configurations/picom.conf",
9 | "redshift -t 5700:3400 -l 26.1445:91.7362",
10 | "udiskie",
11 | "xidlehook --not-when-fullscreen --not-when-audio --timer 300 'xbacklight -set 1' 'xbacklight -set 50' --timer 60 'xbacklight -set 50;" ..default_apps.lock_screen .." ' '' --timer 900 'systemctl suspend' ''",
12 | "$HOME/.local/bin/xinput-tab",
13 | "xbacklight -set 45"
14 | -- Add your startup programs here
15 | }
16 |
17 |
18 | local spawn_once = function (cmd)
19 | local findme = cmd
20 | local firstspace = cmd:find(" ")
21 | if firstspace then
22 | findme = cmd:sub(0, firstspace - 1)
23 | end
24 | awful.spawn.easy_async_with_shell(
25 | string.format('pgrep -u $USER -x %s > /dev/null || (%s)', findme, cmd),
26 | function(_, stderr)
27 | if not stderr or stderr == '' then
28 | return
29 | end
30 | naughty.notification({
31 | app_name = 'Startup Applications',
32 | image = beautiful.icon_noti_error,
33 | title = "Error starting application",
34 | message = "Error while starting " .. cmd,
35 | timeout = 10,
36 | icon = beautiful.icon_noti_error,
37 | })
38 | end
39 | )
40 | end
41 |
42 | for _, app in ipairs(startup_apps) do
43 | spawn_once(app)
44 | end
45 |
46 |
--------------------------------------------------------------------------------
/module/network.lua:
--------------------------------------------------------------------------------
1 | local naughty = require("naughty")
2 | local setting = require("configurations.settings")
3 | local awful = require("awful")
4 | local network = {}
5 |
6 |
7 |
8 | function network.notify(message, title, app_name, icon)
9 | naughty.notification({
10 | message = message,
11 | title = title,
12 | app_name = app_name,
13 | icon = icon
14 | })
15 | end
16 |
17 |
18 | -- Create wireless connection notification
19 | function network.notify_wirless_connected(essid)
20 | local message = 'You are now connected to \"' .. essid .. '\"'
21 | local title = 'Connection Established'
22 | local app_name = 'System Notification'
23 | local icon = setting.icons.wifi_icon
24 | network.notify(message, title, app_name, icon)
25 | end
26 |
27 | -- Create wired connection notification
28 | function network.notify_wired_connected()
29 | local message = 'Connected to internet with \"' .. setting.lan_interface .. '\"'
30 | local title = 'Connection Established'
31 | local app_name = 'System Notification'
32 | local icon = setting.icons.wlan_icon
33 | network.notify(message, title, app_name, icon)
34 | end
35 |
36 | function network.notify_wireless_disconnected ()
37 | local message = 'Wi-Fi network has been disconnected'
38 | local title = 'Connection Disconnected'
39 | local app_name = 'System Notification'
40 | local icon = setting.icons.wifi_icon
41 | network.notify(message, title, app_name, icon)
42 | end
43 |
44 | function network.notify_wired_disconnected()
45 | local message = 'Ethernet network has been disconnected'
46 | local title = 'Connection Disconnected'
47 | local app_name = 'System Notification'
48 | local icon = setting.icons.wlan_icon
49 | network.notify(message, title, app_name, icon)
50 | end
51 |
52 |
53 | -- Get wifi essid
54 | function network.get_essid()
55 | return awful.spawn.easy_async_with_shell(
56 | [[
57 | iw dev ]] .. setting.wlan_interface .. [[ link
58 | ]],
59 | function(stdout)
60 | local essid = stdout:match('SSID: (.-)\n') or 'N/A'
61 | return essid
62 | end
63 | )
64 | end
65 |
66 | function network.set_widgettext_with_ssid(widget)
67 | return awful.spawn.easy_async_with_shell(
68 | [[
69 | iw dev ]] .. setting.wlan_interface .. [[ link
70 | ]],
71 | function(stdout)
72 | local essid = stdout:match('SSID: (.-)\n') or 'N/A'
73 | widget:set_text(essid)
74 | end
75 | )
76 | end
77 |
78 | function network.update_button(widget, widget_i, widget_s)
79 | awful.spawn.easy_async_with_shell(
80 | [=[
81 | wireless="]=] .. tostring(setting.wlan_interface) .. [=["
82 | wired="]=] .. tostring(setting.lan_interface) .. [=["
83 | net="/sys/class/net/"
84 | wired_state="down"
85 | wireless_state="down"
86 | network_mode=""
87 | # Check network state based on interface's operstate value
88 | function check_network_state() {
89 | # Check what interface is up
90 | if [[ "${wireless_state}" == "up" ]];
91 | then
92 | network_mode='wireless'
93 | elif [[ "${wired_state}" == "up" ]];
94 | then
95 | network_mode='wired'
96 | else
97 | network_mode='No internet connection'
98 | fi
99 | }
100 | # Check if network directory exist
101 | function check_network_directory() {
102 | if [[ -n "${wireless}" && -d "${net}${wireless}" ]];
103 | then
104 | wireless_state="$(cat "${net}${wireless}/operstate")"
105 | fi
106 | if [[ -n "${wired}" && -d "${net}${wired}" ]]; then
107 | wired_state="$(cat "${net}${wired}/operstate")"
108 | fi
109 | check_network_state
110 | }
111 | # Start script
112 | function print_network_mode() {
113 | # Call to check network dir
114 | check_network_directory
115 | # Print network mode
116 | printf "${network_mode}"
117 | }
118 | print_network_mode
119 | ]=],
120 | function(stdout)
121 | network.mode = stdout:gsub('%\n', '')
122 | if stdout:match('No internet connection') then
123 | if network.mode == 'wireless' then
124 | widget:set_bg(colors.bg_button)
125 | widget_i:set_text("Wifi")
126 | widget_s:set_text("Offline")
127 | else
128 | widget:set_bg(colors.bg_button)
129 | widget_i:set_text("Ethernet")
130 | widget_s:set_text("Offline")
131 | end
132 | else
133 | if network.mode == 'wireless' then
134 | widget:set_bg(colors.bg_success)
135 | widget_i:set_text("Wifi")
136 | network.set_widgettext_with_ssid(widget_s)
137 | else
138 | widget:set_bg(colors.bg_button)
139 | widget_i:set_text("Ethernet")
140 | widget_s:set_text("Connected")
141 | end
142 | end
143 | end
144 | )
145 | end
146 |
147 | function network.check_network_mode ()
148 | if not network.is_connected then
149 | if network.mode == "wireless" then
150 | network.notify_wirless_diconnected()
151 | else
152 | network.notify_wired_disconnected()
153 | end
154 | elseif network.mode == 'wireless' then
155 | network.notify_wirless_connected(network.get_essid())
156 | elseif network.mode('wired') then
157 | network.notify_wired_connected()
158 | end
159 | end
160 |
161 | return network
162 |
--------------------------------------------------------------------------------
/module/notification.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local naughty = require("naughty")
3 | local beautiful = require("beautiful")
4 | local awful = require("awful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local gears = require("gears")
7 | local menubar = require("menubar")
8 | local clickable_container = require("widgets.clickable-container")
9 |
10 |
11 | naughty.connect_signal(
12 | 'request::icon',
13 | function(n, context, hints)
14 | if context ~= 'app_icon' then return end
15 |
16 | local path = menubar.utils.lookup_icon(hints.app_icon) or
17 | menubar.utils.lookup_icon(hints.app_icon:lower())
18 |
19 | if path then
20 | n.icon = path
21 | end
22 | end
23 | )
24 |
25 | naughty.connect_signal("request::display", function (n)
26 | -- Main container of the notification
27 | local container = wibox.widget{
28 | spacing = beautiful.notification_margin,
29 | layout = wibox.layout.fixed.vertical
30 | }
31 |
32 | local icon = wibox.widget{
33 | resize_strategy = "scale",
34 | widget = naughty.widget.icon
35 | }
36 |
37 | local app_icon = function ()
38 | local widget = {}
39 |
40 | if not n.app_icon == nil or not n.app_icon == '' then
41 | widget = wibox.widget{
42 | image = n.app_icon,
43 | resize = true,
44 | forced_height = dpi(16),
45 | forced_width = dpi(16),
46 | widget = wibox.widget.imagebox
47 | }
48 | elseif not n.image == nil or not n.image == '' then
49 | widget = wibox.widget{
50 | image = n.image,
51 | resize = true,
52 | forced_height = dpi(16),
53 | forced_width = dpi(16),
54 | widget = wibox.widget.imagebox
55 | }
56 |
57 | else
58 | widget = nil
59 | end
60 |
61 | return widget
62 | end
63 |
64 |
65 | local dismiss_button = wibox.widget{
66 | {
67 | {
68 | {
69 | image = beautiful.icon_times,
70 | resize = true,
71 | forced_height = dpi(16),
72 | forced_width = dpi(16),
73 | widget = wibox.widget.imagebox
74 | },
75 | margins = dpi(1),
76 | widget = wibox.container.margin
77 | },
78 | bg = beautiful.bg_button,
79 | border_width = beautiful.btn_border_width,
80 | border_color = beautiful.border_button,
81 | shape = gears.shape.circle,
82 | widget = wibox.container.background
83 | },
84 | widget = clickable_container
85 | }
86 |
87 | dismiss_button:connect_signal("button::press", function (_,_,_,button)
88 | if button == 1 then
89 | n:destroy(nil, 1)
90 | end
91 | end)
92 |
93 | local app_name = wibox.widget{
94 | markup = n.app_name or "System Notification",
95 | font = "Ubuntu Bold 10",
96 | align = 'center',
97 | valign = 'center',
98 | widget = wibox.widget.textbox
99 | }
100 |
101 | local app_icon_with_name_and_dismiss_btn = wibox.widget{
102 | {
103 | app_icon(),
104 | app_name,
105 | spacing = beautiful.notification_margin,
106 | layout = wibox.layout.fixed.horizontal
107 | },
108 | nil,
109 | dismiss_button,
110 | expand = "inside",
111 | spacing = beautiful.notification_margin,
112 | layout = wibox.layout.align.horizontal
113 | }
114 |
115 | local action_list = wibox.widget {
116 | notification = n,
117 | base_layout = wibox.widget {
118 | spacing = beautiful.notification_margin,
119 | layout = wibox.layout.fixed.horizontal
120 | },
121 | widget_template = {
122 | {
123 | {
124 | {
125 | id = 'text_role',
126 | align = "center",
127 | valign = "center",
128 | widget = wibox.widget.textbox
129 | },
130 | top = dpi(4),
131 | bottom = dpi(4),
132 | left = dpi(10),
133 | right = dpi(10),
134 | widget = wibox.container.margin
135 | },
136 | bg = beautiful.bg_button,
137 | border_width = beautiful.btn_border_width,
138 | border_color = beautiful.border_button,
139 | shape = gears.shape.rounded_bar,
140 | widget = wibox.container.background,
141 | },
142 | widget = clickable_container,
143 | },
144 | style = { underline_normal = false, underline_selected = true },
145 | widget = naughty.list.actions,
146 | }
147 |
148 | local title_area_and_message = wibox.widget{
149 | naughty.widget.title,
150 | naughty.widget.message,
151 | spacing = beautiful.notification_margin,
152 | layout = wibox.layout.fixed.vertical
153 | }
154 |
155 |
156 | local notibox = wibox.widget{
157 | app_icon_with_name_and_dismiss_btn,
158 | {
159 | icon,
160 | title_area_and_message,
161 | spacing = beautiful.notification_margin,
162 | layout = wibox.layout.fixed.horizontal
163 | },
164 | spacing = beautiful.notification_margin,
165 | layout = wibox.layout.fixed.vertical
166 | }
167 |
168 |
169 | naughty.layout.box {
170 | notification = n,
171 | bg = "#00000000",
172 | widget_template = {
173 | {
174 | {
175 | {
176 | notibox,
177 | action_list,
178 | widget = container
179 | },
180 | margins = beautiful.notification_margin,
181 | widget = wibox.container.margin
182 | },
183 | bg = beautiful.bg_normal,
184 | shape = beautiful.widget_shape,
185 | widget = wibox.container.background
186 | },
187 | strategy = "max",
188 | forced_width = beautiful.notification_max_width or dpi(300),
189 | widget = wibox.container.constraint
190 | }
191 | }
192 |
193 | local focused = awful.screen.focused()
194 | if _G.dont_disturb or
195 | (focused.central_panel and focused.central_panel.visible) then
196 | naughty.destroy_all_notifications(nil, 1)
197 | end
198 |
199 | end)
200 |
201 |
202 |
--------------------------------------------------------------------------------
/module/signals.lua:
--------------------------------------------------------------------------------
1 | local gears = require("gears")
2 | local awful = require("awful")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local menubar = require("menubar")
6 | local dpi = beautiful.xresources.apply_dpi
7 | local awesome = awesome
8 | local client = client
9 |
10 | -- Toggle titlebar on or off depending on s. Creates titlebar if it doesn't exist
11 | local function setTitlebar(client, s)
12 | if s then
13 | awful.titlebar.show(client)
14 | else
15 | awful.titlebar.hide(client)
16 | end
17 | end
18 |
19 | local set_client_icon = function (c)
20 | local icon = menubar.utils.lookup_icon(c.instance)
21 | local lower_icon = menubar.utils.lookup_icon(c.instance:lower())
22 | --Check if the icon exists
23 | if icon ~= nil then
24 | local new_icon = gears.surface(icon)
25 | c.icon = new_icon._native
26 |
27 | --Check if the icon exists in the lowercase variety
28 | elseif lower_icon ~= nil then
29 | local new_icon = gears.surface(lower_icon)
30 | c.icon = new_icon._native
31 |
32 | --Check if the client already has an icon. If not, give it a default.
33 | elseif c.icon == nil then
34 | local new_icon = gears.surface(menubar.utils.lookup_icon("application-default-icon"))
35 | c.icon = new_icon._native
36 | end
37 | end
38 |
39 |
40 | -- Signal function to execute when a new client appears.
41 | client.connect_signal("manage", function (c)
42 | -- Set the windows at the slave,
43 | -- i.e. put it at the end of others instead of setting it master.
44 | if not awesome.startup then awful.client.setslave(c) end
45 |
46 | if awesome.startup
47 | and not c.size_hints.user_position
48 | and not c.size_hints.program_position then
49 | -- Prevent clients from being unreachable after screen count changes.
50 | awful.placement.no_offscreen(c)
51 | end
52 |
53 | if awful.layout.suit.floating or c.floating then
54 | awful.placement.centered(c)
55 | end
56 |
57 |
58 | set_client_icon(c)
59 | setTitlebar(c, c.first_tag.layout == awful.layout.suit.floating)
60 | end)
61 |
62 | -- Add a titlebar if titlebars_enabled is set to true in the rules.
63 | client.connect_signal("request::titlebars", function(c)
64 | -- buttons for the titlebar
65 | local buttons = gears.table.join(
66 | awful.button({ }, 1, function()
67 | c:emit_signal("request::activate", "titlebar", {raise = true})
68 | awful.mouse.client.move(c)
69 | end),
70 | awful.button({ }, 3, function()
71 | c:emit_signal("request::activate", "titlebar", {raise = true})
72 | awful.mouse.client.resize(c)
73 | end)
74 | )
75 |
76 | awful.titlebar(c) : setup {
77 | { -- Left
78 | {
79 | awful.titlebar.widget.iconwidget(c),
80 | left = dpi(6),
81 | top = dpi(4),
82 | bottom = dpi(4),
83 | widget = wibox.container.margin
84 | },
85 | buttons = buttons,
86 | layout = wibox.layout.fixed.horizontal
87 | },
88 | { -- Middle
89 | { -- Title
90 | align = "center",
91 | widget = awful.titlebar.widget.titlewidget(c)
92 | },
93 | buttons = buttons,
94 | layout = wibox.layout.flex.horizontal
95 | },
96 | { -- Right
97 | {
98 | {
99 | awful.titlebar.widget.minimizebutton(c),
100 | forced_height = dpi(16),
101 | forced_width = dpi(16),
102 | widget = wibox.container.place
103 | },
104 | right = dpi(6),
105 | top = dpi(4),
106 | bottom = dpi(4),
107 | widget = wibox.container.margin
108 | },
109 | {
110 | {
111 | awful.titlebar.widget.maximizedbutton(c),
112 | forced_height = dpi(16),
113 | forced_width = dpi(16),
114 | widget = wibox.container.place
115 | },
116 | right = dpi(6),
117 | top = dpi(4),
118 | bottom = dpi(4),
119 |
120 | widget = wibox.container.margin
121 | },
122 | {
123 | {
124 | awful.titlebar.widget.closebutton (c),
125 | forced_height = dpi(16),
126 | forced_width = dpi(16),
127 | widget = wibox.container.place
128 | },
129 | right = dpi(6),
130 | top = dpi(4),
131 | bottom = dpi(4),
132 | widget = wibox.container.margin
133 | },
134 | layout = wibox.layout.fixed.horizontal()
135 | },
136 | layout = wibox.layout.align.horizontal
137 | }
138 | end)
139 |
140 | -- Enable sloppy focus, so that focus follows mouse.
141 | --client.connect_signal("mouse::enter", function(c)
142 | --c:emit_signal("request::activate", "mouse_enter", {raise = false})
143 | --end)
144 |
145 | client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
146 | client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
147 |
148 | screen.connect_signal("arrange", function (s)
149 | local layout = s.selected_tag.layout.name
150 | for _, c in pairs(s.clients) do
151 | if c.maximized then
152 | c.border_width = 0
153 | awful.spawn("xprop -id " .. c.window .. " -f _COMPTON_SHADOW 32c -set _COMPTON_SHADOW 0", false)
154 | elseif layout == 'floating' then
155 | c.border_width = 0
156 | awful.spawn("xprop -id " .. c.window .. " -f _COMPTON_SHADOW 32c -set _COMPTON_SHADOW 1", false)
157 | else
158 | awful.spawn("xprop -id " .. c.window .. " -f _COMPTON_SHADOW 32c -set _COMPTON_SHADOW 0", false)
159 | c.border_width = beautiful.border_width
160 | end
161 | end
162 | end)
163 |
164 | -- Show titlebars on tags with the floating layout
165 | tag.connect_signal("property::layout", function(t)
166 | for _, c in pairs(t:clients()) do
167 | if t.layout == awful.layout.suit.floating then
168 | setTitlebar(c, true)
169 | else
170 | setTitlebar(c, false)
171 | end
172 | end
173 | end)
174 |
175 | --Toggle titlebar on floating status change
176 | --client.connect_signal("property::floating", function(c)
177 | --setTitlebar(c, c.floating)
178 | --end)
179 |
--------------------------------------------------------------------------------
/rc.lua:
--------------------------------------------------------------------------------
1 | -- If LuaRocks is installed, make sure that packages installed through it are
2 | -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
3 | pcall(require, "luarocks.loader")
4 |
5 | local gears = require("gears")
6 | local awful = require("awful")
7 | require("awful.autofocus")
8 | local wibox = require("wibox")
9 | local beautiful = require("beautiful")
10 | local naughty = require("naughty")
11 | require("awful.hotkeys_popup.keys")
12 | require('awful.autofocus')
13 | local has_fdo, freedesktop = pcall(require, "freedesktop")
14 |
15 | -- Error handling
16 | -- Check if awesome encountered an error during startup and fell back to
17 | -- another config (This code will only ever execute for the fallback config)
18 | if awesome.startup_errors then
19 | naughty.notify({
20 | preset = naughty.config.presets.critical,
21 | title = "Oops, there were errors during startup!",
22 | text = awesome.startup_errors
23 | })
24 | end
25 |
26 | -- Handle runtime errors after startup
27 | do
28 | local in_error = false
29 | awesome.connect_signal("debug::error", function (err)
30 | -- Make sure we don't go into an endless error loop
31 | if in_error then return end
32 | in_error = true
33 |
34 | naughty.notify({ preset = naughty.config.presets.critical,
35 | title = "Oops, an error happened!",
36 | text = tostring(err) })
37 | in_error = false
38 | end)
39 | end
40 |
41 | beautiful.init( gears.filesystem.get_configuration_dir() .. "/themes/default/theme.lua")
42 |
43 | terminal = "kitty"
44 | editor = os.getenv("EDITOR") or "vim"
45 | editor_cmd = terminal .. " -e " .. editor
46 |
47 | modkey = "Mod4"
48 |
49 | -- Table of layouts to cover with awful.layout.inc, order matters.
50 | awful.layout.layouts = {
51 | awful.layout.suit.tile,
52 | awful.layout.suit.floating,
53 | awful.layout.suit.max,
54 | }
55 |
56 | -- Set wallpaper
57 | local function set_wallpaper(s)
58 | -- Wallpaper
59 | if beautiful.wallpaper then
60 | local wallpaper = beautiful.wallpaper
61 | -- If wallpaper is a function, call it with the screen
62 | if type(wallpaper) == "function" then
63 | wallpaper = wallpaper(s)
64 | end
65 | gears.wallpaper.maximized(wallpaper, s, true)
66 | end
67 | end
68 |
69 | -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
70 | screen.connect_signal("property::geometry", set_wallpaper)
71 |
72 | awful.screen.connect_for_each_screen(function(s)
73 | -- Wallpaper
74 | set_wallpaper(s)
75 | -- Create a promptbox for each screen
76 | s.mypromptbox = awful.widget.prompt()
77 |
78 | -- Create the wibox
79 | s.mywibox = awful.wibar({
80 | position = beautiful.wibar_position,
81 | screen = s,
82 | height = beautiful.wibar_height,
83 | bg = "#00000000"
84 | })
85 |
86 | -- Add widgets to the wibox
87 | s.mywibox:setup {
88 | {
89 | layout = wibox.layout.align.horizontal,
90 | { -- Left widgets
91 | layout = wibox.layout.fixed.horizontal,
92 | require("widgets.separator"),
93 | require("widgets.panel.menu"),
94 | require("widgets.panel.taglist")(s),
95 | require("widgets.separator"),
96 | s.mypromptbox,
97 | },
98 | require("widgets.panel.icon-only-tasklist")(s), -- Middle widget
99 | { -- Right widgets
100 | layout = wibox.layout.fixed.horizontal,
101 | require("widgets.panel.systray-no-toggle")(),
102 | require("widgets.panel.layoutbox")(s),
103 | require("widgets.clock")(s),
104 | require("widgets.control-center")(s),
105 | },
106 | },
107 | bg = beautiful.bg_normal,
108 | -- shape = function (cr, width, height)
109 | -- gears.shape.partially_rounded_rect( cr, width, height, true, true, false, false, 50)
110 | -- end,
111 | widget = wibox.container.background
112 | }
113 | end)
114 |
115 | awesome.connect_signal(
116 | "panel::show",
117 | function ()
118 | for s in screen do
119 | s.mywibox.visible = true
120 | end
121 | end
122 | )
123 |
124 | awesome.connect_signal(
125 | "panel::hide",
126 | function ()
127 | for s in screen do
128 | s.mywibox.visible = false
129 | end
130 | end
131 | )
132 |
133 | -- Mouse bindings
134 | root.buttons(gears.table.join(
135 | awful.button({ }, 4, awful.tag.viewnext),
136 | awful.button({ }, 5, awful.tag.viewprev)
137 | ))
138 |
139 | -- Key bindings
140 | globalkeys = require("configurations.keybindings.global")
141 | clientkeys = require("configurations.keybindings.client")
142 | -- Bind all key numbers to tags.
143 | -- Be careful: we use keycodes to make it work on any keyboard layout.
144 | -- This should map on the top row of your keyboard, usually 1 to 9.
145 | for i = 1, 9 do
146 | globalkeys = gears.table.join(globalkeys,
147 | -- View tag only.
148 |
149 | awful.key(
150 | { modkey }, "#" .. i + 9,
151 | function ()
152 | local screen = awful.screen.focused()
153 | local tag = screen.tags[i]
154 | if tag then
155 | tag:view_only()
156 | end
157 | end,
158 | {description = "view tag #"..i, group = "tag"}
159 | ),
160 | -- Toggle tag display.
161 | awful.key(
162 | { modkey, "Control" }, "#" .. i + 9,
163 | function ()
164 | local screen = awful.screen.focused()
165 | local tag = screen.tags[i]
166 | if tag then
167 | awful.tag.viewtoggle(tag)
168 | end
169 | end,
170 | {description = "toggle tag #" .. i, group = "tag"}
171 | ),
172 | -- Move client to tag.
173 | awful.key(
174 | { modkey, "Shift" }, "#" .. i + 9,
175 | function ()
176 | if client.focus then
177 | local tag = client.focus.screen.tags[i]
178 | if tag then
179 | client.focus:move_to_tag(tag)
180 | end
181 | end
182 | end,
183 | {description = "move focused client to tag #"..i, group = "tag"}
184 | ),
185 | -- Toggle tag on focused client.
186 | awful.key(
187 | { modkey, "Control", "Shift" }, "#" .. i + 9,
188 | function ()
189 | if client.focus then
190 | local tag = client.focus.screen.tags[i]
191 | if tag then
192 | client.focus:toggle_tag(tag)
193 | end
194 | end
195 | end,
196 | {description = "toggle focused client on tag #" .. i, group = "tag"}
197 | )
198 | )
199 | end
200 |
201 | clientbuttons = gears.table.join(
202 | awful.button({ }, 1, function (c)
203 | c:emit_signal("request::activate", "mouse_click", {raise = true})
204 | end),
205 | awful.button({ modkey }, 1, function (c)
206 | c:emit_signal("request::activate", "mouse_click", {raise = true})
207 | awful.mouse.client.move(c)
208 | end),
209 | awful.button({ modkey }, 3, function (c)
210 | c:emit_signal("request::activate", "mouse_click", {raise = true})
211 | awful.mouse.client.resize(c)
212 | end)
213 | )
214 |
215 | -- Set keys
216 | root.keys(globalkeys)
217 |
218 | -- Rules
219 | require("module.signals")
220 | require("configurations.rules")
221 | require("widgets.exit-screen")
222 | require("module.notification")
223 | require("module.autostart")
224 |
225 |
--------------------------------------------------------------------------------
/rc.lua.test:
--------------------------------------------------------------------------------
1 | -- If LuaRocks is installed, make sure that packages installed through it are
2 | -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
3 | pcall(require, "luarocks.loader")
4 |
5 | local gears = require("gears")
6 | local awful = require("awful")
7 | require("awful.autofocus")
8 | local wibox = require("wibox")
9 | local beautiful = require("beautiful")
10 | local naughty = require("naughty")
11 | require("awful.hotkeys_popup.keys")
12 | require('awful.autofocus')
13 | local has_fdo, freedesktop = pcall(require, "freedesktop")
14 |
15 | -- Error handling
16 | -- Check if awesome encountered an error during startup and fell back to
17 | -- another config (This code will only ever execute for the fallback config)
18 | if awesome.startup_errors then
19 | naughty.notify({
20 | preset = naughty.config.presets.critical,
21 | title = "Oops, there were errors during startup!",
22 | text = awesome.startup_errors
23 | })
24 | end
25 |
26 | -- Handle runtime errors after startup
27 | do
28 | local in_error = false
29 | awesome.connect_signal("debug::error", function (err)
30 | -- Make sure we don't go into an endless error loop
31 | if in_error then return end
32 | in_error = true
33 |
34 | naughty.notify({ preset = naughty.config.presets.critical,
35 | title = "Oops, an error happened!",
36 | text = tostring(err) })
37 | in_error = false
38 | end)
39 | end
40 |
41 | beautiful.init( gears.filesystem.get_configuration_dir() .. "/themes/default/theme.lua")
42 |
43 | terminal = "kitty"
44 | editor = os.getenv("EDITOR") or "vim"
45 | editor_cmd = terminal .. " -e " .. editor
46 |
47 | modkey = "Mod4"
48 |
49 | -- Table of layouts to cover with awful.layout.inc, order matters.
50 | awful.layout.layouts = {
51 | awful.layout.suit.tile,
52 | awful.layout.suit.floating,
53 | awful.layout.suit.max,
54 | }
55 |
56 |
57 | -- Wibar
58 | -- Create a wibox for each screen and add it
59 |
60 | local function set_wallpaper(s)
61 | -- Wallpaper
62 | if beautiful.wallpaper then
63 | local wallpaper = beautiful.wallpaper
64 | -- If wallpaper is a function, call it with the screen
65 | if type(wallpaper) == "function" then
66 | wallpaper = wallpaper(s)
67 | end
68 | gears.wallpaper.maximized(wallpaper, s, true)
69 | end
70 | end
71 |
72 | -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
73 | screen.connect_signal("property::geometry", set_wallpaper)
74 |
75 | awful.screen.connect_for_each_screen(function(s)
76 | -- Wallpaper
77 | set_wallpaper(s)
78 |
79 |
80 | -- Create a promptbox for each screen
81 | s.mypromptbox = awful.widget.prompt()
82 |
83 |
84 | -- Create the wibox
85 | s.mywibox = awful.wibar({ position = beautiful.wibar_position, screen = s, height = beautiful.wibar_height })
86 |
87 | -- Add widgets to the wibox
88 | s.mywibox:setup {
89 | layout = wibox.layout.align.horizontal,
90 | { -- Left widgets
91 | layout = wibox.layout.fixed.horizontal,
92 | require("widgets.panel.menu"),
93 | require("widgets.panel.taglist")(s),
94 | s.mypromptbox,
95 | },
96 | require("widgets.panel.tasklist")(s), -- Middle widget
97 | { -- Right widgets
98 | layout = wibox.layout.fixed.horizontal,
99 | require("widgets.panel.systray-no-toggle"),
100 | require("widgets.panel.layoutbox")(s),
101 | require("widgets.clock")(),
102 | -- require("widgets.noti-center"),
103 | require("widgets.control-center"),
104 | },
105 | }
106 | end)
107 |
108 | awesome.connect_signal(
109 | "panel::show",
110 | function ()
111 | for s in screen do
112 | s.mywibox.visible = true
113 | end
114 | end
115 | )
116 |
117 | awesome.connect_signal(
118 | "panel::hide",
119 | function ()
120 | for s in screen do
121 | s.mywibox.visible = false
122 | end
123 | end
124 | )
125 |
126 | -- Mouse bindings
127 | root.buttons(gears.table.join(
128 | awful.button({ }, 4, awful.tag.viewnext),
129 | awful.button({ }, 5, awful.tag.viewprev)
130 | ))
131 |
132 | -- Key bindings
133 | globalkeys = require("configurations.keybindings.global")
134 | clientkeys = require("configurations.keybindings.client")
135 | -- Bind all key numbers to tags.
136 | -- Be careful: we use keycodes to make it work on any keyboard layout.
137 | -- This should map on the top row of your keyboard, usually 1 to 9.
138 | for i = 1, 9 do
139 | globalkeys = gears.table.join(globalkeys,
140 | -- View tag only.
141 |
142 | awful.key(
143 | { modkey }, "#" .. i + 9,
144 | function ()
145 | local screen = awful.screen.focused()
146 | local tag = screen.tags[i]
147 | if tag then
148 | tag:view_only()
149 | end
150 | end,
151 | {description = "view tag #"..i, group = "tag"}
152 | ),
153 | -- Toggle tag display.
154 | awful.key(
155 | { modkey, "Control" }, "#" .. i + 9,
156 | function ()
157 | local screen = awful.screen.focused()
158 | local tag = screen.tags[i]
159 | if tag then
160 | awful.tag.viewtoggle(tag)
161 | end
162 | end,
163 | {description = "toggle tag #" .. i, group = "tag"}
164 | ),
165 | -- Move client to tag.
166 | awful.key(
167 | { modkey, "Shift" }, "#" .. i + 9,
168 | function ()
169 | if client.focus then
170 | local tag = client.focus.screen.tags[i]
171 | if tag then
172 | client.focus:move_to_tag(tag)
173 | end
174 | end
175 | end,
176 | {description = "move focused client to tag #"..i, group = "tag"}
177 | ),
178 | -- Toggle tag on focused client.
179 | awful.key(
180 | { modkey, "Control", "Shift" }, "#" .. i + 9,
181 | function ()
182 | if client.focus then
183 | local tag = client.focus.screen.tags[i]
184 | if tag then
185 | client.focus:toggle_tag(tag)
186 | end
187 | end
188 | end,
189 | {description = "toggle focused client on tag #" .. i, group = "tag"}
190 | )
191 | )
192 | end
193 |
194 | clientbuttons = gears.table.join(
195 | awful.button({ }, 1, function (c)
196 | c:emit_signal("request::activate", "mouse_click", {raise = true})
197 | end),
198 | awful.button({ modkey }, 1, function (c)
199 | c:emit_signal("request::activate", "mouse_click", {raise = true})
200 | awful.mouse.client.move(c)
201 | end),
202 | awful.button({ modkey }, 3, function (c)
203 | c:emit_signal("request::activate", "mouse_click", {raise = true})
204 | awful.mouse.client.resize(c)
205 | end)
206 | )
207 |
208 | -- Set keys
209 | root.keys(globalkeys)
210 |
211 | -- Rules
212 | require("configurations.rules")
213 | require("module.signals")
214 | require("widgets.exit-screen")
215 | require("module.notification")
216 | require("module.autostart")
217 |
218 |
--------------------------------------------------------------------------------
/screen-shots/dark1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/dark1.png
--------------------------------------------------------------------------------
/screen-shots/dark2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/dark2.png
--------------------------------------------------------------------------------
/screen-shots/dark3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/dark3.png
--------------------------------------------------------------------------------
/screen-shots/dark4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/dark4.png
--------------------------------------------------------------------------------
/screen-shots/glassy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/glassy1.png
--------------------------------------------------------------------------------
/screen-shots/glassy2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/glassy2.png
--------------------------------------------------------------------------------
/screen-shots/glassy3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/glassy3.png
--------------------------------------------------------------------------------
/screen-shots/glassy4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/glassy4.png
--------------------------------------------------------------------------------
/screen-shots/glassy5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/glassy5.png
--------------------------------------------------------------------------------
/screen-shots/icon-only-tasklist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/icon-only-tasklist.png
--------------------------------------------------------------------------------
/screen-shots/multi-head.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/multi-head.png
--------------------------------------------------------------------------------
/screen-shots/tasklist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/screen-shots/tasklist.png
--------------------------------------------------------------------------------
/scripts/apt-update.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if ! updates=$(apt list --upgradable 2> /dev/null| awk '{print $1}' | wc -l); then
3 | updates=0
4 | fi
5 |
6 | if [ "$updates" -gt 1 ]; then
7 | echo "new update available"
8 | else
9 | echo "everything is upto date"
10 | fi
11 |
--------------------------------------------------------------------------------
/scripts/battery_status.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | bat_state=$(upower -i $(upower -e | grep BAT) | grep state |awk '{print $2}' | tr -d '\n')
3 | bat_percentage=$(upower -i $(upower -e | grep BAT) | grep percentage |awk '{print $2}' | tr -d '\n')
4 | printf $bat_state" "$bat_percentage
5 |
--------------------------------------------------------------------------------
/scripts/i3lock-blur:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | B='#282828FF' # blank
4 | C='#ffffffFF' # clear ish
5 | D='#0A7ACAFF' # default
6 | T='#569cd6FF' # text
7 | W='#F44747FF' # wrong
8 | V='#FFAF00FF' # verifying
9 | VT='#608B4EFF'
10 |
11 |
12 | i3lock \
13 | --radius 60 \
14 | --indpos="w/2:h/2" \
15 | --timepos="w/2:h/2-200" \
16 | --datepos="w/2:h/2-160" \
17 | --greeterpos="w/2:h/2" \
18 | --insidevercolor=$B \
19 | --ringvercolor=$V \
20 | --ring-width=6 \
21 | \
22 | --insidewrongcolor=$W \
23 | --ringwrongcolor=$C \
24 | \
25 | --insidecolor=$B \
26 | --ringcolor=$D \
27 | --linecolor=$B \
28 | --separatorcolor=$D \
29 | \
30 | --verifcolor=$VT \
31 | --wrongcolor=$C \
32 | --timecolor=$C \
33 | --datecolor=$C \
34 | --layoutcolor=$T \
35 | --keyhlcolor=$VT \
36 | --bshlcolor=$W \
37 | \
38 | --screen 1 \
39 | --blur 16 \
40 | --clock \
41 | --indicator \
42 | --timestr="%I:%M:%S %p" \
43 | --datestr="%A %d %b" \
44 | --wrongtext="incorrect!" \
45 | --veriftext="verifying" \
46 | --timesize=75 \
47 | --datesize=30 \
48 | --verifsize=20 \
49 | --wrongsize=20 \
50 |
--------------------------------------------------------------------------------
/scripts/light-mode.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | rm -rf $HOME/.config/awesome ; ln -s $HOME/Projects/awesome-config/dusky-light $HOME/.config/awesome
3 |
4 | echo '
5 | Xft/Hinting 1
6 | Xft/HintStyle "hintslight"
7 | Xft/Antialias 1
8 | Xft/RGBA "rgb"
9 | Net/ThemeName "Fluent-light"
10 | Gtk/CursorThemeName "Adwaita"
11 | Net/IconThemeName "Qogir"
12 | ' > ~/.xsettingsd
13 | # Set Kitty thmeme
14 | kitty @ set-colors -a -c "$HOME/.config/kitty/themes/codeLight.conf"
15 | # Set vim colorcheme
16 | echo "vim.cmd[[colorscheme codelight]]" > $HOME/.config/nvim/lua/set-colorscheme.lua
17 |
18 | killall -HUP xsettingsd
19 |
20 |
--------------------------------------------------------------------------------
/scripts/xinput-tab:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | idd=$(xinput --list | grep 'AlpsPS/2 ALPS GlidePoint' | awk '{print $6}'| cut -d'=' -f2)
4 |
5 | propid=$(xinput list-props $idd | grep 'Tapping Enabled' | awk '{print $4}' |sed 's/[^0-9]*//g' )
6 | xinput --set-prop $idd $propid 1
7 |
--------------------------------------------------------------------------------
/themes/default/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/background.png
--------------------------------------------------------------------------------
/themes/default/icons/48x48/airplane-mode.svg:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/battery-caution.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/battery-empty.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/battery-full-charged.svg:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/bluetooth-active.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/bluetooth-disabled.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/camera-on.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/dialog-error.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/dialog-information.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/dialog-warning.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-audio-volume-high.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-audio-volume-muted.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-battery-low.svg:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-disabled.svg:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-microphone-sensitivity-medium.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-microphone-sensitivity-muted.svg:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-network-ethernet-connected.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-network-ethernet-disconnected.svg:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-network-wireless-disconnected.svg:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/themes/default/icons/48x48/notification-network-wireless.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/themes/default/icons/64x64/battery.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/themes/default/icons/64x64/bluetooth.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/themes/default/icons/64x64/camera-photo.svg:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/themes/default/icons/64x64/network-wireless.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/themes/default/icons/add.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/airplane-mode.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/audio-input-microphone.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/awesome.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/themes/default/icons/battery/ac.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/battery/battery-charging.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/battery/battery-normal.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/brightness.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/camera-photo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/clear-all.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/computer.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/contrast.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/floating-mode1.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/go-next.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/go-previous.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/image-crop.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/kdenlive-show-video.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/lock.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/mail-receive.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/minus.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/network-bluetooth.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/network-wired-activated.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/network-wired-unavailable.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/network-wireless-connected.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/network-wireless-disconnected.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/notifications.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/redshift-status-on.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/remove.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/system/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/icons/system/default.png
--------------------------------------------------------------------------------
/themes/default/icons/system/devops.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/icons/system/devops.png
--------------------------------------------------------------------------------
/themes/default/icons/system/system-lock-screen.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/system/system-log-out.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/system/system-restart.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/system/system-shutdown.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/system/system-suspend.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/update-low.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/update-none.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/utilities-terminal.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/view-fullscreen.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/volume/audio-volume-high.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/volume/audio-volume-low.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/volume/audio-volume-medium.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/volume/audio-volume-muted.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-clear-night.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-clear-sky.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-clouds-night.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-clouds.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-few-clouds-night.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-few-clouds.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-fog.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-freezing-rain.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-overcast-symbolic.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-overcast.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-severe-alert.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-showers-scattered.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-showers.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-snow-rain.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-snow-scattered.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-snow.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-storm.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/themes/default/icons/weather/weather-windy.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/icons/window.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/layouts/dwindle.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
65 |
--------------------------------------------------------------------------------
/themes/default/layouts/floating.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/layouts/fullscreen.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/themes/default/layouts/max.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/themes/default/layouts/tile.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/themes/default/submenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/submenu.png
--------------------------------------------------------------------------------
/themes/default/taglist/squarefw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/taglist/squarefw.png
--------------------------------------------------------------------------------
/themes/default/taglist/squarefw_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/taglist/squarefw_back.png
--------------------------------------------------------------------------------
/themes/default/taglist/squarew.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mofiqul/awesome-shell/86b86548bcf240fcc3801ed1f832d197765292ab/themes/default/taglist/squarew.png
--------------------------------------------------------------------------------
/themes/default/titlebar/go-down.svg:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/themes/default/titlebar/go-up.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/themes/default/titlebar/window-close-normal.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/themes/default/titlebar/window-close.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/utilities/profile-image:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Depends: Mugshot
4 | # Written by manilarome
5 |
6 | awesome_dir="${HOME}/.config/awesome/"
7 | user_profile_dir="${awesome_dir}themes/default/icons/system/"
8 |
9 | accountsservice_user_icons="/var/lib/AccountsService/icons/${USER}"
10 |
11 | # Check if user image exists
12 | if [ -f "${user_profile_dir}${USER}.png" ];
13 | then
14 | if [ -f "${accountsservice_user_icons}" ];
15 | then
16 | if ! cmp --silent "${user_profile_dir}${USER}.png" "${accountsservice_user_icons}";
17 | then
18 | cp "${accountsservice_user_icons}" "${user_profile_dir}${USER}.png"
19 | fi
20 | printf "${user_profile_dir}${USER}.png"
21 | else
22 | printf "${user_profile_dir}${USER}.png"
23 | fi
24 | exit;
25 | else
26 | if [ -f "${accountsservice_user_icons}" ];
27 | then
28 | cp "${accountsservice_user_icons}" "${user_profile_dir}${USER}.png"
29 | printf "${user_profile_dir}${USER}.png"
30 | exit;
31 | else
32 | printf "default"
33 | exit;
34 | fi
35 | fi
36 |
--------------------------------------------------------------------------------
/widgets/brightness-slider.lua:
--------------------------------------------------------------------------------
1 |
2 | local wibox = require("wibox")
3 | local gears = require("gears")
4 | local awful = require("awful")
5 | local beautiful = require("beautiful")
6 | local dpi = beautiful.xresources.apply_dpi
7 |
8 | -- icon
9 | local widget_icon = wibox.widget{
10 | {
11 | {
12 | id = "icon",
13 | image = beautiful.brightness_icon,
14 | resize = true,
15 | forced_height = dpi(16),
16 | forced_width = dpi(16),
17 | widget = wibox.widget.imagebox
18 | },
19 | margins = dpi(4),
20 | widget = wibox.container.margin
21 | },
22 | bg = beautiful.bg_button,
23 | shape = gears.shape.circle,
24 | widget = wibox.container.background
25 | }
26 | -- slider var
27 | local widget_slider = wibox.widget {
28 | bar_shape = gears.shape.rounded_rect,
29 | bar_height = dpi(3),
30 | bar_color = beautiful.bg_focus .. "55",
31 | bar_active_color = beautiful.bg_focus,
32 |
33 | handle_shape = gears.shape.circle,
34 | handle_width = dpi(12),
35 | handle_color = beautiful.bg_focus,
36 |
37 | value = 40,
38 | minimum = 0,
39 | maximum = 100,
40 | forced_height = dpi(20),
41 | widget = wibox.widget.slider
42 | }
43 |
44 | local slider_wrapped = wibox.widget{
45 | widget_icon,
46 | widget_slider,
47 | spacing = dpi(10),
48 | forced_width = dpi(280),
49 | layout = wibox.layout.fixed.horizontal
50 | }
51 |
52 | local set_brightness = function(value)
53 | awful.spawn.with_shell('xbacklight -set ' .. value)
54 | end
55 |
56 |
57 | local update_brigtness = function ()
58 | awful.spawn.easy_async_with_shell(
59 | "xbacklight -get",
60 | function(stdout)
61 | widget_slider.value = tonumber(stdout)
62 | end
63 | )
64 | end
65 |
66 | -- Hover thingy
67 | widget_slider:connect_signal("mouse::enter", function(c)
68 | local wb = mouse.current_wibox
69 | old_cursor, old_wibox = wb.cursor, wb
70 | wb.cursor = "hand1"
71 | end)
72 |
73 | widget_slider:connect_signal("mouse::leave", function(c)
74 | if old_wibox then
75 | old_wibox.cursor = old_cursor
76 | old_wibox = nil
77 | end
78 | end)
79 |
80 | -- When sliding happens
81 | widget_slider:connect_signal(
82 | "property::value",
83 | function(_,value)
84 | set_brightness(value)
85 | end
86 | )
87 |
88 | awesome.connect_signal("update::brigtness", function ()
89 | update_brigtness()
90 | end)
91 |
92 | return slider_wrapped
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/widgets/button-active-container.lua:
--------------------------------------------------------------------------------
1 | -- A background widget for buttons
2 | -- Can active and inactive background color on click or whatever
3 |
4 | local wibox = require("wibox")
5 | local beautiful = require("beautiful")
6 |
7 | local widget_bg = function(widget)
8 | local container = wibox.widget {
9 | widget,
10 | widget = wibox.container.background,
11 | bg = beautiful.bg_panel_button,
12 | shape = beautiful.panel_button_shape,
13 | border_width = beautiful.button_panel_border_width,
14 | border_color = beautiful.border_panel_button,
15 | }
16 | container.set_inactive = function ()
17 | container.bg = beautiful.bg_panel_button
18 | container.shape = beautiful.panel_button_shape
19 | container.border_width = beautiful.button_panel_border_width
20 | container.border_color = beautiful.border_panel_button
21 | end
22 |
23 | container.set_active = function ()
24 | container.bg = beautiful.bg_panel_button_active
25 | container.shape = beautiful.panel_button_shape_active
26 | container.border_width = beautiful.button_panel_border_width_active
27 | container.border_color = beautiful.border_panel_button_active
28 | end
29 |
30 | return container
31 | end
32 |
33 |
34 | return widget_bg
35 |
--------------------------------------------------------------------------------
/widgets/buttons/airplane.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local create_button = require("widgets.buttons.create-button")
4 |
5 | local initial_action = function (button)
6 | local background = button:get_children_by_id("background")[1]
7 | local label = button:get_children_by_id("label")[1]
8 |
9 | awful.spawn.easy_async_with_shell("rfkill list all",function(stdout)
10 | if stdout:match('Soft blocked: yes') then
11 | background:set_bg(beautiful.button_active)
12 | label:set_text("On")
13 | else
14 | background:set_bg(beautiful.bg_button)
15 | label:set_text("Off")
16 | end
17 | end)
18 | end
19 |
20 | local onclick_action = function()
21 | awful.spawn.easy_async("rfkill list all", function(stdout)
22 | if stdout:match('Soft blocked: yes') then
23 | awful.spawn.with_shell("rfkill unblock all")
24 | else
25 | awful.spawn.with_shell("rfkill block all")
26 | end
27 | end)
28 | end
29 |
30 | local airplane_button = create_button.circle_big(beautiful.icon_airplane)
31 |
32 |
33 | airplane_button:connect_signal("button::press", function (self, _, _, button)
34 | if button == 1 then
35 | onclick_action()
36 | initial_action(self)
37 | end
38 | end)
39 |
40 | initial_action(airplane_button)
41 |
42 | return airplane_button
43 |
--------------------------------------------------------------------------------
/widgets/buttons/battery.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local awful = require("awful")
3 | local beautiful = require("beautiful")
4 | local naughty = require("naughty")
5 | local gears = require("gears")
6 | local create_button = require("widgets.buttons.create-button")
7 |
8 | -- Battery button for control center
9 | local button_battery = create_button.circle_big(beautiful.battery_icon)
10 | local label = button_battery:get_children_by_id("label")[1]
11 | local icon = button_battery:get_children_by_id("icon")[1]
12 |
13 | -- Battery indicator for panel
14 | local battery_panel_indicator = wibox.widget {
15 | widget = wibox.widget.imagebox,
16 | resize = true,
17 | forced_height = beautiful.wibar_icon_size,
18 | forced_width = beautiful.wibar_icon_size
19 | }
20 |
21 | local function show_battery_notification(msg, title, icon, timeout)
22 | naughty.notification ({
23 | app_name = "Power Manager",
24 | icon = icon,
25 | text = msg,
26 | title = title,
27 | timeout = timeout or 20, -- show the warning for a longer time
28 | })
29 | end
30 |
31 | local last_battery_check = os.time()
32 |
33 | local update_status = function ()
34 | awful.spawn.easy_async_with_shell(
35 | "acpi",
36 | function (stdout)
37 | local state = str_split(stdout:gsub(",", ""), " ")
38 | local status = state[3]:gsub("%s+", "")
39 | local charge = ''
40 | -- This is required because sometime bad battery show "Not Charging"
41 | if status == "Not" then
42 | charge = state[5]:gsub("%%", "")
43 | else
44 | charge = state[4]:gsub("%%", "")
45 | end
46 | label:set_text(charge:gsub("%s+", "") .. "%")
47 |
48 | if status == 'Charging' then
49 | icon.image = beautiful.battery_icon_charging
50 | icon:emit_signal("widget::redraw_needed")
51 | battery_panel_indicator:set_image(beautiful.battery_icon_charging)
52 | else
53 | icon.image = beautiful.battery_icon
54 | icon:emit_signal("widget::redraw_needed")
55 | battery_panel_indicator:set_image(beautiful.battery_icon)
56 | end
57 |
58 | charge = tonumber(charge)
59 | if (charge >= 0 and charge < 15) then
60 | -- Checking only for "Discharging" because sometimes staus can be "Unknown" and "Not changing"
61 | -- and dont want to give notification for those status
62 | if status ~= "Charging" and os.difftime(os.time(), last_battery_check) > 300 then
63 | last_battery_check = os.time()
64 | local msg = "Battery is criticaly low, save your work or plug adapter"
65 | local title = "Battery criticaly low"
66 | show_battery_notification(msg, title, beautiful.icon_bat_caution, 20)
67 | end
68 | end
69 | end
70 | )
71 | end
72 |
73 |
74 | -- Detect if the system has a battery
75 | local handle = io.popen(
76 | [=[
77 | bat_presence=$(ls /sys/class/power_supply | grep BAT)
78 | if [ -z "$bat_presence" ]; then
79 | echo "No battey detected"
80 | else
81 | echo "Battery detected"
82 | fi
83 | ]=]
84 | )
85 | local stdout = handle:read("*a")
86 | handle:close()
87 | --- If the system has battery then add battery widget to control center
88 | if stdout:match("Battery detected") then
89 |
90 | gears.timer {
91 | timeout = 5,
92 | autostart = true,
93 | call_now = true,
94 | callback = function ()
95 | update_status()
96 | end
97 | }
98 | else
99 | label:set_text("AC")
100 | icon.image = beautiful.icon_ac
101 | icon:emit_signal("widget::redraw_needed")
102 | battery_panel_indicator:set_image(beautiful.icon_ac)
103 | end
104 |
105 | update_status()
106 |
107 | local module = {}
108 | module.button = button_battery
109 | module.indicator = battery_panel_indicator
110 |
111 | return module
112 |
--------------------------------------------------------------------------------
/widgets/buttons/bluetooth-button.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local default_apps = require("configurations.default-apps")
4 | local settings = require("configurations.settings")
5 | local create_button = require("widgets.buttons.create-button")
6 |
7 | local bluetooth_button = create_button.circle_big(beautiful.icon_bluetooth)
8 |
9 | local background = bluetooth_button:get_children_by_id("background")[1]
10 | local label = bluetooth_button:get_children_by_id("label")[1]
11 |
12 |
13 | if settings.is_bluetooth_presence then
14 | awful.widget.watch(
15 | "rfkill list bluetooth",
16 | 5,
17 | function(_, stdout)
18 | if stdout:match('Soft blocked: yes') then
19 | label:set_text('Off')
20 | background:set_bg(beautiful.bg_button)
21 | else
22 | awful.spawn.easy_async_with_shell(
23 | [=[
24 | devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2)
25 |
26 | echo "$devices_paired"| while read -r line; do
27 | device_info=$(bluetoothctl info "$line")
28 | if echo "$device_info" | grep -q "Connected: yes"; then
29 | device_alias=$(echo "$device_info" | grep "Alias" | cut -d ' ' -f 2-)
30 | echo "$device_alias"
31 | break
32 | fi
33 | done
34 | ]=],
35 | function (stdout)
36 | local output = stdout:gsub("%s+", " ")
37 | if output == '' or output == nil then
38 | label:set_text('On')
39 | background:set_bg(beautiful.button_active)
40 | else
41 | label:set_text(output)
42 | background:set_bg(beautiful.button_active)
43 | end
44 | end
45 | )
46 | end
47 | end
48 | )
49 | else
50 | label:set_text('NA')
51 | end
52 |
53 | bluetooth_button:connect_signal(
54 | "button::press",
55 | function (_,_,_,button)
56 | if button == 1 then
57 | awful.spawn.easy_async_with_shell("rfkill list bluetooth", function (stdout)
58 | if stdout:match("Soft blocked: yes") then
59 | awful.spawn.single_instance("rfkill unblock bluetooth")
60 | label:set_text("Turning on...")
61 | else
62 | awful.spawn.single_instance("rfkill block bluetooth")
63 | label:set_text("Turning off...")
64 | end
65 | end)
66 | end
67 | if button == 3 then
68 | awful.spawn.single_instance(default_apps.bluetooth_manager)
69 | end
70 | end
71 | )
72 |
73 | return bluetooth_button
74 |
--------------------------------------------------------------------------------
/widgets/buttons/create-button.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local gears = require("gears")
3 | local beautiful = require("beautiful")
4 | local dpi = beautiful.xresources.apply_dpi
5 | local clickable_container = require("widgets.clickable-container")
6 | local create_button = {}
7 |
8 | function create_button.small(icon_path)
9 |
10 | local button_image = wibox.widget {
11 | id = "icon",
12 | image = icon_path,
13 | resize = true,
14 | forced_width = dpi(22),
15 | forced_height = dpi(22),
16 | widget = wibox.widget.imagebox
17 | }
18 |
19 | local button = wibox.widget {
20 | {
21 | button_image,
22 | margins = dpi(8),
23 | widget = wibox.container.margin
24 | },
25 | bg = beautiful.bg_button,
26 | shape = gears.shape.circle,
27 | widget = wibox.container.background
28 | }
29 |
30 |
31 | local old_cursor, old_wibox
32 |
33 | button:connect_signal("mouse::enter", function(c)
34 | local wb = mouse.current_wibox
35 | old_cursor, old_wibox = wb.cursor, wb
36 | wb.cursor = "hand1"
37 | end)
38 | button:connect_signal("mouse::leave", function(c)
39 | if old_wibox then
40 | old_wibox.cursor = old_cursor
41 | old_wibox = nil
42 | end
43 | end)
44 |
45 | return button
46 | end
47 |
48 | --- Creates big size circle button
49 | --- @param icon_path string
50 | function create_button.circle_big(icon_path)
51 |
52 | local button_with_label = wibox.widget{
53 | {
54 | {
55 | {
56 | {
57 | {
58 | id = "icon",
59 | image = icon_path,
60 | resize = true,
61 | forced_width = dpi(18),
62 | forced_height = dpi(18),
63 | widget = wibox.widget.imagebox
64 | },
65 | widget = wibox.container.place
66 | },
67 | margins = dpi(10),
68 | widget = wibox.container.margin
69 | },
70 | id = "background",
71 | bg = beautiful.bg_button,
72 | shape = gears.shape.circle,
73 | widget = wibox.container.background
74 | },
75 | {
76 | {
77 | id = "label",
78 | text = "Off",
79 | font = "Ubuntu 8",
80 | widget = wibox.widget.textbox
81 | },
82 | forced_width = dpi(50),
83 | widget = wibox.container.place
84 | },
85 | spacing = dpi(6),
86 | layout = wibox.layout.fixed.vertical
87 | },
88 | widget = clickable_container
89 | }
90 |
91 | return button_with_label
92 | end
93 |
94 |
95 | function create_button.button_with_label(name, icon)
96 | local button_label= wibox.widget {
97 | text = name,
98 | font = 'Ubuntu 10',
99 | align = 'center',
100 | valign = 'center',
101 | widget = wibox.widget.textbox
102 | }
103 |
104 | local button = wibox.widget {
105 | {
106 | {
107 | {
108 | {
109 | image = icon,
110 | resize = true,
111 | forced_height = dpi(24),
112 | forced_width = dpi(24),
113 | widget = wibox.widget.imagebox
114 | },
115 | widget = wibox.container.place
116 | },
117 | button_label,
118 | spacing = beautiful.widget_margin,
119 | widget = wibox.layout.fixed.vertical,
120 | },
121 | margins = dpi(16),
122 | widget = wibox.container.margin
123 | },
124 | bg = beautiful.bg_button,
125 | shape = beautiful.widget_shape,
126 | widget = wibox.container.background,
127 | forced_width = dpi(95)
128 | }
129 |
130 |
131 | local old_cursor, old_wibox
132 |
133 | button:connect_signal("mouse::enter", function(c)
134 | local wb = mouse.current_wibox
135 | old_cursor, old_wibox = wb.cursor, wb
136 | wb.cursor = "hand1"
137 | end)
138 | button:connect_signal("mouse::leave", function(c)
139 | if old_wibox then
140 | old_wibox.cursor = old_cursor
141 | old_wibox = nil
142 | end
143 | end)
144 |
145 | return button
146 | end
147 |
148 |
149 | return create_button
150 |
--------------------------------------------------------------------------------
/widgets/buttons/dnd.lua:
--------------------------------------------------------------------------------
1 | local naughty = require("naughty")
2 | local beautiful = require("beautiful")
3 | local create_button = require("widgets.buttons.create-button")
4 |
5 | local initial_action = function(button)
6 | local background = button:get_children_by_id("background")[1]
7 | local label = button:get_children_by_id("label")[1]
8 |
9 | if naughty.suspended then
10 | background:set_bg(beautiful.bg_button)
11 | label:set_text("Off")
12 | else
13 | background:set_bg(beautiful.button_active)
14 | label:set_text("On")
15 | end
16 | end
17 |
18 | local onclick_action = function ()
19 | naughty.suspended = not naughty.suspended
20 | end
21 |
22 |
23 | local dnd_button = create_button.circle_big(beautiful.icon_bell)
24 |
25 | dnd_button:connect_signal("button::press", function (self, _, _, button)
26 | if button == 1 then
27 | onclick_action()
28 | initial_action(self)
29 | end
30 | end)
31 |
32 | initial_action(dnd_button)
33 |
34 | return dnd_button
35 |
36 |
--------------------------------------------------------------------------------
/widgets/buttons/global-floating-mode.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local create_button = require("widgets.buttons.create-button")
4 |
5 | local global_floating_enabled = false
6 |
7 | local update_global_floating_mode = function (button)
8 | local background = button:get_children_by_id("background")[1]
9 | local label = button:get_children_by_id("label")[1]
10 |
11 | if global_floating_enabled then
12 | background:set_bg(beautiful.button_active)
13 | label:set_text("On")
14 | else
15 | background:set_bg(beautiful.bg_button)
16 | label:set_text("Off")
17 | end
18 | end
19 |
20 | local toggle_global_floating = function ()
21 | local tags = awful.screen.focused().tags
22 | if not global_floating_enabled then
23 | for _,tag in ipairs(tags) do
24 | awful.layout.set(awful.layout.suit.floating, tag)
25 | end
26 | global_floating_enabled = true
27 | else
28 | for _,tag in ipairs(tags) do
29 | awful.layout.set(awful.layout.suit.tile, tag)
30 | end
31 | global_floating_enabled = false
32 | end
33 | end
34 |
35 | local floating_mode_button = create_button.circle_big(beautiful.icon_floating)
36 |
37 |
38 | floating_mode_button:connect_signal("button::press", function (self, _, _, button)
39 | if button == 1 then
40 | toggle_global_floating()
41 | update_global_floating_mode(self)
42 | end
43 | end)
44 |
45 | update_global_floating_mode(floating_mode_button)
46 |
47 | return floating_mode_button
48 |
--------------------------------------------------------------------------------
/widgets/buttons/microphone.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local create_button = require("widgets.buttons.create-button")
4 |
5 | local initial_action = function (button)
6 | local background = button:get_children_by_id("background")[1]
7 | local label = button:get_children_by_id("label")[1]
8 |
9 | awful.spawn.easy_async_with_shell(
10 | [[sh -c amixer | grep 'Front Left: Capture' | awk -F' ' '{print $6}' | sed -e 's/\[//' -e 's/\]//']],
11 | function(stdout)
12 | if stdout:match('on') then
13 | background:set_bg(beautiful.button_active)
14 | label:set_text("In Use")
15 | else
16 | background:set_bg(beautiful.bg_button)
17 | label:set_text("Off")
18 | end
19 | end)
20 | end
21 |
22 | local onclick_action = function()
23 | awful.spawn.with_shell("amixer -D pulse sset Capture toggle")
24 | end
25 |
26 | local microphone_button = create_button.circle_big(beautiful.icon_mic)
27 |
28 |
29 | microphone_button:connect_signal("button::press", function (self, _, _, button)
30 | if button == 1 then
31 | onclick_action()
32 | initial_action(self)
33 | end
34 | end)
35 |
36 | initial_action(microphone_button)
37 |
38 | return microphone_button
39 |
--------------------------------------------------------------------------------
/widgets/buttons/network-button.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gears = require("gears")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local network = require("module.network")
6 | local setting = require("configurations.settings")
7 | local default_apps = require("configurations.default-apps")
8 | local create_button = require("widgets.buttons.create-button")
9 |
10 | -- Network button for control center
11 | local network_button = create_button.circle_big(beautiful.wireless_connected_icon)
12 | local background = network_button:get_children_by_id("background")[1]
13 | local label = network_button:get_children_by_id("label")[1]
14 |
15 | -- Panel network indicator
16 | local panel_indicator = wibox.widget {
17 | image = beautiful.wireless_connected_icon,
18 | resize = true,
19 | forced_height = beautiful.wibar_icon_size,
20 | forced_width = beautiful.wibar_icon_size,
21 | widget = wibox.widget.imagebox
22 | }
23 |
24 | local update_button = function()
25 | awful.spawn.easy_async_with_shell(
26 | [=[
27 | wireless="]=] .. tostring(setting.wlan_interface) .. [=["
28 | wired="]=] .. tostring(setting.lan_interface) .. [=["
29 | net="/sys/class/net/"
30 | wired_state="down"
31 | wireless_state="down"
32 | network_mode=""
33 | # Check network state based on interface's operstate value
34 | function check_network_state() {
35 | # Check what interface is up
36 | if [[ "${wireless_state}" == "up" ]];
37 | then
38 | network_mode='wireless'
39 | elif [[ "${wired_state}" == "up" ]];
40 | then
41 | network_mode='wired'
42 | else
43 | network_mode='No internet connection'
44 | fi
45 | }
46 | # Check if network directory exist
47 | function check_network_directory() {
48 | if [[ -n "${wireless}" && -d "${net}${wireless}" ]];
49 | then
50 | wireless_state="$(cat "${net}${wireless}/operstate")"
51 | fi
52 | if [[ -n "${wired}" && -d "${net}${wired}" ]]; then
53 | wired_state="$(cat "${net}${wired}/operstate")"
54 | fi
55 | check_network_state
56 | }
57 | # Start script
58 | function print_network_mode() {
59 | # Call to check network dir
60 | check_network_directory
61 | # Print network mode
62 | printf "${network_mode}"
63 | }
64 | print_network_mode
65 | ]=],
66 | function(stdout)
67 | local mode = stdout:gsub('%\n', '')
68 | if stdout:match('No internet connection') then
69 | if mode == 'wireless' then
70 | background:set_bg(beautiful.bg_button)
71 | label:set_text("Offline")
72 | panel_indicator:set_image(beautiful.wireless_disconnected_icon)
73 | else
74 | background:set_bg(beautiful.bg_button)
75 | label:set_text("Offline")
76 | panel_indicator:set_image(beautiful.wired_disconnected_icon)
77 | end
78 | else
79 | if mode == 'wireless' then
80 | background:set_bg(beautiful.button_active_alt)
81 | network.set_widgettext_with_ssid(label)
82 | panel_indicator:set_image(beautiful.wireless_connected_icon)
83 | else
84 | background:set_bg(beautiful.button_active_alt)
85 | label:set_text("Connected")
86 | panel_indicator:set_image(beautiful.wired_connected_icon)
87 | end
88 | end
89 | end
90 | )
91 | end
92 |
93 | gears.timer {
94 | timeout = 5,
95 | autostart = true,
96 | call_now = true,
97 | callback = function ()
98 | update_button()
99 | end
100 | }
101 | update_button()
102 |
103 | network_button:connect_signal(
104 | "button::press",
105 | function (_,_,_,button)
106 | if button == 1 then
107 | awful.spawn.easy_async_with_shell("rfkill list wifi", function (stdout)
108 | if stdout:match("Soft blocked: yes") then
109 | awful.spawn.single_instance("rfkill unblock wifi")
110 | label:set_text("Turning on...")
111 | else
112 | awful.spawn.single_instance("rfkill block wifi")
113 | label:set_text("Turning off...")
114 | end
115 | end)
116 | end
117 |
118 | if button == 3 then
119 | awful.spawn.single_instance(default_apps.network_manager)
120 | end
121 | end
122 | )
123 |
124 | local module = {}
125 | module.network_button = network_button
126 | module.panel_indicator = panel_indicator
127 |
128 | return module
129 |
--------------------------------------------------------------------------------
/widgets/buttons/redshift.lua:
--------------------------------------------------------------------------------
1 | local beautiful = require("beautiful")
2 | local create_button = require("widgets.buttons.create-button")
3 | local redshift = require("libs.redshift")
4 |
5 | local initial_action = function(button)
6 | local background = button:get_children_by_id("background")[1]
7 | local label = button:get_children_by_id("label")[1]
8 |
9 | if redshift.state == 1 then
10 | background:set_bg(beautiful.bg_yellow)
11 | label:set_text("On")
12 | else
13 | background:set_bg(beautiful.bg_button)
14 | label:set_text("Off")
15 | end
16 | end
17 |
18 | local onclick_action = function ()
19 | redshift.toggle()
20 | end
21 |
22 |
23 | local redshift_button = create_button.circle_big(beautiful.icon_redshift)
24 |
25 | redshift_button:connect_signal("button::press", function (self, _, _, button)
26 | if button == 1 then
27 | onclick_action()
28 | initial_action(self)
29 | end
30 | end)
31 |
32 | initial_action(redshift_button)
33 |
34 | return redshift_button
35 |
36 |
--------------------------------------------------------------------------------
/widgets/buttons/software-update.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local create_button = require("widgets.buttons.create-button")
4 | local default_apps = require("configurations.default-apps")
5 |
6 | local software_update = create_button.circle_big(beautiful.icon_update_none)
7 |
8 | local naughty = require("naughty")
9 |
10 | local notification_sent = 0
11 |
12 |
13 | local action_update_now = naughty.action{
14 | name = "Update now"
15 | }
16 |
17 | action_update_now:connect_signal("invoked", function ()
18 | awful.spawn.with_shell(default_apps.software_updater)
19 | end)
20 |
21 |
22 | awful.widget.watch(
23 | [[sh -c "pacman -Qu | wc -l"]],
24 | 300,
25 | function (_, stdout)
26 | local background = software_update:get_children_by_id("background")[1]
27 | local label = software_update:get_children_by_id("label")[1]
28 | local update_count = stdout:gsub("%s+", "")
29 |
30 | if update_count ~= "0" then
31 | background:set_bg(beautiful.button_active)
32 | label:set_text(update_count)
33 | if notification_sent == 0 then
34 | naughty.notification({
35 | title = "New software updates",
36 | text = "There are new updates available",
37 | icon = beautiful.icon_noti_info,
38 | timeout = 10,
39 | app_name = "Software Updater",
40 | actions = {
41 | action_update_now,
42 | naughty.action {
43 | name = "Maybe later"
44 | }
45 | }
46 | })
47 | notification_sent = 1
48 | end
49 | else
50 | background:set_bg(beautiful.bg_button)
51 | label:set_text("None")
52 | end
53 | end
54 | )
55 |
56 | software_update:connect_signal("button::press", function (self, _, _, button)
57 | if button == 1 then
58 | awful.spawn.with_shell(default_apps.software_updater)
59 | end
60 | end)
61 | return software_update
62 |
--------------------------------------------------------------------------------
/widgets/calender.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local awful = require("awful")
3 | local gears = require("gears")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 |
7 |
8 | -- calendar
9 | local styles = {}
10 |
11 | styles.month = {
12 | bg_color = "#00000000",
13 | border_width = 0,
14 | }
15 |
16 | styles.normal = {
17 | padding = dpi(6),
18 | }
19 |
20 | styles.focus = {
21 | fg_color = beautiful.fg_normal,
22 | markup = function(t) return '' .. t .. '' end,
23 | bg_color = beautiful.bg_focus,
24 | padding = dpi(6),
25 | shape = gears.shape.circle
26 | }
27 |
28 | styles.header = {
29 | fg_color = beautiful.fg_normal,
30 | bg_color = "#00000000",
31 | markup = function(t) return '' .. t .. '' end,
32 | shape = beautiful.widget_shape
33 | }
34 |
35 | styles.weekday = {
36 | fg_color = beautiful.bg_normal_alt,
37 | markup = function(t) return string.upper(t) end,
38 | }
39 |
40 | local function decorate_cell(widget, flag, date)
41 | if flag=='monthheader' and not styles.monthheader then
42 | flag = 'header'
43 | end
44 | local props = styles[flag] or {}
45 | if props.markup and widget.get_text and widget.set_markup then
46 | widget:set_markup(props.markup(widget:get_text()))
47 | end
48 | -- Change bg color for weekends
49 | local d = {year=date.year, month=(date.month or 1), day=(date.day or 1)}
50 | local weekday = tonumber(os.date('%w', os.time(d)))
51 | local default_bg = (weekday==0 or weekday==7) and '#00000000' or '#00000000'
52 | local ret = wibox.widget {
53 | {
54 | widget,
55 | margins = (props.padding or 0) + (props.border_width or 0),
56 | widget = wibox.container.margin
57 | },
58 | shape = props.shape,
59 | shape_border_color = props.border_color or default_bg,
60 | shape_border_width = props.border_width or 0,
61 | fg = props.fg_color or beautiful.fg_normal,
62 | bg = props.bg_color or default_bg,
63 | widget = wibox.container.background
64 | }
65 | return ret
66 | end
67 |
68 | local calendar = wibox.widget{
69 | date = os.date('*t'),
70 | font = beautiful.font,
71 | long_weekdays = false,
72 | start_sunday = false,
73 | fn_embed = decorate_cell,
74 | widget = wibox.widget.calendar.month
75 | }
76 |
77 |
78 | local button = function(icon_path)
79 | local widget = wibox.widget{
80 | {
81 | image = icon_path,
82 | resize = true,
83 | forced_width = dpi(16),
84 | forced_height = dpi(16),
85 | widget = wibox.widget.imagebox
86 | },
87 | margins = dpi(2),
88 | widget = wibox.container.margin
89 | }
90 |
91 | local old_cursor, old_wibox
92 |
93 | widget:connect_signal("mouse::enter", function(c)
94 | local wb = mouse.current_wibox
95 | old_cursor, old_wibox = wb.cursor, wb
96 | wb.cursor = "hand1"
97 | end)
98 | widget:connect_signal("mouse::leave", function(c)
99 | if old_wibox then
100 | old_wibox.cursor = old_cursor
101 | old_wibox = nil
102 | end
103 | end)
104 |
105 | return widget
106 | end
107 |
108 | local button_previous = button(beautiful.icon_previous)
109 | local button_next = button(beautiful.icon_next)
110 |
111 |
112 | button_previous:buttons(
113 | gears.table.join(
114 | awful.button(
115 | {},
116 | 1,
117 | function()
118 | local date = calendar:get_date()
119 | date.month = date.month - 1
120 | calendar:set_date(nil)
121 | calendar:set_date(date)
122 | end
123 | )
124 | )
125 | )
126 |
127 | button_next:buttons(
128 | gears.table.join(
129 | awful.button(
130 | {},
131 | 1,
132 | function()
133 | local date = calendar:get_date()
134 | date.month = date.month + 1
135 | calendar:set_date(nil)
136 | calendar:set_date(date)
137 | end
138 | )
139 | )
140 | )
141 |
142 | local calendar_widget = wibox.widget {
143 | layout = wibox.layout.align.vertical,
144 | calendar,
145 | {
146 | {
147 | layout = wibox.layout.align.horizontal,
148 | expand = "inside",
149 | nil,
150 | nil,
151 | {
152 | layout = wibox.layout.fixed.horizontal,
153 | spacing = beautiful.widget_margin,
154 | button_previous,
155 | button_next
156 | }
157 | },
158 | top = dpi(-15),
159 | widget = wibox.container.margin
160 | }
161 | }
162 |
163 | return calendar_widget
164 |
--------------------------------------------------------------------------------
/widgets/clickable-container/init.lua:
--------------------------------------------------------------------------------
1 | local wibox = require('wibox')
2 |
3 | local create_click_events = function(widget)
4 |
5 | local container = wibox.widget {
6 | widget,
7 | widget = wibox.container.place
8 | }
9 |
10 | local old_cursor, old_wibox
11 |
12 | container:connect_signal(
13 | 'mouse::enter',
14 | function()
15 | local w = mouse.current_wibox
16 | if w then
17 | old_cursor, old_wibox = w.cursor, w
18 | w.cursor = 'hand1'
19 | end
20 | end
21 | )
22 |
23 | container:connect_signal(
24 | 'mouse::leave',
25 | function()
26 | if old_wibox then
27 | old_wibox.cursor = old_cursor
28 | old_wibox = nil
29 | end
30 | end
31 | )
32 |
33 | return container
34 | end
35 |
36 | return create_click_events
37 |
--------------------------------------------------------------------------------
/widgets/clock.lua:
--------------------------------------------------------------------------------
1 | local wibox = require('wibox')
2 | local awful = require('awful')
3 | local beautiful = require('beautiful')
4 | local dpi = beautiful.xresources.apply_dpi
5 | local clickable_container = require('widgets.clickable-container')
6 | local btn_bg_container = require("widgets.button-active-container")
7 |
8 | local create_clock = function(s)
9 |
10 | local clock_format = nil
11 | clock_format = '%I:%M %p'
12 |
13 | local clock_widget = wibox.widget.textclock(clock_format, 60)
14 |
15 | clock_widget = wibox.widget {
16 | { {
17 | {
18 | {
19 | {
20 | clock_widget,
21 | widget = wibox.container.margin
22 | },
23 | widget = clickable_container
24 | },
25 | top = dpi(2),
26 | bottom = dpi(2),
27 | left = dpi(6),
28 | right = dpi(6),
29 | widget = wibox.container.margin
30 | },
31 | id = "background",
32 | widget = btn_bg_container
33 | },
34 | margins = dpi(2),
35 | widget = wibox.container.margin
36 | },
37 | widget = clickable_container
38 | }
39 |
40 |
41 | local popup_height = s.geometry.height - (beautiful.wibar_height + dpi(10))
42 | local time_format = " %I:%M "
43 | local date_formate = " %A, %B, %d "
44 | local time = wibox.container.place(wibox.widget.textclock(time_format, 60))
45 | local date = wibox.container.place(wibox.widget.textclock(date_formate, 60))
46 |
47 | local date_time = wibox.widget{
48 | {
49 | time,
50 | date,
51 | layout = wibox.layout.fixed.vertical
52 | },
53 | margins = dpi(20),
54 | widget = wibox.container.margin
55 | }
56 | local calendar = awful.popup{
57 | ontop = true,
58 | visible = false,
59 | bg = "#00000000",
60 | screen = s,
61 | placement = function (w)
62 | awful.placement.bottom_right(w, {
63 | margins = {left = 0, top = 5, bottom = beautiful.wibar_height + dpi(5), right = dpi(5)}
64 | })
65 | end,
66 | widget = {
67 | {
68 | {
69 | date_time,
70 | {
71 | {
72 | require("widgets.calender"),
73 | margins = {top = 8, left = 16, bottom = 16, right = 16},
74 | widget = wibox.container.margin
75 | },
76 | bg = beautiful.bg_inner_widget,
77 | shape = beautiful.widget_shape,
78 | widget = wibox.container.background
79 | },
80 | {
81 | top = dpi(20),
82 | widget = wibox.container.margin
83 | },
84 | {
85 | {
86 | require("widgets.weather"),
87 | margins = dpi(16),
88 | widget = wibox.container.margin
89 | },
90 | bg = beautiful.bg_inner_widget,
91 | shape = beautiful.widget_shape,
92 | widget = wibox.container.background
93 | },
94 |
95 | layout = wibox.layout.fixed.vertical
96 | },
97 | top = dpi(30),
98 | bottom = dpi(30),
99 | left = dpi(25),
100 | right = dpi(25),
101 | widget = wibox.container.margin,
102 | },
103 | bg = beautiful.bg_normal,
104 | forced_height = popup_height,
105 | shape = beautiful.widget_shape,
106 | widget = wibox.container.background
107 | }
108 | }
109 |
110 | clock_widget:connect_signal("button::press", function (self, _, _, button)
111 | if button == 1 then
112 | local background_widget = self:get_children_by_id('background')[1]
113 | if calendar.visible then
114 | calendar.visible = not calendar.visible
115 | background_widget.set_inactive()
116 | else
117 | calendar.visible = true
118 | background_widget.set_active()
119 | end
120 | end
121 | end)
122 |
123 | awesome.connect_signal("calendar::show", function ()
124 | calendar.visible = true
125 | end)
126 |
127 | awesome.connect_signal("calendar::hide", function ()
128 | calendar.visible = false
129 | end)
130 |
131 | return clock_widget
132 |
133 | end
134 |
135 | return create_clock
136 |
137 |
138 |
--------------------------------------------------------------------------------
/widgets/control-center.lua:
--------------------------------------------------------------------------------
1 | local gears = require("gears")
2 | local wibox = require("wibox")
3 | local beautiful = require("beautiful")
4 | local awful = require("awful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local create_button = require("widgets.buttons.create-button")
7 | local btn_container = require("widgets.clickable-container")
8 | local btn_bg_container = require("widgets.button-active-container")
9 |
10 | local network_widget = require("widgets.buttons.network-button")
11 | local battery_widget = require("widgets.buttons.battery")
12 | local volume_widget = require("widgets.volume-slider-and-indicator")
13 |
14 | local control_center = function (s)
15 | -- Widget to show on panel
16 | local control_widget = wibox.widget{
17 | {
18 | {
19 | {
20 | {
21 | {
22 | network_widget.panel_indicator,
23 | volume_widget.indicator,
24 | battery_widget.indicator,
25 | spacing = dpi(4),
26 | layout = wibox.layout.fixed.horizontal
27 | },
28 | widget = wibox.container.place
29 | },
30 | left = dpi(6),
31 | right = dpi(6),
32 | top = dpi(4),
33 | bottom = dpi(4),
34 | widget = wibox.container.margin
35 | },
36 | id = "background",
37 | widget = btn_bg_container
38 | },
39 | margins = dpi(2),
40 | widget = wibox.container.margin
41 | },
42 | widget = btn_container
43 | }
44 |
45 | --- Control buttons
46 | local button_row_1= wibox.widget{
47 | network_widget.network_button,
48 | require("widgets.buttons.dnd"),
49 | require("widgets.buttons.redshift"),
50 | require("widgets.buttons.airplane"),
51 | battery_widget.button,
52 | spacing = beautiful.widget_margin,
53 | layout = wibox.layout.fixed.horizontal
54 | }
55 | local button_row_2 = wibox.widget{
56 | require("widgets.buttons.bluetooth-button"),
57 | require("widgets.buttons.global-floating-mode"),
58 | require("widgets.buttons.screen-shot")(s),
59 | require("widgets.buttons.microphone"),
60 | require("widgets.buttons.software-update"),
61 | spacing = beautiful.widget_margin,
62 | layout = wibox.layout.fixed.horizontal
63 | }
64 |
65 |
66 | local control_buttons = wibox.widget{
67 | {
68 | {
69 | button_row_1,
70 | widget = wibox.container.place
71 | },
72 | {
73 | button_row_2,
74 | widget = wibox.container.place
75 | },
76 | spacing = beautiful.widget_margin * 2 ,
77 | layout = wibox.layout.fixed.vertical
78 | },
79 | top = dpi(15),
80 | bottom = dpi(15),
81 | widget = wibox.container.margin
82 | }
83 |
84 | -- power button
85 | local power_button = create_button.small(beautiful.icon_system_power_off)
86 |
87 | power_button:connect_signal("button::press", function (_, _, _, button)
88 | if button == 1 then
89 | awesome.emit_signal("control-center::hide")
90 | awesome.emit_signal('module::exit_screen:show')
91 | end
92 | end)
93 |
94 | local logout_button = wibox.widget{
95 | widget = btn_container,
96 | {
97 | widget = wibox.container.background,
98 | bg = beautiful.bg_button,
99 | shape = gears.shape.rounded_bar,
100 | {
101 | widget = wibox.container.margin,
102 | margins = {top = dpi(9), left = dpi(16), bottom = dpi(9), right = dpi(16)},
103 | {
104 | widget = wibox.widget.textbox,
105 | font = beautiful.font_large,
106 | text = "Sign out"
107 | }
108 | }
109 | }
110 | }
111 |
112 | logout_button:connect_signal("button::press", function (_, _, _, button)
113 | if button == 1 then
114 | awesome.quit()
115 | end
116 | end)
117 |
118 | -- Session and user widget
119 | local session_widget = function ()
120 |
121 | local widget_username = wibox.widget{
122 | text = 'Devops',
123 | font = beautiful.font_large_bold,
124 | valign = "center",
125 | widget = wibox.widget.textbox
126 | }
127 | -- Set username
128 | awful.spawn.easy_async(
129 | "whoami",
130 | function(stdout)
131 | widget_username:set_text(stdout:gsub("^%l", string.upper):gsub("%s+", ""))
132 | end
133 | )
134 | local user_widget = wibox.widget {
135 | { {
136 | {
137 | image = beautiful.face_image,
138 | resize = true,
139 | forced_width = dpi(42),
140 | forced_height = dpi(42),
141 | clip_shape = gears.shape.circle,
142 | widget = wibox.widget.imagebox
143 | },
144 | widget_username,
145 | spacing = dpi(10),
146 | layout = wibox.layout.fixed.horizontal
147 | },
148 | nil,
149 | {
150 | logout_button,
151 | {
152 | power_button,
153 | widget = wibox.container.place
154 | },
155 | spacing = dpi(6),
156 | layout = wibox.layout.fixed.horizontal
157 | },
158 | layout = wibox.layout.align.horizontal
159 | },
160 | left = dpi(8),
161 | right = dpi(8),
162 | bottom = dpi(10),
163 | widget = wibox.container.margin
164 | }
165 |
166 |
167 | return user_widget
168 | end
169 |
170 | -- Function to split sting
171 | function str_split (inputstr, sep)
172 | if sep == nil then
173 | sep = "%s"
174 | end
175 | local t={}
176 | for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
177 | table.insert(t, str)
178 | end
179 | return t
180 | end
181 |
182 |
183 | local slider_contols = wibox.widget{
184 | layout = wibox.layout.fixed.vertical,
185 | spacing = dpi(10),
186 | volume_widget.slider,
187 | require("widgets.brightness-slider"),
188 | }
189 |
190 |
191 | local space = wibox.widget{
192 | widget = wibox.container.margin,
193 | top = dpi(10)
194 | }
195 |
196 | local rows = {
197 | layout = wibox.layout.fixed.vertical,
198 | }
199 | table.insert(rows, session_widget())
200 | table.insert(rows, control_buttons)
201 | table.insert(rows, space)
202 | table.insert(rows, slider_contols)
203 |
204 | local notification_center = wibox.widget{
205 | require("widgets.noti-center"),
206 | top = dpi(20),
207 | widget = wibox.container.margin
208 | }
209 | table.insert(rows, notification_center)
210 |
211 |
212 | local popup_height = s.geometry.height - (beautiful.wibar_height + dpi(10))
213 | local control_popup = awful.popup{
214 | widget = {},
215 | ontop = true,
216 | bg = "#00000000",
217 | visible = false,
218 | screen = s,
219 | placement = function (w)
220 | awful.placement.bottom_right(w, {
221 | margins = {left = 0, top = 5, bottom = beautiful.wibar_height + dpi(5), right = dpi(5)}
222 | })
223 | end
224 | }
225 |
226 | control_popup:setup({
227 | widget = wibox.container.background,
228 | bg = beautiful.bg_normal,
229 | shape = beautiful.widget_shape,
230 | forced_height = popup_height,
231 | {
232 | rows,
233 | widget = wibox.container.margin,
234 | top = dpi(40),
235 | bottom = dpi(30),
236 | left = dpi(25),
237 | right = dpi(25)
238 | }
239 | })
240 |
241 | control_widget:connect_signal("button::press", function (self, _, _, button)
242 | if button == 1 then
243 | local background_widget = self:get_children_by_id('background')[1]
244 | if control_popup.visible then
245 | control_popup.visible = not control_popup.visible
246 | background_widget.set_inactive()
247 | else
248 | control_popup.visible = true
249 | background_widget.set_active()
250 | end
251 | end
252 | end)
253 |
254 |
255 | awesome.connect_signal("control-center::hide", function ()
256 | control_popup.visible = false
257 | end)
258 |
259 | awesome.connect_signal("control-center::show", function ()
260 | control_popup.visible = true
261 | end)
262 |
263 | return control_widget
264 | end
265 |
266 |
267 | return control_center
268 |
--------------------------------------------------------------------------------
/widgets/panel/icon-only-tasklist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gears = require("gears")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local client = client
7 |
8 | local tasklist = function (s)
9 |
10 | local tasklist_buttons = gears.table.join(
11 | awful.button({ }, 1, function (c)
12 | if c == client.focus then
13 | c.minimized = true
14 | else
15 | --c.first_tag:emit_signal("request::select")
16 | c:emit_signal(
17 | "request::activate",
18 | "tasklist",
19 | {raise = true}
20 | )
21 | end
22 | end),
23 | awful.button({ }, 3, function()
24 | --awful.menu.client_list({ theme = { width = 250 } })
25 | return
26 | end),
27 | awful.button({ }, 4, function ()
28 | awful.client.focus.byidx(1)
29 | end),
30 | awful.button({ }, 5, function ()
31 | awful.client.focus.byidx(-1)
32 | end)
33 | )
34 |
35 | local widget_tasklist = awful.widget.tasklist {
36 | screen = s,
37 | filter = awful.widget.tasklist.filter.currenttags,
38 | -- source = function()
39 | -- -- Get all clients
40 | -- local cls = client.get()
41 |
42 | -- -- Filter by an existing filter function and allowing only one client per class
43 | -- local result = {}
44 | -- local class_seen = {}
45 | -- for _, c in pairs(cls) do
46 | -- if awful.widget.tasklist.filter.alltags(c, s) then
47 | -- if not class_seen[c.class] then
48 | -- class_seen[c.class] = true
49 | -- table.insert(result, c)
50 | -- end
51 | -- end
52 | -- end
53 | -- return result
54 | -- end,
55 | buttons = tasklist_buttons,
56 | layout = {
57 | layout = wibox.layout.fixed.horizontal,
58 | spacing = dpi(2)
59 | },
60 | -- Notice that there is *NO* wibox.wibox prefix, it is a template,
61 | -- not a widget instance.
62 | widget_template = {
63 | {
64 | {
65 | nil,
66 | {
67 | awful.widget.clienticon,
68 | left = dpi(5),
69 | right = dpi(2.5),
70 | widget = wibox.container.margin
71 | },
72 | {
73 | id = "background_role",
74 | forced_height = dpi(2),
75 | widget = wibox.container.background
76 | },
77 | nil,
78 | expand = "inside",
79 | widget = wibox.layout.align.vertical,
80 | },
81 | widget = wibox.container.background,
82 | id = "background"
83 | },
84 | widget = wibox.container.place,
85 | create_callback = function (self, c, index, objects)
86 | self:get_children_by_id('background')[1].bg = beautiful.bg_tasklist_active
87 | end,
88 | update_callback = function (self, c, index, objects)
89 | local widget_background = self:get_children_by_id("background")[1]
90 | if c.active then
91 | widget_background.bg = beautiful.bg_tasklist_active
92 | else
93 | widget_background.bg = beautiful.bg_transparent
94 | end
95 | end
96 | },
97 | }
98 |
99 | return widget_tasklist
100 |
101 | end
102 |
103 |
104 | function tasklist_container(s)
105 | return wibox.widget{
106 | widget = wibox.container.place,
107 | halign = "left",
108 | tasklist(s)
109 | }
110 | end
111 |
112 | return tasklist_container
113 |
--------------------------------------------------------------------------------
/widgets/panel/layoutbox.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local gears = require("gears")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 |
7 | local layoutbox = function (s)
8 |
9 | local layoutbox_wrapped = wibox.widget {
10 | {
11 | {
12 | {
13 | widget = awful.widget.layoutbox(s),
14 | forced_height = beautiful.wibar_icon_size,
15 | forced_width = beautiful.wibar_icon_size
16 | },
17 | top = dpi(4),
18 | bottom = dpi(4),
19 | left = dpi(4),
20 | right = dpi(4),
21 | widget = wibox.container.margin
22 | },
23 | shape = beautiful.panel_button_shape,
24 | bg = beautiful.bg_panel_button,
25 | border_width = beautiful.button_panel_border_width,
26 | border_color = beautiful.border_panel_button,
27 | widget = wibox.container.background
28 | },
29 | widget = wibox.container.place
30 | }
31 |
32 | layoutbox_wrapped:buttons(
33 | gears.table.join(
34 | awful.button({ }, 1, function () awful.layout.inc( 1) end),
35 | awful.button({ }, 3, function () awful.layout.inc(-1) end),
36 | awful.button({ }, 4, function () awful.layout.inc( 1) end),
37 | awful.button({ }, 5, function () awful.layout.inc(-1) end)
38 | )
39 | )
40 |
41 | return layoutbox_wrapped;
42 | end
43 |
44 | return layoutbox
45 |
--------------------------------------------------------------------------------
/widgets/panel/menu.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local awful = require("awful")
3 | local gears = require("gears")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local default_apps = require("configurations.default-apps")
7 | local clickable_container = require("widgets.clickable-container")
8 |
9 | local widget_menu = wibox.widget{
10 | {
11 | {
12 | {
13 | image = beautiful.awesome_menu_icon,
14 | resize = true,
15 | forced_height = beautiful.wibar_icon_size,
16 | forced_width = beautiful.wibar_icon_size,
17 | widget = wibox.widget.imagebox
18 | },
19 | margins = dpi(4),
20 | widget = wibox.container.margin
21 | },
22 | id = "background",
23 | bg = beautiful.bg_panel_button,
24 | shape = beautiful.panel_button_shape,
25 | border_width = beautiful.button_panel_border_width,
26 | border_color = beautiful.border_panel_button,
27 | widget = wibox.container.background
28 | },
29 | widget = clickable_container
30 | }
31 |
32 | widget_menu:buttons(
33 | gears.table.join(
34 | awful.button(
35 | {},
36 | 1,
37 | nil,
38 | function()
39 | awful.spawn(default_apps.app_menu, false)
40 | end
41 | )
42 | )
43 | )
44 |
45 | return widget_menu
46 |
--------------------------------------------------------------------------------
/widgets/panel/systray-no-toggle.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local beautiful = require("beautiful")
3 | local dpi = beautiful.xresources.apply_dpi
4 |
5 | local systray = function (s)
6 |
7 | local widget = wibox.widget{
8 | {
9 | {
10 | {
11 | screen = s or screen.primary,
12 | base_size = dpi(16),
13 | opacity = .90,
14 | widget = wibox.widget.systray
15 | },
16 | margins = dpi(4),
17 | widget = wibox.container.margin
18 | },
19 | bg = beautiful.bg_panel_button,
20 | shape = beautiful.panel_button_shape,
21 | border_width = beautiful.button_panel_border_width,
22 | border_color = beautiful.border_panel_button,
23 | widget = wibox.container.background
24 | },
25 | margins = dpi(2),
26 | widget = wibox.container.margin
27 | }
28 |
29 | return widget
30 | end
31 |
32 | return systray
33 |
--------------------------------------------------------------------------------
/widgets/panel/systray.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local gears = require("gears")
3 | local beautiful = require("beautiful")
4 | local dpi = beautiful.xresources.apply_dpi
5 | local awful = require("awful")
6 |
7 |
8 | local systray = wibox.widget{
9 | {
10 | widget = wibox.widget.systray
11 | },
12 | visible = false,
13 | left = dpi(6),
14 | widget = wibox.container.margin
15 | }
16 |
17 | local toggle_button_icon = wibox.widget {
18 | id = 'icon',
19 | image = beautiful.arrow_left_icon,
20 | widget = wibox.widget.imagebox,
21 | resize = true
22 | }
23 |
24 | local widget_systray = wibox.widget{
25 | {
26 | {
27 | {
28 | systray,
29 | toggle_button_icon,
30 | layout = wibox.layout.fixed.horizontal
31 | },
32 | left = dpi(2),
33 | right = dpi(2),
34 | top = dpi(2),
35 | bottom = dpi(2),
36 | widget = wibox.container.margin
37 | },
38 | bg = beautiful.bg_panel_button,
39 | shape = beautiful.panel_button_shape,
40 | border_width = beautiful.button_panel_border_width,
41 | border_color = beautiful.border_panel_button,
42 | widget = wibox.container.background
43 | },
44 | margins = dpi(2),
45 | widget = wibox.container.margin
46 | }
47 |
48 | toggle_button_icon:buttons(
49 | gears.table.join(
50 | awful.button(
51 | {},
52 | 1,
53 | nil,
54 | function()
55 | systray.visible = not systray.visible
56 |
57 | if systray.visible then
58 | toggle_button_icon:set_image(beautiful.arrow_right_icon)
59 | else
60 | toggle_button_icon:set_image(beautiful.arrow_left_icon)
61 | end
62 | end
63 | )
64 | )
65 | )
66 | return widget_systray
67 |
--------------------------------------------------------------------------------
/widgets/panel/taglist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gears = require("gears")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local client = client
7 |
8 | local taglist = function (s)
9 |
10 | local taglist_buttons = gears.table.join(
11 | awful.button({ }, 1, function(t) t:view_only() end),
12 | awful.button({ modkey }, 1, function(t)
13 | if client.focus then
14 | client.focus:move_to_tag(t)
15 | end
16 | end),
17 | awful.button({ }, 3, awful.tag.viewtoggle),
18 | awful.button({ modkey }, 3, function(t)
19 | if client.focus then
20 | client.focus:toggle_tag(t)
21 | end
22 | end),
23 | awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
24 | awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
25 | )
26 |
27 | -- Each screen has its own tag table.
28 | local tag_names = {"爵", "", "", "", "", ""}
29 | for idx, name in ipairs(tag_names) do
30 | local selected = false
31 | if idx == 1 then
32 | selected = true
33 | end
34 |
35 | awful.tag.add(name, {
36 | screen = s,
37 | layout = awful.layout.suit.tile,
38 | selected = selected,
39 | })
40 | end
41 |
42 | local tags = awful.widget.taglist {
43 | screen = s,
44 | filter = awful.widget.taglist.filter.all,
45 | buttons = taglist_buttons,
46 | }
47 |
48 | return wibox.widget{
49 | {
50 | tags,
51 | --border_width = dpi(1),
52 | --border_color = beautiful.bg_normal_alt,
53 | --bg = beautiful.bg_button,
54 | --shape = gears.shape.rounded_bar,
55 | widget = wibox.container.background
56 | },
57 | margins = {top = dpi(4), bottom = dpi(4)},
58 | widget = wibox.container.margin
59 | }
60 |
61 | end
62 |
63 | return taglist
64 |
--------------------------------------------------------------------------------
/widgets/panel/tasklist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gears = require("gears")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local client = client
7 |
8 | local tasklist = function (s)
9 |
10 | local tasklist_buttons = gears.table.join(
11 | awful.button({ }, 1, function (c)
12 | if c == client.focus then
13 | c.minimized = true
14 | else
15 | c:emit_signal(
16 | "request::activate",
17 | "tasklist",
18 | {raise = true}
19 | )
20 | end
21 | end),
22 | awful.button({ }, 3, function()
23 | awful.menu.client_list({ theme = { width = 250 } })
24 | end),
25 | awful.button({ }, 4, function ()
26 | awful.client.focus.byidx(1)
27 | end),
28 | awful.button({ }, 5, function ()
29 | awful.client.focus.byidx(-1)
30 | end)
31 | )
32 |
33 | local widget_tasklist = awful.widget.tasklist {
34 | screen = s,
35 | filter = awful.widget.tasklist.filter.currenttags,
36 | buttons = tasklist_buttons,
37 | layout = {
38 | layout = wibox.layout.fixed.horizontal,
39 | spacing = dpi(4)
40 | },
41 | -- Notice that there is *NO* wibox.wibox prefix, it is a template,
42 | -- not a widget instance.
43 | widget_template = {
44 | {
45 | {
46 | {
47 | widget = wibox.container.background,
48 | id = "background_role",
49 | forced_height = dpi(2)
50 | },
51 | {
52 | {
53 | awful.widget.clienticon,
54 | left = dpi(4),
55 | widget = wibox.container.margin
56 | },
57 | {
58 | {
59 | {
60 | id = 'text_role',
61 | widget = wibox.widget.textbox
62 | },
63 | right = dpi(4),
64 | top = dpi(-2),
65 | widget = wibox.container.margin
66 | },
67 | widget = wibox.container.place
68 | },
69 | spacing = dpi(4),
70 | layout = wibox.layout.fixed.horizontal
71 | },
72 | widget = wibox.layout.align.vertical,
73 | },
74 | widget = wibox.container.background,
75 | id = "background"
76 | },
77 | widget = wibox.container.place,
78 | create_callback = function (self, c, index, objects)
79 | self:get_children_by_id('background')[1].bg = beautiful.bg_tasklist_active
80 | end,
81 | update_callback = function (self, c, index, objects)
82 | local widget_background = self:get_children_by_id("background")[1]
83 | if c.active then
84 | widget_background.bg = beautiful.bg_tasklist_active
85 | elseif c.minimized then
86 | widget_background.bg = beautiful.bg_minimize
87 | else
88 | widget_background.bg = beautiful.bg_tasklist_inactive
89 | end
90 | end
91 | },
92 | }
93 |
94 | return widget_tasklist
95 |
96 | end
97 |
98 | return tasklist
99 |
--------------------------------------------------------------------------------
/widgets/separator.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 |
3 | return wibox.widget{
4 | widget = wibox.container.margin,
5 | left = 6
6 | }
7 |
--------------------------------------------------------------------------------
/widgets/volume-slider-and-indicator.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local gears = require("gears")
3 | local awful = require("awful")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local awesome = awesome
7 |
8 |
9 | -- Panel volume indicator
10 | local panel_volume_indicator = wibox.widget{
11 | image = beautiful.volume_normal_icon,
12 | resize = true,
13 | forced_height = beautiful.wibar_icon_size,
14 | forced_width = beautiful.wibar_icon_size,
15 | widget = wibox.widget.imagebox,
16 | }
17 |
18 | -- Slider
19 | -- icon
20 | local icon = wibox.widget{
21 | id = "icon",
22 | image = beautiful.volume_normal_icon,
23 | resize = true,
24 | forced_height = dpi(16),
25 | forced_width = dpi(16),
26 | widget = wibox.widget.imagebox
27 | }
28 | local button = wibox.widget{
29 | {
30 | icon,
31 | margins = dpi(4),
32 | widget = wibox.container.margin
33 | },
34 | bg = beautiful.bg_button,
35 | shape = gears.shape.circle,
36 | widget = wibox.container.background
37 | }
38 | -- slider var
39 | local widget_slider = wibox.widget {
40 | bar_shape = gears.shape.rounded_rect,
41 | bar_height = dpi(3),
42 | bar_color = beautiful.bg_focus .. "55",
43 | bar_active_color = beautiful.bg_focus,
44 |
45 | handle_shape = gears.shape.circle,
46 | handle_width = dpi(12),
47 | handle_color = beautiful.bg_focus,
48 |
49 | value = 40,
50 | minimum = 0,
51 | maximum = 100,
52 | forced_height = dpi(20),
53 | widget = wibox.widget.slider
54 | }
55 |
56 | local slider_wrapped = wibox.widget{
57 | button,
58 | widget_slider,
59 | spacing = dpi(10),
60 | forced_width = dpi(280),
61 | layout = wibox.layout.fixed.horizontal
62 | }
63 |
64 |
65 | local update_volume_icon = function()
66 | awful.spawn.easy_async(
67 | [[ sh -c "pacmd list-sinks | awk '/muted/ { print \$2 }'"]],
68 | function(stdout)
69 | if stdout:match("yes") then
70 | icon:set_image(beautiful.volume_muted_icon)
71 | button:set_bg(beautiful.bg_button)
72 | panel_volume_indicator:set_image(beautiful.volume_muted_icon)
73 | elseif stdout:match("no") then
74 | icon:set_image(beautiful.volume_normal_icon)
75 | button:set_bg(beautiful.button_active)
76 | panel_volume_indicator:set_image(beautiful.volume_normal_icon)
77 | end
78 | end
79 | )
80 | end
81 |
82 | local toggle_mute = function()
83 | awful.spawn.easy_async(
84 | 'amixer -D pulse set Master 1+ toggle',
85 | function(_)
86 | update_volume_icon()
87 | end
88 | )
89 | end
90 |
91 | local set_volume = function(vol)
92 | awful.spawn.with_shell('amixer -D pulse sset Master ' .. vol .. '%')
93 | end
94 |
95 | local update_volume = function ()
96 | awful.spawn.easy_async_with_shell(
97 | [[bash -c "amixer -D pulse sget Master"]],
98 | function (stdout)
99 | local volume = string.match(stdout, '(%d?%d?%d)%%')
100 | widget_slider.value = tonumber(volume)
101 | end
102 | )
103 | end
104 |
105 | -- Hover thingy
106 | local old_cursor, old_wibox
107 | button:connect_signal("mouse::enter", function(c)
108 | local wb = mouse.current_wibox
109 | old_cursor, old_wibox = wb.cursor, wb
110 | wb.cursor = "hand1"
111 | end)
112 |
113 | button:connect_signal("mouse::leave", function(c)
114 | if old_wibox then
115 | old_wibox.cursor = old_cursor
116 | old_wibox = nil
117 | end
118 | end)
119 | widget_slider:connect_signal("mouse::enter", function(c)
120 | local wb = mouse.current_wibox
121 | old_cursor, old_wibox = wb.cursor, wb
122 | wb.cursor = "hand1"
123 | end)
124 |
125 | widget_slider:connect_signal("mouse::leave", function(c)
126 | if old_wibox then
127 | old_wibox.cursor = old_cursor
128 | old_wibox = nil
129 | end
130 | end)
131 |
132 | -- When sliding happens
133 | widget_slider:connect_signal(
134 | "property::value",
135 | function(_,value)
136 | --local v = math.floor((value-0)/(170-0) * (100-0) + 0)
137 | set_volume(value)
138 | end
139 | )
140 |
141 |
142 | button:connect_signal(
143 | "button::press",
144 | function(_,_,_, button)
145 | if (button == 1) then
146 | toggle_mute()
147 | end
148 | end
149 | )
150 |
151 | awesome.connect_signal("update::volume", function ()
152 | update_volume()
153 | end)
154 |
155 | awesome.connect_signal("toggle::mute", function ()
156 | toggle_mute()
157 | end)
158 |
159 | update_volume()
160 | update_volume_icon()
161 |
162 | local module = {}
163 | module.slider = slider_wrapped
164 | module.indicator = panel_volume_indicator
165 | return module
166 |
167 |
168 |
169 |
--------------------------------------------------------------------------------
/widgets/weather.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local gears = require("gears")
4 | local beautiful = require("beautiful")
5 | local dpi = beautiful.xresources.apply_dpi
6 | local filesystem = gears.filesystem
7 | local json = require("module.json")
8 | local settings = require("configurations.settings")
9 | local icon_dir = filesystem.get_configuration_dir() .. "/themes/default/icons/weather/"
10 |
11 | local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]]
12 |
13 | local icon_map = {
14 | ["01d"] = "weather-clear-sky",
15 | ["02d"] = "weather-few-clouds",
16 | ["03d"] = "weather-clouds",
17 | ["04d"] = "weather-few-clouds",
18 | ["09d"] = "weather-showers-scattered",
19 | ["10d"] = "weather-showers",
20 | ["11d"] = "weather-strom",
21 | ["13d"] = "weather-snow",
22 | ["50d"] = "weather-fog",
23 | ["01n"] = "weather-clear-night",
24 | ["02n"] = "weather-few-clouds-night",
25 | ["03n"] = "weather-clouds-night",
26 | ["04n"] = "weather-clouds-night",
27 | ["09n"] = "weather-showers-scattered",
28 | ["10n"] = "weather-showers",
29 | ["11n"] = "weather-strom",
30 | ["13n"] = "weather-snow",
31 | ["50n"] = "weather-fog"
32 | }
33 |
34 | local current_weather_widget = wibox.widget{
35 | {
36 | {
37 | id = "icon",
38 | image = icon_dir .. "weather-showers.svg",
39 | resize = true,
40 | forced_height = dpi(42),
41 | forced_width = dpi(42),
42 | widget = wibox.widget.imagebox
43 | },
44 | {
45 | {
46 | {
47 | id = "description",
48 | text = "Mostly cloudy",
49 | font = "Ubuntu bold 9",
50 | widget = wibox.widget.textbox
51 | },
52 | {
53 | id = "humidity",
54 | text = "Humidity: 80%",
55 | font = "Ubuntu light 9",
56 | widget = wibox.widget.textbox
57 | },
58 | layout = wibox.layout.fixed.vertical
59 | },
60 | widget = wibox.container.place
61 | },
62 | spacing = dpi(10),
63 | layout = wibox.layout.fixed.horizontal
64 | },
65 | nil,
66 | {
67 | {
68 | {
69 | id = "tempareture_current",
70 | markup = "20°",
71 | align = "right",
72 | font = "Ubuntu bold 16",
73 | widget = wibox.widget.textbox
74 | },
75 | {
76 | id = "feels_like",
77 | markup = "Feels like: 19°",
78 | font = "Ubuntu light 8",
79 | widget = wibox.widget.textbox
80 | },
81 | spacing = dpi(-6),
82 | layout = wibox.layout.fixed.vertical
83 | },
84 | widget = wibox.container.place
85 | },
86 | layout = wibox.layout.align.horizontal
87 | }
88 |
89 | local hourly_widget = function ()
90 |
91 | local widget = wibox.widget{
92 | {
93 | {
94 | id = "time",
95 | text = "12PM",
96 | font = "Ubuntu light 9",
97 | widget = wibox.widget.textbox
98 | },
99 | widget = wibox.container.place
100 | },
101 | {
102 | {
103 | id = "icon",
104 | image = icon_dir .. "weather-clear-sky.svg",
105 | resize = true,
106 | forced_height = dpi(16),
107 | forced_width = dpi(16),
108 | widget = wibox.widget.imagebox
109 | },
110 | widget = wibox.container.place
111 | },
112 | {
113 | {
114 | id = "tempareture",
115 | markup = "1°",
116 | font = "Ubuntu light 9",
117 | widget = wibox.widget.textbox
118 | },
119 | widget = wibox.container.place
120 | },
121 | spacing = dpi(6),
122 | layout = wibox.layout.fixed.vertical
123 | }
124 |
125 | widget.update = function (result)
126 | local time = widget:get_children_by_id("time")[1]
127 | local icon = widget:get_children_by_id("icon")[1]
128 | local temp = widget:get_children_by_id("tempareture")[1]
129 | temp:set_markup(math.floor(result.temp) .. "°")
130 | time:set_text(os.date('%I%p', tonumber(result.dt)))
131 | icon.image = icon_dir .. icon_map[result.weather[1].icon] .. ".svg"
132 | icon:emit_signal("widget::redraw_needed")
133 | end
134 | return widget
135 | end
136 |
137 | local hourly_widget_1 = hourly_widget()
138 | local hourly_widget_2 = hourly_widget()
139 | local hourly_widget_3 = hourly_widget()
140 | local hourly_widget_4 = hourly_widget()
141 | local hourly_widget_5 = hourly_widget()
142 |
143 | local weather_widget = wibox.widget{
144 | {
145 | text = "Weather",
146 | font = beautiful.font_large_bold,
147 | align = "center",
148 | widget = wibox.widget.textbox
149 | },
150 | current_weather_widget,
151 | {
152 | hourly_widget_1,
153 | hourly_widget_2,
154 | hourly_widget_3,
155 | hourly_widget_4,
156 | hourly_widget_5,
157 | spacing = dpi(16),
158 | layout = wibox.layout.fixed.horizontal
159 | },
160 | spacing = dpi(10),
161 | layout = wibox.layout.fixed.vertical
162 | }
163 |
164 | local coordinates = settings.openweathermap_coordinates
165 |
166 | local api_key = settings.openweathermap_api_key
167 | local show_hourly_forecast = true
168 | local show_daily_forecast = true
169 | local units = "metric"
170 |
171 | local url =
172 | ('https://api.openweathermap.org/data/2.5/onecall' ..
173 | '?lat=' .. coordinates[1] .. '&lon=' .. coordinates[2] .. '&appid=' .. api_key ..
174 | '&units=' .. units .. '&exclude=minutely' ..
175 | (show_hourly_forecast == false and ',hourly' or '') ..
176 | (show_daily_forecast == false and ',daily' or ''))
177 |
178 | awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function (_,stdout, stderr)
179 | if stderr == '' then
180 | local result = json.decode(stdout)
181 | -- Current weather setup
182 | local icon = current_weather_widget:get_children_by_id('icon')[1]
183 | local description = current_weather_widget:get_children_by_id("description")[1]
184 | local humidity = current_weather_widget:get_children_by_id("humidity")[1]
185 | local temp_current = current_weather_widget:get_children_by_id("tempareture_current")[1]
186 | local feels_like = current_weather_widget:get_children_by_id("feels_like")[1]
187 | icon.image = icon_dir .. icon_map[result.current.weather[1].icon] .. ".svg"
188 | icon:emit_signal("widget::redraw_needed")
189 | description:set_text(result.current.weather[1].description:gsub("^%l", string.upper))
190 | humidity:set_text("Humidity: ".. result.current.humidity .. "%")
191 | temp_current:set_markup(math.floor(result.current.temp) .."°")
192 | feels_like:set_markup("Feels like: ".. math.floor(result.current.feels_like) .."°")
193 | -- Hourly widget setup
194 | hourly_widget_1.update(result.hourly[1])
195 | hourly_widget_2.update(result.hourly[2])
196 | hourly_widget_3.update(result.hourly[3])
197 | hourly_widget_4.update(result.hourly[4])
198 | hourly_widget_5.update(result.hourly[5])
199 | end
200 | end)
201 |
202 | return weather_widget
203 |
--------------------------------------------------------------------------------