config
This commit is contained in:
parent
5c078feab5
commit
d8eae8a1a5
@ -3,12 +3,12 @@
|
|||||||
role="$1"
|
role="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
session_ts="$(date +%s)"
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
aichat --role "$role" "$@"
|
aichat --save-session --session "$session_ts" --role "$role" "$@"
|
||||||
else
|
fi
|
||||||
session_ts="$(date +%s)"
|
|
||||||
while true; do
|
while true; do
|
||||||
read -e -r -p "> " input
|
read -e -r -p "> " input
|
||||||
aichat --save-session --session "$session_ts" --role "$role" "$input"
|
aichat --save-session --session "$session_ts" --role "$role" "$input"
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
17
arch-user/bin/sway/focus-cousin.sh
Executable file
17
arch-user/bin/sway/focus-cousin.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
parent_has_sibl=$(swaymsg -t get_tree | jq '
|
||||||
|
def find_focused_path:
|
||||||
|
if .focused then [.]
|
||||||
|
elif .nodes then
|
||||||
|
[.] + (.nodes[] | find_focused_path | select(length > 0))
|
||||||
|
else empty
|
||||||
|
end;
|
||||||
|
find_focused_path | if length >= 3 and .[-2].type=="con" then 1 else 0 end
|
||||||
|
')
|
||||||
|
|
||||||
|
if [ "$parent_has_sibl" = 1 ]; then
|
||||||
|
swaymsg "focus parent; focus $1 sibling; focus child"
|
||||||
|
else
|
||||||
|
swaymsg "focus $1 sibling; focus child"
|
||||||
|
fi
|
60
arch-user/bin/sway/search-mode.sh
Executable file
60
arch-user/bin/sway/search-mode.sh
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
MAX_TITLE_LENGTH=600
|
||||||
|
|
||||||
|
get_windows_with_workspace() {
|
||||||
|
swaymsg -t get_tree | jq -r --arg max_len "$MAX_TITLE_LENGTH" '
|
||||||
|
def get_workspace_name(node):
|
||||||
|
if node.type == "workspace" then node.name
|
||||||
|
elif node.parent then get_workspace_name(node.parent)
|
||||||
|
else "Unknown" end;
|
||||||
|
|
||||||
|
def get_windows(workspace_name):
|
||||||
|
if .type == "con" and .pid != null and (.name // "") != "" then
|
||||||
|
{
|
||||||
|
id: .id,
|
||||||
|
name: .name,
|
||||||
|
app_id: (.app_id // .window_properties.class // "Unknown"),
|
||||||
|
workspace: workspace_name,
|
||||||
|
focused: .focused
|
||||||
|
}
|
||||||
|
else empty end,
|
||||||
|
(.nodes[]? | get_windows(workspace_name)),
|
||||||
|
(.floating_nodes[]? | get_windows(workspace_name));
|
||||||
|
|
||||||
|
def get_workspaces:
|
||||||
|
if .type == "workspace" then
|
||||||
|
. as $ws | .name as $ws_name | get_windows($ws_name)
|
||||||
|
else empty end,
|
||||||
|
(.nodes[]? | get_workspaces);
|
||||||
|
|
||||||
|
get_workspaces |
|
||||||
|
"\(.id)|\(.app_id)|\(.name)|\(.workspace)|\(.focused)"
|
||||||
|
'
|
||||||
|
}
|
||||||
|
window_list=$(get_windows_with_workspace)
|
||||||
|
|
||||||
|
formatted_list=$(echo "$window_list" | while IFS='|' read -r id app_id name workspace focused; do
|
||||||
|
if [ ${#name} -gt $MAX_TITLE_LENGTH ]; then
|
||||||
|
truncated_name="${name:0:$((MAX_TITLE_LENGTH-3))}..."
|
||||||
|
else
|
||||||
|
truncated_name="$name"
|
||||||
|
fi
|
||||||
|
if [ "$focused" = "true" ]; then
|
||||||
|
indicator="> "
|
||||||
|
else
|
||||||
|
indicator=" "
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "[%s/%s]%s %s: %s\n" "$workspace" "$id" "$indicator" "$app_id" "$truncated_name"
|
||||||
|
done)
|
||||||
|
|
||||||
|
selection=$(echo "$formatted_list" | bemenu --prompt "/" --index "$(echo "$formatted_list" | awk '/]>/ {print NR-1 ":" $0}')" )
|
||||||
|
[ -z "$selection" ] && exit 0
|
||||||
|
|
||||||
|
window_id=$(echo "$selection" | sed 's/.*\/\([^]]*\)].*/\1/')
|
||||||
|
|
||||||
|
if [ -n "$window_id" ]; then
|
||||||
|
swaymsg "[con_id=\"$window_id\"] focus"
|
||||||
|
else
|
||||||
|
echo "Failed to extract window ID."
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -16,6 +16,7 @@ default_border pixel 2
|
|||||||
gaps inner 4
|
gaps inner 4
|
||||||
smart_borders on
|
smart_borders on
|
||||||
smart_gaps on
|
smart_gaps on
|
||||||
|
show_marks on
|
||||||
title_align center
|
title_align center
|
||||||
font pango:{{ .theme.font.name_regular }} {{ .theme.font.size_base_pt }}
|
font pango:{{ .theme.font.name_regular }} {{ .theme.font.size_base_pt }}
|
||||||
output * bg #{{ .theme.color.bg }} solid_color
|
output * bg #{{ .theme.color.bg }} solid_color
|
||||||
@ -74,6 +75,11 @@ bindgesture swipe:left workspace next
|
|||||||
############################################
|
############################################
|
||||||
|
|
||||||
############### containers #################
|
############### containers #################
|
||||||
|
# numeric row
|
||||||
|
bindsym --to-code {
|
||||||
|
$mod+Minus opacity minus 0.05
|
||||||
|
$altmod+Minus opacity plus 0.05
|
||||||
|
}
|
||||||
# top row - layouts
|
# top row - layouts
|
||||||
bindsym --to-code {
|
bindsym --to-code {
|
||||||
$mod+p layout splitv
|
$mod+p layout splitv
|
||||||
@ -91,12 +97,12 @@ bindsym --to-code {
|
|||||||
}
|
}
|
||||||
# mid row - focus, movement
|
# mid row - focus, movement
|
||||||
bindsym --to-code {
|
bindsym --to-code {
|
||||||
$mod+$fwd focus child
|
$mod+$fwd exec ~/.local/bin/sway/focus-cousin.sh prev
|
||||||
$mod+$left focus left
|
$mod+$left focus left
|
||||||
$mod+$up focus up
|
$mod+$up focus up
|
||||||
$mod+$down focus down
|
$mod+$down focus down
|
||||||
$mod+$right focus right
|
$mod+$right focus right
|
||||||
$mod+$bwd focus parent
|
$mod+$bwd exec ~/.local/bin/sway/focus-cousin.sh next
|
||||||
$altmod+$left move left 40px
|
$altmod+$left move left 40px
|
||||||
$altmod+$up move up 40px
|
$altmod+$up move up 40px
|
||||||
$altmod+$down move down 40px
|
$altmod+$down move down 40px
|
||||||
@ -110,17 +116,14 @@ bindsym --to-code {
|
|||||||
bindsym --to-code {
|
bindsym --to-code {
|
||||||
$mod+d scratchpad show
|
$mod+d scratchpad show
|
||||||
$altmod+d sticky enable; move scratchpad
|
$altmod+d sticky enable; move scratchpad
|
||||||
$mod+z focus tiling
|
$mod+k focus floating
|
||||||
$altmod+z focus floating; floating disable; sticky disable
|
$altmod+k floating enable; sticky enable
|
||||||
$mod+h focus floating
|
$mod+h focus tiling
|
||||||
$altmod+h floating enable; sticky enable
|
$altmod+h focus floating; floating disable; sticky disable
|
||||||
$mod+k focus prev sibling
|
|
||||||
$mod+Comma opacity minus 0.05
|
|
||||||
$mod+Period opacity plus 0.05
|
|
||||||
$mod+slash focus next sibling
|
|
||||||
$mod+x exec wtype -M ctrl x -m ctrl
|
$mod+x exec wtype -M ctrl x -m ctrl
|
||||||
$mod+c exec wtype -M ctrl c -m ctrl
|
$mod+c exec wtype -M ctrl c -m ctrl
|
||||||
$mod+v exec wtype -M ctrl v -m ctrl
|
$mod+v exec wtype -M ctrl v -m ctrl
|
||||||
|
$mod+Slash exec ~/.local/bin/sway/search-mode.sh
|
||||||
}
|
}
|
||||||
floating_modifier $mod normal
|
floating_modifier $mod normal
|
||||||
############################################
|
############################################
|
||||||
|
Loading…
Reference in New Issue
Block a user