feat: some stuff

This commit is contained in:
max_richter 2022-04-08 17:37:26 +02:00
parent f30fcd5da0
commit 1c225e141d
6 changed files with 28 additions and 2 deletions

View File

@ -40,6 +40,7 @@ set $password_mngr rofi-rbw --selector wofi --typer wtype --clipboarder wl-copy
set $bluetooth_mngr blueman-manager set $bluetooth_mngr blueman-manager
set $calculator flatpak run io.github.Qalculate set $calculator flatpak run io.github.Qalculate
set $photo_editor gtk-launch ~/.local/share/applications/photopea.desktop set $photo_editor gtk-launch ~/.local/share/applications/photopea.desktop
set $translator com.github.gi_lom.dialect
# Scripts # Scripts
set $config_editor ~/.config/sway/config_editor.sh set $config_editor ~/.config/sway/config_editor.sh
@ -112,6 +113,7 @@ input "1739:24385:Synaptics_TM2438-005" {
# Basics: # Basics:
# #
bindsym $mod+d exec $quickmenu bindsym $mod+d exec $quickmenu
bindsym $mod+t exec $translator
bindsym $mod+q kill bindsym $mod+q kill
bindsym $mod+Shift+q exec $wofi_scripts/wofi-power-menu.sh bindsym $mod+Shift+q exec $wofi_scripts/wofi-power-menu.sh
bindsym $mod+Return exec $term bindsym $mod+Return exec $term
@ -175,6 +177,7 @@ input "1739:24385:Synaptics_TM2438-005" {
# Workspaces: # Workspaces:
# #
for_window [class="zoom"] floating enable for_window [class="zoom"] floating enable
for_window [app_id="com.github.gi_lom.dialect"] floating enable, resize set 800 400, sticky enable
for_window [app_id="gnome-calculator"] floating enable for_window [app_id="gnome-calculator"] floating enable
for_window [app_id="qalculate-gtk"] floating enable for_window [app_id="qalculate-gtk"] floating enable
for_window [title="Zoom Meeting.*"] floating disable for_window [title="Zoom Meeting.*"] floating disable

View File

@ -3,9 +3,19 @@
$@ & $@ &
pid=$! pid=$!
# ALL_NODES='recurse(.nodes[]?, .floating_nodes[]?) | select(.pid and .visible)'
# echo "pid: $pid"
# all_nodes="$(swaymsg -t get_tree | jq -r "$ALL_NODES")"
# window_id="$(swaymsg -t get_tree | jq -r "$ALL_NODES" | jq -c ". | select(.pid==$pid) | .id")"
# echo "al: $all_nodes"
# echo "window_id: $window_id"
swaymsg -t subscribe -m '[ "window" ]' \ swaymsg -t subscribe -m '[ "window" ]' \
| jq --unbuffered --argjson pid "$pid" '.container | select(.pid == $pid) | .id' \ | jq --unbuffered --argjson pid "$pid" '.container | select(.pid == $pid) | .id' \
| xargs -I '@' -- swaymsg '[ con_id=@ ] floating enable, resize set 600 450' & | xargs -I '@' -- swaymsg '[ con_id=@ ] floating enable' &
subscription=$! subscription=$!

View File

@ -6,7 +6,7 @@ ID_PREFIX='"\(.pid):"'
WINDOW_PROTOCOL='(if .shell == "xwayland" then "X11" else "wayland" end)' WINDOW_PROTOCOL='(if .shell == "xwayland" then "X11" else "wayland" end)'
WINDOW_GEOMETRY='(.rect | "\(.x),\(.y) \(.width)x\(.height) ")' WINDOW_GEOMETRY='(.rect | "\(.x),\(.y) \(.width)x\(.height) ")'
WINDOW_PID='(.id | tostring)' WINDOW_PID='(.id | tostring)'
CLEAR_OBJ="del(.focus, .border, .current_border_width, .window_rect, .orientation, .layout, .percent, .deco_rect, .geometry, .window, .urgent, .marks, .sticky, .fullscreen_mode, .nodes, .floating_nodes, .shell, .max_render_time, .visible, .idle_inhibitors, .inhibit_idle)" CLEAR_OBJ="del(.focus, .pid, .border, .current_border_width, .window_rect, .orientation, .layout, .percent, .deco_rect, .geometry, .window, .urgent, .marks, .sticky, .fullscreen_mode, .nodes, .floating_nodes, .shell, .max_render_time, .visible, .idle_inhibitors, .inhibit_idle)"
# Output format, e.g. "1234 - 12:firefox (wayland)" or "5678 - 17:discord (X11)" # Output format, e.g. "1234 - 12:firefox (wayland)" or "5678 - 17:discord (X11)"
FILT="$ALL_NODES | $WINDOW_GEOMETRY + $WINDOW_PID" FILT="$ALL_NODES | $WINDOW_GEOMETRY + $WINDOW_PID"

View File

@ -158,6 +158,7 @@
"on-click": "kitty -e htop" "on-click": "kitty -e htop"
}, },
"custom/waybar-mpris": { "custom/waybar-mpris": {
"max-length": 30,
"return-type": "json", "return-type": "json",
"exec": "waybar-mpris --position --autofocus", "exec": "waybar-mpris --position --autofocus",
"on-click": "waybar-mpris --send toggle", "on-click": "waybar-mpris --send toggle",

View File

@ -11,3 +11,4 @@ source $(dirname "$0")/functions/cht.zsh;
source $(dirname "$0")/functions/run.zsh; source $(dirname "$0")/functions/run.zsh;
source $(dirname "$0")/functions/conf.zsh; source $(dirname "$0")/functions/conf.zsh;
source $(dirname "$0")/functions/note.zsh; source $(dirname "$0")/functions/note.zsh;
source $(dirname "$0")/functions/mv-safe.zsh;

View File

@ -0,0 +1,11 @@
function mv-safe(){
for OLD_NAME in "$@"
do
NEW_NAME="$(echo $OLD_NAME | sed -e 'y/āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜĀÁǍÀĒÉĚÈĪÍǏÌŌÓǑÒŪÚǓÙǕǗǙǛ/aaaaeeeeiiiioooouuuuüüüüAAAAEEEEIIIIOOOOUUUUÜÜÜÜ/' | sed -e 's/[^A-Za-z0-9._-]/_/g')"
if [ $OLD_NAME != $NEW_NAME ]; then
mv $OLD_NAME $NEW_NAME;
else
echo "No need to rename $OLD_NAME";
fi
done
}