summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2025-07-26 13:01:51 -0500
committerZachIR <zachir@librem.one>2025-07-26 13:01:51 -0500
commite7bd39aeda112e7c0dd0493fa3886149df2f2771 (patch)
tree284ecbfed3fb0c1216fefb28a02f1683f4f1c240
parent4f33e1fcdc425edec30791a8d54197284bed81ac (diff)
parentb35c7ad4db8e604f109f4857a4ed5a1c236caf30 (diff)
Merge branch 'master' into car
-rw-r--r--.gitignore1
-rw-r--r--Makefile30
-rw-r--r--scroll/config99
-rw-r--r--scroll/scripts/scratchpad.lua41
-rw-r--r--scroll/scripts/swallow.lua32
5 files changed, 166 insertions, 37 deletions
diff --git a/.gitignore b/.gitignore
index 3dcf353..6bd8fea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -237,6 +237,7 @@ RVXX EXEX.settings
RVXX v2/
RVXX v2.settings
SchildiChat/
+scroll/user.conf
Serenity/
Session/
Shibalba EXEX.settings
diff --git a/Makefile b/Makefile
index ac56da3..ce4171e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,18 +6,10 @@ DCONFS := doas.conf
all:
-install: install-hyprplugins install-zshconfigs install-shconfigs vimplug-vim
+install: install-hyprplugins install-zshconfigs install-shconfigs vimplug-vim install-scrollconf
install-hyprplugins: install-hyprsplit install-hyprland-plugins
-install-bashconfigs: $(BCONFS) install-shconfigs
- @echo "Installing bash conf files..."
- @echo ".bashrc..."
- @ln -sf `pwd`/bash/.bashrc ~/.bashrc
- @echo ".bash_logout..."
- @ln -sf `pwd`/bash/.bash_logout ~/.bash_logout
- @echo "Done."
-
install-hyprsplit:
@echo "Installing hyprsplit..."
@hyprpm add https://github.com/shezdy/hyprsplit || echo "Already installed!"
@@ -32,6 +24,24 @@ install-hyprland-plugins:
@hyprpm enable hyprscrolling
@echo "Done."
+install-scrollconf: scroll/user.conf
+ @echo "Installing user.conf..."
+ @sudo ln -sf `pwd`/scroll/user.conf /etc/scroll/config.d/user.conf
+ @echo "Done."
+
+scroll/user.conf:
+ @echo "Generating user.conf..."
+ @echo 'set $$home' $(shell echo $(HOME)) > scroll/user.conf
+ @echo "Done."
+
+install-bashconfigs: $(BCONFS) install-shconfigs
+ @echo "Installing bash conf files..."
+ @echo ".bashrc..."
+ @ln -sf `pwd`/bash/.bashrc ~/.bashrc
+ @echo ".bash_logout..."
+ @ln -sf `pwd`/bash/.bash_logout ~/.bash_logout
+ @echo "Done."
+
install-zshconfigs: install-shconfigs
@echo "Settings up ZDOTDIR..."
@echo "Installing .zprofile..."
@@ -58,4 +68,4 @@ doas-conf: $(DCONFS)
@sudo cp -n doas.conf /etc/doas.conf
@echo "Done."
-.PHONY: install-hyprplugins install-zshconfigs install-shconfigs vimplug-vim doas-conf install
+.PHONY: install-hyprplugins install-zshconfigs install-shconfigs vimplug-vim doas-conf install install-scrollconf install-bashconfigs
diff --git a/scroll/config b/scroll/config
index c715eed..2b18e24 100644
--- a/scroll/config
+++ b/scroll/config
@@ -6,6 +6,8 @@
#
# Read `man 5 scroll` for a complete reference.
+include /etc/scroll/config.d/*
+
### Variables
#
# Logo key. Use Mod1 for Alt.
@@ -23,7 +25,6 @@ set $dmenu dmenu_run -l 15
# Your preferred file manager
set $filemanager kitty -e lf
-bar mode invisible
exec waybar
exec hypridle
exec hyprpaper
@@ -129,7 +130,7 @@ animations {
bindsym $mod+Shift+c reload
# Closes the active application (hopefully)
- bindsym $mod+Shift+q view_close
+ bindsym $mod+Shift+q kill
# Exit scroll (logs you out of your Wayland session)
bindsym $mod+Shift+e exec scrollnag -t warning -m 'You pressed the exit shortcut. Do you really want to exit scroll? This will end your Wayland session.' -B 'Yes, exit scroll' 'scrollmsg exit'
@@ -232,7 +233,7 @@ animations {
#
# Make the current focus fullscreen
bindsym $mod+f fullscreen
- bindsym $mod+Ctrl+f fullscreen global
+ bindsym $mod+Shift+f fullscreen global
bindsym $mod+Alt+f fullscreen_application toggle
bindsym $mod+Ctrl+Alt+f fullscreen_application reset
@@ -242,7 +243,7 @@ animations {
bindsym $mod+Shift+y layout_transpose
# Float a window
- bindsym $mod+Shift+f floating toggle
+ bindsym $mod+Shift+space floating toggle
# Toggle sticky
bindsym $mod+Shift+Ctrl+a sticky toggle
@@ -269,14 +270,14 @@ animations {
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
- bindsym $mod+Shift+z move scratchpad
+ #bindsym $mod+Shift+z 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+z scratchpad show
- bindsym --no-repeat $mod+Alt+z scratchpad jump
+ #bindsym $mod+z scratchpad show
+ #bindsym --no-repeat $mod+Alt+z scratchpad jump
- bindsym $mod+Ctrl+z workspace back_and_forth
+ #bindsym $mod+Ctrl+z workspace back_and_forth
#
# Mode modifiers
@@ -460,10 +461,10 @@ bindsym $mod+g mode "spaces"
# Utilities:
#
# Special keys to adjust volume via PulseAudio
- bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
- bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
- bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
- bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
+ bindsym --locked XF86AudioMute exec volsv -t
+ bindsym --locked XF86AudioLowerVolume exec volsv -d
+ bindsym --locked XF86AudioRaiseVolume exec volsv -i
+ bindsym --locked XF86AudioMicMute exec volsv -m
# Special keys to control media via playerctl
bindsym --locked XF86AudioPlay exec playerctl play-pause
@@ -473,12 +474,20 @@ bindsym $mod+g mode "spaces"
bindsym --locked XF86AudioStop exec playerctl stop
# Special keys to adjust brightness via brightnessctl
- bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
- bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
+ bindsym --locked XF86MonBrightnessDown exec bl -d
+ bindsym --locked XF86MonBrightnessUp exec bl -i
# Special key to take a screenshot with grim
bindsym Print exec grim
+# Launch lwc librewolf profile interface
+bindsym $mod+Alt+w exec lwc
+# Launch qbc qutebrowser profile interface
+bindsym $mod+Alt+q exec qbc
+# Launch dmount dmenu mount script
+bindsym $mod+Alt+comma exec dmount
+# Launch dmenuumount dmenu umount script
+bindsym $mod+Alt+period exec dmenuumount
focus_wrapping no
@@ -487,6 +496,41 @@ bindgesture swipe:4:left workspace prev
bindgesture swipe:4:up scale_workspace overview
+# Enable window swallowing (of mpv specifically)
+lua $home/.config/scroll/scripts/swallow.lua
+
+# Scratchpads
+for_window [app_id="sphtop"] move scratchpad
+for_window [app_id="sphtop"] scratchpad show
+bindsym $mod+Ctrl+z lua $home/.config/scroll/scripts/scratchpad.lua sphtop htop
+for_window [app_id="spterm"] move scratchpad
+for_window [app_id="spterm"] scratchpad show
+bindsym $mod+Ctrl+x lua $home/.config/scroll/scripts/scratchpad.lua spterm
+for_window [app_id="sppmxr"] move scratchpad
+for_window [app_id="sppmxr"] scratchpad show
+bindsym $mod+Ctrl+c lua $home/.config/scroll/scripts/scratchpad.lua sppmxr pulsemixer
+for_window [app_id="spblue"] move scratchpad
+for_window [app_id="spblue"] scratchpad show
+bindsym $mod+Ctrl+v lua $home/.config/scroll/scripts/scratchpad.lua spblue bluetoothctl
+for_window [app_id="spncmp"] move scratchpad
+for_window [app_id="spncmp"] scratchpad show
+bindsym $mod+Ctrl+b lua $home/.config/scroll/scripts/scratchpad.lua spncmp ncmpcpp
+for_window [app_id="spmutt"] move scratchpad
+for_window [app_id="spmutt"] scratchpad show
+bindsym $mod+Ctrl+a lua $home/.config/scroll/scripts/scratchpad.lua spmutt neomutt
+for_window [app_id="spprof"] move scratchpad
+for_window [app_id="spprof"] scratchpad show
+bindsym $mod+Ctrl+s lua $home/.config/scroll/scripts/scratchpad.lua spprof profanity
+for_window [app_id="spirss"] move scratchpad
+for_window [app_id="spirss"] scratchpad show
+bindsym $mod+Ctrl+d lua $home/.config/scroll/scripts/scratchpad.lua spirss irssi
+for_window [app_id="sptodo"] move scratchpad
+for_window [app_id="sptodo"] scratchpad show
+bindsym $mod+Ctrl+f lua $home/.config/scroll/scripts/scratchpad.lua sptodo todo
+for_window [app_id="sptrmc"] move scratchpad
+for_window [app_id="sptrmc"] scratchpad show
+bindsym $mod+Ctrl+g lua $home/.config/scroll/scripts/scratchpad.lua sptrmc tremc
+
#
# Workspace rules:
#
@@ -499,18 +543,19 @@ bindgesture swipe:4:up scale_workspace overview
#
# Read `man 5 scroll-bar` for more information about this section.
bar {
- position top
-
- # When the status_command prints a new line to stdout, scrollbar updates.
- # The default just shows the current date and time.
- status_command while date +'%Y-%m-%d %X'; do sleep 1; done
-
- colors {
- statusline #ffffff
- background #323232
- inactive_workspace #32323200 #32323200 #5c5c5c
- scroller #2F343AFF #055E20FF #FFFFFFFF
- }
+ mode invisible
+
+ #position top
+
+ ## When the status_command prints a new line to stdout, scrollbar updates.
+ ## The default just shows the current date and time.
+ #status_command while date +'%Y-%m-%d %X'; do sleep 1; done
+
+ #colors {
+ # statusline #ffffff
+ # background #323232
+ # inactive_workspace #32323200 #32323200 #5c5c5c
+ # scroller #2F343AFF #055E20FF #FFFFFFFF
+ #}
}
#
-# include /etc/scroll/config.d/*
diff --git a/scroll/scripts/scratchpad.lua b/scroll/scripts/scratchpad.lua
new file mode 100644
index 0000000..7e078d6
--- /dev/null
+++ b/scroll/scripts/scratchpad.lua
@@ -0,0 +1,41 @@
+local args, _ = ...
+local id = ""
+local spawn = ""
+
+for i, arg in ipairs(args) do
+ if i <= 1 then
+ id = arg
+ else
+ spawn = spawn .. " " .. arg
+ end
+end
+
+local function exists(id)
+ local is_in_array = false
+ local cons = scroll.scratchpad_get_containers()
+ for _, con in ipairs(cons) do
+ local views = scroll.container_get_views(con)
+ for _, view in ipairs(views) do
+ local app_id = scroll.view_get_app_id(view)
+ if (app_id == id) then
+ is_in_array = true
+ end
+ end
+ end
+ return is_in_array
+end
+
+local function is_focused(id)
+ local view = scroll.focused_view()
+ local app_id = scroll.view_get_app_id(view)
+ return app_id == id
+end
+
+if (not exists(id)) then
+ scroll.command(nil, "exec kitty --class " .. id .. spawn)
+end
+if (is_focused(id)) then
+ scroll.command(nill, "scratchpad show")
+else
+ scroll.command(nil, "[app_id=\"" .. id .. "\"] scratchpad show")
+end
diff --git a/scroll/scripts/swallow.lua b/scroll/scripts/swallow.lua
new file mode 100644
index 0000000..5760886
--- /dev/null
+++ b/scroll/scripts/swallow.lua
@@ -0,0 +1,32 @@
+local function candidate(view)
+ local app_id = scroll.view_get_app_id(view)
+ if app_id == "mpv" then
+ local pview = scroll.view_get_parent_view(view)
+ if pview ~= nil and pview ~= view then
+ local papp_id = scroll.view_get_app_id(pview)
+ if papp_id == "kitty" then
+ return scroll.view_get_container(pview)
+ end
+ end
+ end
+ return nil
+end
+
+local function on_create(view, _)
+ local parent = candidate(view)
+ if parent ~= nil then
+ scroll.command(parent, "move scratchpad")
+ end
+end
+
+local function on_destroy(view, _)
+ local parent = candidate(view)
+ if parent ~= nil then
+ scroll.command(nil, "scratchpad show; floating toggle")
+ end
+end
+
+scroll.add_callback("view_map", on_create, nil)
+scroll.add_callback("view_unmap", on_destroy, nil)
+
+