dotfiles add
This commit is contained in:
parent
49a51849e0
commit
3bfa324d00
47
matboot-sway/config/kitty/kitty.conf
Executable file
47
matboot-sway/config/kitty/kitty.conf
Executable file
@ -0,0 +1,47 @@
|
||||
font_family iosevka Medium
|
||||
bold_font Iosevka Bold
|
||||
italic_font Iosevka Medium Italic
|
||||
|
||||
font_size 9.0
|
||||
|
||||
enable_audio_bell no
|
||||
window_border_width 0.0
|
||||
|
||||
tab_title_template {index}:{title}
|
||||
tab_bar_min_tabs 2
|
||||
tab_bar_edge top
|
||||
tab_bar_style powerline
|
||||
|
||||
|
||||
active_tab_background #5294E2
|
||||
active_tab_foreground #ffffff
|
||||
inactive_tab_background #272d3b
|
||||
inactive_tab_foreground #888888
|
||||
|
||||
clear_all_shortcuts yes
|
||||
kitty_mod ctrl
|
||||
map kitty_mod+insert copy_to_clipboard
|
||||
map shift+insert paste_from_clipboard
|
||||
map kitty_mod+t new_tab
|
||||
map kitty_mod+w close_tab
|
||||
map alt+l next_tab
|
||||
map kitty_mod+right next_tab
|
||||
map alt+h previous_tab
|
||||
map kitty_mod+left previous_tab
|
||||
map kitty_mod+alt+t set_tab_title
|
||||
map kitty_mod+g axis vertical
|
||||
|
||||
map alt+1 goto_tab 1
|
||||
map alt+2 goto_tab 2
|
||||
map alt+3 goto_tab 3
|
||||
map alt+4 goto_tab 4
|
||||
map alt+5 goto_tab 5
|
||||
map alt+6 goto_tab 6
|
||||
map alt+7 goto_tab 7
|
||||
map alt+8 goto_tab 8
|
||||
map alt+9 goto_tab 9
|
||||
|
||||
map kitty_mod+alt+r launch --type=tab ranger
|
||||
|
||||
include ./theme.conf
|
||||
|
||||
31
matboot-sway/config/kitty/theme.conf
Executable file
31
matboot-sway/config/kitty/theme.conf
Executable file
@ -0,0 +1,31 @@
|
||||
background #1f2227
|
||||
foreground #abb2bf
|
||||
selection_background #abb2bf
|
||||
selection_foreground #282c34
|
||||
url_color #565c64
|
||||
cursor #abb2bf
|
||||
active_border_color #545862
|
||||
inactive_border_color #353b45
|
||||
active_tab_background #1f2227
|
||||
active_tab_foreground #abb2bf
|
||||
inactive_tab_background #353b45
|
||||
inactive_tab_foreground #565c64
|
||||
tab_bar_background #353b45
|
||||
color0 #282c34
|
||||
color8 #282c34
|
||||
color1 #e06c75
|
||||
color9 #e06c75
|
||||
color2 #98c379
|
||||
color10 #98c379
|
||||
color3 #e5c07b
|
||||
color11 #e5c07b
|
||||
color4 #81A1C1
|
||||
color12 #81A1C1
|
||||
color5 #c678dd
|
||||
color13 #c678dd
|
||||
color6 #56b6c2
|
||||
color14 #56b6c2
|
||||
color7 #c8ccd4
|
||||
color15 #c8ccd4
|
||||
|
||||
# vim: ft=kitty
|
||||
20
matboot-sway/config/mako/config
Executable file
20
matboot-sway/config/mako/config
Executable file
@ -0,0 +1,20 @@
|
||||
#my simple mako
|
||||
sort=-time
|
||||
max-visible=5
|
||||
layer=top
|
||||
anchor=top-right
|
||||
|
||||
font=iosevka Nerd Font 9
|
||||
background-color=#1f2227
|
||||
text-color=#e5c07b
|
||||
|
||||
width=300
|
||||
height=180
|
||||
margin=12
|
||||
padding=15
|
||||
border-size=2
|
||||
border-color=#88c0d0
|
||||
|
||||
icons=1
|
||||
|
||||
default-timeout=5000
|
||||
15
matboot-sway/config/rofi/colors.rasi
Executable file
15
matboot-sway/config/rofi/colors.rasi
Executable file
@ -0,0 +1,15 @@
|
||||
/* colors */
|
||||
|
||||
* {
|
||||
al: #c8ccd4;
|
||||
bg: #1f2227;
|
||||
se: #413E4Aff;
|
||||
fg: #abb2bf;
|
||||
ac: #B38184ff;
|
||||
red: #e06c75;
|
||||
green: #98c379;
|
||||
yellow: #e5c07b;
|
||||
blue: #81a1c1;
|
||||
purple: #BA68C8ff;
|
||||
cyan: #56b6c2;
|
||||
}
|
||||
28
matboot-sway/config/rofi/config.rasi
Executable file
28
matboot-sway/config/rofi/config.rasi
Executable file
@ -0,0 +1,28 @@
|
||||
configuration {
|
||||
lines: 15;
|
||||
columns: 1;
|
||||
font: "Iosevka Nerd Font 9";
|
||||
bw: 0;
|
||||
location: 0;
|
||||
padding: 0;
|
||||
fixed-num-lines: true;
|
||||
show-icons: false;
|
||||
sidebar-mode: true;
|
||||
separator-style: "none";
|
||||
hide-scrollbar: true;
|
||||
fullscreen: false;
|
||||
fake-transparency: false;
|
||||
scroll-method: 0;
|
||||
click-to-exit: true;
|
||||
show-match: false;
|
||||
combi-hide-mode-prefix: false;
|
||||
display-window: " ";
|
||||
display-windowcd: " ";
|
||||
display-run: " ";
|
||||
display-ssh: " ";
|
||||
display-drun: " ";
|
||||
display-combi: " ";
|
||||
window-format: "{w} ··· [{c}] ··· {t}";
|
||||
}
|
||||
|
||||
@theme "matbook"
|
||||
143
matboot-sway/config/rofi/matbook.rasi
Executable file
143
matboot-sway/config/rofi/matbook.rasi
Executable file
@ -0,0 +1,143 @@
|
||||
@import "colors.rasi"
|
||||
|
||||
* {
|
||||
background-color: @bg;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
window {
|
||||
border: 0px;
|
||||
border-color: @ac;
|
||||
border-radius: 4px;
|
||||
padding: 15;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
prompt {
|
||||
spacing: 0;
|
||||
border: 0;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: " ";
|
||||
margin: 0px 4px 0px 0px;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
spacing: 0px;
|
||||
text-color: @fg;
|
||||
padding: 1px;
|
||||
children: [ prompt,textbox-prompt-colon,entry,overlay,case-indicator ];
|
||||
}
|
||||
|
||||
mainbox {
|
||||
border: 0px;
|
||||
border-color: @ac;
|
||||
padding: 6;
|
||||
}
|
||||
|
||||
listview {
|
||||
fixed-height: 0;
|
||||
border: 0px;
|
||||
border-color: @ac;
|
||||
spacing: 4px;
|
||||
scrollbar: false;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
|
||||
element {
|
||||
border: 0px;
|
||||
border-radius: 2px;
|
||||
padding: 1.8px;
|
||||
}
|
||||
element normal.normal {
|
||||
background-color: @bg;
|
||||
text-color: @fg;
|
||||
}
|
||||
element normal.urgent {
|
||||
background-color: @bg;
|
||||
text-color: @red;
|
||||
}
|
||||
element normal.active {
|
||||
background-color: @green;
|
||||
text-color: @bg;
|
||||
}
|
||||
element selected.normal {
|
||||
background-color: @fg;
|
||||
text-color: @bg;
|
||||
}
|
||||
element selected.urgent {
|
||||
background-color: @bg;
|
||||
text-color: @red;
|
||||
}
|
||||
element selected.active {
|
||||
background-color: @fg;
|
||||
text-color: @bg;
|
||||
}
|
||||
element alternate.normal {
|
||||
background-color: @bg;
|
||||
text-color: @fg;
|
||||
}
|
||||
element alternate.urgent {
|
||||
background-color: @bg;
|
||||
text-color: @fg;
|
||||
}
|
||||
element alternate.active {
|
||||
background-color: @bg;
|
||||
text-color: @fg;
|
||||
}
|
||||
|
||||
sidebar {
|
||||
border: 0px;
|
||||
border-color: @ac;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: @fg;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
text-color: @bg;
|
||||
border: 0px;
|
||||
border-radius: 4px;
|
||||
border-color: @fg;
|
||||
}
|
||||
|
||||
button selected {
|
||||
background-color: @red;
|
||||
text-color: @fg;
|
||||
border: 0px;
|
||||
border-radius: 4px;
|
||||
border-color: @fg;
|
||||
}
|
||||
|
||||
scrollbar {
|
||||
width: 4px;
|
||||
border: 0px;
|
||||
handle-color: @fg;
|
||||
handle-width: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
message {
|
||||
border: 0px;
|
||||
border-color: @ac;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
textbox {
|
||||
text-color: @red;
|
||||
}
|
||||
185
matboot-sway/config/sway/config
Executable file
185
matboot-sway/config/sway/config
Executable file
@ -0,0 +1,185 @@
|
||||
################################################################################
|
||||
### VARIABLES
|
||||
################################################################################
|
||||
|
||||
set $mod Mod4
|
||||
set $term kitty
|
||||
set $file_man kitty -e ranger
|
||||
set $menu rofi -show run
|
||||
set $browser firefox
|
||||
set $alt_browser waterfox
|
||||
set $audio_man pavucontrol
|
||||
set $email_client mutt
|
||||
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
################################################################################
|
||||
### STARTUP
|
||||
################################################################################
|
||||
|
||||
exec light -A 100
|
||||
workspace 1
|
||||
exec $term
|
||||
workspace 2
|
||||
exec $browser
|
||||
workspace 1
|
||||
exec mako
|
||||
|
||||
################################################################################
|
||||
### STYLING
|
||||
################################################################################
|
||||
|
||||
font pango:iosevka Medium 9
|
||||
default_border pixel 1
|
||||
client.focused #81a1c1 #81a1c1 #FFFFFF #81a1c1 #81a1c1
|
||||
client.focused_inactive #282c34 #282c34 #FFFFFF #282c34 #282c34
|
||||
client.urgent #e06c75 #e06c75 #FFFFFF #e06c75 #e06c75
|
||||
client.unfocused #282c34 #282c34 #FFFFFF #282c34 #282c34
|
||||
|
||||
gaps inner 3
|
||||
gaps outer 5
|
||||
|
||||
output "*" background "~/Documents/Wallpapers/w.jpg" fill
|
||||
|
||||
################################################################################
|
||||
### KEYBINDINGS
|
||||
################################################################################
|
||||
|
||||
## Applications:
|
||||
|
||||
bindsym --to-code $mod+Return exec $term
|
||||
bindsym --to-code $mod+Shift+Return exec $file_man
|
||||
bindsym --to-code $mod+d exec $menu
|
||||
bindsym $mod+Escape exec powermenu
|
||||
bindsym --to-code $mod+n exec notesmenu
|
||||
bindsym --to-code $mod+b exec $browser
|
||||
bindsym --to-code $mod+Shift+b exec $alt_browser
|
||||
|
||||
bindsym --to-code $mod+Alt+a exec $audio_man
|
||||
bindsym --to-code $mod+Alt+b exec blueman-manager
|
||||
|
||||
bindsym --to-code $mod+y exec playweb
|
||||
## Sway:
|
||||
|
||||
bindsym --to-code $mod+q kill
|
||||
bindsym --to-code $mod+Shift+q exec swaymsg exit
|
||||
bindsym --to-code $mod+Shift+c reload
|
||||
|
||||
floating_modifier $mod normal
|
||||
|
||||
## Window Navigation:
|
||||
|
||||
# Move your focus around
|
||||
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
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
|
||||
## 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
|
||||
|
||||
# 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
|
||||
|
||||
## Layout stuff:
|
||||
|
||||
# Switch layout style of current container
|
||||
bindsym --to-code $mod+w layout tabbed
|
||||
bindsym --to-code $mod+e layout toggle split
|
||||
|
||||
# bindsym $mod+space focus mode_toggle
|
||||
bindsym --to-code $mod+f fullscreen
|
||||
bindsym --to-code $mod+t floating toggle
|
||||
bindsym --to-code $mod+a focus parent
|
||||
|
||||
## Scratchpad:
|
||||
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
## Spotify:
|
||||
|
||||
bindsym $mod+s+p exec spotifycli --playpause
|
||||
bindsym $mod+s+l exec spotifycli --next
|
||||
bindsym $mod+s+h exec spotifycli --previous
|
||||
|
||||
# Random Stuff:
|
||||
|
||||
bindsym --to-code $mod+p exec screenshot
|
||||
|
||||
mode "resize" {
|
||||
bindsym $left resize grow width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize shrink width 10px
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym --to-code $mod+r mode "resize"
|
||||
|
||||
## Layout keyboard
|
||||
|
||||
input * {
|
||||
xkb_layout "us,ru"
|
||||
xkb_options "grp:caps_toggle"
|
||||
}
|
||||
|
||||
input <identifier> xkb_model "pc101"
|
||||
|
||||
## Display light
|
||||
bindsym XF86MonBrightnessUp exec light -A 1
|
||||
bindsym XF86MonBrightnessDown exec light -U 1
|
||||
|
||||
# Volumes
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +1%
|
||||
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -1%
|
||||
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
|
||||
################################################################################
|
||||
### GET GTK WORKING IN SWAY
|
||||
################################################################################
|
||||
|
||||
set $gnome-schema org.gnome.desktop.interface
|
||||
exec_always {
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "matbook"
|
||||
gsettings set org.gnome.desktop.interface icon-theme "Arc"
|
||||
gsettings set org.gnome.desktop.interface cursor-theme "DMZ-Black"
|
||||
gsettings set $gnome-schema cursor-theme 'Adwaita'
|
||||
gsettings set $gnome-schema font-name 'iosevka Medium 9'
|
||||
}
|
||||
|
||||
################################################################################
|
||||
### STATUS BAR
|
||||
################################################################################
|
||||
|
||||
bar {
|
||||
swaybar_command waybar
|
||||
}
|
||||
}
|
||||
|
||||
include /etc/sway/config.d/*
|
||||
|
||||
|
||||
12
matboot-sway/config/vim/vimrc
Normal file
12
matboot-sway/config/vim/vimrc
Normal file
@ -0,0 +1,12 @@
|
||||
set encoding=utf-8
|
||||
set mouse=a
|
||||
set hlsearch
|
||||
set t_Co=256
|
||||
set clipboard=unnamed
|
||||
set noswapfile
|
||||
|
||||
syntax on
|
||||
inoremap jk <esc>
|
||||
|
||||
set directory=~/.config/vim,.
|
||||
set viminfo+=n~/.config/vim/viminfo
|
||||
24
matboot-sway/config/waybar/.prettierrc.json
Executable file
24
matboot-sway/config/waybar/.prettierrc.json
Executable file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"endOfLine": "lf",
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"printWidth": 80,
|
||||
"proseWrap": "always",
|
||||
"requirePragma": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "all",
|
||||
"useTabs": false,
|
||||
"vueIndentScriptAndStyle": true,
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.json"
|
||||
},
|
||||
{
|
||||
"files": "*.rasi",
|
||||
"options": { "parser": "css" }
|
||||
}
|
||||
]
|
||||
}
|
||||
117
matboot-sway/config/waybar/config
Executable file
117
matboot-sway/config/waybar/config
Executable file
@ -0,0 +1,117 @@
|
||||
{
|
||||
"position": "bottom",
|
||||
"modules-left": ["custom/launch", "sway/workspaces"],
|
||||
"modules-center": ["custom/spotify"],
|
||||
"modules-right": [
|
||||
"custom/xkblayout",
|
||||
"pulseaudio",
|
||||
"backlight",
|
||||
"custom/wgstatus",
|
||||
"network",
|
||||
"memory",
|
||||
"battery",
|
||||
"clock",
|
||||
"custom/off"
|
||||
],
|
||||
"custom/launch": {
|
||||
"format": " ",
|
||||
"on-click": "rofi -show run"
|
||||
},
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"format": " {icon} ",
|
||||
"persistent_workspaces": {
|
||||
"1": [],
|
||||
"2": [],
|
||||
"3": [],
|
||||
"4": [],
|
||||
"5": [],
|
||||
"6": []
|
||||
},
|
||||
"format-icons": {
|
||||
"1": " ",
|
||||
"2": " ",
|
||||
"3": " ",
|
||||
"4": " ",
|
||||
"5": " ",
|
||||
"6": " ",
|
||||
"urgent": " ",
|
||||
"focused": " ",
|
||||
"default": " "
|
||||
}
|
||||
},
|
||||
"custom/spotify": {
|
||||
"exec": "/usr/bin/python3 $XDG_CONFIG_HOME/waybar/scripts/mediaplayer.py --player spotify",
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"on-click": "spotifycli --playpause",
|
||||
"on-scroll-up": "spotifycli --next",
|
||||
"on-scroll-down": "spotifycli --previous"
|
||||
},
|
||||
"custom/xkblayout": {
|
||||
"exec": "~/.config/waybar/scripts/xkblayout.py",
|
||||
"format": " {} ",
|
||||
"tooltip": false
|
||||
},
|
||||
"pulseaudio": {
|
||||
"scroll-step": 5,
|
||||
"format": "{icon} {volume}%", "format-bluetooth": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth-muted": "婢 {icon} muted",
|
||||
"format-muted": "婢 muted",
|
||||
"format-icons": {
|
||||
"speaker": " ",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"headphone": [" ", " ", " "]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
},
|
||||
"backlight": {
|
||||
"device": "intel_backlight",
|
||||
"format": " {percent}%",
|
||||
"on-scroll-up": "light -A 1",
|
||||
"on-scroll-down": "light -U 1"
|
||||
},
|
||||
"custom/wgstatus": {
|
||||
"interval": 1,
|
||||
"exec": "~/.config/waybar/scripts/wgstatus",
|
||||
"format": " {} ",
|
||||
"tooltip": false,
|
||||
"on-click": "~/.config/waybar/scripts/wgstatus -toggle"
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": "直 {essid}",
|
||||
"format-ethernet": "直 {ifname}: {ipaddr}/{cidr}",
|
||||
"format-linked": "直 {ifname} (No IP)",
|
||||
"format-disconnected": "睊 Disconnected",
|
||||
"format-alt": "直 {ifname}: {ipaddr}/{cidr}",
|
||||
"on-click-middle": "~/.config/waybar/scripts/wgstatus -toggle"
|
||||
},
|
||||
"memory": {
|
||||
"interval": 3,
|
||||
"format": " {}%",
|
||||
"max-length": 10
|
||||
},
|
||||
"battery": {
|
||||
"interval": 60,
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-icons": [" ", " ", " ", " ", " "]
|
||||
},
|
||||
"clock": {
|
||||
"interval": 1,
|
||||
"format": " {:%I:%M %p}",
|
||||
"format-alt": " {:%b %d, %G}"
|
||||
},
|
||||
"custom/off": {
|
||||
"format": " ",
|
||||
"on-click": "powermenu"
|
||||
}
|
||||
}i
|
||||
144
matboot-sway/config/waybar/scripts/mediaplayer.py
Executable file
144
matboot-sway/config/waybar/scripts/mediaplayer.py
Executable file
@ -0,0 +1,144 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
import signal
|
||||
import gi
|
||||
import json
|
||||
|
||||
gi.require_version("Playerctl", "2.0")
|
||||
from gi.repository import Playerctl, GLib
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def write_output(text, player):
|
||||
logger.info("Writing output")
|
||||
|
||||
output = {
|
||||
"text": text,
|
||||
"class": "custom-" + player.props.player_name,
|
||||
"alt": player.props.player_name,
|
||||
}
|
||||
|
||||
sys.stdout.write(json.dumps(output) + "\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def on_play(player, status, manager):
|
||||
logger.info("Received new playback status")
|
||||
on_metadata(player, player.props.metadata, manager)
|
||||
|
||||
|
||||
def on_metadata(player, metadata, manager):
|
||||
logger.info("Received new metadata")
|
||||
track_info = ""
|
||||
|
||||
if (
|
||||
player.props.player_name == "spotify"
|
||||
and "mpris:trackid" in metadata.keys()
|
||||
and ":ad:" in player.props.metadata["mpris:trackid"]
|
||||
):
|
||||
track_info = "AD PLAYING"
|
||||
elif player.get_artist() != "" and player.get_title() != "":
|
||||
track_info = "{artist} - {title}".format(
|
||||
artist=player.get_artist(), title=player.get_title()
|
||||
)
|
||||
else:
|
||||
track_info = player.get_title()
|
||||
|
||||
if player.props.status != "Playing" and track_info:
|
||||
track_info = "契 " + track_info
|
||||
elif player.props.status == "Playing" and track_info:
|
||||
track_info = " " + track_info
|
||||
write_output(track_info, player)
|
||||
|
||||
|
||||
def on_player_appeared(manager, player, selected_player=None):
|
||||
if player is not None and (
|
||||
selected_player is None or player.name == selected_player
|
||||
):
|
||||
init_player(manager, player)
|
||||
else:
|
||||
logger.debug("New player appeared, but it's not the selected player, skipping")
|
||||
|
||||
|
||||
def on_player_vanished(manager, player):
|
||||
logger.info("Player has vanished")
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def init_player(manager, name):
|
||||
logger.debug("Initialize player: {player}".format(player=name.name))
|
||||
player = Playerctl.Player.new_from_name(name)
|
||||
player.connect("playback-status", on_play, manager)
|
||||
player.connect("metadata", on_metadata, manager)
|
||||
manager.manage_player(player)
|
||||
on_metadata(player, player.props.metadata, manager)
|
||||
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
logger.debug("Received signal to stop, exiting")
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.flush()
|
||||
# loop.quit()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
# Increase verbosity with every occurence of -v
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
|
||||
# Define for which player we're listening
|
||||
parser.add_argument("--player")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
arguments = parse_arguments()
|
||||
|
||||
# Initialize logging
|
||||
logging.basicConfig(
|
||||
stream=sys.stderr,
|
||||
level=logging.DEBUG,
|
||||
format="%(name)s %(levelname)s %(message)s",
|
||||
)
|
||||
|
||||
# Logging is set by default to WARN and higher.
|
||||
# With every occurrence of -v it's lowered by one
|
||||
logger.setLevel(max((3 - arguments.verbose) * 10, 0))
|
||||
|
||||
# Log the sent command line arguments
|
||||
logger.debug("Arguments received {}".format(vars(arguments)))
|
||||
|
||||
manager = Playerctl.PlayerManager()
|
||||
loop = GLib.MainLoop()
|
||||
|
||||
manager.connect(
|
||||
"name-appeared", lambda *args: on_player_appeared(*args, arguments.player)
|
||||
)
|
||||
manager.connect("player-vanished", on_player_vanished)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
|
||||
for player in manager.props.player_names:
|
||||
if arguments.player is not None and arguments.player != player.name:
|
||||
logger.debug(
|
||||
"{player} is not the filtered player, skipping it".format(
|
||||
player=player.name
|
||||
)
|
||||
)
|
||||
continue
|
||||
|
||||
init_player(manager, player)
|
||||
|
||||
loop.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
23
matboot-sway/config/waybar/scripts/wgstatus
Executable file
23
matboot-sway/config/waybar/scripts/wgstatus
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
WGON(){
|
||||
echo "VPN"
|
||||
WGS='true'
|
||||
}
|
||||
|
||||
WGOFF(){
|
||||
# echo "Off"
|
||||
WGS='false'
|
||||
}
|
||||
|
||||
ifconfig n2400 &>/dev/null && WGON ||WGOFF
|
||||
|
||||
if [ "$1" = '-toggle' ]; then
|
||||
if [ "$WGS" = 'true' ]; then
|
||||
sudo wg-quick down n2400 &>/dev/null
|
||||
else
|
||||
sudo wg-quick up n2400 &>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
50
matboot-sway/config/waybar/scripts/xkblayout.py
Executable file
50
matboot-sway/config/waybar/scripts/xkblayout.py
Executable file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env -S python3 -u
|
||||
# vi:syntax=python
|
||||
|
||||
|
||||
import os
|
||||
import signal
|
||||
|
||||
import i3ipc
|
||||
|
||||
pri_layout_code = "Eng"
|
||||
sec_layout_code = "Rus"
|
||||
sec_layout_name = "russian"
|
||||
input_event_change = "xkb_layout"
|
||||
|
||||
sway_sock_path = os.environ["SWAYSOCK"]
|
||||
sway = i3ipc.Connection(socket_path=sway_sock_path, auto_reconnect=False)
|
||||
|
||||
|
||||
def on_posix_signal(sig, frame):
|
||||
sway.main_quit()
|
||||
|
||||
|
||||
signal.signal(signal.SIGHUP, on_posix_signal)
|
||||
signal.signal(signal.SIGINT, on_posix_signal)
|
||||
signal.signal(signal.SIGQUIT, on_posix_signal)
|
||||
signal.signal(signal.SIGTERM, on_posix_signal)
|
||||
|
||||
# print the primary layout as it's the default
|
||||
print(pri_layout_code)
|
||||
|
||||
|
||||
def on_input_change(conn, event):
|
||||
if event.change != input_event_change:
|
||||
return
|
||||
if event.input.xkb_active_layout_name.lower() == sec_layout_name:
|
||||
print(sec_layout_code)
|
||||
else:
|
||||
print(pri_layout_code)
|
||||
|
||||
|
||||
def on_shutdown_or_reload(conn, event):
|
||||
conn.main_quit()
|
||||
|
||||
|
||||
sway.on(i3ipc.Event.INPUT, on_input_change)
|
||||
sway.on(i3ipc.Event.SHUTDOWN, on_shutdown_or_reload)
|
||||
sway.on(i3ipc.Event.SHUTDOWN_EXIT, on_shutdown_or_reload)
|
||||
sway.on(i3ipc.Event.SHUTDOWN_RESTART, on_shutdown_or_reload)
|
||||
sway.on(i3ipc.Event.BARCONFIG_UPDATE, on_shutdown_or_reload)
|
||||
sway.main()
|
||||
184
matboot-sway/config/waybar/style.css
Executable file
184
matboot-sway/config/waybar/style.css
Executable file
@ -0,0 +1,184 @@
|
||||
/*
|
||||
|
||||
Color Pallete
|
||||
|
||||
foreground: '#abb2bf'
|
||||
background: '#1f2227'
|
||||
alt-background: '#282c34'
|
||||
alt-foreground: '#1f2227'
|
||||
|
||||
black: '#282c34'
|
||||
red: '#e06c75'
|
||||
green: '#98c379'
|
||||
yellow: '#e5c07b'
|
||||
blue: '#81A1C1'
|
||||
magenta: '#c678dd'
|
||||
cyan: '#56b6c2'
|
||||
white: '#c8ccd4'
|
||||
|
||||
*/
|
||||
|
||||
* {
|
||||
border: 0px solid rgba(40, 44, 52, 0);
|
||||
border-radius: 2px;
|
||||
font-family: Iosevka Nerd Font, Font Awesome, Arial, sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: #1f2227;
|
||||
background: transparent;
|
||||
color: #c8ccd4;
|
||||
transition-property: background-color;
|
||||
transition-duration: 0.5s;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
window > box {
|
||||
margin-left: 6.5px;
|
||||
margin-right: 6.5px;
|
||||
margin-bottom: 6.5px;
|
||||
background: #1f2227;
|
||||
color: #c8ccd4;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #282c34;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #c8ccd4;
|
||||
color: #282c34;
|
||||
}
|
||||
}
|
||||
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#workspaces,
|
||||
#clock,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#mpd {
|
||||
padding: 0 10px;
|
||||
margin: 4px 4px 4px 4px;
|
||||
color: #1f2227;
|
||||
}
|
||||
|
||||
#custom-launch {
|
||||
margin-right: 10px;
|
||||
margin-left: 4px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 17px;
|
||||
background-color: #81a1c1;
|
||||
color: #1f2227;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 5px 5px;
|
||||
background-color: transparent;
|
||||
border-radius: 4px;
|
||||
margin-left: 1px;
|
||||
color: #c8ccd4;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background-color: #c8ccd4;
|
||||
color: #1f2227;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #e06c75;
|
||||
color: #282c34;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #e04753;
|
||||
}
|
||||
|
||||
#custom-spotify {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 17px;
|
||||
font-weight: 500;
|
||||
background-color: #98c379;
|
||||
color: #1f2227;
|
||||
}
|
||||
|
||||
#custom-xkblayout {
|
||||
color: #81a1c1;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: #81a1c1;
|
||||
color: #282c34;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
color: #e5c07b;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: #81a1c1;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
#battery {
|
||||
color: #e5c07b;
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
color: #e06c75;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#clock {
|
||||
color: #98c379;
|
||||
}
|
||||
|
||||
#custom-off {
|
||||
margin-right: 4px;
|
||||
margin-left: 11px;
|
||||
padding-left: 10px;
|
||||
padding-right: 8px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 17px;
|
||||
background-color: #e06c75;
|
||||
color: #1f2227;
|
||||
}
|
||||
10
matboot-sway/config/zsh/alias.zsh
Executable file
10
matboot-sway/config/zsh/alias.zsh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# ALIASES
|
||||
alias df='df -l -H'
|
||||
alias ls='ls_extended'
|
||||
alias sn='sncli -c ~/.config/sncli/snclirc'
|
||||
alias neofetch='neofetch --config ~/.config/neofetch/matbook.conf'
|
||||
alias sirot='pacman -Qdt && sudo pacman -Rs $(pacman -Qtdq)'
|
||||
alias swayconf='vim ~/.config/sway/config'
|
||||
|
||||
42
matboot-sway/config/zsh/arhfunc.zsh
Executable file
42
matboot-sway/config/zsh/arhfunc.zsh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# АРХИВЫ
|
||||
unpack() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjf $1 ;;
|
||||
*.tar.gz) tar xzf $1 ;;
|
||||
*.tar.xz) tar xf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "$fg_bold[red]Ошибка:$reset_color Невозможно распаковать '$1'..." ;;
|
||||
esac
|
||||
else
|
||||
echo "$fg_bold[red]Ошибка:$reset_color '$1' - неподдерживаемый тип файла"
|
||||
fi
|
||||
}
|
||||
|
||||
pack() {
|
||||
if [ $1 ] ; then
|
||||
case $1 in
|
||||
tbz) tar cjvf $2.tar.bz2 $2 ;;
|
||||
tgz) tar czvf $2.tar.gz $2 ;;
|
||||
tar) tar cpvf $2.tar $2 ;;
|
||||
bz2) bzip $2 ;;
|
||||
gz) gzip -c -9 -n $2 > $2.gz ;;
|
||||
zip) zip -r $2.zip $2 ;;
|
||||
7z) 7z a $2.7z $2 ;;
|
||||
*) echo "$fg_bold[red]Ошибка:$reset_color '$1' не может быть упакован через pack()" ;;
|
||||
esac
|
||||
else
|
||||
echo "$fg_bold[red]Ошибка:$reset_color '$1' - неподдерживаемый тип файла"
|
||||
fi
|
||||
}
|
||||
|
||||
11
matboot-sway/config/zsh/binds.zsh
Executable file
11
matboot-sway/config/zsh/binds.zsh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/zsh
|
||||
|
||||
#BINDS
|
||||
|
||||
bindkey '^[[24~' clear-screen
|
||||
bindkey "^[OH" beginning-of-line
|
||||
bindkey "^[OF" end-of-line
|
||||
bindkey '^[[1;5D' backward-word
|
||||
bindkey '^[[1;5C' forward-word
|
||||
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
9
matboot-sway/config/zsh/git.zsh
Executable file
9
matboot-sway/config/zsh/git.zsh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/zsh
|
||||
|
||||
#git
|
||||
|
||||
autoload -Uz vcs_info
|
||||
precmd_vcs_info() { vcs_info }
|
||||
precmd_functions+=( precmd_vcs_info )
|
||||
setopt prompt_subst
|
||||
zstyle ':vcs_info:git:*' formats '[ %b]'
|
||||
19
matboot-sway/config/zsh/history.zsh
Executable file
19
matboot-sway/config/zsh/history.zsh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/zsh
|
||||
|
||||
#HISTORY
|
||||
##Где хранить историю
|
||||
HISTFILE=~/.config/zsh-history
|
||||
##Число команд, сохраняемых в HISTFILE
|
||||
SAVEHIST=5000
|
||||
##Чucлo кoмaнд, coxpaняeмыx в сеансе
|
||||
HISTSIZE=5000
|
||||
##Игнорировать повторяющиеся команды
|
||||
setopt HIST_IGNORE_ALL_DUPS
|
||||
##Игнopupoвать лишние пpoбeлы
|
||||
setopt HIST_IGNORE_SPACE
|
||||
##Удалять из файл истории пустые строки
|
||||
setopt HIST_REDUCE_BLANKS
|
||||
##время выполнения команд
|
||||
setopt extended_history
|
||||
##История становится общей между всеми сессиями
|
||||
setopt share_history
|
||||
11
matboot-sway/config/zsh/kitty.zsh
Executable file
11
matboot-sway/config/zsh/kitty.zsh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/zsh
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
# Completion for kitty
|
||||
kitty + complete setup zsh | source /dev/stdin
|
||||
|
||||
# Kitty aliases
|
||||
alias icat='kitty +kitten icat'
|
||||
alias clear='icat --clear && clear'
|
||||
36
matboot-sway/config/zsh/options.zsh
Executable file
36
matboot-sway/config/zsh/options.zsh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/zsh
|
||||
|
||||
autoload -U colors && colors
|
||||
|
||||
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/mat/.local/bin:/usr/bin/core_perl"
|
||||
export EDITOR="vim"
|
||||
export MUTT_EDITOR="vim"
|
||||
export VISUAL="vim"
|
||||
export VIMINIT="source ~/.config/vim/vimrc"
|
||||
export SSH_KEY_PATH="~/.ssh/"
|
||||
export TERM="xterm-kitty"
|
||||
export TERMINAL="kitty"
|
||||
export MOZ_ENABLE_WAYLAND=1
|
||||
|
||||
#НАВИГАЦИЯ
|
||||
##авто cd
|
||||
setopt autocd
|
||||
setopt extended_glob
|
||||
|
||||
##автодополнение TAB
|
||||
autoload -Uz compinit && compinit
|
||||
_comp_options+=(globdots)
|
||||
|
||||
# Установка-снятие опций шелла
|
||||
setopt notify globdots correct pushdtohome cdablevars autolist
|
||||
setopt correctall autocd recexact longlistjobs
|
||||
setopt autoresume histignoredups pushdsilent noclobber
|
||||
setopt autopushd pushdminus extendedglob rcquotes mailwarning
|
||||
unsetopt bgnice autoparamslash
|
||||
unsetopt nomatch
|
||||
|
||||
autoload -Uz bracketed-paste-magic
|
||||
zle -N bracketed-paste bracketed-paste-magic
|
||||
autoload -Uz url-quote-magic
|
||||
zle -N self-insert url-quote-magic
|
||||
unsetopt nomatch
|
||||
5
matboot-sway/config/zsh/prompt.zsh
Executable file
5
matboot-sway/config/zsh/prompt.zsh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# PROMPTS
|
||||
PROMPT=%{$fg_bold[blue]%}'[%n][%~]» '%{$reset_color%}
|
||||
RPROMPT=%{$fg_bold[green]%}\$vcs_info_msg_0_%{$reset_color%}%{$fg_bold[red]%}'[%T]'%{$reset_color%}
|
||||
11
matboot-sway/config/zsh/zshrc
Executable file
11
matboot-sway/config/zsh/zshrc
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/zsh
|
||||
|
||||
for conf in ~/.config/zsh/*.zsh; do
|
||||
source $conf
|
||||
done
|
||||
|
||||
#start sway
|
||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||
exec sway
|
||||
fi
|
||||
|
||||
15
matboot-sway/local/bin/import-gsettings
Executable file
15
matboot-sway/local/bin/import-gsettings
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# usage: import-gsettings
|
||||
config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
|
||||
if [ ! -f "$config" ]; then exit 1; fi
|
||||
|
||||
gnome_schema="org.gnome.desktop.interface"
|
||||
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
|
||||
gsettings set "$gnome_schema" icon-theme "$icon_theme"
|
||||
gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
|
||||
gsettings set "$gnome_schema" font-name "$font_name"
|
||||
44
matboot-sway/local/bin/powermenu
Executable file
44
matboot-sway/local/bin/powermenu
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
option0=" Lock"
|
||||
option1=" Poweroff"
|
||||
option2=" Reboot"
|
||||
option3=" Exit"
|
||||
|
||||
option4="Enable Display"
|
||||
option5="Disable Display"
|
||||
|
||||
options="$option0\n$option1\n$option2\n$option3\n$option4\n$option5"
|
||||
|
||||
selected="$(echo -e "$options" | rofi -lines 4 -dmenu -P " Powermenu:")"
|
||||
|
||||
case $selected in
|
||||
$option0)
|
||||
swaylock \
|
||||
--screenshots \
|
||||
--clock \
|
||||
--indicator \
|
||||
--indicator-radius 100 \
|
||||
--indicator-thickness 7 \
|
||||
--effect-blur 6x5 \
|
||||
--effect-vignette 0.5:0.5 \
|
||||
--ring-color 1f2227 \
|
||||
--key-hl-color e06c75 \
|
||||
--line-color 00000000 \
|
||||
--inside-color 00000088 \
|
||||
--separator-color 00000000 \
|
||||
--grace 2 \
|
||||
--fade-in 0.2;;
|
||||
$option1)
|
||||
systemctl poweroff;;
|
||||
$option2)
|
||||
systemctl reboot;;
|
||||
$option3)
|
||||
swaymsg exit;;
|
||||
$option4)
|
||||
swaymsg output eDP-1 enable;;
|
||||
$option5)
|
||||
swaymsg output eDP-1 disable;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
5
matboot-sway/local/bin/screenshot
Executable file
5
matboot-sway/local/bin/screenshot
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
slurp | grim -g - $HOME/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')
|
||||
|
||||
exit 0
|
||||
Loading…
x
Reference in New Issue
Block a user