init commit
21
sway/brightness.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
now_delta="$(brightnessctl get)"
|
||||
delta="$(python -c "print(max(0, min(255, $now_delta + int($1 / 100 * 255))))")"
|
||||
iter="$(python -c "print(-1 if $1 < 0 else 1)")"
|
||||
|
||||
for i in $(seq $now_delta $iter $delta)
|
||||
do
|
||||
if [ $iter == -1 && $(brightnessctl get) < $i ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
if [ $iter == 1 && $(brightnessctl get) > $i ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
brightnessctl set $i
|
||||
sleep 0.01s
|
||||
done
|
355
sway/config
Normal file
|
@ -0,0 +1,355 @@
|
|||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term kitty
|
||||
# Your preferred application launcher
|
||||
set $menu dmenu_run
|
||||
|
||||
set $bindsym bindsym --to-code
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||
# output * bg /home/user/Pictures/bg.png fill
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
# output HDMI-A-1 resolution 1920x1080 position 1920,0
|
||||
#
|
||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||
|
||||
### Idle configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
exec ~/.config/sway/idle.sh
|
||||
|
||||
|
||||
# $bindsym $mod+z exec ~/.config/sway/idle.sh
|
||||
#
|
||||
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||
# your displays after another 300 seconds, and turn your screens back on when
|
||||
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||
|
||||
### Input configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
# CHANGE TOUCHPAD ID HERE (get identifiers: swaymsg -t get_inputs)
|
||||
input "2362:597:HTIX5288:00_093A:0255_Touchpad" {
|
||||
dwt disabled
|
||||
tap enabled
|
||||
natural_scroll enabled
|
||||
middle_emulation enabled
|
||||
scroll_factor 0.3
|
||||
drag_lock disabled
|
||||
}
|
||||
|
||||
|
||||
input type:keyboard {
|
||||
xkb_layout "us,ru"
|
||||
xkb_options "grp:alt_caps_toggle"
|
||||
xkb_numlock enabled
|
||||
}
|
||||
|
||||
#
|
||||
# You can get the names of your inputs by running: swaymsg -t get_inputs
|
||||
# Read `man 5 sway-input` for more information about this section.
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
# Start a terminal
|
||||
$bindsym $mod+Return exec $term
|
||||
|
||||
# Kill focused window
|
||||
$bindsym $mod+Shift+q kill
|
||||
|
||||
# Start your launcher
|
||||
$bindsym $mod+d exec $menu
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
$bindsym $mod+Shift+c reload
|
||||
# mod+shift+c
|
||||
|
||||
# Exit sway (logs you out of your Wayland session)
|
||||
$bindsym $mod+Shift+d exit
|
||||
# mod+shift+d
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
$bindsym $mod+$left focus left
|
||||
# h
|
||||
$bindsym $mod+$down focus down
|
||||
# j
|
||||
$bindsym $mod+$up focus up
|
||||
# k
|
||||
$bindsym $mod+$right focus right
|
||||
# l
|
||||
# Or use $mod+[up|down|left|right]
|
||||
$bindsym $mod+Left focus left
|
||||
$bindsym $mod+Down focus down
|
||||
$bindsym $mod+Up focus up
|
||||
$bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
$bindsym $mod+Shift+$left move left
|
||||
# h
|
||||
$bindsym $mod+Shift+$down move down
|
||||
# j
|
||||
$bindsym $mod+Shift+$up move up
|
||||
# k
|
||||
$bindsym $mod+Shift+$right move right
|
||||
# l
|
||||
# Ditto, with arrow keys
|
||||
$bindsym $mod+Shift+Left move left
|
||||
$bindsym $mod+Shift+Down move down
|
||||
$bindsym $mod+Shift+Up move up
|
||||
$bindsym $mod+Shift+Right move right
|
||||
focus_follows_mouse no
|
||||
|
||||
$bindsym $mod+Shift+s sticky toggle
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
# Switch to workspace
|
||||
$bindsym $mod+1 workspace number 1
|
||||
$bindsym $mod+2 workspace number 2
|
||||
$bindsym $mod+3 workspace number 3
|
||||
$bindsym $mod+4 workspace number 4
|
||||
$bindsym $mod+5 workspace number 5
|
||||
$bindsym $mod+6 workspace number 6
|
||||
$bindsym $mod+7 workspace number 7
|
||||
$bindsym $mod+8 workspace number 8
|
||||
$bindsym $mod+9 workspace number 9
|
||||
$bindsym $mod+0 workspace number 10
|
||||
# Move focused container to workspace
|
||||
$bindsym $mod+Shift+1 move container to workspace number 1
|
||||
$bindsym $mod+Shift+2 move container to workspace number 2
|
||||
$bindsym $mod+Shift+3 move container to workspace number 3
|
||||
$bindsym $mod+Shift+4 move container to workspace number 4
|
||||
$bindsym $mod+Shift+5 move container to workspace number 5
|
||||
$bindsym $mod+Shift+6 move container to workspace number 6
|
||||
$bindsym $mod+Shift+7 move container to workspace number 7
|
||||
$bindsym $mod+Shift+8 move container to workspace number 8
|
||||
$bindsym $mod+Shift+9 move container to workspace number 9
|
||||
$bindsym $mod+Shift+0 move container to workspace number 10
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
$bindsym $mod+b splith
|
||||
# mod+b
|
||||
$bindsym $mod+v splitv
|
||||
# mod+v
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
$bindsym $mod+s layout stacking
|
||||
# mod+s
|
||||
$bindsym $mod+w layout tabbed
|
||||
# mod+w
|
||||
$bindsym $mod+e layout toggle split
|
||||
# mod+e
|
||||
|
||||
# Make the current focus fullscreen
|
||||
$bindsym $mod+f fullscreen
|
||||
# mod+f
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
$bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
$bindsym $mod+space focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
$bindsym $mod+a focus parent
|
||||
# mod+a
|
||||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
$bindsym $mod+Shift+minus 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+minus scratchpad show
|
||||
|
||||
$bindsym $mod+g exec "$HOME/.config/sway/random-bg.py onetime"
|
||||
|
||||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
$bindsym $left resize shrink width 10px
|
||||
$bindsym $down resize grow height 10px
|
||||
$bindsym $up resize shrink height 10px
|
||||
$bindsym $right resize grow width 10px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
$bindsym Left resize shrink width 10px
|
||||
$bindsym Down resize grow height 10px
|
||||
$bindsym Up resize shrink height 10px
|
||||
$bindsym Right resize grow width 10px
|
||||
|
||||
# Return to default mode
|
||||
$bindsym Return mode "default"
|
||||
$bindsym Escape mode "default"
|
||||
}
|
||||
$bindsym $mod+r mode "resize"
|
||||
# mod+r
|
||||
#
|
||||
# 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
|
||||
# Special keys to adjust brightness via brightnessctl
|
||||
$bindsym --locked XF86MonBrightnessDown exec $HOME/.config/sway/brightness.sh -5
|
||||
$bindsym --locked XF86MonBrightnessUp exec $HOME/.config/sway/brightness.sh +5
|
||||
# Special key to take a screenshot with grim
|
||||
#
|
||||
# $bindsym XF86Sleep exec swaylock -f -c 000000
|
||||
|
||||
$bindsym $mod+n exec thunar
|
||||
# mod+n
|
||||
$bindsym Print exec slurp | grim -g - - | swappy -f -
|
||||
$bindsym $mod+Print exec slurp | grim -g - - | feh --auto-zoom --scale-down -
|
||||
$bindsym Shift+Print exec grim - | swappy -f -
|
||||
$bindsym $mod+c exec copyq toggle
|
||||
$bindsym $mod+o exec gnome-calculator
|
||||
$bindsym $mod+i exec chromium
|
||||
$bindsym $mod+z exec woomer
|
||||
# https://github.com/coffeeispower/woomer
|
||||
# mod+c
|
||||
$bindsym $mod+Shift+g exec bash -c "cd $HOME/Source/touchpaddraw && ./toggle.sh touchpad"
|
||||
|
||||
#
|
||||
# Status Bar:
|
||||
#
|
||||
# Read `man 5 sway-bar` for more information about this section.
|
||||
bar {
|
||||
swaybar_command waybar
|
||||
# position top
|
||||
|
||||
# When the status_command prints a new line to stdout, swaybar updates.
|
||||
# The default just shows the current date and time.
|
||||
# status_command i3blocks
|
||||
|
||||
# colors {
|
||||
# statusline #ffffff
|
||||
# background #323232
|
||||
# inactive_workspace #32323200 #32323200 #5c5c5c
|
||||
# }
|
||||
}
|
||||
|
||||
set {
|
||||
$ii inhibit_idle focus
|
||||
$game inhibit_idle focus; floating enable; border none; fullscreen enable; shadows disable
|
||||
$popup floating enable; border pixel 1; sticky enable; shadows enable
|
||||
$float floating enable; border pixel 1; shadows enable
|
||||
$video inhibit_idle fullscreen; border none; max_render_time off
|
||||
$important inhibit_idle open; floating enable; border pixel 1
|
||||
$max inhibit_idle visible; floating enable; sticky enable; border pixel 1
|
||||
}
|
||||
|
||||
for_window {
|
||||
#popup - floating enable; sticky enable
|
||||
[app_id="org.kde.kcalc"] $popup
|
||||
[app_id="dunst"] $popup
|
||||
[app_id="com.github.hluk.copyq"] $popup
|
||||
[class="feh"] $popup
|
||||
[class="Gnome-power-statistics"] $popup
|
||||
[title="Picture-in-Picture"] $popup
|
||||
[title="Picture in picture"] $popup
|
||||
[app_id="stoken-gui"] $popup
|
||||
[app_id="org.twosheds.iwgtk"] $popup
|
||||
[app_id="iwgtk"] $popup
|
||||
[app_id="ksysguard"] $popup
|
||||
[app_id="net.nokyan.Resources"] $popup
|
||||
[app_id="galculator"] $popup
|
||||
[title="(?:Open|Save) (?:File|Folder|As)" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $popup
|
||||
[title="^(File|Folder)\s*Already Exists\s*—\s*" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $popup
|
||||
[title="Confirm to replace files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $popup
|
||||
[app_id="pavucontrol"] $popup
|
||||
[class="wpaCute"] $popup
|
||||
[app_id="qtalarm"] $popup
|
||||
[app_id="blueman-manager"] $popup
|
||||
[app_id="deluge" title="Add Torrents*"] $popup
|
||||
[app_id="org.telegram.desktop"] border none; shadows enable
|
||||
|
||||
#float - floating enable; border pixel 1
|
||||
[window_role="pop-up,task_dialog,About"] $float; shadows enable
|
||||
[window_type="dialog"] $float; shadows enable
|
||||
[window_type="utility"] $float; shadows enable
|
||||
[window_type="toolbar"] $float; shadows enable
|
||||
[window_type="splash"] $float; shadows enable
|
||||
[window_type="menu"] $float; shadows enable
|
||||
[window_type="dropdown_menu"] $float; shadows enable
|
||||
[window_type="popup_menu"] $float; shadows enable
|
||||
[window_type="tooltip"] $float; shadows enable
|
||||
[window_type="notification"] $float; shadows enable
|
||||
[class="bRAC"] $float
|
||||
|
||||
#video - inhibit_idle fullscreen; border none; max_render_time off
|
||||
[instance="chromium"] $video
|
||||
[app_id="mpv"] $video
|
||||
[app_id="vlc"] $video
|
||||
[class="firefox"] $video
|
||||
[app_id="firefox"] $video
|
||||
[class="Nightly"] $video
|
||||
|
||||
#important - inhibit_idle open; floating enable; border pixel 1
|
||||
[title="Move files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
|
||||
[title="^(Copying|Moving)\s*—\s*Dolphin" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
|
||||
[title="^Extracting\s" app_id="(dolphin|org.kde.ark)"] $important
|
||||
[title="Copy Files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
|
||||
[title="Delete Files" app_id="dolphin|org.kde.ark|pcmanfm|pcmanfm-qt"] $important
|
||||
[title="Removable medium is inserted" app_id="pcmanfm|pcmanfm-qt"] $important
|
||||
[title="Compressing (.*) — Ark" app_id="org.kde.ark"] $important; resize set width 18 ppt
|
||||
|
||||
[app_id="org.gnome.clocks"] floating enable
|
||||
[app_id="org.gnome.Calculator"] floating enable
|
||||
}
|
||||
|
||||
# bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+
|
||||
# bindsym XF86AudioLowerVolume exec amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks
|
||||
# bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle && pkill -RTMIN+1 i3blocks
|
||||
|
||||
exec "$HOME/.config/sway/startup.sh"
|
||||
|
||||
include /etc/sway/config.d/*
|
9
sway/idle.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOCK_CMD="swaylock -f --color 000000"
|
||||
|
||||
swayidle -w \
|
||||
timeout 600 "$LOCK_CMD" \
|
||||
timeout 1200 'sudo zzz' \
|
||||
before-sleep "$LOCK_CMD" \
|
||||
|
72
sway/random-bg.py
Executable file
|
@ -0,0 +1,72 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import random
|
||||
import time
|
||||
import subprocess
|
||||
import threading
|
||||
import sys
|
||||
import os
|
||||
import psutil
|
||||
|
||||
WALLPAPERS_DIR = os.path.join(os.path.dirname(__file__), "wallpapers/")
|
||||
INTERVAL_SECONDS = 60 * 10
|
||||
|
||||
def get_wallpapers():
|
||||
return [os.path.join(WALLPAPERS_DIR, i) for i in os.listdir(WALLPAPERS_DIR)]
|
||||
|
||||
def get_random_wallpaper():
|
||||
return random.choice(get_wallpapers())
|
||||
|
||||
def create_wallpaper_process(path):
|
||||
process = subprocess.Popen(
|
||||
["swaybg", "-m", "fill", "-i", path],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE
|
||||
)
|
||||
return process
|
||||
|
||||
def send_wallpaper(path, interval):
|
||||
process = create_wallpaper_process(path)
|
||||
time.sleep(1)
|
||||
kill_old_processes(process.pid)
|
||||
time.sleep(interval-1)
|
||||
process.kill()
|
||||
|
||||
def kill_old_processes(new_pid):
|
||||
for proc in psutil.process_iter():
|
||||
if proc.pid != new_pid and proc.name() == "swaybg":
|
||||
print(proc.name(), proc.pid)
|
||||
proc.kill()
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
|
||||
if len(args) == 1:
|
||||
if args[0] == "loop":
|
||||
while True:
|
||||
wallpapers = get_wallpapers()
|
||||
random.shuffle(wallpapers)
|
||||
|
||||
for wallpaper in wallpapers:
|
||||
thread = threading.Thread(
|
||||
target = lambda: send_wallpaper(
|
||||
wallpaper,
|
||||
INTERVAL_SECONDS + 1
|
||||
)
|
||||
)
|
||||
thread.start()
|
||||
time.sleep(INTERVAL_SECONDS)
|
||||
return
|
||||
elif args[0] == "onetime":
|
||||
process = create_wallpaper_process(get_random_wallpaper())
|
||||
while process.stdout.read() not in "1234567890-:_":
|
||||
time.sleep(1/60)
|
||||
if process.poll() is None:
|
||||
kill_old_processes(process.pid)
|
||||
process.wait()
|
||||
return
|
||||
|
||||
print("Usage:", sys.argv[0], "<onetime/loop>")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
9
sway/startup.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
dunst &
|
||||
copyq &
|
||||
blueman-applet &
|
||||
~/.config/sway/random-bg.py loop &
|
||||
~/.startup &
|
||||
|
||||
wait
|
BIN
sway/wallpapers/1086198.png
Executable file
After Width: | Height: | Size: 15 MiB |
BIN
sway/wallpapers/108764.jpg
Executable file
After Width: | Height: | Size: 313 KiB |
BIN
sway/wallpapers/110811.jpg
Executable file
After Width: | Height: | Size: 435 KiB |
BIN
sway/wallpapers/113424.jpg
Executable file
After Width: | Height: | Size: 933 KiB |
BIN
sway/wallpapers/1270543.jpg
Executable file
After Width: | Height: | Size: 8.3 MiB |
BIN
sway/wallpapers/1289103.jpg
Executable file
After Width: | Height: | Size: 4.9 MiB |
BIN
sway/wallpapers/18208.jpg
Executable file
After Width: | Height: | Size: 50 KiB |
BIN
sway/wallpapers/705791.png
Executable file
After Width: | Height: | Size: 356 KiB |
BIN
sway/wallpapers/722359.png
Executable file
After Width: | Height: | Size: 280 KiB |
BIN
sway/wallpapers/969569.jpg
Executable file
After Width: | Height: | Size: 2 MiB |
BIN
sway/wallpapers/997285.jpg
Executable file
After Width: | Height: | Size: 1 MiB |
BIN
sway/wallpapers/snapedit_1740823344276.png
Executable file
After Width: | Height: | Size: 1.2 MiB |
BIN
sway/wallpapers/void-anime-wallpaper.jpg
Normal file
After Width: | Height: | Size: 534 KiB |
BIN
sway/wallpapers/Без имени.jpg
Executable file
After Width: | Height: | Size: 1.1 MiB |