Move to Xonsh, add hypr scripts
This commit is contained in:
parent
7f324958a5
commit
ce9124c7ed
13 changed files with 224 additions and 48 deletions
|
|
@ -1,5 +1,32 @@
|
|||
monitor=,preferred,auto,1
|
||||
monitor=DP-2,2560x1440@144,0x0,1
|
||||
monitor=DP-1,2560x1440@144,-2560x0,1
|
||||
monitor=HDMI-A-1,disable
|
||||
env = HYPR_MON_PRIMARY, DP-2
|
||||
env = HYPR_MON_SECONDARY, DP-1
|
||||
|
||||
# Primaries
|
||||
workspace=name:home, monitor:DP-2, persistent:true, default:true
|
||||
workspace=name:game, monitor:DP-2, persistent:true
|
||||
workspace=name:etc0, monitor:DP-2, persistent:true
|
||||
# Secondaries
|
||||
workspace=name:chat, monitor:DP-1, persistent:true, default:true
|
||||
workspace=name:misc0, monitor:DP-1, persistent:true
|
||||
# Switches
|
||||
workspace=name:web , monitor:DP-1, persistent:true
|
||||
workspace=name:med , monitor:DP-1, persistent:true
|
||||
|
||||
windowrule = workspace name:web, librewolf
|
||||
windowrulev2 = workspace name:med, librewolf,title:Picture-in-Picture
|
||||
windowrule = workspace name:chat, discord
|
||||
|
||||
env = LIBVA_DRIVER_NAME,nvidia
|
||||
env = XDG_SESSION_TYPE,wayland
|
||||
env = GBM_BACKEND,nvidia-drm
|
||||
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
||||
env = WLR_NO_HARDWARE_CURSORS,1
|
||||
|
||||
env = HYPR_WORK_DB,$XDG_CACHE_HOME/hypr/workspace.db
|
||||
exec-once = $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh
|
||||
|
||||
exec-once = swww init
|
||||
exec-once = swww img $HOME/med/pix/bg.png
|
||||
|
|
@ -8,7 +35,8 @@ input {
|
|||
kb_layout = us
|
||||
follow_mouse = 1
|
||||
accel_profile = flat
|
||||
sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification.
|
||||
sensitivity = -0.52
|
||||
#sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification.
|
||||
}
|
||||
|
||||
general {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,21 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let rootPath = ./.; in
|
||||
{
|
||||
wayland.windowManager.hyprland.enable = true;
|
||||
wayland.windowManager.hyprland.extraConfig = ''
|
||||
${builtins.readFile ./default.conf}
|
||||
${builtins.readFile ./keybinds.conf}
|
||||
'';
|
||||
# wayland.windowManager.hyprland.enableNvidiaPatches = true;
|
||||
home.packages = with pkgs; [
|
||||
socat # For hyprland scripts
|
||||
swww # Wallpaper engine
|
||||
wlr-randr # Xrandr for wayland
|
||||
xdg-desktop-portal-hyprland # XDP for hyprland
|
||||
];
|
||||
xdg.configFile."hypr-scripts" = {
|
||||
source = rootPath + "/scripts";
|
||||
target = "hypr/scripts";
|
||||
executable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,30 +3,26 @@ $mainMod = SUPER
|
|||
# Exec programs
|
||||
bind = $mainMod, return, exec, alacritty
|
||||
bind = $mainMod SHIFT, return, exec, rofi -show run
|
||||
# bind = $mainMod SHIFT, P, exec, screenshot
|
||||
|
||||
# Hyprland Management
|
||||
bind = $mainMod SHIFT, Q, exit,
|
||||
|
||||
# Bars stuff
|
||||
bind = $mainMod, TAB, exec, eww open --toggle
|
||||
|
||||
# Workspace / Monitor Management
|
||||
bind = $mainMod, h, focusmonitor, l
|
||||
bind = $mainMod, l, focusmonitor, r
|
||||
bind = $mainMod, j, cyclenext,
|
||||
bind = $mainMod, k, cyclenext, prev
|
||||
bind = $mainMod SHIFT, j, swapnext,
|
||||
bind = $mainMod SHIFT, k, swapnext, prev
|
||||
bind = $mainMod SHIFT, h, movecurrentworkspacetomonitor, -1
|
||||
bind = $mainMod SHIFT, l, movecurrentworkspacetomonitor, +1
|
||||
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
bind = $mainMod, 1, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh home
|
||||
bind = $mainMod, 2, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh web
|
||||
bind = $mainMod, 3, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh med
|
||||
bind = $mainMod, 4, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh game
|
||||
binde = $mainMod, 5, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh etc
|
||||
binde = $mainMod, TAB, exec, $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh
|
||||
|
||||
# Window Management
|
||||
bind = $mainMod, C, killactive,
|
||||
|
|
@ -34,16 +30,11 @@ bind = $mainMod, C, killactive,
|
|||
bind = $mainMod, F, togglefloating,
|
||||
bind = $mainMod SHIFT, F, fullscreen,
|
||||
|
||||
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
|
||||
bind = $mainMod SHIFT, 1, movetoworkspacesilent, name:home
|
||||
bind = $mainMod SHIFT, 2, movetoworkspacesilent, name:web
|
||||
bind = $mainMod SHIFT, 3, movetoworkspacesilent, name:med
|
||||
bind = $mainMod SHIFT, 4, movetoworkspacesilent, name:misc
|
||||
bind = $mainMod SHIFT, TAB, movetoworkspacesilent, r-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
|
|
|
|||
27
programs/hypr/scripts/changeprimary.xsh
Executable file
27
programs/hypr/scripts/changeprimary.xsh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env xonsh
|
||||
import shelve
|
||||
|
||||
# Usage:
|
||||
# ./changeprimary.xsh workspace
|
||||
# changes to that workspace
|
||||
# if workspace is "etc" then changes to etcN where N is a number
|
||||
|
||||
workspace=$ARG1
|
||||
monitor=$HYPR_MON_PRIMARY
|
||||
|
||||
current_workspace = "home"
|
||||
|
||||
with shelve.open($HYPR_WORK_DB) as db:
|
||||
current_workspace = db.get("primary")
|
||||
if workspace == "etc":
|
||||
if current_workspace.startswith("etc"):
|
||||
current = current_workspace[3:] % db.get("primary_extras")
|
||||
current_workspace = "etc" + str(current)
|
||||
else:
|
||||
current_workspace = "etc0"
|
||||
else:
|
||||
current_workspace = workspace
|
||||
db["primary"] = current_workspace
|
||||
|
||||
hyprctl dispatch moveworkspacetomonitor name:@(current_workspace) $HYPR_MON_PRIMARY >> /dev/null
|
||||
hyprctl dispatch workspace name:@(current_workspace) >> /dev/null
|
||||
27
programs/hypr/scripts/changesecondary.xsh
Executable file
27
programs/hypr/scripts/changesecondary.xsh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env xonsh
|
||||
import shelve
|
||||
import copy
|
||||
|
||||
# Usage:
|
||||
# ./changesecondary.xsh
|
||||
# cycles through the secondary workspaces
|
||||
|
||||
current_secondary = "chat"
|
||||
|
||||
with shelve.open($HYPR_WORK_DB) as db:
|
||||
workspaces = db.get("secondaries").copy()
|
||||
current_primary = db.get("primary")
|
||||
current_secondary = db.get("secondary")
|
||||
#extras = db.get("secondary_extras")
|
||||
|
||||
if current_primary in workspaces:
|
||||
workspaces.remove(current_primary)
|
||||
|
||||
current_secondary = workspaces[
|
||||
(workspaces.index(current_secondary)+1) % len(workspaces)
|
||||
]
|
||||
db["secondary"] = current_secondary
|
||||
|
||||
# Change primary to bind
|
||||
hyprctl dispatch moveworkspacetomonitor name:@(current_secondary) $HYPR_MON_SECONDARY
|
||||
hyprctl dispatch workspace name:@(current_secondary)
|
||||
13
programs/hypr/scripts/initdb.xsh
Executable file
13
programs/hypr/scripts/initdb.xsh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env xonsh
|
||||
import shelve
|
||||
|
||||
# Usage:
|
||||
# ./initdb.xsh
|
||||
# initialize a db for use hypr workspace scripts
|
||||
|
||||
with shelve.open($HYPR_WORK_DB) as db:
|
||||
db["primary"] = "home"
|
||||
db["secondary"] = "chat"
|
||||
db["secondaries"] = ["chat", "web"]
|
||||
db["secondary_extras"] = 1
|
||||
db["primary_extras"] = 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue