Skip to content

Commit

Permalink
Dump
Browse files Browse the repository at this point in the history
  • Loading branch information
A committed Jun 7, 2024
1 parent 9c544cc commit b85cce1
Show file tree
Hide file tree
Showing 39 changed files with 496 additions and 155 deletions.
2 changes: 1 addition & 1 deletion bin/playerctl-pick-current-track
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ for service in bus.list_names():
file = re.sub(r"file:\/\/", "", file_url)
if os.path.isfile(file):
print(file)
os.system(f"~/.bin/pick-track '{file}'")
os.system(f"~/.bin/pick-track \"{file}\"")
22 changes: 22 additions & 0 deletions bin/swap_usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

for proc_dir in /proc/*
do
if [ -d "$proc_dir" ]
then
pid=$(basename "$proc_dir")
if [[ $pid =~ ^-?[0-9]+$ ]]
then
if grep -q "VmSwap" $proc_dir/status
then
swap_usage_nums=$(cat $proc_dir/status | grep VmSwap | awk '{ print $2 }')
if (( swap_usage_nums > 0 ))
then
swap_usage_unit=$(cat $proc_dir/status | grep VmSwap | awk '{ print $3 }')
cmdline=$(cat $proc_dir/cmdline | sed -e "s/\x00/ /g";)
echo "${swap_usage_nums}${swap_usage_unit} $cmdline"
fi
fi
fi
fi
done | sort -h -r
9 changes: 9 additions & 0 deletions configs/hypr/bin/lock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if pgrep -x "hyprlock" > /dev/null
then
echo "$(date '+%Y-%m-%dT%T.%3N'): Skip locking, hyprlock is already running" >> ~/.tmp/logs/sleep.log
else
echo "$(date '+%Y-%m-%dT%T.%3N'): Start locking" >> ~/.tmp/logs/sleep.log
hyprlock -q --immediate
fi
5 changes: 5 additions & 0 deletions configs/hypr/bin/restart-waybar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/bash

killall waybar
waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css
waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css
12 changes: 6 additions & 6 deletions configs/hypr/bin/sleep.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

# Run swaylock if it's not already running
if pgrep -x "swaylock" > /dev/null
if pgrep -x "hyprlock" > /dev/null
then
echo "Skip locking, swaylock is already running" >> ~/.tmp/logs/sleep.log
echo "$(date '+%Y-%m-%dT%T.%3N'): Skip locking, hyprlock is already running" >> ~/.tmp/logs/sleep.log
else
echo "Start swaylock" >> ~/.tmp/logs/sleep.log
swaylock --grace=0 --fade-in=0 -fF
echo "$(date '+%Y-%m-%dT%T.%3N'): Start locking" >> ~/.tmp/logs/sleep.log
hyprlock -q --immediate
sleep 2
fi

systemctl suspend
# systemctl suspend
2 changes: 1 addition & 1 deletion configs/hypr/bin/waybar-wf-recorder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SIGNAL=1
pid_file="/tmp/waybar-screenrecorder"
wf_recorder_opts="--audio"
wf_recorder_opts="--audio --pixel-format yuv420p"
video_extension="mp4"

get_status() {
Expand Down
2 changes: 2 additions & 0 deletions configs/hypr/bin/xdg-portal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
sleep 1
killall -e xdg-desktop-portal-hyprland
killall -e xdg-desktop-portal-wlr
killall -e xdg-desktop-portal-gtk
killall xdg-desktop-portal

/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &
38 changes: 25 additions & 13 deletions configs/hypr/config.d/00-env.conf
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
env = TERMINAL,kitty
env = XDG_SESSION_TYPE,wayland
env = WLR_NO_HARDWARE_CURSORS,1
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DESKTOP,Hyprland

env = WLR_NO_HARDWARE_CURSORS,1
env = XCURSOR_SIZE,24

env = ELECTRON_ARGS="--enable-features=UseOzonePlatform --ozone-platform=wayland"
env = WLR_USE_LIBINPUT,1
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = WLR_EGL_NO_MODIFIERS,0
env = MOZ_ENABLE_WAYLAND,1
# env = MOZ_DBUS_REMOTE,1
env = QT_QPA_PLATFORM,wayland # "wayland;xcb"
env = QT_QPA_PLATFORMTHEME,qt5ct

# Toolkits
env = GDK_BACKEND,wayland,x11
env = GDK_SCALE,1
env = GDK_DPI_SCALE,1

env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland
env = WLR_RENDERER_ALLOW_SOFTWARE,1
env = MOZ_ENABLE_WAYLAND,1
env = MOZ_DISABLE_RDD_SANDBOX,1
env = MOZ_DBUS_REMOTE,1
env = __GL_MaxFramesAllowed,1
env = PROTON_ENABLE_NGX_UPDATER,1


xwayland {
force_zero_scaling = true
}

env = GDK_SCALE,1
env = GDK_DPI_SCALE,1

# env = WLR_USE_LIBINPUT,1
# env = WLR_EGL_NO_MODIFIERS,0
# env = WLR_RENDERER_ALLOW_SOFTWARE,1

# TODO: Check if video render is accelerated
# env = MOZ_DISABLE_RDD_SANDBOX,1
#
# env = __GL_MaxFramesAllowed,1
# env = PROTON_ENABLE_NGX_UPDATER,1


6 changes: 4 additions & 2 deletions configs/hypr/config.d/00-nvidia-env.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# https://github.com/Gl00ria/dotfiles/blob/main/dot_hyprland/.config/hypr/source/06_decoration.conf

# env = LIBVA_DRIVER_NAME,nvidia
env = GBM_BACKEND=nvidia-drm


# (https://wiki.archlinux.org/title/Wayland#Requirements)
# WARN: crashes me hyprland
Expand All @@ -15,10 +17,10 @@
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = __GL_SYNC_TO_VBLANK,1
env = WLR_DRM_NO_ATOMIC,1
#env = WLR_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0
#env = __VK_LAYER_NV_optimus,NVIDIA_only
env = NVD_BACKEND,direct

#env = WLR_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0
#env = __VK_LAYER_NV_optimus,NVIDIA_only
# env = MANGOHUD,1
# env = MANGOHUD_DLSYM,1
# env = LIBSEAT_BACKEND,logind
Expand Down
4 changes: 3 additions & 1 deletion configs/hypr/config.d/10-autostart.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ exec-once = pasystray &
exec-once = ~/.config/hypr/bin/wallpapers.py > ~/.tmp/logs/wallpapers.py.log
exec-once = ~/.config/hypr/bin/uair.sh
exec-once = avizo-service
exec-once = ~/.config/hypr/bin/xdg-portal.sh
# exec-once = ~/.config/hypr/bin/xdg-portal.sh
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = hypridle
31 changes: 7 additions & 24 deletions configs/hypr/config.d/10-display.conf
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1, 2560x1600@60Hz, 200x1440, 1.25
monitor=eDP-2, 2560x1600@60Hz, 200x1440, 1.25
# monitor=eDP-1, [email protected], 200x1440, 1.25
# monitor=eDP-2, [email protected], 200x1440, 1.25
monitor=eDP-1, 2560x1600@60Hz, 200x1152, 1.6

monitor=HDMI-A-1, [email protected], 0x0, 1.5
monitor=HDMI-A-2, [email protected], 0x0, 2.5
# monitor=DP-6, [email protected], 0x0, 1.5
#
# monitor=HDMI-A-2,disable
monitor=DP-2, [email protected], 0x0, 1
# monitor=DP-2, [email protected], 0x0, 1.5
# Office
monitor=desc:Samsung Electric Company LU28R55 H4ZT400899, 3840x2160@60Hz, -400x-288, 1.5

# Home Office
monitor=desc:Samsung Electric Company LU28R55 HNMN700388, 3840x2160@30Hz, -400x-288, 1.5

# monitor=DP-5, [email protected], 0x720, 1

# monitor=HDMI-A-2, [email protected], 0x0, 1.25

# monitor=eDP-2, [email protected], 200x1728, 1.25
# monitor=HDMI-A-1, [email protected], 0x0, 1.25
# monitor=DP-6, [email protected], 0x0, 1.25
# Gaming
monitor=desc:Samsung Electric Company C34H89x H4ZT300037, 3440x1440@100Hz, -720x0, 1.25

exec-once = hyprpaper &
# exec-once = hyprctl hyprpaper wallpaper "eDP-1,~/Pictures/Wallpapers/dune-2.jpg"
# exec-once = hyprctl hyprpaper wallpaper "HDMI-A-2,~/Pictures/Wallpapers/dune-2.jpg"

# exec = hyprctl hyprpaper wallpaper "eDP-2,~/Pictures/Wallpapers/after_all_desktop.jpg"
# exec = hyprctl hyprpaper wallpaper "HDMI-A-1,~/Pictures/Wallpapers/after_all_desktop.jpg"
55 changes: 33 additions & 22 deletions configs/hypr/config.d/20-key-bindings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,37 @@ $mainModAlt = SUPER_ALT

$term = 'kitty'

$volumeUp = volumectl up
$volumeDown = volumectl down
$volumeToggle = volumectl toggle

$brightnessUp = brightnessctl set 2%+
$brightnessDown = brightnessctl set 2%-


# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainModShift, return, exec, ~/.bin/add-todo
bind = $mainMod, F, fullscreen
bind = $mainMod, R, togglesplit

# Speaker volume
bindle = ,XF86AudioRaiseVolume, exec, $volumeUp
bindle = ,XF86AudioLowerVolume, exec, $volumeDown
bindle = ,XF86AudioMute,exec, $volumeToggle
bindle = CTRL, EQUAL, exec, $volumeUp
bindle = CTRL, MINUS, exec, $volumeDown

bindle = ,XF86MonBrightnessUp, exec, $brightnessUp
bindle = ,XF86MonBrightnessDown, exec, $brightnessDown

# External Display Brightness
# bindl = $mainMod,XF86MonBrightnessUp, exec, ddcutil setvcp 10 + 10
# bindl = $mainMod,XF86MonBrightnessDown, exec, ddcutil setvcp 10 - 10

bind = $mainMod, return, exec, $term
bind = $mainMod, Q, killactive,
bind = $mainMod, DELETE, exit,
bind = $mainMod, l, exec, swaylock -f; # hyprctl dispatch dpms off
bind = $mainMod, l, exec, hyprlock; # hyprctl dispatch dpms off
bind = $mainMod, E, exec, thunar
bind = $mainMod, V, togglefloating,
bind = $mainMod, P, pin, # All Screens
Expand All @@ -19,11 +45,6 @@ bind = $mainMod, K, exec, ~/.bin/wofi-files --conf ~/.config/wofi/config
bind = $mainMod, equal, exec, wofi-calc --conf ~/.config/wofi/config
bind = $mainMod, h, exec, ~/.bin/wofi-hyprland-hidden --conf ~/.config/wofi/config

bind = $mainModShift, return, exec, ~/.bin/add-todo
bind = $mainMod, F, fullscreen

bind = $mainMod, R, togglesplit

# Tabs
bind = $mainMod, T, togglegroup
bind = $mainMod, Tab, changegroupactive
Expand Down Expand Up @@ -103,20 +124,13 @@ bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Brightness
bindl = ,XF86MonBrightnessUp, exec, lightctl up
bindl = ,XF86MonBrightnessDown, exec, lightctl down
bind = ,XF86MonBrightnessUp, exec, brightnessctl set 2%+
bind = ,XF86MonBrightnessDown, exec, brightnessctl set 2%-

# External Display Brightness
bindl = $mainMod,XF86MonBrightnessUp, exec, ddcutil setvcp 10 + 10
bindl = $mainMod,XF86MonBrightnessDown, exec, ddcutil setvcp 10 - 10

# Speaker volume
bindl = ,XF86AudioRaiseVolume, exec, volumectl -u up
# bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5
bindl = ,XF86AudioLowerVolume, exec, volumectl -u down
# bind = ,XF86AudioLowerVolume, exec, pamixer -d 5
bindl = ,XF86AudioMute,exec, volumectl toggle-mute
# bind = ,XF86AudioMute,exec, pamixer --toggle-mute

# Mic volume
bind = SUPER, XF86AudioRaiseVolume, exec, pamixer --default-source -i 5
Expand All @@ -133,22 +147,19 @@ bind = ,PRINT, exec, grim -g "$(slurp)" - | swappy -f -
bind = $mainModShift, c, exec, grim -g "$(slurp)" - | tesseract - - -l vie | wl-copy

# Player
bindl = $mainMod,comma, exec, playerctl previous
bindl = $mainMod,period, exec, playerctl next
bindl = $mainMod,slash, exec, playerctl play-pause
bindl = $mainMod,slash, exec, playerctl play-pause

# Deadbeef
bindl = $mainModShift, comma, exec, playerctl previous
bindl = $mainModShift, period, exec, playerctl next
bindl = $mainModCtrl, comma, exec, playerctl position 10-
bindl = $mainModCtrl, period, exec, playerctl position 10+
bindl = $mainModShift, slash, exec, playerctl play-pause
bindl = $mainModShift, END, exec, ~/.bin/playerctl-remove-file
bindl = $mainModShift, INSERT, exec, ~/.bin/playerctl-pick-current-track
bindl = $mainModShift, HOME, exec, ~/.bin/playerctl-pick-current-track


# Launcher
# bind = $mainMod, space, exec, albert toggle
#
bind = $mainModShift, W, exec, ~/.config/hypr/bin/restart-waybar

# 1Password
bind = $mainMod, backslash, exec, 1password --toggle
Expand Down
9 changes: 9 additions & 0 deletions configs/hypr/config.d/20-trackball.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
device {
name = jomaa-mouse01-mouse
# sensitivity = 1
accel_profile = adaptive
scroll_method = on_button_down
scroll_button = 275
}

# bind = , mouse:274, killactive,
26 changes: 26 additions & 0 deletions configs/hypr/config.d/90-plugins.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugin {
# hyprbars {
# # bar_height = 8
# # bar_title_enabled = false
# # bar_color = rgb(2a2a2a)
# # bar_color = rgb(AF5F5F)
# # bar_part_of_window = false
#
# # example buttons (R -> L)
# # hyprbars-button = color, size, on-click
# # hyprbars-button = rgb(ff4040), 10, 󰖭, hyprctl dispatch killactive
# # hyprbars-button = rgb(eeee11), 10, , hyprctl dispatch fullscreen 1
# }

# hyprexpo {
# columns = 3
# gap_size = 2
# bg_col = rgb(000000)
# workspace_method = center current
# enable_gesture = false
# }
}

# bind = SUPER, SPACE, hyprexpo:expo, toggle # can be: toggle, off/disable or on/enable

# windowrulev2 = plugin:hyprbars:nobar, focus:0
6 changes: 3 additions & 3 deletions configs/hypr/config.d/90-theme.conf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
# max_fps = 60
gaps_in = 5
gaps_in = 4
gaps_out = 10

border_size = 4
border_size = 2
col.active_border = rgb(AF5F5F)
col.inactive_border = rgb(7F848D)

layout = dwindle
no_border_on_floating = true
no_border_on_floating = false
}

group {
Expand Down
Loading

0 comments on commit b85cce1

Please sign in to comment.