major ui improvements

This commit is contained in:
kp2pml30 2025-03-20 13:21:56 +04:00
parent 8ef03fdd80
commit 3fc17746d0
14 changed files with 143 additions and 9488 deletions

View file

@ -23,9 +23,11 @@ require("awful.hotkeys_popup.keys")
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
naughty.notify({
preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors
})
end
-- Handle runtime errors after startup
@ -36,9 +38,11 @@ do
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err) })
naughty.notify({
preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err)
})
in_error = false
end)
end
@ -93,13 +97,17 @@ myawesomemenu = {
{ "quit", function() awesome.quit() end },
}
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal }
}
})
mymainmenu = awful.menu({
items = {
{ "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal }
}
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
mylauncher = awful.widget.launcher({
image = beautiful.awesome_icon,
menu = mymainmenu
})
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
@ -180,6 +188,7 @@ for i = 1,9 do
all_tags[i - 1] = awful.tag.add(tostring(i), {
screen = awful.screen.primary,
layout = awful.layout.layouts[1],
selected = (i == 1),
}
)
end
@ -188,6 +197,8 @@ local function screen_delta(delta)
local cur_screen = awful.screen.focused()
local tag = cur_screen.selected_tag
if tag == nil then return end
local all_screens = {}
local i = 0
local idx = 0
@ -215,15 +226,22 @@ awful.screen.connect_for_each_screen(function(s)
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)
))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = taglist_buttons
buttons = taglist_buttons,
update_function = function(w, buttons, label, data, objects, args)
table.sort(objects, function(l, r)
return l.name < r.name
end)
return awful.widget.common.list_update(w, buttons, label, data, objects, args)
end,
}
-- Create a tasklist widget
@ -270,13 +288,13 @@ root.buttons(gears.table.join(
-- {{{ Key bindings
globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
{description="show help", group="awesome"}),
awful.key({ modkey, "Shift" }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
{description = "view previous", group = "tag"}),
awful.key({ modkey, "Shift" }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "Left",
function ()
@ -293,15 +311,15 @@ globalkeys = gears.table.join(
-- Layout manipulation
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,
{description = "swap with previous client by index", group = "client"}),
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 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,
{description = "focus the previous screen", group = "screen"}),
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
@ -313,60 +331,60 @@ globalkeys = gears.table.join(
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Shift" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "d", function () awful.spawn("rofi -show drun -drun-show-actions") end,
{description = "run prompt", group = "launcher"}),
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"}),
{description = "show the menubar", group = "launcher"}),
-- fns
awful.key({}, "XF86AudioRaiseVolume", function() my_volume:up() end),
@ -398,15 +416,15 @@ clientkeys = gears.table.join(
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey }, "q", function (c) c:kill() end,
{description = "close", group = "client"}),
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
{description = "toggle floating", group = "client"}),
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"}),
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, }, "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",
function (c)
-- The client currently has the input focus, so it cannot be
@ -488,52 +506,61 @@ root.keys(globalkeys)
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
{
rule = { },
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Floating clients.
{ rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
},
class = {
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer"},
{
rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
},
class = {
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer"
},
-- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here.
name = {
"Event Tester", -- xev.
-- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here.
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = { floating = true }},
properties = { floating = true }
},
-- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = true }
{
rule_any = {
type = { "normal", "dialog" }
},
properties = { titlebars_enabled = true }
},
-- Set Firefox to always map on the tag named "2" on screen 1.
@ -550,8 +577,8 @@ client.connect_signal("manage", function (c)
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup
and not c.size_hints.user_position
and not c.size_hints.program_position then
and not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end

View file

@ -1,30 +1,6 @@
function read_confirm
while true
read -l -P "$argv [y/N] " confirm
switch $confirm
case Y y
return 0
case '' N n
return 1
end
end
end
function fish_greeting
if status is-interactive && ! test -f /encrypt/.exists && test -f ~/encrypted.vhdx
if test -f /tmp/.skip-encrypt
echo "Encrypted drive not installed"
return
end
touch /tmp/.skip-encrypt
if read_confirm "Setup encrypted drive?"
set home "$HOME"
printf "su "
sudo bash -c "losetup /dev/loop0 '$HOME/encrypted.vhdx' && cryptsetup open /dev/loop0 loop0 && mount /dev/mapper/loop0 /encrypt"
echo "success: $status"
end
end
alias clear="printf '\033[2J\033[3J\033[1;1H'"
if test -f ~/.bashrc
bass source ~/.bashrc
end
if status is-interactive
@ -32,18 +8,3 @@ if status is-interactive
zoxide init fish | source
end
end
#if test -f ~/.ghcup/env
# bass source ~/.ghcup/env
#end
#if test -x ~/.rbenv/bin/rbenv
# ~/.rbenv/bin/rbenv init - fish | source
#end
#if test -f ~/.opam/opam-init/init.fish
# source ~/.opam/opam-init/init.fish
#end
alias clear="printf '\033[2J\033[3J\033[1;1H'"
export PATH="$PATH:$KP2PATH"
if set -uq KP2COMPLETIONS
eval "$KP2COMPLETIONS"
end
bass source ~/.bashrc

View file

@ -1,43 +0,0 @@
function __scrap_select
for cmd in $argv
if command -v "$cmd" 2> /dev/null > /dev/null
command -v "$cmd"
return
end
end
end
function 'scrap-default-tool-paths'
env > /tmp/env-before
set -Ux PYENV_ROOT $HOME/.pyenv
set -le NP
for dir in "$HOME/.cargo/bin" "$HOME/.local/bin" "$HOME/.bin" "$HOME/.ghcup/bin" "$HOME/.cabal/bin" "$HOME/go/bin" "$HOME/.pyenv/bin"
if test -d "$dir"
echo "$dir exists"
if test -n "$NP"
set NP "$NP:$dir"
else
set NP "$dir"
end
end
end
echo "found path is $NP"
set -U KP2PATH "$NP"
set -l OLDP "$PATH"
set PATH "$NP:$PATH"
set -le COMPLETIONS
if command -v poetry > /dev/null
IFS='' set -l out (poetry completions fish)
set COMPLETIONS "$COMPLETIONS"\n"$out"
end
IFS='' set -U KP2COMPLETIONS "$COMPLETIONS"
set -Ux EDITOR (__scrap_select nvim vim vi)
set -Ux PAGER (__scrap_select less more)
set -Ux GIT_EDITOR "$EDITOR"
set PATH "$OLDP"
env > /tmp/env-after
diff /tmp/env-before /tmp/env-after
rm /tmp/env-after /tmp/env-before
end

View file

@ -1,2 +0,0 @@
alias clear="printf '\033[2J\033[3J\033[1;1H'"
bass source ~/.bashrc

View file

@ -1 +0,0 @@
rofi.theme: ~/.config/rofi/simple-tokyonight.rasi

View file

@ -0,0 +1 @@
@theme "simple-tokyonight"

View file

@ -1,4 +1,5 @@
# See https://github.com/newmanls/rofi-themes-collection/tree/master (GPLv3)
// See https://github.com/newmanls/rofi-themes-collection/tree/master (GPLv3)
// This version may be modified
* {
font: "Iosevka Nerd Font Medium 11";
@ -32,11 +33,6 @@ element-icon, element-text, scrollbar {
}
window {
location : northwest;
width : 280px;
x-offset : 4px;
y-offset : 26px;
background-color: @bg1;
border: 1px;
border-color: @bg3;

View file

@ -42,8 +42,10 @@ in lib.mkIf cfg.xserver {
home-manager.users.${cfg.username} = {
programs.rofi = {
enable = true;
theme = "simple-tokyonight";
location = "center";
};
home.file.".config/rofi" = { source = rootPath + "/home/.config/rofi"; recursive = true; };
home.file.".config/rofi/simple-tokyonight.rasi" = { source = rootPath + "/home/.config/rofi/simple-tokyonight.rasi"; };
home.file.".config/awesome/rc.lua" = { source = rootPath + "/home/.config/awesome/rc.lua"; };
home.file.".config/awesome/theme.lua" = { source = rootPath + "/home/.config/awesome/theme.lua"; };

View file

@ -33,6 +33,7 @@ in {
makeWorkDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run mkdir -p ~/work/personal
run mkdir -p ~/work/experiments
run mkdir -p ~/.sock
'';
};
};
@ -55,7 +56,7 @@ in {
fish = {
enable = true;
shellInitLast = builtins.readFile (rootPath + "/home/.config/fish/minimal.fish");
shellInitLast = builtins.readFile (rootPath + "/home/.config/fish/config.fish");
};
starship = {

View file

@ -1,11 +0,0 @@
import secrets
with open("words.txt", "rt") as f:
lines = [l.strip() for l in f]
bits = secrets.randbits(300)
mx = len(lines)
while bits > 0:
print(lines[bits % mx], end=' ')
bits //= mx
print()

View file

@ -1,38 +0,0 @@
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if ! command -v nvim
then
echo "no nvim"
exit 1
fi
if ! command -v base64
then
echo "no base64"
exit 1
fi
if ! command -v openssl
then
echo "no openssl"
exit 1
fi
if ! command -v python3
then
echo "no python3"
exit 1
fi
echo -n Password:
read -s password
echo
PASS="$password" nvim --clean -n \
-u "$SCRIPT_DIR/script.vim" \
"$SCRIPT_DIR/secrets.txt"

View file

@ -1,43 +0,0 @@
set nobackup nowritebackup noundofile noswapfile viminfo= history=0 noshelltemp secure
function! s:OpenSSLReadPre()
endfunction
function! s:OpenSSLReadPost()
silent! execute "0,$!openssl enc -aes-256-cbc -pbkdf2 -iter 1000000 -base64 -d -k '" . $PASS . "'"
if v:shell_error
silent! 0,$y
silent! undo
echo "Note that your version of openssl may not have the given cipher engine built-in"
echo "even though the engine may be documented in the openssl man pages."
echo "ERROR FROM OPENSSL:"
echo @"
echo "COULD NOT DECRYPT"
return
endif
redraw!
endfunction
function! s:OpenSSLWritePre()
silent! execute "0,$!openssl enc -aes-256-cbc -pbkdf2 -iter 1000000 -base64 -k '" . $PASS . "'"
if v:shell_error
silent! 0,$y
silent! undo
echo "Note that your version of openssl may not have the given cipher engine built in"
echo "even though the engine may be documented in the openssl man pages."
echo "ERROR FROM OPENSSL:"
echo @"
echo "COULD NOT ENCRYPT"
return
endif
endfunction
function! s:OpenSSLWritePost()
"silent! undo
"redraw!
endfunction
autocmd BufReadPre,FileReadPre * call s:OpenSSLReadPre()
autocmd BufReadPost,FileReadPost * call s:OpenSSLReadPost()
autocmd BufWritePre,FileWritePre * call s:OpenSSLWritePre()
autocmd BufWritePost,FileWritePost * call s:OpenSSLWritePost()

View file

@ -1,10 +0,0 @@
U2FsdGVkX1/IejDwU8laqAtttoC3wuFgOGjO9OVcGAUSAlXEH8QEmUEGuY/DReH8
nWpffl36C0Q7Jzrdx1xQIQW0G9d+rtaPy4myUdZjinR/9930tND05a8RvcLxQdGm
jjAaGkGB1H+JynoS9QB5bMpLb/ub+aOdKFP/mginc54h51jPblQ+ZnPbgICXwyP6
SxyniQaGhDKymr4mxbchXGnvaVFNetYtepD4+VgU1ksl9z06bHsY25YfEmU+TssO
9wn6a4gnq2jf43oL1epL9KuXPyKW3X+VOB7i4jVHSdUiryQJbYclWyUpcpjMCgNF
YQeMGYf/Ga1VQkFhudgXJKTB83jTsgblQnpU0mRBOuygWTtkPyp1jxMJkmx+WI6x
1QVIc5UiC9o5hVy4oMgpsgJOCbT4551xhknG5QFbjb9zclNCfuGG0wVmh4BIs8o+
IOP6WzttO56UilKHFNpnMXLPCFhUpYO7a3Io3n7VlBBbBd2QF5dJtfsfCJvLmyA6
pFDO/RwiAgMVJG6oeVDK38gfvOZzcGyzAv/11+NOlhg5Hii6Q/p7meI/OEICMH7W
s2WF3hjIMxRD3gBDgTYLR6SvOLLpUasACf7hZL+tULU=

File diff suppressed because it is too large Load diff