diff --git a/.config/chrome-flags.conf b/.config/chrome-flags.conf index c5f1803..cd4b4fb 100644 --- a/.config/chrome-flags.conf +++ b/.config/chrome-flags.conf @@ -1,3 +1,2 @@ ---enable-features=WebUIDarkMode,UseOzonePlatform ---ozone-platform=wayland +--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,WebUIDarkMode --force-dark-mode diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 91259f8..492f8ff 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -261,7 +261,7 @@ font_family DejaVuSansMono #: Terminal bell {{{ -# enable_audio_bell yes +enable_audio_bell no #: Enable/disable the audio bell. Useful in environments that require #: silence. diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf index e952636..82b5492 100644 --- a/.config/mpv/input.conf +++ b/.config/mpv/input.conf @@ -2,6 +2,7 @@ ctrl+r cycle-values video-rotate 0 90 180 270 ctrl+b cycle deband b cycle-values scale "bilinear" "spline64"; cycle-values dscale "bilinear" "mitchell"; cycle-values cscale "bilinear" "sinc" ctrl+s sub-reload +ctrl+S cycle shuffle S screenshot-to-file /tmp/mpv-screenshot.png ; run sh -c "cat /tmp/mpv-screenshot.png | wl-copy -t image/png" x add sub-delay -0.04 diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 5111a5b..6f7e1f2 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -340,7 +340,7 @@ map i display_file map ? help map W display_log map w taskview_open -map S shell $SHELL +map S shell zsh map : console map ; console diff --git a/.config/sway/config b/.config/sway/config index c4740b5..8b98548 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -139,6 +139,8 @@ input "9653:84:Samsung_electronics_inc._Samsung_HID_Multi-Touch"\ # Screenshot bindsym Print exec grim -g "$(slurp -d)" - | wl-copy -t image/png + bindsym Ctrl+Print exec swaymsg -t get_tree | jq -r 'recurse(.nodes[], .floating_nodes[]) | select(.focused and .pid).rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -g - - | wl-copy -t image/png + bindsym Shift+Print exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - | wl-copy -t image/png # # Moving around: # @@ -208,6 +210,9 @@ input "9653:84:Samsung_electronics_inc._Samsung_HID_Multi-Touch"\ # Make the current focus fullscreen bindsym $mod+f fullscreen + # Maximize current focus + bindsym $mod+m exec swaymsg floating true && swaymsg resize set $(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | .rect | "\(.width)px \(.height)px"') + # Toggle the current focus between tiling and floating mode bindsym $mod+Shift+space floating toggle @@ -262,7 +267,7 @@ bindsym Ctrl+Alt+l exec $srclocker bar { position top pango_markup enabled - font pango:DejaVu Sans Mono, FontAwesome 10 + font pango:DejaVu Sans Mono, devicons, FontAwesome 10 # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. @@ -289,28 +294,20 @@ bindsym Ctrl+m exec mpv "$(wl-paste -t text)" hide_edge_borders both default_border none gaps inner 6 -#smart_gaps on include /etc/sway/config.d/* # Assignments assign [class="discord"] workspace 3 assign [class="Spotify"] workspace 3 -#for_window [class="Spotify"] opacity 0.8 -#for_window [class="Chromium"] opacity 0.9 exec redshift -O 4500 -m wayland -exec megasync -exec nm-applet --indicator -#exec cadence -#exec ~/.local/start_jack.sh - -exec ~/.config/sway/workspace_rename.py +exec ~/.config/sway/workspace_rename.py > ~/.cache/workspace_rename.log 2> ~/.cache/workspace_rename_error.log for_window [class="Tor Browser"] floating enable -for_window [app_id="kitty-scratch"] { +for_window [app_id="kitty-scratch|pavucontrol"] { move to scratchpad scratchpad show } @@ -321,8 +318,6 @@ exec $term workspace 2 output eDP-1 workspace 3 output eDP-1 -exec discord -exec spotify workspace 4 output "Dell Inc. DELL U2410 F525M0A1082L" @@ -337,3 +332,7 @@ workspace 8 output "Dell Inc. DELL U2717D JXRPT83GAHKS" workspace 9 output "Dell Inc. DELL U2717D JXRPT83GAHKS" exec xrdb -load ~/.Xresources + +exec autotiling + +exec "systemctl --user import-environment; systemctl --user start sway-session.target" diff --git a/.config/sway/status.toml b/.config/sway/status.toml index f5739f3..1598133 100644 --- a/.config/sway/status.toml +++ b/.config/sway/status.toml @@ -19,10 +19,9 @@ separator = "\ue0b2" [[block]] block = "music" player = "spotify" -buttons = ["play", "next"] +buttons = ["prev", "play", "next"] on_collapsed_click = "spotify" -max_width = 21 -marquee = true +max_width = 0 [[block]] block = "sound" @@ -30,6 +29,7 @@ driver = "auto" show_volume_when_muted = true headphones_indicator = true step_width = 3 +on_click = "pavucontrol" [[block]] block = "memory" @@ -63,7 +63,7 @@ on_click = "kitty --class kitty-scratch -c ~/.config/kitty/kitty-scratch.conf zs [[block]] block = "networkmanager" -on_click = "networkmanager_dmenu" +on_click = "kitty --class kitty-scratch -c ~/.config/kitty/kitty-scratch.conf nmtui" device_format = "{icon}{ap}" interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"] diff --git a/.config/sway/workspace_rename.py b/.config/sway/workspace_rename.py index 51b438f..ec4b565 100755 --- a/.config/sway/workspace_rename.py +++ b/.config/sway/workspace_rename.py @@ -9,40 +9,53 @@ from i3ipc.aio import Connection async def main(): sway = await Connection().connect() - @sway.on(Event.WINDOW_FOCUS) - async def on_window_focus(sway, e): - focused_window = (await sway.get_tree()).find_focused() - focused_workspace = focused_window.workspace() + @sway.on(Event.WINDOW_NEW) + @sway.on(Event.WINDOW_CLOSE) + @sway.on(Event.WINDOW_MOVE) + @sway.on(Event.WINDOW_TITLE) + async def on_window_change(sway, _): + for w in (await sway.get_tree()).workspaces(): + new_name = f'{w.num}:' - new_name = f'{focused_workspace.num}:' + first_descendant = True + for d in w.descendants(): + app_name = d.app_id + if not app_name: + app_name = d.window_instance - app_name = e.container.app_id - if not app_name: - app_name = e.container.window_instance + if app_name: + if not first_descendant: + new_name += ' ' + first_descendant = False - if app_name: - if 'kitty' in app_name: - new_name += '' - elif app_name in ['Chromium', 'google-chrome']: - if 'YouTube' in e.container.name: - new_name += '' - else: - new_name += '' - elif app_name == 'discord': - new_name += '' - elif app_name == 'spotify': - new_name += '' - elif app_name in ['GEMOC Studio', 'code-oss']: - new_name += '' - elif 'okular' in app_name: - new_name += '' - elif app_name == 'pavucontrol': - new_name += '' - else: - new_name += app_name + if 'kitty' in app_name: + if 'vim' in d.name: + new_name += '\ue6c5' + else: + new_name += '' + elif app_name in ['Chromium', 'google-chrome', 'google-chrome-unstable']: + if 'YouTube' in d.name: + new_name += '' + else: + new_name += '' + elif app_name == 'Navigator': + new_name += '' + elif app_name == 'discord': + new_name += '' + elif app_name == 'spotify': + new_name += '' + elif app_name in ['GEMOC Studio', 'code-oss']: + new_name += '' + elif 'okular' in app_name or 'zathura' in app_name: + new_name += '' + elif app_name == 'pavucontrol': + new_name += '' + else: + new_name += app_name + + await sway.command(f'rename workspace "{w.name}" to "{new_name}"') - await sway.command(f'rename workspace to "{new_name}"') await sway.main() -asyncio.get_event_loop().run_until_complete(main()) +asyncio.run(main()) diff --git a/.zshrc b/.zshrc index 7a08b23..2275c89 100644 --- a/.zshrc +++ b/.zshrc @@ -19,6 +19,7 @@ plugins=( archlinux docker docker-compose + fzf git systemd vagrant @@ -27,11 +28,35 @@ plugins=( ) source $ZSH/oh-my-zsh.sh -bindkey '^R' history-incremental-pattern-search-backward if [ -f ~/.bash_aliases ]; then source ~/.bash_aliases fi eval $(thefuck --alias) +ranger() { + if [ -z "$RANGER_LEVEL" ]; then + /usr/bin/ranger "$@" + else + exit + fi +} + alias start_gnome='XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session' + +# >>> mamba initialize >>> +# !! Contents within this block are managed by 'mamba init' !! +export MAMBA_EXE="/usr/bin/micromamba"; +export MAMBA_ROOT_PREFIX="/home/rhiobet/micromamba"; +__mamba_setup="$('/usr/bin/micromamba' shell hook --shell zsh --prefix '/home/rhiobet/micromamba' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__mamba_setup" +else + if [ -f "/home/rhiobet/micromamba/etc/profile.d/micromamba.sh" ]; then + . "/home/rhiobet/micromamba/etc/profile.d/micromamba.sh" + else + export PATH="/home/rhiobet/micromamba/bin:$PATH" # extra space after export prevents interference from conda init + fi +fi +unset __mamba_setup +# <<< mamba initialize <<<