Compare commits

..

7 Commits
main ... hpold

Author SHA1 Message Date
Schneider Roland
01227361e5 hg g6 2025-04-15 20:24:41 +02:00
e4d92e8927 improve doc 2022-01-30 09:39:09 +01:00
656951981e add tag support for 10 to 20 2022-01-30 09:21:48 +01:00
06fbcaee7c restore all, select client by idx 2022-01-29 23:24:25 +01:00
334d71f5fd add iterate over all client in active tag 2022-01-29 20:42:08 +01:00
39835d2a82 add alt+ta switcher 2022-01-28 22:38:59 +01:00
46aabb2983 autorun changes 2022-01-28 19:58:00 +01:00
7 changed files with 2206 additions and 115 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
battery-widget battery-widget
keyboard-layout-indicator keyboard-layout-indicator
revelation revelation
awesome-switcher
.idea
*.iml

19
askme.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
rc=-1
# while [[ $rc != [01] ]]; do  ✔  took 4s   at 07:46:30 
ans=$(zenity --info --title 'Choose!' \
--text 'Autostart apps?' \
--ok-label YES \
--extra-button NO \
--timeout 15)
rc=$?
echo "${rc}-${ans}"
# done
if [[ $rc = 1 ]]
then
echo "exiting"
else
echo "startng"
fi

View File

@ -1,37 +1,65 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function run { function run {
if ! pgrep $1 ; if ! pgrep $1; then
then $@ &
$@& fi
fi
} }
ans=$(zenity --info --title 'Choose!' \
--text 'Autostart tray icons?' \
--ok-label YES \
--extra-button NO \
--timeout 15)
rc1=$?
echo "${rc}-${ans}"
# utilities in top bar if [[ $rc1 = 1 ]]; then
# network manager echo "exiting"
run /usr/bin/nm-applet else
# bluetooth indicator # utilities in top bar
run /usr/bin/blueman-manager # network manager
# screenshot utility run /usr/bin/nm-applet
run /usr/bin/shutter # bluetooth indicator
# volume control run /usr/bin/blueman-manager
run /usr/bin/pasystray # screenshot utility
run /usr/bin/shutter
# volume control
run /usr/bin/pasystray
fi
ans=$(zenity --info --title 'Choose!' \
--text 'Autostart apps?' \
--ok-label YES \
--extra-button NO \
--timeout 15)
rc=$?
echo "${rc}-${ans}"
if [[ $rc = 1 ]]; then
echo "exiting"
exit 0
fi
# tag 1 # tag 1
run idea #run /usr/local/bin/jetbrains-toolbox
run /snap/bin/intellij-idea-ultimate
# tag 2 # tag 2
run /opt/google/chrome/chrome run /opt/google/chrome/chrome
# tag 3 # tag 3
run /usr/bin/terminator run /usr/bin/terminator
# tag 4 # tag 4
run /usr/bin/code run /snap/bin/code
# tag 5 # tag 5
run /usr/bin/zoom run /usr/bin/zoom
run /usr/bin/teams #run /snap/bin/teams
run /snap/bin/rambox
#tag 6 #tag 6
run /snap/bin/rocketchat-desktop run /snap/bin/rocketchat-desktop
run /usr/bin/thunderbird run /usr/bin/thunderbird
run /usr/bin/discord #run /snap/bin/discord
# tag 7 # tag 7
run /usr/bin/bitwarden run /snap/bin/bitwarden
# run /usr/bin/keepassx #run /usr/bin/keepassx
# tag 12
run /snap/bin/firefox

View File

@ -1,4 +1,6 @@
git clone https://github.com/deficient/battery-widget.git git clone https://github.com/deficient/battery-widget.git
git clone https://github.com/deficient/keyboard-layout-indicator.git git clone https://github.com/deficient/keyboard-layout-indicator.git
git clone https://github.com/guotsuan/awesome-revelation revelation git clone https://github.com/guotsuan/awesome-revelation revelation
sudo apt-get install acpid git clone https://github.com/berlam/awesome-switcher.git awesome-switcher
sudo apt update
sudo apt-get install acpid fonts-emojione fonts-noto-color-emoji

