mirror of
https://github.com/elenapan/dotfiles.git
synced 2025-12-26 15:14:58 +08:00
Small tweaks, fixes and code cleanup
This commit is contained in:
parent
6b4053b6b4
commit
0702149eca
13 changed files with 46 additions and 47 deletions
|
|
@ -28,6 +28,9 @@ apps.discord = function ()
|
|||
-- Run or raise Discord app
|
||||
-- helpers.run_or_raise({class = 'discord'}, false, "discord")
|
||||
end
|
||||
apps.weechat = function ()
|
||||
helpers.run_or_raise({instance = 'weechat'}, true, user.terminal.." --class weechat -e weechat")
|
||||
end
|
||||
apps.mail = function ()
|
||||
helpers.run_or_raise({instance = 'email'}, false, user.email_client, {switchtotag = true})
|
||||
end
|
||||
|
|
@ -57,9 +60,7 @@ apps.torrent = function ()
|
|||
end
|
||||
|
||||
apps.editor = function ()
|
||||
-- helpers.run_or_raise({class = 'Emacs'}, false, "emacs")
|
||||
helpers.run_or_raise({instance = 'editor'}, false, user.editor, { switchtotag = true })
|
||||
-- helpers.run_or_raise({class = 'editor'}, false, user.editor, { switchtotag = true })
|
||||
end
|
||||
|
||||
-- Toggle compositor
|
||||
|
|
|
|||
|
|
@ -198,8 +198,6 @@ end
|
|||
-- Load theme and custom decorations
|
||||
function decorations.init(theme_name)
|
||||
require("decorations.themes." .. theme_name)
|
||||
|
||||
-- TODO (work in progress)
|
||||
-- Custom decorations for specific clients
|
||||
require("decorations.mpd")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ local files = create_button("", x.color3, x.color11, apps.file_manager, "f")
|
|||
local gimp = create_button("", x.color5, x.color13, apps.gimp, "g")
|
||||
local youtube = create_button("", x.color1, x.color9, apps.youtube, "y")
|
||||
local networks = create_button("", x.color3, x.color11, apps.networks, "n")
|
||||
local passwords = create_button("", x.color1, x.color9, apps.passwords, "p")
|
||||
local passwords = create_button("", x.color1, x.color9, apps.passwords, "p")
|
||||
local night_mode = create_button("", x.color1, x.color9, apps.night_mode, "x")
|
||||
local record = create_button("", x.color4, x.color12, apps.record, "r")
|
||||
local lutris = create_button("", x.color6, x.color14, apps.lutris, "l")
|
||||
|
|
|
|||
|
|
@ -118,12 +118,7 @@ host_text.align = "center"
|
|||
host_text.valign = "center"
|
||||
local user_widget = wibox.widget {
|
||||
user_picture,
|
||||
-- Dummy widget for spacing
|
||||
{
|
||||
forced_height = dpi(30),
|
||||
-- forced_width = gen_button_margin,
|
||||
layout = wibox.layout.fixed.vertical
|
||||
},
|
||||
helpers.vertical_pad(dpi(30)),
|
||||
user_text,
|
||||
host_text,
|
||||
layout = wibox.layout.fixed.vertical
|
||||
|
|
|
|||
|
|
@ -69,13 +69,8 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
id = "bg_role",
|
||||
widget = wibox.container.background,
|
||||
create_callback = function(self, c, _, __)
|
||||
local i
|
||||
if class_icons[c.class] then
|
||||
i = c.class
|
||||
else
|
||||
i = '_'
|
||||
end
|
||||
self:get_children_by_id('text_icon')[1].markup = helpers.colorize_text(class_icons[i].symbol, class_icons[i].color)
|
||||
local i = class_icons[c.class] or class_icons['_']
|
||||
self:get_children_by_id('text_icon')[1].markup = helpers.colorize_text(i.symbol, i.color)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ require("evil.brightness")
|
|||
-- require("evil.spotify")
|
||||
|
||||
-- Internet access required
|
||||
-- Note: These daemons use a temp file to store the retrieved
|
||||
-- values in order to check its modification time and decide if it is time to update or not.
|
||||
-- Note: These daemons use a temp file to store the retrieved values in order
|
||||
-- to check its modification time and decide if it is time to update or not.
|
||||
-- No need to worry that you will be updating too often when restarting AwesomeWM :)
|
||||
-- This is useful because some APIs have a limit on the number of calls per hour.
|
||||
require("evil.coronavirus")
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ function helpers.prompt(action, textbox, prompt, callback)
|
|||
exe_callback = function(input)
|
||||
if not input or #input == 0 then return end
|
||||
awful.spawn.with_shell("noglob "..user.web_search_cmd.."'"..input.."'")
|
||||
naughty.notify { title = "Searching the web for", text = input, icon = icons.image.firefox }
|
||||
naughty.notify { title = "Searching the web for", text = input, icon = icons.image.firefox, urgency = "low" }
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ keys.globalkeys = gears.table.join(
|
|||
awful.key({ superkey }, "grave", function() sidebar_toggle() end,
|
||||
{description = "show or hide sidebar", group = "awesome"}),
|
||||
-- Toggle wibar(s)
|
||||
awful.key({ superkey, shiftkey }, "b", function() wibars_toggle() end,
|
||||
awful.key({ superkey }, "b", function() wibars_toggle() end,
|
||||
{description = "show or hide wibar(s)", group = "awesome"}),
|
||||
-- Emacs (O for org mode)
|
||||
awful.key({ superkey }, "o", apps.org,
|
||||
|
|
@ -595,7 +595,7 @@ keys.clientkeys = gears.table.join(
|
|||
helpers.float_and_resize(c, screen_width * 0.65, screen_height * 0.9)
|
||||
end)
|
||||
end),
|
||||
|
||||
|
||||
-- Relative move client
|
||||
awful.key({ superkey, shiftkey, ctrlkey }, "j", function (c)
|
||||
c:relative_move(0, dpi(20), 0, 0)
|
||||
|
|
@ -810,21 +810,15 @@ end
|
|||
-- Mouse buttons on the client (whole window, not just titlebar)
|
||||
keys.clientbuttons = gears.table.join(
|
||||
awful.button({ }, 1, function (c) client.focus = c end),
|
||||
-- awful.button({ }, 2, function (c)
|
||||
-- if c.class == "mpv" then
|
||||
-- -- mpv_osd_toggle(c:geometry())
|
||||
-- decorations.cycle(c)
|
||||
-- end
|
||||
-- end),
|
||||
awful.button({ superkey }, 1, awful.mouse.client.move),
|
||||
awful.button({ superkey }, 2, function (c) c:kill() end),
|
||||
-- awful.button({ superkey }, 2, function (c) c:kill() end),
|
||||
awful.button({ superkey }, 3, function(c)
|
||||
client.focus = c
|
||||
awful.mouse.client.resize(c)
|
||||
-- awful.mouse.resize(c, nil, {jump_to_corner=true})
|
||||
end),
|
||||
|
||||
-- Superkey + scrolling = Change client opacity
|
||||
-- Super + scroll = Change client opacity
|
||||
awful.button({ superkey }, 4, function(c)
|
||||
c.opacity = c.opacity + 0.1
|
||||
end),
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ local dotw_colors = {
|
|||
x.color9,
|
||||
x.color9,
|
||||
-- Different color for weekends ^_^
|
||||
x.color12,
|
||||
x.color12,
|
||||
x.color13,
|
||||
x.color13,
|
||||
}
|
||||
|
||||
local dotw_textboxes = {}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ mpd_next_symbol.valign = "center"
|
|||
|
||||
local note_symbol = ""
|
||||
local big_note = wibox.widget.textbox(note_symbol)
|
||||
big_note.font = "Material Icons Bold 16"
|
||||
big_note.font = "Material Icons Bold 15"
|
||||
big_note.align = "center"
|
||||
local small_note = wibox.widget.textbox()
|
||||
small_note.align = "center"
|
||||
|
|
@ -29,10 +29,10 @@ local double_note = wibox.widget {
|
|||
-- small_note,
|
||||
{
|
||||
small_note,
|
||||
top = dpi(8),
|
||||
top = dpi(11),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
spacing = dpi(-10),
|
||||
spacing = dpi(-9),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ awesome.connect_signal("evil::volume", function (percentage, muted)
|
|||
if first_time then
|
||||
first_time = false
|
||||
else
|
||||
if sidebar.visible or (client.focus and client.focus.class == "Pavucontrol") then
|
||||
if (sidebar and sidebar.visible) or (client.focus and client.focus.class == "Pavucontrol") then
|
||||
-- Sidebar and Pavucontrol already show volume, so
|
||||
-- destroy notification if it exists
|
||||
if notif then
|
||||
|
|
|
|||
|
|
@ -79,10 +79,10 @@ user = {
|
|||
terminal = "kitty -1",
|
||||
floating_terminal = "kitty -1",
|
||||
browser = "firefox",
|
||||
file_manager = "kitty -1 -e ranger",
|
||||
file_manager = "kitty -1 --class files -e ranger",
|
||||
editor = "kitty -1 --class editor -e vim",
|
||||
email_client = "kitty -1 --class email -e neomutt",
|
||||
music_client = "kitty -1 --class music -e ncmpcpp",
|
||||
music_client = "kitty -o font_size=12 --class music -e ncmpcpp",
|
||||
|
||||
-- >> Web Search <<
|
||||
web_search_cmd = "xdg-open https://duckduckgo.com/?q=",
|
||||
|
|
@ -120,7 +120,7 @@ user = {
|
|||
-- >> Battery <<
|
||||
-- You will receive notifications when your battery reaches these
|
||||
-- levels.
|
||||
battery_threshold_low = 15,
|
||||
battery_threshold_low = 20,
|
||||
battery_threshold_critical = 5,
|
||||
|
||||
-- >> Weather <<
|
||||
|
|
@ -196,7 +196,7 @@ end)
|
|||
|
||||
-- Features
|
||||
-- ===================================================================
|
||||
-- Initialize global icons variable and load icon theme
|
||||
-- Initialize icons array and load icon theme
|
||||
local icons = require("icons")
|
||||
icons.init(icon_theme)
|
||||
-- Keybinds and mousebinds
|
||||
|
|
@ -345,7 +345,9 @@ local floating_client_placement = function(c)
|
|||
end
|
||||
|
||||
local centered_client_placement = function(c)
|
||||
return awful.placement.centered(c, {honor_padding = true, honor_workarea=true})
|
||||
return gears.timer.delayed_call(function ()
|
||||
awful.placement.centered(c, {honor_padding = true, honor_workarea=true})
|
||||
end)
|
||||
end
|
||||
|
||||
-- Rules
|
||||
|
|
@ -427,6 +429,7 @@ awful.rules.rules = {
|
|||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
"lt-love",
|
||||
"portal2_linux",
|
||||
"csgo_linux64",
|
||||
"EtG.x86_64",
|
||||
|
|
@ -484,6 +487,9 @@ awful.rules.rules = {
|
|||
{
|
||||
rule_any = {
|
||||
instance = {
|
||||
"install league of legends (riot client live).exe",
|
||||
"gw2-64.exe",
|
||||
"battle.net.exe",
|
||||
"riotclientservices.exe",
|
||||
"leagueclientux.exe",
|
||||
"riotclientux.exe",
|
||||
|
|
@ -497,8 +503,8 @@ awful.rules.rules = {
|
|||
"Subl3",
|
||||
--"discord",
|
||||
--"TelegramDesktop",
|
||||
"Firefox",
|
||||
"firefox",
|
||||
"Nightly",
|
||||
"Steam",
|
||||
"Lutris",
|
||||
"Chromium",
|
||||
|
|
@ -508,6 +514,9 @@ awful.rules.rules = {
|
|||
},
|
||||
type = {
|
||||
"splash"
|
||||
},
|
||||
name = {
|
||||
"^discord.com is sharing your screen.$" -- Discord (running in browser) screen sharing popup
|
||||
}
|
||||
},
|
||||
callback = function(c)
|
||||
|
|
@ -535,6 +544,8 @@ awful.rules.rules = {
|
|||
rule_any = {
|
||||
class = {
|
||||
"TelegramDesktop",
|
||||
"firefox",
|
||||
"Nightly",
|
||||
},
|
||||
type = {
|
||||
"dialog",
|
||||
|
|
@ -809,7 +820,8 @@ awful.rules.rules = {
|
|||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
"[fF]irefox",
|
||||
"firefox",
|
||||
"Nightly",
|
||||
-- "qutebrowser",
|
||||
},
|
||||
},
|
||||
|
|
@ -825,6 +837,7 @@ awful.rules.rules = {
|
|||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
"underlords",
|
||||
"lt-love",
|
||||
"portal2_linux",
|
||||
"deadcells",
|
||||
|
|
@ -838,6 +851,7 @@ awful.rules.rules = {
|
|||
"trove.exe"
|
||||
},
|
||||
instance = {
|
||||
"love.exe",
|
||||
"synthetik.exe",
|
||||
"pathofexile_x64steam.exe",
|
||||
"leagueclient.exe",
|
||||
|
|
@ -859,6 +873,8 @@ awful.rules.rules = {
|
|||
"Slack",
|
||||
"TeamSpeak 3",
|
||||
"zoom",
|
||||
"weechat",
|
||||
"6cord",
|
||||
},
|
||||
},
|
||||
properties = { screen = 1, tag = awful.screen.focused().tags[3] }
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ theme.bg_normal = x.color0
|
|||
theme.bg_focus = x.color8
|
||||
theme.bg_urgent = x.color8
|
||||
theme.bg_minimize = x.color8
|
||||
theme.bg_systray = x.color8
|
||||
theme.bg_systray = x.background
|
||||
|
||||
theme.fg_normal = x.color8
|
||||
theme.fg_focus = x.color4
|
||||
theme.fg_urgent = x.color3
|
||||
theme.fg_urgent = x.color9
|
||||
theme.fg_minimize = x.color8
|
||||
|
||||
-- Gaps
|
||||
|
|
@ -172,7 +172,7 @@ theme.sidebar_position = "left" -- left or right
|
|||
theme.sidebar_width = dpi(300)
|
||||
theme.sidebar_x = 0
|
||||
theme.sidebar_y = 0
|
||||
theme.sidebar_border_radius = 0
|
||||
theme.sidebar_border_radius = dpi(40)
|
||||
-- theme.sidebar_border_radius = theme.border_radius
|
||||
|
||||
-- Dashboard
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue