Skip to content

Commit

Permalink
Massive (hypr migration and misc updates)
Browse files Browse the repository at this point in the history
  • Loading branch information
A committed Oct 29, 2023
1 parent b6fc2bd commit 4301156
Show file tree
Hide file tree
Showing 44 changed files with 1,124 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
files/git
packer_compiled.lua
todo.md
40 changes: 40 additions & 0 deletions bin/dockertags
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
- list all tags for ubuntu:
dockertags ubuntu
- list all php tags containing apache:
dockertags php apache
HELP
fi


image_arr=($(echo $1 | tr "/" "\n"))

if [ "${#image_arr[@]}" -eq 1 ]; then
org=library
image=${image_arr[0]}
else
org=${image_arr[0]}
image=${image_arr[1]}

fi

URL="https://registry.hub.docker.com/v2/repositories/${org}/${image}/tags?page_size=1024"

tags=`curl -L -s ${URL} | jq '."results"[]["name"]'`

if [ -n "$2" ]
then
tags=` echo "${tags}" | grep "$2" `
fi

echo "${tags}"
21 changes: 21 additions & 0 deletions bin/start-vivaldi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
vivaldi-stable \
--disable-software-rasterizer \
--disable-gpu-driver-bug-workarounds \
--disable-gpu-driver-workarounds \
--disable-gpu-vsync \
--ozone-platform-hint=auto \
--disable-reading-from-canvas \
--enable-accelerated-2d-canvas \
--enable-accelerated-video-decode \
--enable-accelerated-mjpeg-decode \
--enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization \
--enable-gpu-compositing \
--enable-native-gpu-memory-buffers \
--enable-gpu-rasterization \
--enable-oop-rasterization \
--enable-raw-draw \
--enable-zero-copy \
--ignore-gpu-blocklist \
--use-gl=desktop \
--num-raster-threads=6\
--disable-features=UseChromeOSDirectVideoDecoder
2 changes: 2 additions & 0 deletions bin/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#/!bin/bash
polybar &
65 changes: 65 additions & 0 deletions bin/sway-prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
# https://gitlab.com/wef/dotfiles/-/blob/master/bin/sway-prop
# shellcheck disable=SC2034
TIME_STAMP="20230211.212842"

# Copyright (C) 2020-2021 Bob Hepple <bob dot hepple at gmail dot com>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

PROG=$( basename "$0" )

case "$1" in
-h|--help)
echo "Usage: $PROG"
echo
# shellcheck disable=SC2016
echo 'shows the properties of the focused window
best bindings:
bindsym $mod+question exec sway-prop
bindsym $a+$c+question exec sway-prop
but if running from a terminal rather than a sway key binding:
sleep 2; sway-prop'
exit 0
;;
esac

TMP=/tmp/sway-prop-$$.tmp

trap 'rm $TMP' EXIT

swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true)' > "$TMP"

if [[ "$1" || -t 1 ]]; then
cat "$TMP"
else
# I prefer to popup a terminal eg:
if type foot &> /dev/null; then
kitty -1 --instance-group modal --class floating -o initial_window_width=800 -o initial_window_height=1000 -e bash -c "bat $TMP"
else
# ... but sway doesn't have anything like i3-sensible-terminal.
# swaynag is always installed with sway, so:
swaynag -l -m "sway-prop" < "$TMP"
fi
fi

# Local Variables:
# mode: shell-script
# time-stamp-pattern: "4/TIME_STAMP=\"%:y%02m%02d.%02H%02M%02S\""
# eval: (add-hook 'before-save-hook 'time-stamp)
# End:


3 changes: 3 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "123"
7 changes: 7 additions & 0 deletions bin/xdg-open
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ "${1:-}" = slack://* ]]; then
exec /usr/lib/slack/slack --enable-crashpad "$1"
fi

exec /usr/bin/xdg-open "$@"
2 changes: 1 addition & 1 deletion configs/git/gitconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[user]
email = [email protected]
name = 'Anton Shuvalov'
name = Anton Shuvalov
[core]
editor = nvim
bare = false
Expand Down
8 changes: 8 additions & 0 deletions configs/hypr/bin/uair-stats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash
STATS_FILE=~/.tmp/pomodoro.log