1771
mein-a1 Normal file

File diff suppressed because it is too large Load Diff

422
rc.lua
View File

@ -18,24 +18,60 @@ local battery_widget = require("battery-widget")
local keyboard_layout_indicator = require("keyboard-layout-indicator") local keyboard_layout_indicator = require("keyboard-layout-indicator")
local revelation=require("revelation") local revelation=require("revelation")
revelation.curr_tag_only = true
-- Load Debian menu entries -- Load Debian menu entries
local debian = require("debian.menu") local debian = require("debian.menu")
local has_fdo, freedesktop = pcall(require, "freedesktop") local has_fdo, freedesktop = pcall(require, "freedesktop")
local switcher = require("awesome-switcher")
switcher.settings.preview_box = true -- display preview-box
switcher.settings.preview_box_bg = "#ddddddaa" -- background color
switcher.settings.preview_box_border = "#22222200" -- border-color
switcher.settings.preview_box_fps = 30 -- refresh framerate
switcher.settings.preview_box_delay = 150 -- delay in ms
switcher.settings.preview_box_title_font = {"sans","italic","normal"}-- the font for cairo
switcher.settings.preview_box_title_font_size_factor = 0.8 -- the font sizing factor
switcher.settings.preview_box_title_color = {0,0,0,1} -- the font color
switcher.settings.client_opacity = false -- opacity for unselected clients
switcher.settings.client_opacity_value = 0.5 -- alpha-value for any client
switcher.settings.client_opacity_value_in_focus = 0.5 -- alpha-value for the client currently in focus
switcher.settings.client_opacity_value_selected = 1 -- alpha-value for the selected client
switcher.settings.cycle_raise_client = true -- raise clients on cycle
local KEY_ALT = "Mod1" local KEY_ALT = "Mod1"
local tag1 = "1:idea" local tag1 = "1"
local tag2 = "2:brow" local tag2 = "2"
local tag3 = "3:term" local tag3 = "3"
local tag4 = "4:code" local tag4 = "4"
local tag5 = "5:zoom" local tag5 = "5"
local tag6 = "6:chat" local tag6 = "6"
local tag7 = "7:pass" local tag7 = "7"
local tag8 = "8" local tag8 = "8"
local tag9 = "9" local tag9 = "9"
local tag10 = "10"
local tag11 = "11"
local tag12 = "12"
local tag13 = "13"
local tag14 = "14"
local tag15 = "15"
local tag16 = "16"
local tag17 = "17"
local tag18 = "18"
local tag19 = "19"
local tag20 = "20"
-- Numpad: [0-9] = [#90, #87-#89, #83-#85, #79-#81]
local numpadMap = { 87, 88, 89, 83, 84, 85, 79, 80, 81, 90 }
local tags = { local tags = {
tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9 tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10,
tag11,tag12,tag13,tag14,tag15,tag16,tag17,tag18,tag19,tag20
} }
local wibar_font="Deja Vu Sans Mono 14" local wibar_font="Deja Vu Sans Mono 14"
@ -201,7 +237,7 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
-- mytextclock = wibox.widget.textclock() -- mytextclock = wibox.widget.textclock()
mytextclock = wibox.widget.textclock("%y-%m-%d %a %H:%M:%S",1) mytextclock = wibox.widget.textclock("%y-%m-%d %a %H:%M:%S",1)
mybatterywidget = battery_widget { adapter = "BAT0", ac = "AC", widget_font = wibar_font mybatterywidget = battery_widget { adapter = "BAT0", ac = "AC", widget_font = wibar_font
, battery_prefix = "🔋" , battery_prefix = "🔋"
, ac_prefix = "🔌" , ac_prefix = "🔌"
} }
@ -274,6 +310,102 @@ local function set_wallpaper(s)
end end
end end
-- get count of elements in table
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
-- return all client from selected tag
local function getAllClient()
local focusedScreen = awful.screen.focused ()
local t = focusedScreen.selected_tag
local clientsOnTag = t:clients()
return clientsOnTag
end
-- restore the given client
local function restoreClient(currentClient)
currentClient.minimized = false
currentClient.maximized = false
currentClient.fullscreen = false
end
-- make all client minimized=false,maximized=false,fullscreen=false
local function restoreAll()
local clientsOnTag = getAllClient()
for k, currentClient in pairs(clientsOnTag) do
restoreClient(currentClient)
end
end
-- minimize the given client
local function minimizeClient(currentClient)
currentClient.minimized = true
currentClient.maximized = false
currentClient.fullscreen = false
end
-- minimize all client
local function minimizeAll()
local clientsOnTag = getAllClient()
for k, currentClient in pairs(clientsOnTag) do
minimizeClient(currentClient)
end
end
-- make all client minimized=false,maximized=false,fullscreen=false
local function selectClientIdx(idx)
local clientsOnTag = getAllClient()
local clientCount = tablelength(clientsOnTag)
minimizeAll()
if ( clientCount >= idx ) then
local clientToFocus = clientsOnTag[idx];
client.focus = clientToFocus
clientToFocus:raise()
restoreClient(clientToFocus)
end
end
-- only the focused client will be opened, all other client minimized
local function normalizeClients()
local focusedScreen = awful.screen.focused ()
local focusedClient = client.focus
local t = focusedScreen.selected_tag
local clientsOnTag = t:clients()
for k, currentClient in pairs(clientsOnTag) do
currentClient.maximized = false
if currentClient == focusedClient then
currentClient.minimized = false
else
currentClient.minimized = true;
end
end
end
local function move_tag_to_focused_screen(tagName)
-- For all screens: find tag by name
print("looking for tag " .. tagName)
local tagByName = awful.tag.find_by_name(nil, tagName)
if tag then
print("tag found with name" .. tagName)
local screenFocused = awful.screen.focused()
tagByName.screen=screenFocused
tagByName:view_only()
end
end
local function move_client_to_tag(tagName)
if client.focus then
local tag = awful.tag.find_by_name(nil, tagName)
if tag then
client.focus:move_to_tag(tag)
end
end
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper) screen.connect_signal("property::geometry", set_wallpaper)
@ -351,22 +483,59 @@ root.buttons(gears.table.join(
-- {{{ Key bindings -- {{{ Key bindings
-- mod + s = show help -- mod + s = show help
globalkeys = gears.table.join( globalkeys = gears.table.join(
awful.key({ modkey, "Control" }, "v",
function ()
for _, c in ipairs(client.get()) do
awful.titlebar.show(c)
end
end,
{description = "show titles", group = "awesome"}
),
awful.key({ modkey }, "v",
function ()
for _, c in ipairs(client.get()) do
awful.titlebar.hide(c)
end
end,
{description = "hide titles", group = "awesome"}
),
awful.key({ modkey }, "b",
function ()
myscreen = awful.screen.focused()
myscreen.mywibox.visible = not myscreen.mywibox.visible
end,
{description = "toggle statusbar", group = "awesome"}
),
awful.key({ "Mod1", }, "Tab",
function ()
switcher.switch( 1, "Mod1", "Alt_L", "Shift", "Tab")
end),
awful.key({ "Mod1", "Shift" }, "Tab",
function ()
switcher.switch(-1, "Mod1", "Alt_L", "Shift", "Tab")
end),
-- mod + e -> custom widget revelation -- mod + e -> custom widget revelation
-- awful.key({ modkey, }, "e", revelation), awful.key({ modkey, }, "e", revelation),
awful.key({ modkey, }, "s", hotkeys_popup.show_help, awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}), {description="show help", group="awesome"}),
-- mod + left|right -> view next/prev tag -- mod + left|right -> view next/prev tag
awful.key({ modkey, }, "Left", awful.tag.viewprev, awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}), {description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext, awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}), {description = "view next", group = "tag"}),
-- mod + Esc -> tag history resotre awful.key({ modkey, }, "End", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Home", awful.tag.viewnext,
{description = "view next", group = "tag"}),
-- mod + Esc -> tag history resotre
awful.key({ modkey, }, "Escape", awful.tag.history.restore, awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}), {description = "go back", group = "tag"}),
-- mod + j|k -> focus next|prev client -- mod + j|k -> focus next|prev client
awful.key({ modkey, }, "j", awful.key({ modkey, }, "j",
function () function ()
awful.client.focus.byidx( 1) awful.client.focus.byidx( 1)
--swapClient(1)
end, end,
{description = "focus next by index", group = "client"} {description = "focus next by index", group = "client"}
), ),
@ -376,20 +545,44 @@ globalkeys = gears.table.join(
end, end,
{description = "focus previous by index", group = "client"} {description = "focus previous by index", group = "client"}
), ),
awful.key({ modkey, }, "o",
function ()
restoreAll()
end,
{description = "restore all", group = "client"}
),
awful.key({ modkey}, "Prior",
function ()
restoreAll()
awful.client.focus.byidx( 1)
normalizeClients()
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey }, "Next",
function ()
restoreAll()
awful.client.focus.byidx(-1)
normalizeClients()
end,
{description = "focus previous by index", group = "client"}
),
-- mod + w -> show main menu -- mod + w -> show main menu
awful.key({ modkey, }, "w", function () mymainmenu:show() end, awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}), {description = "show main menu", group = "awesome"}),
-- Layout manipulation -- Layout manipulation
-- mod + shift + j|k -> swap client wiht next|prev client in tag -- md + shift + j|k -> swap client wiht next|prev client in tag
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}), {description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}), {description = "swap with previous client by index", group = "client"}),
-- mod + ctrl + j|k -> focus next|prev screen -- mod + é|á|ű -> focus next|prev screen
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, awful.key({ modkey }, "é", function () awful.screen.focus( 1) end,
{description = "focus the next screen", group = "screen"}), {description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, awful.key({ modkey }, "á", function () awful.screen.focus(2) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey }, "ű", function () awful.screen.focus(3) end,
{description = "focus the previous screen", group = "screen"}), {description = "focus the previous screen", group = "screen"}),
-- mod + u -> urgent client -- mod + u -> urgent client
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
@ -410,7 +603,7 @@ globalkeys = gears.table.join(
-- mod + ctrl + r -> restart awsome -- mod + ctrl + r -> restart awsome
awful.key({ modkey, "Control" }, "r", awesome.restart, awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}), {description = "reload awesome", group = "awesome"}),
-- mod + shift + q -> quit awesome -- mod + shift + q -> quit awesome
awful.key({ modkey, "Shift" }, "q", awesome.quit, awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}), {description = "quit awesome", group = "awesome"}),
@ -479,17 +672,17 @@ clientkeys = gears.table.join(
-- mod + shift + c -> close client -- mod + shift + c -> close client
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}), {description = "close", group = "client"}),
-- mod + ctrl + space -> toggle float -- mod + ctrl + space -> toggle float
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}), {description = "toggle floating", group = "client"}),
-- mod + ctrl + enter -> move to master position -- mod + ctrl + enter -> move to master position
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}), {description = "move to master", group = "client"}),
-- mod + o -> move to screen -- mod + o -> move to screen
-- move the current client in to the active tag of the next screen -- move the current client in to the active tag of the next screen
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}), {description = "move to screen", group = "client"}),
-- mod + t -> toggle on top -- mod + t -> toggle on top
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}), {description = "toggle keep on top", group = "client"}),
-- mod + n -> minimize -- mod + n -> minimize
@ -500,14 +693,14 @@ clientkeys = gears.table.join(
c.minimized = true c.minimized = true
end , end ,
{description = "minimize", group = "client"}), {description = "minimize", group = "client"}),
-- mod + m -> toggle maximize -- mod + m -> toggle maximize
awful.key({ modkey, }, "m", awful.key({ modkey, }, "m",
function (c) function (c)
c.maximized = not c.maximized c.maximized = not c.maximized
c:raise() c:raise()
end , end ,
{description = "(un)maximize", group = "client"}), {description = "(un)maximize", group = "client"}),
-- mod + ctrl + m -> toggle maximize vertical -- mod + ctrl + m -> toggle maximize vertical
awful.key({ modkey, "Control" }, "m", awful.key({ modkey, "Control" }, "m",
function (c) function (c)
c.maximized_vertical = not c.maximized_vertical c.maximized_vertical = not c.maximized_vertical
@ -523,31 +716,12 @@ clientkeys = gears.table.join(
{description = "(un)maximize horizontally", group = "client"}) {description = "(un)maximize horizontally", group = "client"})
) )
local function move_tag_to_focused_screen(tagName)
-- For all screens: find tag by name
print("looking for tag " .. tagName)
local tagByName = awful.tag.find_by_name(nil, tagName)
if tag then
print("tag found with name" .. tagName)
local screenFocused = awful.screen.focused()
tagByName.screen=screenFocused
tagByName:view_only()
end
end
local function move_client_to_tag(tagName)
if client.focus then
local tag = awful.tag.find_by_name(nil, tagName)
if tag then
client.focus:move_to_tag(tag)
end
end
end
-- Bind all key numbers to tags. -- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout. -- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9. -- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do for i = 1, 10 do
globalkeys = gears.table.join(globalkeys, globalkeys = gears.table.join(globalkeys,
-- View tag only. -- View tag only.
-- mod + i -> show tag -- mod + i -> show tag
@ -562,14 +736,16 @@ for i = 1, 9 do
end, end,
{description = "view tag #"..i, group = "tag"}), {description = "view tag #"..i, group = "tag"}),
awful.key({ modkey, KEY_ALT }, "#" .. i + 9, -- awful.key({ modkey, KEY_ALT }, "#" .. i + 9,
-- awful.key({ modkey, KEY_ALT }, "#" .. i + 9,
awful.key({ modkey, KEY_ALT }, "#" .. numpadMap[i],
function () function ()
move_tag_to_focused_screen(tags[i]) selectClientIdx(i)
end, end,
{description = "view tag #"..i, group = "tag"}), {description = "select client in active tag #"..i, group = "client"}),
-- Toggle tag display. -- Toggle tag display.
-- --
-- mod + ctrl + i -> show/hide tag -- mod + ctrl + i -> show/hide tag
awful.key({ modkey, "Control" }, "#" .. i + 9, awful.key({ modkey, "Control" }, "#" .. i + 9,
function () function ()
@ -589,22 +765,79 @@ for i = 1, 9 do
-- if tag then -- if tag then
-- client.focus:move_to_tag(tag) -- client.focus:move_to_tag(tag)
-- end -- end
-- end -- end
move_client_to_tag(tags[i]) move_client_to_tag(tags[i])
end, end,
{description = "move focused client to tag #"..i, group = "tag"}), {description = "move focused client to tag #"..i, group = "tag"})
-- Toggle tag on focused client. -- Toggle tag on focused client.
-- mod + ctrl + shift +i -> toggle focused client on tag -- mod + ctrl + shift +i -> toggle focused client on tag
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, --awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function () -- function ()
if client.focus then -- if client.focus then
local tag = client.focus.screen.tags[i] -- local tag = client.focus.screen.tags[i]
if tag then -- if tag then
client.focus:toggle_tag(tag) -- client.focus:toggle_tag(tag)
end -- end
end -- end
end, -- end,
{description = "toggle focused client on tag #" .. i, group = "tag"}) -- {description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
-- tags 11-20
for i = 1, 10 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
-- mod + i -> show tag
awful.key({ modkey }, "#" .. numpadMap[i],
function ()
-- local screen = awful.screen.focused()
-- local tag = screen.tags[i]
-- if tag then
-- tag:view_only()
-- end
move_tag_to_focused_screen(tags[10+ i])
end,
{description = "view tag #"..(10+i), group = "tag"}),
-- Toggle tag display.
--
-- mod + ctrl + i -> show/hide tag
awful.key({ modkey, "Control" }, "#" .. numpadMap[i],
function ()
local screen = awful.screen.focused()
local tag = screen.tags[10+i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. (10+i), group = "tag"}),
-- Move client to tag.
-- mod + shift + i -> move client to tag
awful.key({ modkey, "Shift" }, "#" .. numpadMap[i],
function ()
-- if client.focus then
-- local tag = client.focus.screen.tags[i]
-- if tag then
-- client.focus:move_to_tag(tag)
-- end
-- end
move_client_to_tag(tags[10+i])
end,
{description = "move focused client to tag #"..(10+i), group = "tag"})
-- Toggle tag on focused client.
-- mod + ctrl + shift +i -> toggle focused client on tag
-- awful.key({ modkey, "Control", "Shift" }, "#" .. np_map[i],
-- function ()
-- if client.focus then
-- local tag = client.focus.screen.tags[i]
-- if tag then
-- client.focus:toggle_tag(tag)
-- end
-- end
-- end,
-- {description = "toggle focused client on tag #" .. i, group = "tag"})
) )
end end
@ -628,7 +861,7 @@ local function getScreenByTagName(tagName)
print( "tag " .. tostring(tagName) .. " is on screen " .. tostring(indexOfScreen)) print( "tag " .. tostring(tagName) .. " is on screen " .. tostring(indexOfScreen))
return indexOfScreen return indexOfScreen
end end
return awful.screen.focused().index return awful.screen.focused().index
end end
@ -636,6 +869,7 @@ local function getTagByName(tagName)
return awful.tag.find_by_name(nil, tagName) return awful.tag.find_by_name(nil, tagName)
end end
-- {{{ Rules -- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal). -- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = { awful.rules.rules = {
@ -648,39 +882,35 @@ awful.rules.rules = {
keys = clientkeys, keys = clientkeys,
buttons = clientbuttons, buttons = clientbuttons,
screen = awful.screen.preferred, screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen, placement = awful.placement.no_overlap+awful.placement.no_offscreen
maximized_vertical = false,
maximized_horizontal = false,
-- floating = false,
maximized = false
} }
}, },
-- Floating clients. -- Floating clients.
{ rule_any = { -- { rule_any = {
instance = { -- instance = {
"DTA", -- Firefox addon DownThemAll. -- "DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class. -- "copyq", -- Includes session name in class.
}, -- },
class = { -- class = {
"Arandr", -- "Arandr",
"Gpick", -- "Gpick",
"Kruler", -- "Kruler",
"MessageWin", -- kalarm. -- "MessageWin", -- kalarm.
"Sxiv", -- "Sxiv",
"Wpa_gui", -- "Wpa_gui",
"pinentry", -- "pinentry",
"veromix", -- "veromix",
"xtightvncviewer"}, -- "xtightvncviewer"},
name = { -- name = {
"Event Tester", -- xev. -- "Event Tester", -- xev.
}, -- },
role = { -- role = {
"AlarmWindow", -- Thunderbird's calendar. -- "AlarmWindow", -- Thunderbird's calendar.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools. -- "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
} -- }
}, properties = { floating = true }}, -- }, properties = { floating = true }},
-- Add titlebars to normal clients and dialogs -- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" } { rule_any = {type = { "normal", "dialog" }
@ -704,8 +934,10 @@ awful.rules.rules = {
{ rule = { instance = "zoom" }, { rule = { instance = "zoom" },
properties = { screen = function () return getScreenByTagName(tag5) end, tag = tag5 } }, properties = { screen = function () return getScreenByTagName(tag5) end, tag = tag5 } },
-- microsoft teams - preview -> tag5 -- microsoft teams - preview -> tag5
{ rule = { instance = "microsoft teams - preview" }, -- { rule = { instance = "microsoft teams - preview" },
properties = { screen = function () return getScreenByTagName(tag5) end, tag = tag5 } }, -- properties = { screen = function () return getScreenByTagName(tag5) end, tag = tag5 } },
{ rule = { class = "rambox" },
properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag6 } },
-- rocket.chat-> tag6 -- rocket.chat-> tag6
{ rule = { instance = "rocket.chat" }, { rule = { instance = "rocket.chat" },
properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag6 } }, properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag6 } },
@ -713,14 +945,17 @@ awful.rules.rules = {
{ rule = { instance = "discord" }, { rule = { instance = "discord" },
properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag6 } }, properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag6 } },
-- Thunderbird -> tag6 -- Thunderbird -> tag6
{ rule = { class = "Thunderbird" }, { rule = { class = "thunderbird" },
properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag6 } }, properties = { screen = function () return getScreenByTagName(tag6) end, tag = tag17 } },
-- Bitwarden -> tag7 -- Bitwarden -> tag7
{ rule = { instance = "bitwarden" }, { rule = { instance = "bitwarden" },
properties = { screen = function () return getScreenByTagName(tag7) end, tag = tag7 } }, properties = { screen = function () return getScreenByTagName(tag7) end, tag = tag7 } },
-- keepass2 -> tag7 -- keepass2 -> tag7
{ rule = { instance = "keepassx" }, { rule = { instance = "keepassx" },
properties = { screen = function () return getScreenByTagName(tag7) end, tag = tag7 } }, properties = { screen = function () return getScreenByTagName(tag7) end, tag = tag7 } },
-- fireefox -> tag12
{ rule = { class = "firefox" },
properties = { screen = function () return getScreenByTagName(tag12) end, tag = tag12 } },
-- Set Firefox to always map on the tag named "2" on screen 1. -- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" }, -- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } }, -- properties = { screen = 1, tag = "2" } },
@ -734,7 +969,6 @@ client.connect_signal("manage", function (c)
-- i.e. put it at the end of others instead of setting it master. -- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end -- if not awesome.startup then awful.client.setslave(c) end
awful.placement.no_offscreen(c)
if awesome.startup and if awesome.startup and
not c.size_hints.user_position not c.size_hints.user_position
and not c.size_hints.program_position then and not c.size_hints.program_position then
@ -798,5 +1032,5 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n
-- }}} -- }}}
-- --
-- {{{ autostart -- {{{ autostart
awful.spawn.with_shell("~/.config/awesome/autorun.sh") awful.spawn.with_shell("~/.config/awesome/autorun.sh")
-- }}} -- }}}

34
readme.md Normal file
View File

@ -0,0 +1,34 @@
# AwesomeWM config
Features:
- fix set of tags 1-20 (super+num|super+numpad)
- tags can be moved across multiple screen (super+num|super+numpad)
- move client to tag (super+shift+num|super+shift+numpad)
- revelation widget (super+e)
- battery-widget
- keyboard-layout-indicator
- awesome-switcher(alt+tab)
Main keyboard shortcuts
select next client in current tag: super u, super i
restore all clients in current tag: super o
minimize/open client: super+n
maximaze client: super+m
revelation plugin: super+e
show help: super+s
select tag 1-10: super+num
select tag 11-20: super+numpad
next/prev tag: super+arrow(left|right)
select client by index: super+alt+num
## Checkout
Checkout the awesome folder and copy it to
~/.cofig/awesome
## install dependencies
```bash
sudo bash install-deps.sh
```