Compare commits
5 commits
5eb1eee3d2
...
63bd48abf6
Author | SHA1 | Date | |
---|---|---|---|
63bd48abf6 | |||
532ec3e17f | |||
444b82680d | |||
d8ca4ecaf9 | |||
b63a8318a9 |
|
@ -312,11 +312,11 @@
|
||||||
"vimwiki-cli": "vimwiki-cli"
|
"vimwiki-cli": "vimwiki-cli"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671858011,
|
"lastModified": 1672200014,
|
||||||
"narHash": "sha256-H1y+8HuPDv2DQxD80/HU/ifT/q/Qn3SB3B56MMgM9Ro=",
|
"narHash": "sha256-gJW+GktGJAMmb5WRs2rcUQI673Jx148pWwwejJjIL04=",
|
||||||
"ref": "main",
|
"ref": "main",
|
||||||
"rev": "6e83e0cf52e84c9abc1bb95e9c90eac3da8b3c53",
|
"rev": "7143809a518037b4ad4ef0762a3e8f42cd99a790",
|
||||||
"revCount": 468,
|
"revCount": 473,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
|
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
|
||||||
},
|
},
|
||||||
|
|
19
home/profiles/cli/dasht-queries.txt
Normal file
19
home/profiles/cli/dasht-queries.txt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
`dasht-docsets-intstall`
|
||||||
|
|
||||||
|
Bash
|
||||||
|
Clojure
|
||||||
|
Docker
|
||||||
|
Elixir
|
||||||
|
HTML
|
||||||
|
JavaScript
|
||||||
|
Jinja
|
||||||
|
Lua_5.4
|
||||||
|
Nginx
|
||||||
|
OpenGL_4
|
||||||
|
PostgreSQL
|
||||||
|
Processing
|
||||||
|
Python_3
|
||||||
|
React
|
||||||
|
Rust
|
||||||
|
TypeScript
|
||||||
|
Vim
|
71
home/profiles/desktop/bin/bspswallow
Executable file
71
home/profiles/desktop/bin/bspswallow
Executable file
|
@ -0,0 +1,71 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Get class of a wid
|
||||||
|
get_class() {
|
||||||
|
id=$1
|
||||||
|
if [ -z "$id" ]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
xprop -id "$id" | sed -n \
|
||||||
|
-e '/WM_CLASS/s/\( "\)/\n/g; s/[^\n]*\n\([^"]*\)[^\n]*/\1\n/g' \
|
||||||
|
-e '/WM_COMMAND/s/[^"]*/\n\n/1; s/\n"//1; s/\n\([^"]*\)".*/\n\1/; /\n/p' | sed '/^$/d' | head -n1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_pid() {
|
||||||
|
xprop _NET_WM_PID -id "$1" | awk '/[0-9]+/ {print $3}'
|
||||||
|
}
|
||||||
|
|
||||||
|
get_ppid() {
|
||||||
|
ps -o ppid= -p $1
|
||||||
|
}
|
||||||
|
|
||||||
|
check_swallowing_process() {
|
||||||
|
pid=$(get_pid $1)
|
||||||
|
[ -z $pid ] && return 0
|
||||||
|
gppid=$(get_ppid $(get_ppid $pid))
|
||||||
|
grep -i "^$(ps -o cmd= -p $gppid | awk '{print $1}' | sed 's_^.*/__')$" ~/.config/bspwm/terminals && return 0
|
||||||
|
[ "$(get_ppid "$(get_ppid "$(get_pid "$1")")")" = "$(get_pid "$2")" ] && return 0 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
swallow() {
|
||||||
|
addedtodesktop=$2
|
||||||
|
lasttermdesktop=$(bspc query -D -n last)
|
||||||
|
|
||||||
|
swallowerid=$1
|
||||||
|
swallowingid=$(bspc query -N -n last)
|
||||||
|
if [ "$addedtodesktop" = "$lasttermdesktop" ] && check_swallowing_process "$swallowerid" "$swallowingid"; then
|
||||||
|
grep -q "^$(get_class "$swallowerid")$" ~/.config/bspwm/{noswallow, terminals} && return
|
||||||
|
grep -i "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return
|
||||||
|
echo "$swallowerid $swallowingid" >> /tmp/swallowids
|
||||||
|
bspc node "$swallowingid" --flag hidden=on
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
spit() {
|
||||||
|
spitterid=$1
|
||||||
|
spitterdesktop=$2
|
||||||
|
grep "^$spitterid" /tmp/swallowids || return
|
||||||
|
spittingid=$(grep "^$spitterid" /tmp/swallowids | head -n1 | awk '{print $2}')
|
||||||
|
|
||||||
|
bspc node "$spittingid" --flag hidden=off
|
||||||
|
|
||||||
|
termdesktop=$(bspc query -D -n "$spittingid")
|
||||||
|
[ "$termdesktop" = "$spitterdesktop" ] || bspc node "$spittingid" -d "$spitterdesktop"
|
||||||
|
|
||||||
|
bspc node "$spittingid" -f
|
||||||
|
sed -i "/^$spitterid/d" /tmp/swallowids
|
||||||
|
}
|
||||||
|
|
||||||
|
bspc subscribe node_add node_remove | while read -r event
|
||||||
|
do
|
||||||
|
case $(echo "$event" | awk '{ print $1 }') in
|
||||||
|
node_add)
|
||||||
|
swallow $(echo "$event" | awk '{print $5 " " $3}')
|
||||||
|
;;
|
||||||
|
node_remove)
|
||||||
|
spit $(echo "$event" | awk '{print $4 " " $3}')
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
|
@ -39,7 +39,10 @@ bspc rule -a Pinentry state=floating center=on
|
||||||
bspc rule -a Firefox state=fullscreen
|
bspc rule -a Firefox state=fullscreen
|
||||||
bspc rule -a feh state=fullscreen
|
bspc rule -a feh state=fullscreen
|
||||||
|
|
||||||
|
# bspswallow
|
||||||
|
pgrep bspswallow || bspswallow &
|
||||||
|
|
||||||
# polybar
|
# polybar
|
||||||
for file in $XDG_CONFIG_HOME/bspwm/rc.d/*; do
|
for file in "$XDG_CONFIG_HOME"/bspwm/rc.d/*; do
|
||||||
source "$file"
|
source "$file"
|
||||||
done
|
done
|
||||||
|
|
|
@ -116,6 +116,7 @@ in
|
||||||
".local/bin/powermenu".source = ./bin/powermenu;
|
".local/bin/powermenu".source = ./bin/powermenu;
|
||||||
".local/bin/screenshot".source = ./bin/screenshot;
|
".local/bin/screenshot".source = ./bin/screenshot;
|
||||||
".local/bin/mpv-ify".source = ./bin/mpv-ify;
|
".local/bin/mpv-ify".source = ./bin/mpv-ify;
|
||||||
|
".local/bin/bspwallow".source = ./bin/bspswallow;
|
||||||
".config/eww/eww.yuck".source = ./eww/eww.yuck;
|
".config/eww/eww.yuck".source = ./eww/eww.yuck;
|
||||||
".config/eww/eww.scss".source = ./eww/eww.scss;
|
".config/eww/eww.scss".source = ./eww/eww.scss;
|
||||||
".config/eww/widgets.yuck".source = ./eww/widgets.yuck;
|
".config/eww/widgets.yuck".source = ./eww/widgets.yuck;
|
||||||
|
|
|
@ -467,6 +467,14 @@ in
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||||
|
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.border = opts.border or 'rounded'
|
||||||
|
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>vt', ':call v:lua.toggle_diagnostics()<CR>', {noremap = true, silent = true})
|
vim.api.nvim_set_keymap('n', '<leader>vt', ':call v:lua.toggle_diagnostics()<CR>', {noremap = true, silent = true})
|
||||||
|
|
||||||
-- autopairs
|
-- autopairs
|
||||||
|
|
Loading…
Reference in a new issue