feat: optimization for mobile scenario

This commit is contained in:
Klesh Wong 2022-05-25 00:26:22 +08:00
parent a699d5a038
commit 25fa2b127b
2 changed files with 18 additions and 11 deletions

View File

@ -2,13 +2,19 @@
if mpc status | grep -F '[playing]'; then if mpc status | grep -F '[playing]'; then
mpc pause mpc pause
RESTORE=1 RESTORE_MPD=1
fi
if command -v bluetoothctl >/dev/null; then
RESTORE_BLU=$(bluetoothctl show | grep -F "Powered: yes")
fi fi
if [ -n "$LOCKER" ]; then if [ -n "$LOCKER" ]; then
$LOCKER $LOCKER
else else
slock slock
fi fi
if [ "$RESTORE" = 1 ]; then if [ "$RESTORE_MPD" = 1 ]; then
mpc play mpc play
fi fi
if [ -n "$RESTORE_BLU" ]; then
bluetoothctl power on
fi

View File

@ -281,10 +281,11 @@ awful.screen.connect_for_each_screen(function(s)
screen = s, screen = s,
filter = awful.widget.tasklist.filter.currenttags, filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons, buttons = tasklist_buttons,
layout = { --layout = {
spacing = 10, --spacing = 10,
layout = wibox.layout.fixed.horizontal, --forced_width = 100,
}, --layout = wibox.layout.fixed.horizontal,
--},
update_function = function(w, buttons, label, data, clients, args) update_function = function(w, buttons, label, data, clients, args)
s.mytasklist.clientlist = clients s.mytasklist.clientlist = clients
--for k, v in pairs(data) do --for k, v in pairs(data) do
@ -540,7 +541,9 @@ globalkeys = gears.table.join(
-- Dict.sh -- Dict.sh
awful.key({ modkey }, "t", function() awful.spawn.with_shell('D_SELECTOR="rofi -dmenu -p dict.sh" d "$(xsel -o)"') end, awful.key({ modkey }, "t", function() awful.spawn.with_shell('D_SELECTOR="rofi -dmenu -p dict.sh" d "$(xsel -o)"') end,
{description = "dict.sh", group = "launcher"}) {description = "dict.sh", group = "launcher"}),
awful.key({ modkey }, "o", function() awful.spawn.with_shell('find ~/Nextcloud/notes/ | rofi -dmenu -title notes | xargs xdg-open') end,
{description = "open note", group = "launcher"})
) )
clientkeys = gears.table.join( clientkeys = gears.table.join(
@ -558,10 +561,6 @@ clientkeys = gears.table.join(
{description = "move to master", group = "client"}), {description = "move to master", group = "client"}),
--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"}),
awful.key({ modkey, }, "o", function (c)
awful.spawn.with_shell("find ~/Nextcloud/notes/ | rofi -dmenu -title notes | xargs xdg-open")
end,
{description = "open note", group = "hotkeys"}),
--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"}),
awful.key({ modkey, }, "n", awful.key({ modkey, }, "n",
@ -747,6 +746,7 @@ awful.rules.rules = {
"file-roller", "file-roller",
}, },
class = { class = {
"Thunar",
"Arandr", "Arandr",
"Blueman-manager", "Blueman-manager",
"Gpick", "Gpick",
@ -859,5 +859,6 @@ awful.spawn.with_shell("flameshot")
--awful.spawn.with_shell("blueman-applet") --awful.spawn.with_shell("blueman-applet")
awful.spawn.with_shell("nm-applet") awful.spawn.with_shell("nm-applet")
awful.spawn.with_shell("copyq") awful.spawn.with_shell("copyq")
awful.spawn.with_shell("bluetoothctl power on")
-- }}} -- }}}