F=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep F | wc -l`
R=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep R | wc -l`
P=`cat ${STATS_FILE} | grep $(date '+%Y-%m-%d') | grep P | wc -l`

echo "F:${F} R:${R} P:${P}"
2 changes: 2 additions & 0 deletions configs/hypr/bin/uair.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/bash
while true; do uair; done
66 changes: 66 additions & 0 deletions configs/hypr/bin/wallpapers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#! /usr/bin/python3

# Dependencies:
# - hyprctl
# - jq

import os
import logging
import subprocess
import random
import time
from pathlib import Path


WALLPAPERS_DIR = os.path.expanduser("~/Pictures/Wallpapers")
INTERVAL = 60
SUPPORTED_IMAGE_EXTS = ['.jpg', 'jpeg', '.png']


logging.basicConfig(
format='wallpapers.py [%(levelname)s]: %(message)s',
level=logging.DEBUG,
)


def get_wallpapers():
wallpapers = Path(WALLPAPERS_DIR).glob("**/*.jpg")
wallpapers = (p.resolve() for p in Path(WALLPAPERS_DIR).glob("**/*") if p.suffix in SUPPORTED_IMAGE_EXTS)
wallpapers = [w for w in wallpapers]
logging.info(f'Found {len(wallpapers)} wallpapers')
return wallpapers


def get_displays():
stdout = subprocess.check_output('hyprctl monitors -j | jq ".[].name"', shell=True).decode("utf-8")
displays = stdout.replace('"', '').split('\n')
displays = list(filter(len, displays))
logging.info(f'Found {[d for d in displays]} displays')
return displays

def set_wallpapers():
wallpapers = get_wallpapers()
displays = get_displays()

if not len(wallpapers):
logging.warning("No wallpapers have been found")
return

subprocess.run("hyprctl hyprpaper unload all", shell=True)

for display in displays:
wallpaper = random.choice(wallpapers)
logging.info(f'Setting wallpaper for {display}: {wallpaper}')
subprocess.run(f'hyprctl hyprpaper preload {wallpaper}', shell=True)
time.sleep(2)
subprocess.run(f'hyprctl hyprpaper wallpaper {display},{wallpaper}', shell=True)


def main():
logging.info('Started')
while True:
set_wallpapers()
time.sleep(INTERVAL)

main()

5 changes: 5 additions & 0 deletions configs/hypr/config.d/00-env.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
env = XDG_SESSION_TYPE,wayland
env = WLR_NO_HARDWARE_CURSORS,1
env = XCURSOR_SIZE,48

#env XCURSOR_SIZE,32
10 changes: 10 additions & 0 deletions configs/hypr/config.d/00-nvidia-env.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# env = LIBVA_DRIVER_NAME,nvidia
# env = GBM_BACKEND,nvidia
# env = __GLX_VENDOR_LIBRARY_NAME,nvidia

#env = WLR_DRM_NO_ATOMIC,1
#env = WLR_RENDERER,vulkan

#env = __GL_GSYNC_ALLOWED,0
#env = __GL_VRR_ALLOWED,0

10 changes: 10 additions & 0 deletions configs/hypr/config.d/10-autostart.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
exec-once = waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css &
exec-once = waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css &
exec-once = swaync &
exec-once = blueman-applet &
exec-once = nm-applet --indicator &
exec-once = udiskie -an --tray -f dolphin &
exec-once = pasystray &
exec-once = albert &
exec-once = ~/.config/hypr/bin/wallpapers.py > ~/.tmp/logs/wallpapers.py.log
exec-once = ~/.config/hypr/bin/uair.sh
13 changes: 13 additions & 0 deletions configs/hypr/config.d/10-display.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1, [email protected], 200x1728, 1.25
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

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"
17 changes: 17 additions & 0 deletions configs/hypr/config.d/10-input.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us,ru
kb_variant = ,mac
kb_options = grp:caps_toggle

follow_mouse = 1

touchpad {
natural_scroll = yes
tap-to-click = yes
clickfinger_behavior = 1
}

sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

Loading

0 comments on commit 4301156

Please sign in to comment.