scratch terminal acting better. mod return toggles it too

This commit is contained in:
rileyrg 2021-05-26 18:05:19 +02:00
parent 4ea4be8c0d
commit f4a9ac7321
6 changed files with 33 additions and 27 deletions

View file

@ -774,7 +774,7 @@ set $mod Mod4
set $menu sway-launcher-fzf
for_window [title="sway-launcher"] floating enable
set $term 'sway-terminal'
set $term 'sway-scratch-terminal'
set $editor 'sway-editor'
set $wallpaper "~/Pictures/Wallpapers/current"
@ -802,7 +802,6 @@ Bindsym $mod+Shift+r restart
output * bg $wallpaper fill
bindsym $mod+Return exec $term
bindsym $mod+Shift+e exec $editor
bindsym $mod+d exec $menu
@ -847,7 +846,10 @@ bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
for_window [title=^Scratch] move container to scratchpad
for_window [title=^Scratch] move to scratchpad,scratchpad show
bindsym $mod+Return exec sway-scratch-terminal
```
@ -1786,9 +1788,9 @@ exec swayidle -w \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_BLANK:-300} 'sway-lock-utils blank' \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_LOCK:-360} 'sway-lock' \
timeout ${XIDLEHOOK_LOCK:-900} 'sway-lock' \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_SUSPEND:-720} 'sway-lock-utils suspend' \
timeout ${XIDLEHOOK_SUSPEND:-7200} 'sway-lock-utils suspend' \
resume 'sway-lock-utils unblank' \
lock 'sway-lock' \
before-sleep 'sway-lock'
@ -1841,7 +1843,7 @@ notify-send -t 3000 "${@}"
```
<a id="orgdee8f28"></a>
<a id="orgc3d173e"></a>
### ~/bin/sway/sway-screen
@ -1862,7 +1864,7 @@ swaymsg "output ${m} ${c}"
### ~/bin/sway/sway-screen-menu
Gui to select a display and enable/disable it. Calls down to [~/bin/sway/sway-screen](#orgdee8f28).
Gui to select a display and enable/disable it. Calls down to [~/bin/sway/sway-screen](#orgc3d173e).
:ID: 82455cae-1c48-48b2-a8b3-cb5d44eeaee9
@ -1889,12 +1891,12 @@ export SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock
```
### ~/bin/sway/sway-terminal :swaysock:
### ~/bin/sway/sway-scratch-terminal :swaysock:
```bash
#!/usr/bin/bash
#Maintained in linux-config.org
oneterminal "${1:-ScratchTerminal}" ""
#!/usr/bin/bash
#Maintained in linux-config.org
swaymsg "[title=ScratchTerminal] scratchpad show" || alacritty --title "ScratchTerminal" --command bash -c "tmux new-session -A -s ScratchTerminal"
```

View file

@ -8,9 +8,9 @@ exec swayidle -w \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_BLANK:-300} 'sway-lock-utils blank' \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_LOCK:-360} 'sway-lock' \
timeout ${XIDLEHOOK_LOCK:-900} 'sway-lock' \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_SUSPEND:-720} 'sway-lock-utils suspend' \
timeout ${XIDLEHOOK_SUSPEND:-7200} 'sway-lock-utils suspend' \
resume 'sway-lock-utils unblank' \
lock 'sway-lock' \
before-sleep 'sway-lock'

View file

@ -0,0 +1,3 @@
#!/usr/bin/bash
#Maintained in linux-config.org
swaymsg "[title=ScratchTerminal] scratchpad show" || alacritty --title "ScratchTerminal" --command bash -c "tmux new-session -A -s ScratchTerminal"

View file

@ -1,3 +0,0 @@
#!/usr/bin/bash
#Maintained in linux-config.org
oneterminal "${1:-ScratchTerminal}" ""

View file

@ -7,7 +7,7 @@ set $mod Mod4
set $menu sway-launcher-fzf
for_window [title="sway-launcher"] floating enable
set $term 'sway-terminal'
set $term 'sway-scratch-terminal'
set $editor 'sway-editor'
set $wallpaper "~/Pictures/Wallpapers/current"
@ -35,7 +35,6 @@ Bindsym $mod+Shift+r restart
output * bg $wallpaper fill
bindsym $mod+Return exec $term
bindsym $mod+Shift+e exec $editor
bindsym $mod+d exec $menu
@ -58,7 +57,10 @@ bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
for_window [title=^Scratch] move container to scratchpad
for_window [title=^Scratch] move to scratchpad,scratchpad show
bindsym $mod+Return exec sway-scratch-terminal
# change focus
# bindsym $mod+h focus left

View file

@ -1305,7 +1305,7 @@ $XDG_DATA_HOME/dbus-1/services/org.freedesktop.Notifications.service
set $menu sway-launcher-fzf
for_window [title="sway-launcher"] floating enable
set $term 'sway-terminal'
set $term 'sway-scratch-terminal'
set $editor 'sway-editor'
set $wallpaper "~/Pictures/Wallpapers/current"
@ -1333,7 +1333,6 @@ $XDG_DATA_HOME/dbus-1/services/org.freedesktop.Notifications.service
output * bg $wallpaper fill
bindsym $mod+Return exec $term
bindsym $mod+Shift+e exec $editor
bindsym $mod+d exec $menu
@ -1367,7 +1366,10 @@ gaps outer 2
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
for_window [title=^Scratch] move container to scratchpad
for_window [title=^Scratch] move to scratchpad,scratchpad show
bindsym $mod+Return exec sway-scratch-terminal
#+end_src
*** navigation :navigation
@ -2227,9 +2229,9 @@ Just a gathering place of locky/suspendy type things...
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_BLANK:-300} 'sway-lock-utils blank' \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_LOCK:-360} 'sway-lock' \
timeout ${XIDLEHOOK_LOCK:-900} 'sway-lock' \
resume 'sway-lock-utils unblank' \
timeout ${XIDLEHOOK_SUSPEND:-720} 'sway-lock-utils suspend' \
timeout ${XIDLEHOOK_SUSPEND:-7200} 'sway-lock-utils suspend' \
resume 'sway-lock-utils unblank' \
lock 'sway-lock' \
before-sleep 'sway-lock'
@ -2316,11 +2318,11 @@ Gui to select a display and enable/disable it. Calls down to [[id:539e9065-2df6-
#Maintained in linux-config.org
export SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock
#+end_src
*** ~/bin/sway/sway-terminal :swaysock:
#+begin_src bash :tangle "~/bin/sway/sway-terminal"
*** ~/bin/sway/sway-scratch-terminal :swaysock:
#+begin_src bash :tangle "~/bin/sway/sway-scratch-terminal"
#!/usr/bin/bash
#Maintained in linux-config.org
oneterminal "${1:-ScratchTerminal}" ""
swaymsg "[title=ScratchTerminal] scratchpad show" || alacritty --title "ScratchTerminal" --command bash -c "tmux new-session -A -s ScratchTerminal"
#+end_src
*** ~/bin/sway/sway-display-swap
https://i3wm.org/docs/user-contributed/swapping-workspaces.html