Initial commit
This commit is contained in:
commit
6d08af082a
24
LICENSE
Normal file
24
LICENSE
Normal file
|
@ -0,0 +1,24 @@
|
|||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <https://unlicense.org>
|
33
README.md
Normal file
33
README.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# My dotfiles
|
||||
|
||||
This is a collection of some of my dotfiles for my Artix Linux system.
|
||||
|
||||
You can install these dotfiles by cloning this repository and executing `install.sh`.
|
||||
Make sure you have `git` and `stow` installed.
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/theanonymousexyz/dotfiles.git
|
||||
$ cd dotfiles
|
||||
$ chmod +x install.sh
|
||||
$ ./install.sh
|
||||
```
|
||||
|
||||
These dotfiles depend on the following software packages:
|
||||
|
||||
- `alacritty`
|
||||
- `doas`\*
|
||||
- `mako`
|
||||
- `neovim`
|
||||
- `pavucontrol`
|
||||
- `pipewire`/`pulseaudio`
|
||||
- `playerctl`
|
||||
- `python`
|
||||
- `sway`
|
||||
- `swaylock`
|
||||
- `waybar`
|
||||
- `sway-launcher-desktop`
|
||||
|
||||
\* If you prefer `sudo`, then change all instances if `doas` to `sudo`. They're mainly in the sway config file and my `autostart.sh` script.
|
||||
|
||||
Also, you need to make a `doas`/`sudo` rule that allows you to execute `poweroff` and `reboot` without a password, otherwise the keybindings for those won't work.
|
||||
|
51
alacritty/.config/alacritty/alacritty.yml
Normal file
51
alacritty/.config/alacritty/alacritty.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
window:
|
||||
padding:
|
||||
x: 4
|
||||
y: 4
|
||||
decorations: none
|
||||
title: Alacritty
|
||||
dynamic_title: true
|
||||
gtk_theme_variant: dark
|
||||
scrolling:
|
||||
history: 10000
|
||||
font:
|
||||
normal:
|
||||
family: MesloLGS NF
|
||||
size: 10.0
|
||||
draw_bold_text_with_bright_colors: false
|
||||
colors:
|
||||
primary:
|
||||
background: '#0a0a0a'
|
||||
foreground: '#f4f4f4'
|
||||
cursor:
|
||||
text: CellBackground
|
||||
cursor: CellForeground
|
||||
selection:
|
||||
text: CellBackground
|
||||
background: CellForeground
|
||||
normal:
|
||||
black: '#0a0a0a'
|
||||
red: '#ce0000'
|
||||
green: '#29ab00'
|
||||
yellow: '#ffa700'
|
||||
blue: '#0060e5'
|
||||
magenta: '#ce00ce'
|
||||
cyan: '#66e6e6'
|
||||
white: '#f4f4f4'
|
||||
bright:
|
||||
black: '#4c4c4c'
|
||||
red: '#ff0000'
|
||||
green: '#69c44c'
|
||||
yellow: '#ffc14c'
|
||||
blue: '#4c8fec'
|
||||
magenta: '#dc4cdc'
|
||||
cyan: '#93eded'
|
||||
white: '#ffffff'
|
||||
background_opacity: 0.8
|
||||
cursor:
|
||||
style:
|
||||
shape: Block
|
||||
blinking: Never
|
||||
mouse:
|
||||
hide_when_typing: true
|
||||
|
6
autostart/.scripts/autostart.sh
Executable file
6
autostart/.scripts/autostart.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
env SUDO_USER=$USER doas protonvpn c --cc DK
|
||||
# Uncomment to use sudo instead of doas, comment the above
|
||||
#sudo protonvpn c --cc DK
|
||||
sway-launcher-desktop autostart
|
19
mako/.config/mako/config
Normal file
19
mako/.config/mako/config
Normal file
|
@ -0,0 +1,19 @@
|
|||
sort=-time
|
||||
layer=overlay
|
||||
background-color=#0a0a0acc
|
||||
border-size=2
|
||||
border-color=#ffa700
|
||||
border-radius=12
|
||||
icons=1
|
||||
max-icon-size=64
|
||||
default-timeout=10000
|
||||
ignore-timeout=1
|
||||
|
||||
[urgency=low]
|
||||
border-color=#0060e5
|
||||
default-timeout=5000
|
||||
|
||||
[urgency=high]
|
||||
border-color=#ce0000
|
||||
default-timeout=0
|
||||
|
3
nvim/.config/nvim/init.vim
Normal file
3
nvim/.config/nvim/init.vim
Normal file
|
@ -0,0 +1,3 @@
|
|||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
||||
let &packpath = &runtimepath
|
||||
source ~/.vimrc
|
1117
nvim/.vim/colors/solarized.vim
Normal file
1117
nvim/.vim/colors/solarized.vim
Normal file
File diff suppressed because it is too large
Load diff
46
nvim/.vimrc
Normal file
46
nvim/.vimrc
Normal file
|
@ -0,0 +1,46 @@
|
|||
set nocompatible
|
||||
filetype off
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
set modelines=0
|
||||
set number
|
||||
set ruler
|
||||
set encoding=utf-8
|
||||
set wrap
|
||||
set textwidth=79
|
||||
set formatoptions=tcqrn1
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set expandtab
|
||||
set noshiftround
|
||||
set scrolloff=3
|
||||
set backspace=indent,eol,start
|
||||
set matchpairs+=<:> " use % to jump between pairs
|
||||
runtime! macros/matchit.vim
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
set hidden
|
||||
set ttyfast
|
||||
set laststatus=2
|
||||
set showmode
|
||||
set showcmd
|
||||
nnoremap / /\v
|
||||
vnoremap / /\v
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set showmatch
|
||||
map <leader><space> :let @/=''<cr> " clear search
|
||||
inoremap <F1> <ESC>:set invfullscreen<CR>a
|
||||
nnoremap <F1> :set invfullscreen<CR>
|
||||
vnoremap <F1> :set invfullscreen<CR>
|
||||
map <leader>q gqip
|
||||
set listchars=tab:▸\ ,eol:¬
|
||||
map <leader>l :set list!<CR> " Toggle tabs and EOL
|
||||
set t_Co=256
|
||||
set background=dark
|
||||
let g:solarized_termcolors=256
|
||||
let g:solarized_termtrans=1
|
||||
colorscheme solarized
|
210
sway/.config/sway/config
Normal file
210
sway/.config/sway/config
Normal file
|
@ -0,0 +1,210 @@
|
|||
# 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 (changed to arrow keys on 2021-08-28)
|
||||
set $left Left
|
||||
set $down Down
|
||||
set $up Up
|
||||
set $right Right
|
||||
# Your preferred terminal emulator
|
||||
set $term alacritty
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
set $menu exec $term --class launcher -t "Application Launcher" -e env HIST_FILE="" /usr/bin/sway-launcher-desktop
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||
output * bg ~/Pictures/Wallpapers/jonatan-pie-3l3RwQdHRHg-unsplash.jpg 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 swayidle -w \
|
||||
timeout 600 'swaylock' \
|
||||
timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep 'swaylock'
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# input "2:14:SynPS/2_Synaptics_TouchPad" {
|
||||
# dwt enabled
|
||||
# tap enabled
|
||||
# natural_scroll enabled
|
||||
# middle_emulation 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+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
|
||||
|
||||
# Lock the screen
|
||||
bindsym $mod+l exec swaylock
|
||||
|
||||
# Exit sway (logs you out of your Wayland session)
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'Log out?' -b 'Yes' 'swaymsg exit'
|
||||
|
||||
# Reboot
|
||||
bindsym $mod+Shift+r exec swaynag -t warning -m 'Reboot?' -b 'Yes' 'doas reboot'
|
||||
# Uncomment to use sudo instead of doas, comment the above
|
||||
#bindsym $mod+Shift+r exec swaynag -t warning -m 'Reboot?' -b 'Yes' 'sudo reboot'
|
||||
|
||||
# Power off
|
||||
bindsym $mod+Shift+q exec swaynag -t warning -m 'Shut down?' -b 'Yes' 'doas poweroff'
|
||||
# Uncomment to use sudo instead of doas, comment the above
|
||||
#bindsym $mod+Shift+q exec swaynag -t warning -m 'Shut down?' -b 'Yes' 'sudo poweroff'
|
||||
|
||||
#
|
||||
# Screenshotting:
|
||||
#
|
||||
bindsym Print exec grimshot --notify save output
|
||||
bindsym Shift+Print exec grimshot --notify save area
|
||||
bindsym Ctrl+Print exec grimshot --notify copy output
|
||||
bindsym Shift+Ctrl+Print exec grimshot --notify copy area
|
||||
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# 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
|
||||
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; workspace number 1
|
||||
bindsym $mod+Shift+2 move container to workspace number 2; workspace number 2
|
||||
bindsym $mod+Shift+3 move container to workspace number 3; workspace number 3
|
||||
bindsym $mod+Shift+4 move container to workspace number 4; workspace number 4
|
||||
bindsym $mod+Shift+5 move container to workspace number 5; workspace number 5
|
||||
bindsym $mod+Shift+6 move container to workspace number 6; workspace number 6
|
||||
bindsym $mod+Shift+7 move container to workspace number 7; workspace number 7
|
||||
bindsym $mod+Shift+8 move container to workspace number 8; workspace number 8
|
||||
bindsym $mod+Shift+9 move container to workspace number 9; workspace number 9
|
||||
bindsym $mod+Shift+0 move container to workspace number 10; 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
|
||||
bindsym $mod+v splitv
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# 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
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# 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
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Status Bar:
|
||||
bar {
|
||||
swaybar_command waybar
|
||||
}
|
||||
|
||||
include ~/.config/sway/config.d/*
|
24
sway/.config/sway/config.d/appearance
Normal file
24
sway/.config/sway/config.d/appearance
Normal file
|
@ -0,0 +1,24 @@
|
|||
###############################
|
||||
# #
|
||||
# APPEARANCE #
|
||||
# #
|
||||
###############################
|
||||
|
||||
default_border pixel 2
|
||||
hide_edge_borders smart
|
||||
|
||||
gaps inner 8
|
||||
gaps outer 10
|
||||
|
||||
### COLORS ###
|
||||
|
||||
# border, bground and text only apply to window titlebars
|
||||
# class border bground text indicator child_border
|
||||
client.focused #0060E5 #000000 #FFFFFF #0043A0 #0060E5
|
||||
client.focused_inactive #222222 #000000 #FFFFFF #111111 #222222
|
||||
client.unfocused #222222 #000000 #FFFFFF #000000 #222222
|
||||
client.urgent #900000 #000000 #FFFFFF #0043A0 #900000
|
||||
client.placeholder #0C0C0C #000000 #FFFFFF #0043A0 #0C0C0C
|
||||
|
||||
client.background #FFFFFF
|
||||
|
36
sway/.config/sway/config.d/behavior
Normal file
36
sway/.config/sway/config.d/behavior
Normal file
|
@ -0,0 +1,36 @@
|
|||
###############################
|
||||
# #
|
||||
# BEHAVIOR #
|
||||
# #
|
||||
###############################
|
||||
|
||||
# Application autostart
|
||||
exec mako
|
||||
exec ~/.scripts/autostart.sh
|
||||
|
||||
# Window focus doesn't follow mouse
|
||||
focus_follows_mouse no
|
||||
|
||||
# Mouse doesn't move to workspace on workspace change
|
||||
mouse_warping none
|
||||
|
||||
# Workspace 10 always on second monitor (I use this for Spotify, feel free to change)
|
||||
workspace 10 output "DP-2"
|
||||
|
||||
### APPLICATION SPECIFIC ###
|
||||
|
||||
# Config for sway-launcher-desktop
|
||||
for_window [app_id="^launcher$"] floating enable, resize set 30 ppt 60 ppt, border pixel 4
|
||||
|
||||
# Floating window for KeePassXC-Browser popup
|
||||
for_window [title="^Unlock Database - KeePassXC$"] floating enable, resize set 40 ppt 55 ppt,
|
||||
|
||||
# Nextcloud main status window (when clicking on tray icon)
|
||||
for_window [title="^Nextcloud$"] floating enable, border none,
|
||||
|
||||
# NoScript pop-ups in Tor Browser
|
||||
for_window [title="about:blank - - Tor Browser"] floating enable,
|
||||
|
||||
# About Tor Browser window
|
||||
for_window [title="^About Tor Browser$"] floating enable,
|
||||
|
45
sway/.config/sway/config.d/input
Normal file
45
sway/.config/sway/config.d/input
Normal file
|
@ -0,0 +1,45 @@
|
|||
###############################
|
||||
# #
|
||||
# INPUT DEVICES #
|
||||
# #
|
||||
###############################
|
||||
|
||||
input type:keyboard {
|
||||
xkb_layout dk
|
||||
}
|
||||
|
||||
input type:touchpad {
|
||||
drag enabled
|
||||
natural_scroll enabled
|
||||
scroll_factor 0.5
|
||||
tap enabled
|
||||
}
|
||||
|
||||
input type:pointer {
|
||||
accel_profile flat # I hate mouse acceleration
|
||||
natural_scroll disabled
|
||||
}
|
||||
|
||||
### DEVICE SPECIFIC ###
|
||||
|
||||
input 6940:6958:Corsair_Corsair_Gaming_M65_Pro_RGB_Mouse {
|
||||
pointer_accel -0.5
|
||||
}
|
||||
|
||||
### KEYBINDS ###
|
||||
|
||||
# PipeWire controls
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +2%
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -2%
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute 0 toggle
|
||||
|
||||
# Media player controls
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioStop exec playerctl stop
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
# Sreen brightness controls
|
||||
bindsym XF86MonBrightnessUp exec light -A 5
|
||||
bindsym XF86MonBrightnessDown exec light -U 5
|
29
swaylock/.config/swaylock/config
Normal file
29
swaylock/.config/swaylock/config
Normal file
|
@ -0,0 +1,29 @@
|
|||
clock
|
||||
show-failed-attempts
|
||||
indicator
|
||||
indicator-radius=128
|
||||
indicator-thickness=8
|
||||
screenshots
|
||||
effect-blur=9x5
|
||||
effect-vignette=0.4:0.8
|
||||
ring-color=0060e5
|
||||
ring-clear-color=0060e5
|
||||
ring-ver-color=29ab00
|
||||
ring-wrong-color=ce0000
|
||||
separator-color=0060e5
|
||||
line-uses-ring
|
||||
inside-color=00000095
|
||||
inside-clear-color=00000095
|
||||
inside-ver-color=00000095
|
||||
inside-wrong-color=00000095
|
||||
text-color=ffa700
|
||||
text-caps-lock-color=ffa700
|
||||
text-clear-color=ffa700
|
||||
text-ver-color=29ab00
|
||||
text-wrong-color=ce0000
|
||||
key-hl-color=66e6e6
|
||||
bs-hl-color=ce00ce
|
||||
fade-in=0.2
|
||||
grace=2
|
||||
grace-no-mouse
|
||||
ignore-empty-password
|
123
waybar/.config/waybar/config
Normal file
123
waybar/.config/waybar/config
Normal file
|
@ -0,0 +1,123 @@
|
|||
{
|
||||
"layer": "top", // Waybar at top layer
|
||||
"position": "top", // Waybar position (top|bottom|left|right)
|
||||
"height": 24, // Waybar height (to be removed for auto height)
|
||||
// "width": 1280, // Waybar width
|
||||
// Choose the order of the modules
|
||||
"modules-left": ["idle_inhibitor", "sway/workspaces", "tray", "custom/media", "sway/mode"],
|
||||
"modules-center": ["sway/window"],
|
||||
"modules-right": ["custom/pvpn", "network", "pulseaudio", "cpu", "memory", "battery", "clock"],
|
||||
// Modules configuration
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
//"all-outputs": true,
|
||||
/* "format": "{name}{icon}", */
|
||||
"format-icons": {
|
||||
"1": " \uf120", // terminal
|
||||
"2": " \uf121", // code
|
||||
"3": " \ue007", // firefox-browser
|
||||
"4": " \uf3ed", // shield-alt
|
||||
"5": " \uf0c0", // users
|
||||
"6": " \uf086", // comments
|
||||
"7": "",
|
||||
"8": "",
|
||||
"9": "",
|
||||
"10": " \uf51f", // compact-disc
|
||||
}
|
||||
},
|
||||
"sway/window": {
|
||||
"max-length": 64
|
||||
},
|
||||
"sway/mode": {
|
||||
"format": "<span style=\"italic\">{}</span>"
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "\uf06e", // eye
|
||||
"deactivated": "\uf070" // eye-slash
|
||||
},
|
||||
"tooltip": false
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 14,
|
||||
"spacing": 8
|
||||
},
|
||||
"clock": {
|
||||
"timezone": "Europe/Copenhagen",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"format": "{:%Y-%m-%d \uf783 %T \uf017}", // calendar-day, clock
|
||||
"interval": 1
|
||||
},
|
||||
"cpu": {
|
||||
"format": "{usage}% \uf2db", // microchip
|
||||
"tooltip": true
|
||||
},
|
||||
"memory": {
|
||||
"format": "{}% \uf538"
|
||||
},
|
||||
"temperature": {
|
||||
//"thermal-zone": 2,
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon5/temp1_input",
|
||||
"critical-threshold": 90,
|
||||
"format-critical": "Critical! {temperatureC}°C {icon}",
|
||||
"format": "{temperatureC}°C {icon}",
|
||||
"format-icons": ["\uf2cb", "\uf76b", "\uf769"], // thermometer-empty, temperature-low, temperature-high
|
||||
"tooltip": true
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
"good": 95,
|
||||
"warning": 20,
|
||||
"critical": 10
|
||||
},
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-charging": "{capacity}% \uf5e7", // charging-station
|
||||
"format-plugged": "{capacity}% \uf1e6", // plug
|
||||
"format-alt": "{time} {icon}",
|
||||
"format-icons": ["\uf244", "\uf243", "\uf242", "\uf241", "\uf240"] // battery-empty, battery-quarter, battery-half, battery-three-quarters, battery-full
|
||||
},
|
||||
"network": {
|
||||
// "interface": "wlp2*", // (Optional) To force the use of this interface
|
||||
"format-wifi": "{essid} ({signalStrength}%) ",
|
||||
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format-disconnected": "Disconnected \uf071" // exclamation-triangle
|
||||
},
|
||||
"pulseaudio": {
|
||||
"scroll-step": 2, // %, can be a float
|
||||
"format": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth-muted": " {icon} {format_source}",
|
||||
"format-muted": " {format_source}",
|
||||
"format-source": "{volume}% ",
|
||||
"format-source-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"on-click": "/usr/bin/pavucontrol"
|
||||
},
|
||||
"custom/media": {
|
||||
"format": "{icon} {}",
|
||||
"return-type": "json",
|
||||
"max-length": 64,
|
||||
"format-icons": {
|
||||
"chromium": "\uf1bc", // spotify (I use Spotify in my browser)
|
||||
},
|
||||
"escape": true,
|
||||
// "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
||||
"exec": "$HOME/.config/waybar/mediaplayer.py --player chromium 2> /dev/null" // Filter player based on name
|
||||
},
|
||||
"custom/pvpn": { // Custom status module for ProtonVPN
|
||||
"format": "ProtonVPN {}",
|
||||
"exec": "$HOME/.config/waybar/pvpn.sh",
|
||||
"return-type": "json",
|
||||
"interval": 5
|
||||
}
|
||||
}
|
127
waybar/.config/waybar/mediaplayer.py
Executable file
127
waybar/.config/waybar/mediaplayer.py
Executable file
|
@ -0,0 +1,127 @@
|
|||
#!/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
|
||||
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()
|
15
waybar/.config/waybar/pvpn.sh
Executable file
15
waybar/.config/waybar/pvpn.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
STATUS=`protonvpn status | awk '{print "\\\n"$0}'`
|
||||
TOOLTIP=`echo -E ${STATUS} | cut -c 3-`
|
||||
CLASS=`echo ${STATUS} | grep 'Status' | awk '{print $2}'`
|
||||
TEXT=""
|
||||
|
||||
if [ $CLASS == "Connected" ]; then
|
||||
TEXT="\uf084" # key
|
||||
else
|
||||
TEXT="\uf071" # exclamation-triangle
|
||||
fi
|
||||
|
||||
echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}"
|
||||
|
209
waybar/.config/waybar/style.css
Normal file
209
waybar/.config/waybar/style.css
Normal file
|
@ -0,0 +1,209 @@
|
|||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
/* `otf-font-awesome` is required to be installed for icons */
|
||||
/* Find Ubuntu Condensed font somewhere and install it in your system, it is NOT installed by default */
|
||||
font-family: "Ubuntu Condensed", "Font Awesome 5 Free Solid", "Font Awesome 5 Free Regular", "Font Awesome 5 Brands Regular", sans-serif;
|
||||
font-size: 15px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(10, 10, 10, 0.8);
|
||||
color: #66e6e6;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 2px;
|
||||
margin: 0 2px;
|
||||
color: #664200;
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
box-shadow: inset 0 -2px #664200;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
#workspaces button:hover {
|
||||
background: transparent;
|
||||
color: #b27400;
|
||||
box-shadow: inset 0 -2px #b27400;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #ffa700;
|
||||
box-shadow: inset 0 -2px #ffa700;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#mode {
|
||||
color: #0060e5;
|
||||
box-shadow: inset 0 -2px #0060e5;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#mpd,
|
||||
#custom-pvpn{
|
||||
padding: 0 5px;
|
||||
margin: 0 3px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#window {
|
||||
margin: 0 12px;
|
||||
}
|
||||
|
||||
/* If workspaces is the leftmost module, omit left margin */
|
||||
.modules-left > widget:first-child > #workspaces {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* If workspaces is the rightmost module, omit right margin */
|
||||
.modules-right > widget:last-child > #workspaces {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#clock {
|
||||
color: #ffa700;
|
||||
box-shadow: inset 0 -2px #ffa700;
|
||||
}
|
||||
|
||||
#battery {
|
||||
color: #66e6e6;
|
||||
box-shadow: inset 0 -2px #66e6e6;
|
||||
}
|
||||
|
||||
#battery.charging, #battery.plugged {
|
||||
color: #29ab00;
|
||||
box-shadow: inset 0 -2px #29ab00;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #f53c3c;
|
||||
color: #ffffff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
color: #29ab00;
|
||||
box-shadow: inset 0 -2px #29ab00;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: #ce00ce;
|
||||
box-shadow: inset 0 -2px #ce00ce;
|
||||
}
|
||||
|
||||
#disk {
|
||||
background-color: #964B00;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
color: #66e6e6;
|
||||
box-shadow: inset 0 -2px #66e6e6;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: #0060e5;
|
||||
box-shadow: inset 0 -2px #0060e5;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
color: #ce0000;
|
||||
box-shadow: inset 0 -2px #ce0000;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #ffa700;
|
||||
box-shadow: inset 0 -2px #ffa700;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
color: #ffa700;
|
||||
box-shadow: inset 0 -2px #ffa700;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
background-color: transparent;
|
||||
color: #ffa700;
|
||||
box-shadow: inset 0 -2px #ffa700;
|
||||
}
|
||||
|
||||
#custom-media.custom-chromium {
|
||||
background-color: transparent;
|
||||
color: #29ab00;
|
||||
box-shadow: inset 0 -2px #29ab00;
|
||||
}
|
||||
|
||||
#custom-media.custom-vlc {
|
||||
background-color: #ffa000;
|
||||
}
|
||||
|
||||
#tray {
|
||||
color: #66e6e6;
|
||||
box-shadow: inset 0 -2px #66e6e6;
|
||||
}
|
||||
|
||||
#tray > .passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
||||
#tray > .needs-attention {
|
||||
-gtk-icon-effect: highlight;
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
color: #003072;
|
||||
box-shadow: inset 0 -2px #003072;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
color: #0060e5;
|
||||
box-shadow: inset 0 -2px #0060e5;
|
||||
}
|
||||
|
||||
#custom-pvpn {
|
||||
color: #ce0000;
|
||||
box-shadow: inset 0 -2px #ce0000;
|
||||
}
|
||||
|
||||
#custom-pvpn.Connected {
|
||||
color: #29ab00;
|
||||
box-shadow: inset 0 -2px #29ab00;
|
||||
}
|
||||
|
Loading…
Reference in a new issue