Compare commits

..

3 Commits

Author SHA1 Message Date
3bffa00e0a Added fzf functions. 2022-11-18 20:17:48 +00:00
2c9ff2a6a6 Update .bash_aliases 2022-11-18 20:09:19 +00:00
3b9cde5436 Update sway config. 2022-11-18 20:06:55 +00:00
3 changed files with 53 additions and 15 deletions

View File

@ -31,5 +31,3 @@ alias mixer="pulsemixer"
# tmux '-2' colors # tmux '-2' colors
alias tmux="tmux -2" alias tmux="tmux -2"
# open spotify web client on firefox
alias spw="firefox --new-window https://open.spotify.com/ & exit"

View File

@ -0,0 +1,30 @@
#!/bin/bash
#
# These are functions related to fzf used to go to locations, edit
# configurations, or start a tmux session in common directories.
# Finds within current directory and cd into the location of the file or
# directory.
goto()
{
path=$(find $1 | fzf)
[ -f "$path" ] && path=$(dirname "$path")
cd "$path"
}
# Quickly find and edit a file within ~/.config or ~/Documents
cfg()
{
file=$(find $HOME/.config $HOME/Documents -type f | fzf)
[ -z "$file" ] && return
$EDITOR "$file"
}
# Quickly find a directory within ~/.config or ~/Documents and start a tmux
# session there with the name of the directory.
ts()
{
dir=$(find $HOME/.config $HOME/Documents -type d | fzf)
[ -z "$dir" ] && return
tmux new -s $(basename "$dir") -c "$dir"
}

View File

@ -137,7 +137,8 @@ exec swayidle -w \
bindsym $mod+Control+q exec swaymsg exit bindsym $mod+Control+q exec swaymsg exit
# Lock Sway # Lock Sway
bindsym $mod+Escape exec sh -c 'swaylock -f -c 000000; sleep 0.1; pkill -10 swayidle' #bindsym $mod+Escape exec sh -c 'swaylock -f -c 000000; sleep 0.1; pkill -10 swayidle'
bindsym $mod+Escape exec swaylock -f -c 000000
# #
# Moving around: # Moving around:
# #
@ -174,6 +175,9 @@ exec swayidle -w \
bindsym $mod+x workspace number 6:x bindsym $mod+x workspace number 6:x
bindsym $mod+c workspace number 7:c bindsym $mod+c workspace number 7:c
bindsym $mod+v workspace number 8:v bindsym $mod+v workspace number 8:v
# Trash workspace
bindsym $mod+Mod1+1 workspace left
bindsym $mod+Mod1+2 workspace right
# Trash workspace # Trash workspace
bindsym $mod+Mod1+a workspace trash bindsym $mod+Mod1+a workspace trash
# Move focused container to workspace # Move focused container to workspace
@ -188,22 +192,25 @@ exec swayidle -w \
# Note: workspaces can have any name you want, not just numbers. # Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default. # We just use 1-10 as the default.
# bind workspaces to monitor # Bind workspaces to monitor
workspace 1:a output $mon1 workspace 1:a output $mon1
workspace 2:r output $mon1 workspace 2:r output $mon1
workspace 3:s output $mon1 workspace 3:s output $mon1
workspace 4:t output $mon1 workspace 4:t output $mon1
workspace 5:z output $mon2 workspace 5:z output $mon1
workspace 6:x output $mon3 workspace 6:x output $mon1
workspace 7:c output $mon1 workspace 7:c output $mon1
workspace 8:v output $mon1 workspace 8:v output $mon1
workspace left output $mon2
workspace right output $mon3
# #
# Monitors: # Monitors:
# #
bindsym $mod+comma focus output left bindsym $mod+comma focus output left
bindsym $mod+period focus output right bindsym $mod+period focus output right
bindsym $mod+shift+comma move workspace to output left bindsym $mod+Shift+comma move container to output left
bindsym $mod+shift+period move workspace to output right bindsym $mod+Shift+period move container to output right
# #
# Layout stuff: # Layout stuff:
# #
@ -217,6 +224,7 @@ exec swayidle -w \
bindsym $mod+u layout stacking bindsym $mod+u layout stacking
bindsym $mod+y layout tabbed bindsym $mod+y layout tabbed
bindsym $mod+n layout toggle split bindsym $mod+n layout toggle split
bindsym $mod+Shift+n split toggle
# Make the current focus fullscreen # Make the current focus fullscreen
bindsym $mod+f fullscreen bindsym $mod+f fullscreen
@ -229,7 +237,7 @@ exec swayidle -w \
# Move focus to the parent container # Move focus to the parent container
bindsym $mod+p focus parent bindsym $mod+p focus parent
bindsym $mod+shift+p focus child bindsym $mod+Shift+p focus child
# #
# Scratchpad: # Scratchpad:
# #
@ -279,7 +287,7 @@ mode "gaming" {
} }
bindsym $mod+g mode "gaming" bindsym $mod+g mode "gaming"
# #
# Status Bar: # Status ar:
# #
# Read `man 5 sway-bar` for more information about this section. # Read `man 5 sway-bar` for more information about this section.
font pango:$font font pango:$font
@ -318,10 +326,12 @@ client.background $base03
bindsym $mod+Control+h gaps horizontal current plus 200 bindsym $mod+Control+h gaps horizontal current plus 200
bindsym $mod+Control+l gaps horizontal current minus 200 bindsym $mod+Control+l gaps horizontal current minus 200
bindsym $mod+shift+f gaps horizontal current toggle 400 bindsym $mod+Shift+f gaps horizontal current toggle 400
smart_gaps inverse_outer smart_gaps inverse_outer
gaps inner 2
default_border pixel 3 default_border pixel 3
# #
@ -347,14 +357,14 @@ assign [app_id="Discord Firefox"] workspace 3:s
for_window [title="^Discord — Mozilla Firefox$"] fullscreen disable for_window [title="^Discord — Mozilla Firefox$"] fullscreen disable
assign [class="WebCord"] workspace 3:s assign [class="WebCord"] workspace 3:s
assign [class="Signal"] workspace 3:s assign [class="Signal"] workspace 3:s
for_window [title="^WhatsApp — Mozilla Firefox$"] move container to workspace 3:s;
assign [class="Steam"] workspace 4:t assign [class="Steam"] workspace 4:t
# Space Games, as joystick usage without mouse and keyboard count as idle. # Inhibit idle if fullscreen
for_window [class="steam_app_359320"] inhibit_idle focus for_window [app_id="^.*"] inhibit_idle fullscreen
for_window [class="starcitizen.exe"] inhibit_idle focus for_window [class="^.*"] inhibit_idle fullscreen
# Inhibit idle on focus # Inhibit idle on focus
for_window [class="WebCord"] inhibit_idle focus for_window [class="WebCord"] inhibit_idle focus
for_window [app_id="org.jellyfin.jellyfinmediaplayer"] inhibit_idle focus for_window [app_id="org.jellyfin.jellyfinmediaplayer"] inhibit_idle focus
for_window [class="steam_app_888790"] inhibit_idle focus
# Floating windows # Floating windows
for_window [title="^Firefox — Sharing Indicator$"] floating enable, move position 50ppt 0px; for_window [title="^Firefox — Sharing Indicator$"] floating enable, move position 50ppt 0px;
for_window [class="^Steam$"] floating enable for_window [class="^Steam$"] floating enable