Compare commits

..

1 Commits

Author SHA1 Message Date
a48d49cffb NixOS config 2022-08-30 22:24:49 +03:00
137 changed files with 7770 additions and 292 deletions

View File

@ -1,43 +0,0 @@
# Base16 Solarized Light - kitty color config
# Scheme by Ethan Schoonover (modified by aramisgithub)
background #fdf6e3
foreground #586e75
selection_background #586e75
selection_foreground #fdf6e3
url_color #657b83
cursor #586e75
active_border_color #839496
inactive_border_color #eee8d5
active_tab_background #fdf6e3
active_tab_foreground #586e75
inactive_tab_background #eee8d5
inactive_tab_foreground #657b83
tab_bar_background #eee8d5
# normal
color0 #fdf6e3
color1 #dc322f
color2 #859900
color3 #b58900
color4 #268bd2
color5 #6c71c4
color6 #2aa198
color7 #586e75
# bright
color8 #839496
color9 #dc322f
color10 #859900
color11 #b58900
color12 #268bd2
color13 #6c71c4
color14 #2aa198
color15 #002b36
# extended base16 colors
color16 #cb4b16
color17 #d33682
color18 #eee8d5
color19 #93a1a1
color20 #657b83
color21 #073642

View File

@ -1,9 +1,139 @@
font_family Fira Code Regular
font_family Fira Code Medium
bold_font Fira Code Bold
italic_font Fira Code Italic
bold_italic_font auto
font_size 12.0
#window_padding_width 2.0
#window_padding_height 2.0
#include base16-solarized-light-256.conf
include base16-gruvbox-dark-medium-256.conf
font_size 11.0
window_padding_width 2.0
window_padding_height 2.0
# Base16 Gruvbox dark, hard - kitty color config
# Scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
background #1d2021
foreground #d5c4a1
selection_background #d5c4a1
selection_foreground #1d2021
url_color #bdae93
cursor #d5c4a1
active_border_color #665c54
inactive_border_color #3c3836
active_tab_background #1d2021
active_tab_foreground #d5c4a1
inactive_tab_background #3c3836
inactive_tab_foreground #bdae93
tab_bar_background #3c3836
# normal
color0 #1d2021
color1 #fb4934
color2 #b8bb26
color3 #fabd2f
color4 #83a598
color5 #d3869b
color6 #8ec07c
color7 #d5c4a1
# bright
color8 #665c54
color9 #fb4934
color10 #b8bb26
color11 #fabd2f
color12 #83a598
color13 #d3869b
color14 #8ec07c
color15 #fbf1c7
# extended base16 colors
color16 #fe8019
color17 #d65d0e
color18 #3c3836
color19 #504945
color20 #bdae93
color21 #ebdbb2
## Base16 Solarized Dark - kitty color config
## Scheme by Ethan Schoonover (modified by aramisgithub)
#background #002b36
#foreground #93a1a1
#selection_background #93a1a1
#selection_foreground #002b36
#url_color #839496
#cursor #93a1a1
#active_border_color #657b83
#inactive_border_color #073642
#active_tab_background #002b36
#active_tab_foreground #93a1a1
#inactive_tab_background #073642
#inactive_tab_foreground #839496
#tab_bar_background #073642
#
## normal
#color0 #002b36
#color1 #dc322f
#color2 #859900
#color3 #b58900
#color4 #268bd2
#color5 #6c71c4
#color6 #2aa198
#color7 #93a1a1
#
## bright
#color8 #657b83
#color9 #dc322f
#color10 #859900
#color11 #b58900
#color12 #268bd2
#color13 #6c71c4
#color14 #2aa198
#color15 #fdf6e3
#
## extended base16 colors
#color16 #cb4b16
#color17 #d33682
#color18 #073642
#color19 #586e75
#color20 #839496
#color21 #eee8d5
# Base16 Default Dark - kitty color config
## Scheme by Chris Kempson (http://chriskempson.com)
#background #181818
#foreground #d8d8d8
#selection_background #d8d8d8
#selection_foreground #181818
#url_color #b8b8b8
#cursor #d8d8d8
#active_border_color #585858
#inactive_border_color #282828
#active_tab_background #181818
#active_tab_foreground #d8d8d8
#inactive_tab_background #282828
#inactive_tab_foreground #b8b8b8
#tab_bar_background #282828
#
## normal
#color0 #181818
#color1 #ab4642
#color2 #a1b56c
#color3 #f7ca88
#color4 #7cafc2
#color5 #ba8baf
#color6 #86c1b9
#color7 #d8d8d8
#
## bright
#color8 #585858
#color9 #ab4642
#color10 #a1b56c
#color11 #f7ca88
#color12 #7cafc2
#color13 #ba8baf
#color14 #86c1b9
#color15 #f8f8f8
#
## extended base16 colors
#color16 #dc9656
#color17 #a16946
#color18 #282828
#color19 #383838
#color20 #b8b8b8
#color21 #e8e8e8

View File

@ -1,21 +1,21 @@
# Base16 Gruvbox dark, medium - kitty color config
# Base16 Gruvbox dark, hard - kitty color config
# Scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
background #282828
background #1d2021
foreground #d5c4a1
selection_background #d5c4a1
selection_foreground #282828
selection_foreground #1d2021
url_color #bdae93
cursor #d5c4a1
active_border_color #665c54
inactive_border_color #3c3836
active_tab_background #282828
active_tab_background #1d2021
active_tab_foreground #d5c4a1
inactive_tab_background #3c3836
inactive_tab_foreground #bdae93
tab_bar_background #3c3836
# normal
color0 #282828
color0 #1d2021
color1 #fb4934
color2 #b8bb26
color3 #fabd2f

View File

@ -0,0 +1,43 @@
# Base16 Solarized Dark - kitty color config
# Scheme by Ethan Schoonover (modified by aramisgithub)
background #002b36
foreground #93a1a1
selection_background #93a1a1
selection_foreground #002b36
url_color #839496
cursor #93a1a1
active_border_color #657b83
inactive_border_color #073642
active_tab_background #002b36
active_tab_foreground #93a1a1
inactive_tab_background #073642
inactive_tab_foreground #839496
tab_bar_background #073642
# normal
color0 #002b36
color1 #dc322f
color2 #859900
color3 #b58900
color4 #268bd2
color5 #6c71c4
color6 #2aa198
color7 #93a1a1
# bright
color8 #657b83
color9 #dc322f
color10 #859900
color11 #b58900
color12 #268bd2
color13 #6c71c4
color14 #2aa198
color15 #fdf6e3
# extended base16 colors
color16 #cb4b16
color17 #d33682
color18 #073642
color19 #586e75
color20 #839496
color21 #eee8d5

View File

@ -5,35 +5,7 @@ map i $~/.config/lf/pv.sh $f | less -R
cmd trash %trash-put "$fx"
# Search with fzf
# map f $vi $(fzf)
# If you want to jump to a file or directory in lf using fuzzy matching, you can utilize fzf for this purpose:
cmd fzf_jump ${{
res="$(fd . | fzf --reverse --header='Jump to location' | sed 's/\\/\\\\/g;s/"/\\"/g')"
if [ -d "$res" ] ; then
cmd="cd"
elif [ -f "$res" ] ; then
cmd="select"
else
exit 0
fi
lf -remote "send $id $cmd \"$res\""
}}
map f :fzf_jump
# Combining fzf with ripgrep, you can interactively search in the contents of files under the current directory and select a file from the results:
cmd fzf_search ${{
res="$( \
RG_PREFIX="rg --column --line-number --no-heading --color=always \
--smart-case "
FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --layout=reverse --header 'Search in files' \
| cut -d':' -f1
)"
[ ! -z "$res" ] && lf -remote "send $id select \"$res\""
}}
map gs :fzf_search
map f $vi $(fzf)
# Recreate open-with with lf
cmd open-with %"$@" "$fx"

View File

@ -1,4 +0,0 @@
"set runtimepath^=~/.vim runtimepath+=~/.vim/after
"let &packpath=&runtimepath
"source ~/.vimrc
GuiFont! Fira\ Code:h11:m

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -1,19 +0,0 @@
## Base16 Gruvbox dark, medium
# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
set $base00 #282828
set $base01 #3c3836
set $base02 #504945
set $base03 #665c54
set $base04 #bdae93
set $base05 #d5c4a1
set $base06 #ebdbb2
set $base07 #fbf1c7
set $base08 #fb4934
set $base09 #fe8019
set $base0A #fabd2f
set $base0B #b8bb26
set $base0C #8ec07c
set $base0D #83a598
set $base0E #d3869b
set $base0F #d65d0e

View File

@ -1,19 +0,0 @@
## Base16 Solarized Light
# Author: Ethan Schoonover (modified by aramisgithub)
set $base00 #fdf6e3
set $base01 #eee8d5
set $base02 #93a1a1
set $base03 #839496
set $base04 #657b83
set $base05 #586e75
set $base06 #073642
set $base07 #002b36
set $base08 #dc322f
set $base09 #cb4b16
set $base0A #b58900
set $base0B #859900
set $base0C #2aa198
set $base0D #268bd2
set $base0E #6c71c4
set $base0F #d33682

View File

@ -35,10 +35,10 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
#exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
exec swayidle -w \
timeout 300 'swaylock -f -c 000000' \
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f -c 000000'
#
# 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
@ -244,20 +244,17 @@ bindsym $mod+Shift+0 move container to workspace $ws10
# Assignments
assign [app_id="^firefox$"] → $ws3
assign [app_id="^librewolf$"] → $ws3
assign [app_id="^cantata$"] → $ws10
assign [app_id="^org.keepassxc.KeePassXC$" title="^Avaa tietokanta"] → $ws3
assign [app_id="^org.keepassxc.KeePassXC$" title="(?!Avaa tietokanta)"] → $ws9
assign [app_id="^pavucontrol$"] → $ws10
assign [app_id="^blueman-manager$"] → $ws10
assign [app_id="^lutris$"] → $ws6
assign [app_id="com.nextcloud.desktopclient.nextcloud"] → $ws10
assign [app_id="^Element$"] → $ws2
assign [class="^krita$"] → $ws4
assign [class="^Blender$"] → $ws4
assign [class="^Gimp$"] → $ws4
assign [class="^Nextcloud$"] → $ws10
assign [class="^Element$"] → $ws2
assign [app_id="^Element$"] → $ws2
# Modifiers
for_window [app_id="telegramdesktop" title="(.*)Telegram(.*)"] floating enable, move scratchpad
@ -266,7 +263,6 @@ for_window [app_id="mpv"] floating enable, move position center
for_window [app_id="net.sourceforge.mumble.mumble"] floating enable, move position center
for_window [app_id="imv"] floating enable
for_window [app_id="com.nextcloud.desktopclient.nextcloud"] floating enable, move position mouse, move down 25px
for_window [app_id="opensnitch_ui"] floating enable, move position center
for_window [class="itch"] floating enable
# for_window [class="Wine"] floating enable
for_window [class="vlc"] floating enable
@ -278,9 +274,6 @@ for_window [class="boincmgr"] floating disable
# Games
for_window [class="kfgame.exe"] floating enable
for_window [class="noita.exe"] floating enable
for_window [class="^galaxyclient.exe$"] floating enable
for_window [class="epicgameslauncher.exe"] floating enable
for_window [class="Origin"] floating enable
for_window [class="^steam_app"] floating enable
for_window [class="Wine"] floating enable
@ -312,17 +305,85 @@ bindsym $mod+t [app_id="telegramdesktop"] scratchpad show
bindsym $mod+n [class="^Nextcloud"] scratchpad show
# gaps
#smart_borders off
#smart_gaps on
#gaps outer 0
#gaps inner 10
smart_borders off
smart_gaps off
gaps outer 0
gaps inner 0
## Base16 Gruvbox dark, hard
# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
#
# You can use these variables anywhere in the i3 configuration file.
#set $base00 #1d2021
#set $base01 #3c3836
#set $base02 #504945
#set $base03 #665c54
#set $base04 #bdae93
#set $base05 #d5c4a1
#set $base06 #ebdbb2
#set $base07 #fbf1c7
#set $base08 #fb4934
#set $base09 #fe8019
#set $base0A #fabd2f
#set $base0B #b8bb26
#set $base0C #8ec07c
#set $base0D #83a598
#set $base0E #d3869b
#set $base0F #d65d0e
# https://github.com/khamer/base16-i3/tree/master/colors
## Base16 Solarized Light
# Author: Ethan Schoonover (modified by aramisgithub)
#
# You can use these variables anywhere in the i3 configuration file.
#set $base00 #fdf6e3
#set $base01 #eee8d5
#set $base02 #93a1a1
#set $base03 #839496
#set $base04 #657b83
#set $base05 #586e75
#set $base06 #073642
#set $base07 #002b36
#set $base08 #dc322f
#set $base09 #cb4b16
#set $base0A #b58900
#set $base0B #859900
#set $base0C #2aa198
#set $base0D #268bd2
#set $base0E #6c71c4
#set $base0F #d33682
## Base16 Solarized Dark
# Author: Ethan Schoonover (modified by aramisgithub)
#
# You can use these variables anywhere in the i3 configuration file.
set $base00 #002b36
set $base01 #073642
set $base02 #586e75
set $base03 #657b83
set $base04 #839496
set $base05 #93a1a1
set $base06 #eee8d5
set $base07 #fdf6e3
set $base08 #dc322f
set $base09 #cb4b16
set $base0A #b58900
set $base0B #859900
set $base0C #2aa198
set $base0D #268bd2
set $base0E #6c71c4
set $base0F #d33682
# Basic bar configuration using the Base16 variables.
bar {
swaybar_command waybar
}
include /home/lanxu/.config/sway/base16-gruvbox-dark-medium.config
# Basic color configuration using the Base16 variables for windows and borders.
# Property Name Border BG Text Indicator Child Border
client.focused $base05 $base0D $base00 $base0D $base0C
@ -340,7 +401,7 @@ exec --no-startup-id "dunst" # in case multiple daemons are installed
# Services
exec --no-startup-id "mpd /home/lanxu/.config/mpd/mpd.conf" # Music Player Daemon
exec --no-startup-id "systemd-run --user --unit=fullscreen-inhibitor --on-calendar='*:*:0/15' /home/lanxu/Scripts/sway/fullscreen-inhibitor.sh" # Fullscreen inhibitor for dunst
#exec --no-startup-id "./Scripts/sway_screensaver.sh" # Screensaver
exec --no-startup-id "udiskie --notify --automount" # Automounter
@ -349,21 +410,15 @@ exec --no-startup-id "cantata"
exec --no-startup-id "pavucontrol"
exec --no-startup-id "keepassxc" # Password manager
exec --no-startup-id "nextcloud --background"
exec --no-startup-id "gammastep -l 61.49911:23.78712" # blue light filter, flickers
# Applications
exec --no-startup-id "dex -a -s ~/.config/autostart/"
# exec --no-startup-id "telegram-desktop" # Added to autostart
# exec --no-startup-id "element-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland" # Added to autostart
# exec --no-startup-id "steam" # Should be done with autostart
exec --no-startup-id "telegram-desktop"
exec --no-startup-id "element-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland"
exec --no-startup-id "steam"
# Set manual layout for tray workspace
#exec --no-startup-id "i3-msg 'workspace 10:tray; append_layout /home/lanxu/.config/i3/tray.json'"
set $locker 'swaylock -f -c 000000'
exec swayidle -w \
timeout 60 $locker \
timeout 65 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep $locker
bindsym XF86AudioStop exec --no-startup-id mpc stop
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
@ -376,14 +431,11 @@ bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ to
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
# Print screen
bindsym $mod+F8 exec --no-startup-id "./Scripts/sway/take_screencast.sh region-copy"
bindsym $mod+Shift+F8 exec --no-startup-id "./Scripts/sway/take_screencast.sh region"
bindsym $mod+Print exec --no-startup-id "./Scripts/sway/take_screenshot.sh region-copy"
bindsym $mod+Shift+Print exec --no-startup-id "./Scripts/sway/take_screenshot.sh region"
bindsym Print exec --no-startup-id "./Scripts/sway/take_screenshot.sh screen"
#bindsym Print exec --no-startup-id flameshot gui
#bindsym Scroll_Lock exec --no-startup-id "./Scripts/powermenu.sh"
# With Keychron Scroll_Lock is assigned automatically to mod+c (microphone on windows)
bindsym $mod+c exec --no-startup-id "./Scripts/powermenu.sh"
# Moving desktops
@ -391,32 +443,18 @@ bindsym $mod+o move workspace to output left
bindsym $mod+Ctrl+Right move workspace to output right
bindsym $mod+Ctrl+Left move workspace to output left
## One screen
##output HDMI-A-1 disable
#output HDMI-A-2 disable
##output DP-2 pos 0 0 res 1920x1080@60Hz adaptive_sync on
#output DP-2 pos 0 0 res 1920x1080@120Hz adaptive_sync on
# Two screens
output HDMI-A-1 pos 0 0 res 1920x1080
output HDMI-A-2 disable
#output HDMI-A-1 disable
#output HDMI-A-2 pos 0 0 res 1920x1080
output DP-2 pos 1920 0 res 1920x1080@144Hz adaptive_sync on
#output DP-2 pos 0 0 res 1920x1080@144Hz adaptive_sync on
# Other
#output DVI-D-1 pos 0 0 res 1920x1080
#output DP-2 pos 1920 0 res 1920x1080@60Hz adaptive_sync off
#output DP-2 disable
#output DVI-D-1 disable
output DVI-D-1 pos 0 0 res 1920x1080
output DP-2 pos 1920 0 res 1920x1080@144Hz adaptive_sync on
#output HDMI-A-1 disable
#output HDMI-A-1 pos 3840 0 res 1680x1050
#output HDMI-A-2 pos 5520 0 res 1920x1080 # TV
#output HDMI-A-2 pos 3840 0 res 1920x1080 # TV
output "*" bg "/home/lanxu/.config/sway/background2022.jpg" fill
#max_render_time 5
output "*" bg "/home/lanxu/.config/sway/background.jpg" fill
# inhibits
# wayland
for_window [app_id=".*"] inhibit_idle fullscreen

View File

@ -1,23 +0,0 @@
/*
*
* Base16 Gruvbox dark, medium
* Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
*
*/
@define-color base00 #282828;
@define-color base01 #3c3836;
@define-color base02 #504945;
@define-color base03 #665c54;
@define-color base04 #bdae93;
@define-color base05 #d5c4a1;
@define-color base06 #ebdbb2;
@define-color base07 #fbf1c7;
@define-color base08 #fb4934;
@define-color base09 #fe8019;
@define-color base0A #fabd2f;
@define-color base0B #b8bb26;
@define-color base0C #8ec07c;
@define-color base0D #83a598;
@define-color base0E #d3869b;
@define-color base0F #d65d0e;

View File

@ -1,23 +0,0 @@
/*
*
* Base16 Solarized Light
* Author: Ethan Schoonover (modified by aramisgithub)
*
*/
@define-color base00 #fdf6e3;
@define-color base01 #eee8d5;
@define-color base02 #93a1a1;
@define-color base03 #839496;
@define-color base04 #657b83;
@define-color base05 #586e75;
@define-color base06 #073642;
@define-color base07 #002b36;
@define-color base08 #dc322f;
@define-color base09 #cb4b16;
@define-color base0A #b58900;
@define-color base0B #859900;
@define-color base0C #2aa198;
@define-color base0D #268bd2;
@define-color base0E #6c71c4;
@define-color base0F #d33682;

View File

@ -18,6 +18,8 @@
"cpu",
"custom/gpu",
"network",
"disk",
"custom/pacman",
"mpd",
"tray"
],
@ -101,16 +103,14 @@
},
"disk": {
"interval": 5,
"format": "💾 {percentage_used:2}%",
"format": "Disk {percentage_used:2}%",
"path": "/"
},
"tray": {
"icon-size": 20,
"spacing": 5
"icon-size": 20
},
"mpd": {
"format": "🎵 {title}",
"max-length": 20
"format": "{title}"
},
"custom/gpu": {
"format": "GPU {} ℃",

View File

@ -1,6 +1,3 @@
/*@import "/home/lanxu/.config/waybar/base16-solarized-light.css";*/
@import "/home/lanxu/.config/waybar/base16-gruvbox-dark-medium.css";
* {
font-size: 12px;
font-family: "Fira Sans", monospace;
@ -8,6 +5,7 @@
window#waybar {
background: transparent;
color: #fdf6e3;
}
#workspaces,
@ -23,89 +21,87 @@ window#waybar {
#custom-pacman,
#mpd,
#network,
#tray,
#mpd {
background: @base00;
color: @base07;
margin-top: 0px;
#tray {
background: #1a1a1a;
margin-top: 2px;
margin-bottom: 2px;
}
#tray {
background: @base03;
color: @base0D;
padding-left: 10px;
padding-right: 5px;
border-radius: 0px 0 0 5px;
}
#workspaces {
border-radius: 0 0px 5px 0;
border-radius: 0 5px 5px 0;
}
#clock.1 {
border-radius: 0px 0 0 5px;
border-radius: 5px 0 0 5px;
}
#clock.2 {
font-weight: bold;
}
#clock.3 {
border-radius: 0 0px 5px 0;
border-radius: 0 5px 5px 0;
}
#pulseaudio {
border-radius: 0px 0 0 5px;
border-radius: 5px 0 0 5px;
}
#workspaces button {
color: @base07;
color: #fdf6e3;
border: none;
border-radius: 0;
padding: 0 5px 0 5px;
border-top: 2px solid @base00;
border-bottom: 2px solid @base00;
}
#workspaces button:last-child {
padding: 0 5px;
margin-right: 5px;
border-bottom: 2px solid #1a1a1a;
}
#workspaces button.focused {
background: @base02;
color: #268bd2;
border-bottom: 2px solid #268bd2;
}
#workspaces button.urgent {
background: @base08;
color: #af005f;
border-bottom: 2px solid #af005f;
}
#workspaces button.urgent:hover {
box-shadow: inherit;
text-shadow: inherit;
background: @base08;
background: #1a1a1a;
border-radius: 0;
border-bottom: 2px solid #af005f;
}
#workspaces button:hover {
box-shadow: inherit;
text-shadow: inherit;
background: @base02;
background: #1a1a1a;
border-radius: 0;
border-bottom: 2px solid #268bd2;
}
/*
#workspaces button:hover {
color: #268bd2;
border: 0;
border-bottom: 2px solid #268bd2;
background: #1a1a1a;
}*/
#pulseaudio {
color: @base0D;
color: #268bd2;
}
#memory {
color: @base0D;
color: #2aa198;
}
#cpu {
color: @base0D;
color: #6c71c4;
}
#custom-gpu {
color: @base0D;
color: #6c71c4;
}
#battery {
color: @base0D;
color: #859900;
}
#disk {
color: @base0D;
color: #b58900;
}
#mpd {
color: @base0D;
color: #EEE;
}
#clock,

15
.vimrc
View File

@ -16,7 +16,7 @@ Plug 'rust-lang/rust.vim', {'for': 'rust'}
" Syntax checking
"Plug 'Valloric/YouCompleteMe' " alternative #1, full-blown
Plug 'dense-analysis/ale'
Plug 'w0rp/ale',
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Useful plugins
@ -29,10 +29,6 @@ Plug 'ervandew/supertab'
Plug 'reedes/vim-lexical'
Plug 'majutsushi/tagbar'
" Search
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Snippets
Plug 'sirver/ultisnips'
Plug 'honza/vim-snippets'
@ -62,11 +58,10 @@ filetype plugin indent on
syntax on
"set t_Co=256
set termguicolors
set background=light
set background=dark
"let base16colorspace=256
"colorscheme base16-solarized-light
"colorscheme base16-gruvbox-dark-hard
colorscheme base16-gruvbox-dark-medium
"colorscheme base16-solarized-dark
colorscheme base16-gruvbox-dark-hard
"colorscheme base16-default-dark
@ -169,7 +164,7 @@ let g:ale_linters = {
\'javascript': ['standard'],
\'vue': ['standard --plugin html "**/*.{js,vue}"'],
\'jsx': ['standard --plugin html "**/*.{js,jsx}"'],
\'rust': ['analyzer']
\'rust': ['cargo']
\}
let b:ale_fixers = {
\'*': ['remove_trailing_lines', 'trim_whitespace'],

View File

@ -13,6 +13,12 @@ export COCOS_CONSOLE_ROOT=${HOME}/Sovellukset/cocos2d-js-v3.6.1/tools/cocos2d-co
export IONIC_INSTALL=${HOME}/Asiakirjat/Work/Android/ionic/node_modules/.bin
export PATH=$IONIC_INSTALL:$COCOS_CONSOLE_ROOT:$PATH
# npm without sudo
# https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
export NPM_PACKAGES=${HOME}/.npm-packages
export NODE_PATH=$NPM_PACKAGES/lib/node_modules:$NODE_PATH
export PATH=$NPM_PACKAGES/bin:$PATH
# Local
export PATH=/usr/local/bin:$PATH
export PATH=${HOME}/.local/bin:$PATH
@ -25,7 +31,7 @@ export PATH=$LANXU_SCRIPTS_ROOT:$PATH
#export XDG_CURRENT_DESKTOP=gnome
# export QT_STYLE_OVERRIDE='adwaita'
# qt5-styleplugins must be installed to set this to gtk2
export QT_QPA_PLATFORMTHEME="qt5ct"
#export QT_QPA_PLATFORMTHEME="qt5ct"
#export QT_AUTO_SCREEN_SCALE_FACTOR=0
#export QT_SCALE_FACTOR=1
@ -37,10 +43,8 @@ export WINEDLLOVERRIDES="winemenubuilder.exe=d;winegstreamer=" # No more desktop
# Npm with no sudo
# https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
export NPM_PACKAGES="${HOME}/.npm-packages"
# export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" # Do not enable by default
export PATH="$PATH:$NPM_PACKAGES/bin"
export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"
# dotnet
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
export PATH="$NPM_PACKAGES/bin:$PATH"
export PATH="${HOME}/.dotnet:$PATH"
# Emscripten
@ -69,10 +73,3 @@ export TERMCMD=$TERMINAL
# exec startx
#fi
export WORKON_HOME="${HOME}/Envs"
# Rootless docker (https://docs.docker.com/engine/security/rootless/)
export PATH=/home/lanxu/bin:$PATH
export DOCKER_HOST=unix:///run/user/1000/docker.sock
# nixOS integration
#export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS"

11
.zshrc
View File

@ -52,8 +52,6 @@ alias ll="exa -lh"
alias la="exa -a"
alias lp="keepass.sh"
alias ranger="ranger"
alias vim="nvim"
alias vimdiff="nvim -d"
#alias lf="TCELL_TRUECOLOR=on lf"
alias search="search.sh"
#alias ls="ls -N --time-style=long-iso --color=auto"
@ -69,8 +67,6 @@ alias rbackup="restic -r rclone:hubic:ChimeraLinux"
alias bat="bat --theme base16"
alias wine32="WINEPREFIX=~/.wine32 wine"
alias resetkbcolors="/usr/bin/g512-led -p /etc/g810-led/profile"
alias showerrors="journalctl -p 3 -xb"
alias browsephone="mount-phone | xargs -I % lf %"
# alias steam="DBUS_SESSION_BUS_ADDRESS=unix:abstract=/dev/null steam"
# https://github.com/chriskempson/base16-shell
# git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
@ -88,7 +84,8 @@ alias browsephone="mount-phone | xargs -I % lf %"
function auradd {
pkg=$1
aur sync --no-view --no-confirm --rebuild --database localrepo "$pkg" >&2 && sudo pacman -Sy "$pkg"
aur sync --no-view --no-confirm --rebuild --database localrepo "$pkg" >&2
sudo pacman -Sy "$pkg"
}
function aurrm {
@ -109,10 +106,6 @@ function aurupdate {
sudo pacman -Syu
}
function aurclear {
find ~/.cache/aurutils/sync -type d -name .git -execdir git clean -xf \;
}
function c {
echo "scale=2; $@" | bc
}

View File

@ -0,0 +1,24 @@
-- {{{ Grab environment
local setmetatable = setmetatable
-- }}}
local temp = {};
-- {{{ Date widget type
local function worker(format, warg)
local f = io.popen("xset q | grep 'DPMS is' | awk '/ / {print $3}'")
temp[0] = "";
for line in f:lines() do
temp[0] = temp[0] .. line
end
io.close(f)
return temp
end
-- }}}
return setmetatable(temp, { __call = function(_, ...) return worker(...) end })

View File

@ -0,0 +1,23 @@
-- {{{ Grab environment
local setmetatable = setmetatable
-- }}}
local temp = {};
-- {{{ Date widget type
local function worker(format, warg)
local f = io.popen("gputemp.py")
temp[0] = "";
for line in f:lines() do
temp[0] = temp[0] .. line
end
io.close(f)
return temp
end
-- }}}
return setmetatable(temp, { __call = function(_, ...) return worker(...) end })

23
config/awesome/hubic.lua Normal file
View File

@ -0,0 +1,23 @@
-- {{{ Grab environment
local setmetatable = setmetatable
-- }}}
local temp = {};
-- {{{ Date widget type
local function worker(format, warg)
local f = io.popen("hubic.py")
temp[0] = "";
for line in f:lines() do
temp[0] = temp[0] .. line
end
io.close(f)
return temp
end
-- }}}
return setmetatable(temp, { __call = function(_, ...) return worker(...) end })

View File

@ -0,0 +1,35 @@
lanxu awesome scripts
=====================
Requirements
------------
- dkjson (for parsing json. Available with this widget)
How to use
----------
You may create your widget like this:
~~~lua
local mcstatus = require("lanxu/mcstatus")
myserverstatus = mcstatus({
settings = function()
widget.markup = "PLAYERS <b>" .. totalplayers .. "</b>"
end
})
~~~
After this you can use "myserverstatus" like any other textbox widget
full list of available settings below
~~~lua
myserverstatus = mcstatus({
hideempty = false,
hideoffline = true,
calluri = "https://page.not.found/mc_stats.php?type=server_status",
settings = function()
widget.markup = "PLAYERS <b>" .. totalplayers .. "</b>"
end
})
~~~

View File

@ -0,0 +1,80 @@
local naughty = require("naughty")
local wibox = require("wibox")
local gears = require("gears")
local focused = require("awful.screen").focused
local easy_async = require("awful.spawn").easy_async
local function factory(args)
local args = args or {}
local timeout = args.timeout or 5
local status_cmd = args.status_cmd or "hubic status"
local full_cmd = args.full_cmd or "hubic status"
local cloud = { widget = wibox.widget.textbox() }
local settings = args.settings or function() end
local followtag = args.followtag or true
local notification_preset = args.notification_preset or { font = "Monospace 10" }
cloud.widget:set_markup("N/A")
function cloud.show(tout)
cloud.hide()
if followtag then
notification_preset.screen = focused()
end
cloud.notification = naughty.notify({
text = cloud.notification_text,
-- icon = cloud.icon
timeout = 0,
preset = notification_preset,
})
end
function cloud.hide()
if cloud.notification then
naughty.destroy(cloud.notification)
end
end
function cloud.attach(obj)
obj:connect_signal("mouse::enter", function()
cloud.show()
end)
obj:connect_signal("mouse::leave", function()
cloud.hide()
end)
obj:connect_signal("button::press", function()
cloud.update()
cloud.show()
end)
end
function cloud.update()
local cmd = string.format(full_cmd)
easy_async(cmd, function(response, stderr, reason, exit_code)
local res = string.match(response, 'State: (.-)Up')
res = res:gsub("%s+", "")
res = string.gsub(res, "%s+", "")
currentstatus = res or "No"
cloud.notification_text = response
widget = cloud.widget
settings()
end)
end
cloud.attach(cloud.widget)
gears.timer {
timeout = timeout,
autostart = true,
callback = cloud.update
}
cloud.update()
return cloud
end
return factory

View File

@ -0,0 +1,714 @@
-- Module options:
local always_try_using_lpeg = true
local register_global_module_table = false
local global_module_name = 'json'
--[==[
David Kolf's JSON module for Lua 5.1/5.2
Version 2.5
For the documentation see the corresponding readme.txt or visit
<http://dkolf.de/src/dkjson-lua.fsl/>.
You can contact the author by sending an e-mail to 'david' at the
domain 'dkolf.de'.
Copyright (C) 2010-2013 David Heiko Kolf
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 OR COPYRIGHT HOLDERS
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.
--]==]
-- global dependencies:
local pairs, type, tostring, tonumber, getmetatable, setmetatable, rawset =
pairs, type, tostring, tonumber, getmetatable, setmetatable, rawset
local error, require, pcall, select = error, require, pcall, select
local floor, huge = math.floor, math.huge
local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat =
string.rep, string.gsub, string.sub, string.byte, string.char,
string.find, string.len, string.format
local strmatch = string.match
local concat = table.concat
local json = { version = "dkjson 2.5" }
if register_global_module_table then
_G[global_module_name] = json
end
local _ENV = nil -- blocking globals in Lua 5.2
pcall (function()
-- Enable access to blocked metatables.
-- Don't worry, this module doesn't change anything in them.
local debmeta = require "debug".getmetatable
if debmeta then getmetatable = debmeta end
end)
json.null = setmetatable ({}, {
__tojson = function () return "null" end
})
local function isarray (tbl)
local max, n, arraylen = 0, 0, 0
for k,v in pairs (tbl) do
if k == 'n' and type(v) == 'number' then
arraylen = v
if v > max then
max = v
end
else
if type(k) ~= 'number' or k < 1 or floor(k) ~= k then
return false
end
if k > max then
max = k
end
n = n + 1
end
end
if max > 10 and max > arraylen and max > n * 2 then
return false -- don't create an array with too many holes
end
return true, max
end
local escapecodes = {
["\""] = "\\\"", ["\\"] = "\\\\", ["\b"] = "\\b", ["\f"] = "\\f",
["\n"] = "\\n", ["\r"] = "\\r", ["\t"] = "\\t"
}
local function escapeutf8 (uchar)
local value = escapecodes[uchar]
if value then
return value
end
local a, b, c, d = strbyte (uchar, 1, 4)
a, b, c, d = a or 0, b or 0, c or 0, d or 0
if a <= 0x7f then
value = a
elseif 0xc0 <= a and a <= 0xdf and b >= 0x80 then
value = (a - 0xc0) * 0x40 + b - 0x80
elseif 0xe0 <= a and a <= 0xef and b >= 0x80 and c >= 0x80 then
value = ((a - 0xe0) * 0x40 + b - 0x80) * 0x40 + c - 0x80
elseif 0xf0 <= a and a <= 0xf7 and b >= 0x80 and c >= 0x80 and d >= 0x80 then
value = (((a - 0xf0) * 0x40 + b - 0x80) * 0x40 + c - 0x80) * 0x40 + d - 0x80
else
return ""
end
if value <= 0xffff then
return strformat ("\\u%.4x", value)
elseif value <= 0x10ffff then
-- encode as UTF-16 surrogate pair
value = value - 0x10000
local highsur, lowsur = 0xD800 + floor (value/0x400), 0xDC00 + (value % 0x400)
return strformat ("\\u%.4x\\u%.4x", highsur, lowsur)
else
return ""
end
end
local function fsub (str, pattern, repl)
-- gsub always builds a new string in a buffer, even when no match
-- exists. First using find should be more efficient when most strings
-- don't contain the pattern.
if strfind (str, pattern) then
return gsub (str, pattern, repl)
else
return str
end
end
local function quotestring (value)
-- based on the regexp "escapable" in https://github.com/douglascrockford/JSON-js
value = fsub (value, "[%z\1-\31\"\\\127]", escapeutf8)
if strfind (value, "[\194\216\220\225\226\239]") then
value = fsub (value, "\194[\128-\159\173]", escapeutf8)
value = fsub (value, "\216[\128-\132]", escapeutf8)
value = fsub (value, "\220\143", escapeutf8)
value = fsub (value, "\225\158[\180\181]", escapeutf8)
value = fsub (value, "\226\128[\140-\143\168-\175]", escapeutf8)
value = fsub (value, "\226\129[\160-\175]", escapeutf8)
value = fsub (value, "\239\187\191", escapeutf8)
value = fsub (value, "\239\191[\176-\191]", escapeutf8)
end
return "\"" .. value .. "\""
end
json.quotestring = quotestring
local function replace(str, o, n)
local i, j = strfind (str, o, 1, true)
if i then
return strsub(str, 1, i-1) .. n .. strsub(str, j+1, -1)
else
return str
end
end
-- locale independent num2str and str2num functions
local decpoint, numfilter
local function updatedecpoint ()
decpoint = strmatch(tostring(0.5), "([^05+])")
-- build a filter that can be used to remove group separators
numfilter = "[^0-9%-%+eE" .. gsub(decpoint, "[%^%$%(%)%%%.%[%]%*%+%-%?]", "%%%0") .. "]+"
end
updatedecpoint()
local function num2str (num)
return replace(fsub(tostring(num), numfilter, ""), decpoint, ".")
end
local function str2num (str)
local num = tonumber(replace(str, ".", decpoint))
if not num then
updatedecpoint()
num = tonumber(replace(str, ".", decpoint))
end
return num
end
local function addnewline2 (level, buffer, buflen)
buffer[buflen+1] = "\n"
buffer[buflen+2] = strrep (" ", level)
buflen = buflen + 2
return buflen
end
function json.addnewline (state)
if state.indent then
state.bufferlen = addnewline2 (state.level or 0,
state.buffer, state.bufferlen or #(state.buffer))
end
end
local encode2 -- forward declaration
local function addpair (key, value, prev, indent, level, buffer, buflen, tables, globalorder, state)
local kt = type (key)
if kt ~= 'string' and kt ~= 'number' then
return nil, "type '" .. kt .. "' is not supported as a key by JSON."
end
if prev then
buflen = buflen + 1
buffer[buflen] = ","
end
if indent then
buflen = addnewline2 (level, buffer, buflen)
end
buffer[buflen+1] = quotestring (key)
buffer[buflen+2] = ":"
return encode2 (value, indent, level, buffer, buflen + 2, tables, globalorder, state)
end
local function appendcustom(res, buffer, state)
local buflen = state.bufferlen
if type (res) == 'string' then
buflen = buflen + 1
buffer[buflen] = res
end
return buflen
end
local function exception(reason, value, state, buffer, buflen, defaultmessage)
defaultmessage = defaultmessage or reason
local handler = state.exception
if not handler then
return nil, defaultmessage
else
state.bufferlen = buflen
local ret, msg = handler (reason, value, state, defaultmessage)
if not ret then return nil, msg or defaultmessage end
return appendcustom(ret, buffer, state)
end
end
function json.encodeexception(reason, value, state, defaultmessage)
return quotestring("<" .. defaultmessage .. ">")
end
encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, state)
local valtype = type (value)
local valmeta = getmetatable (value)
valmeta = type (valmeta) == 'table' and valmeta -- only tables
local valtojson = valmeta and valmeta.__tojson
if valtojson then
if tables[value] then
return exception('reference cycle', value, state, buffer, buflen)
end
tables[value] = true
state.bufferlen = buflen
local ret, msg = valtojson (value, state)
if not ret then return exception('custom encoder failed', value, state, buffer, buflen, msg) end
tables[value] = nil
buflen = appendcustom(ret, buffer, state)
elseif value == nil then
buflen = buflen + 1
buffer[buflen] = "null"
elseif valtype == 'number' then
local s
if value ~= value or value >= huge or -value >= huge then
-- This is the behaviour of the original JSON implementation.
s = "null"
else
s = num2str (value)
end
buflen = buflen + 1
buffer[buflen] = s
elseif valtype == 'boolean' then
buflen = buflen + 1
buffer[buflen] = value and "true" or "false"
elseif valtype == 'string' then
buflen = buflen + 1
buffer[buflen] = quotestring (value)
elseif valtype == 'table' then
if tables[value] then
return exception('reference cycle', value, state, buffer, buflen)
end
tables[value] = true
level = level + 1
local isa, n = isarray (value)
if n == 0 and valmeta and valmeta.__jsontype == 'object' then
isa = false
end
local msg
if isa then -- JSON array
buflen = buflen + 1
buffer[buflen] = "["
for i = 1, n do
buflen, msg = encode2 (value[i], indent, level, buffer, buflen, tables, globalorder, state)
if not buflen then return nil, msg end
if i < n then
buflen = buflen + 1
buffer[buflen] = ","
end
end
buflen = buflen + 1
buffer[buflen] = "]"
else -- JSON object
local prev = false
buflen = buflen + 1
buffer[buflen] = "{"
local order = valmeta and valmeta.__jsonorder or globalorder
if order then
local used = {}
n = #order
for i = 1, n do
local k = order[i]
local v = value[k]
if v then
used[k] = true
buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
prev = true -- add a seperator before the next element
end
end
for k,v in pairs (value) do
if not used[k] then
buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
if not buflen then return nil, msg end
prev = true -- add a seperator before the next element
end
end
else -- unordered
for k,v in pairs (value) do
buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
if not buflen then return nil, msg end
prev = true -- add a seperator before the next element
end
end
if indent then
buflen = addnewline2 (level - 1, buffer, buflen)
end
buflen = buflen + 1
buffer[buflen] = "}"
end
tables[value] = nil
else
return exception ('unsupported type', value, state, buffer, buflen,
"type '" .. valtype .. "' is not supported by JSON.")
end
return buflen
end
function json.encode (value, state)
state = state or {}
local oldbuffer = state.buffer
local buffer = oldbuffer or {}
state.buffer = buffer
updatedecpoint()
local ret, msg = encode2 (value, state.indent, state.level or 0,
buffer, state.bufferlen or 0, state.tables or {}, state.keyorder, state)
if not ret then
error (msg, 2)
elseif oldbuffer == buffer then
state.bufferlen = ret
return true
else
state.bufferlen = nil
state.buffer = nil
return concat (buffer)
end
end
local function loc (str, where)
local line, pos, linepos = 1, 1, 0
while true do
pos = strfind (str, "\n", pos, true)
if pos and pos < where then
line = line + 1
linepos = pos
pos = pos + 1
else
break
end
end
return "line " .. line .. ", column " .. (where - linepos)
end
local function unterminated (str, what, where)
return nil, strlen (str) + 1, "unterminated " .. what .. " at " .. loc (str, where)
end
local function scanwhite (str, pos)
while true do
pos = strfind (str, "%S", pos)
if not pos then return nil end
local sub2 = strsub (str, pos, pos + 1)
if sub2 == "\239\187" and strsub (str, pos + 2, pos + 2) == "\191" then
-- UTF-8 Byte Order Mark
pos = pos + 3
elseif sub2 == "//" then
pos = strfind (str, "[\n\r]", pos + 2)
if not pos then return nil end
elseif sub2 == "/*" then
pos = strfind (str, "*/", pos + 2)
if not pos then return nil end
pos = pos + 2
else
return pos
end
end
end
local escapechars = {
["\""] = "\"", ["\\"] = "\\", ["/"] = "/", ["b"] = "\b", ["f"] = "\f",
["n"] = "\n", ["r"] = "\r", ["t"] = "\t"
}
local function unichar (value)
if value < 0 then
return nil
elseif value <= 0x007f then
return strchar (value)
elseif value <= 0x07ff then
return strchar (0xc0 + floor(value/0x40),
0x80 + (floor(value) % 0x40))
elseif value <= 0xffff then
return strchar (0xe0 + floor(value/0x1000),
0x80 + (floor(value/0x40) % 0x40),
0x80 + (floor(value) % 0x40))
elseif value <= 0x10ffff then
return strchar (0xf0 + floor(value/0x40000),
0x80 + (floor(value/0x1000) % 0x40),
0x80 + (floor(value/0x40) % 0x40),
0x80 + (floor(value) % 0x40))
else
return nil
end
end
local function scanstring (str, pos)
local lastpos = pos + 1
local buffer, n = {}, 0
while true do
local nextpos = strfind (str, "[\"\\]", lastpos)
if not nextpos then
return unterminated (str, "string", pos)
end
if nextpos > lastpos then
n = n + 1
buffer[n] = strsub (str, lastpos, nextpos - 1)
end
if strsub (str, nextpos, nextpos) == "\"" then
lastpos = nextpos + 1
break
else
local escchar = strsub (str, nextpos + 1, nextpos + 1)
local value
if escchar == "u" then
value = tonumber (strsub (str, nextpos + 2, nextpos + 5), 16)
if value then
local value2
if 0xD800 <= value and value <= 0xDBff then
-- we have the high surrogate of UTF-16. Check if there is a
-- low surrogate escaped nearby to combine them.
if strsub (str, nextpos + 6, nextpos + 7) == "\\u" then
value2 = tonumber (strsub (str, nextpos + 8, nextpos + 11), 16)
if value2 and 0xDC00 <= value2 and value2 <= 0xDFFF then
value = (value - 0xD800) * 0x400 + (value2 - 0xDC00) + 0x10000
else
value2 = nil -- in case it was out of range for a low surrogate
end
end
end
value = value and unichar (value)
if value then
if value2 then
lastpos = nextpos + 12
else
lastpos = nextpos + 6
end
end
end
end
if not value then
value = escapechars[escchar] or escchar
lastpos = nextpos + 2
end
n = n + 1
buffer[n] = value
end
end
if n == 1 then
return buffer[1], lastpos
elseif n > 1 then
return concat (buffer), lastpos
else
return "", lastpos
end
end
local scanvalue -- forward declaration
local function scantable (what, closechar, str, startpos, nullval, objectmeta, arraymeta)
local len = strlen (str)
local tbl, n = {}, 0
local pos = startpos + 1
if what == 'object' then
setmetatable (tbl, objectmeta)
else
setmetatable (tbl, arraymeta)
end
while true do
pos = scanwhite (str, pos)
if not pos then return unterminated (str, what, startpos) end
local char = strsub (str, pos, pos)
if char == closechar then
return tbl, pos + 1
end
local val1, err
val1, pos, err = scanvalue (str, pos, nullval, objectmeta, arraymeta)
if err then return nil, pos, err end
pos = scanwhite (str, pos)
if not pos then return unterminated (str, what, startpos) end
char = strsub (str, pos, pos)
if char == ":" then
if val1 == nil then
return nil, pos, "cannot use nil as table index (at " .. loc (str, pos) .. ")"
end
pos = scanwhite (str, pos + 1)
if not pos then return unterminated (str, what, startpos) end
local val2
val2, pos, err = scanvalue (str, pos, nullval, objectmeta, arraymeta)
if err then return nil, pos, err end
tbl[val1] = val2
pos = scanwhite (str, pos)
if not pos then return unterminated (str, what, startpos) end
char = strsub (str, pos, pos)
else
n = n + 1
tbl[n] = val1
end
if char == "," then
pos = pos + 1
end
end
end
scanvalue = function (str, pos, nullval, objectmeta, arraymeta)
pos = pos or 1
pos = scanwhite (str, pos)
if not pos then
return nil, strlen (str) + 1, "no valid JSON value (reached the end)"
end
local char = strsub (str, pos, pos)
if char == "{" then
return scantable ('object', "}", str, pos, nullval, objectmeta, arraymeta)
elseif char == "[" then
return scantable ('array', "]", str, pos, nullval, objectmeta, arraymeta)
elseif char == "\"" then
return scanstring (str, pos)
else
local pstart, pend = strfind (str, "^%-?[%d%.]+[eE]?[%+%-]?%d*", pos)
if pstart then
local number = str2num (strsub (str, pstart, pend))
if number then
return number, pend + 1
end
end
pstart, pend = strfind (str, "^%a%w*", pos)
if pstart then
local name = strsub (str, pstart, pend)
if name == "true" then
return true, pend + 1
elseif name == "false" then
return false, pend + 1
elseif name == "null" then
return nullval, pend + 1
end
end
return nil, pos, "no valid JSON value at " .. loc (str, pos)
end
end
local function optionalmetatables(...)
if select("#", ...) > 0 then
return ...
else
return {__jsontype = 'object'}, {__jsontype = 'array'}
end
end
function json.decode (str, pos, nullval, ...)
local objectmeta, arraymeta = optionalmetatables(...)
return scanvalue (str, pos, nullval, objectmeta, arraymeta)
end
function json.use_lpeg ()
local g = require ("lpeg")
if g.version() == "0.11" then
error "due to a bug in LPeg 0.11, it cannot be used for JSON matching"
end
local pegmatch = g.match
local P, S, R = g.P, g.S, g.R
local function ErrorCall (str, pos, msg, state)
if not state.msg then
state.msg = msg .. " at " .. loc (str, pos)
state.pos = pos
end
return false
end
local function Err (msg)
return g.Cmt (g.Cc (msg) * g.Carg (2), ErrorCall)
end
local SingleLineComment = P"//" * (1 - S"\n\r")^0
local MultiLineComment = P"/*" * (1 - P"*/")^0 * P"*/"
local Space = (S" \n\r\t" + P"\239\187\191" + SingleLineComment + MultiLineComment)^0
local PlainChar = 1 - S"\"\\\n\r"
local EscapeSequence = (P"\\" * g.C (S"\"\\/bfnrt" + Err "unsupported escape sequence")) / escapechars
local HexDigit = R("09", "af", "AF")
local function UTF16Surrogate (match, pos, high, low)
high, low = tonumber (high, 16), tonumber (low, 16)
if 0xD800 <= high and high <= 0xDBff and 0xDC00 <= low and low <= 0xDFFF then
return true, unichar ((high - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000)
else
return false
end
end
local function UTF16BMP (hex)
return unichar (tonumber (hex, 16))
end
local U16Sequence = (P"\\u" * g.C (HexDigit * HexDigit * HexDigit * HexDigit))
local UnicodeEscape = g.Cmt (U16Sequence * U16Sequence, UTF16Surrogate) + U16Sequence/UTF16BMP
local Char = UnicodeEscape + EscapeSequence + PlainChar
local String = P"\"" * g.Cs (Char ^ 0) * (P"\"" + Err "unterminated string")
local Integer = P"-"^(-1) * (P"0" + (R"19" * R"09"^0))
local Fractal = P"." * R"09"^0
local Exponent = (S"eE") * (S"+-")^(-1) * R"09"^1
local Number = (Integer * Fractal^(-1) * Exponent^(-1))/str2num
local Constant = P"true" * g.Cc (true) + P"false" * g.Cc (false) + P"null" * g.Carg (1)
local SimpleValue = Number + String + Constant
local ArrayContent, ObjectContent
-- The functions parsearray and parseobject parse only a single value/pair
-- at a time and store them directly to avoid hitting the LPeg limits.
local function parsearray (str, pos, nullval, state)
local obj, cont
local npos
local t, nt = {}, 0
repeat
obj, cont, npos = pegmatch (ArrayContent, str, pos, nullval, state)
if not npos then break end
pos = npos
nt = nt + 1
t[nt] = obj
until cont == 'last'
return pos, setmetatable (t, state.arraymeta)
end
local function parseobject (str, pos, nullval, state)
local obj, key, cont
local npos
local t = {}
repeat
key, obj, cont, npos = pegmatch (ObjectContent, str, pos, nullval, state)
if not npos then break end
pos = npos
t[key] = obj
until cont == 'last'
return pos, setmetatable (t, state.objectmeta)
end
local Array = P"[" * g.Cmt (g.Carg(1) * g.Carg(2), parsearray) * Space * (P"]" + Err "']' expected")
local Object = P"{" * g.Cmt (g.Carg(1) * g.Carg(2), parseobject) * Space * (P"}" + Err "'}' expected")
local Value = Space * (Array + Object + SimpleValue)
local ExpectedValue = Value + Space * Err "value expected"
ArrayContent = Value * Space * (P"," * g.Cc'cont' + g.Cc'last') * g.Cp()
local Pair = g.Cg (Space * String * Space * (P":" + Err "colon expected") * ExpectedValue)
ObjectContent = Pair * Space * (P"," * g.Cc'cont' + g.Cc'last') * g.Cp()
local DecodeValue = ExpectedValue * g.Cp ()
function json.decode (str, pos, nullval, ...)
local state = {}
state.objectmeta, state.arraymeta = optionalmetatables(...)
local obj, retpos = pegmatch (DecodeValue, str, pos, nullval, state)
if state.msg then
return nil, state.pos, state.msg
else
return obj, retpos
end
end
-- use this function only once:
json.use_lpeg = function () return json end
json.using_lpeg = true
return json -- so you can get the module using json = require "dkjson".use_lpeg()
end
if always_try_using_lpeg then
pcall (json.use_lpeg)
end
return json

View File

@ -0,0 +1,53 @@
local naughty = require("naughty")
local wibox = require("wibox")
local json = require("lanxu/dkjson")
local gears = require("gears")
local focused = require("awful.screen").focused
local easy_async = require("awful.spawn").easy_async
local function factory(args)
local args = args or {}
local calluri = args.uri or "https://api.ipify.org"
local settings = args.settings or function() end
local homeaddress = args.homeaddress or nil
local ip = { widget = wibox.widget.textbox() }
ip.widget:set_markup("N/A")
function ip.attach(obj)
obj:connect_signal("button::press", function()
ip.update()
end)
end
function ip.update()
local cmd = string.format("curl -s " .. "'" .. calluri .. "'")
address = "N/A"
settings()
easy_async(cmd, function(response, stderr, reason, exit_code)
address = response
address = string.gsub(address, "[^0-9.]", "")
if address == homeaddress then
address = "Home"
end
ip.address = address
widget = ip.widget
settings()
end)
end
ip.attach(ip.widget)
address = "N/A"
settings()
ip.update()
return ip
end
return factory

View File

@ -0,0 +1,116 @@
local naughty = require("naughty")
local wibox = require("wibox")
local json = require("lanxu/dkjson")
local gears = require("gears")
local focused = require("awful.screen").focused
local easy_async = require("awful.spawn").easy_async
local function factory(args)
local args = args or {}
local timeout = args.timeout or 600
local calluri = args.uri or "https://masa.dy.fi/api/games/stats/minecraft/?type=server_status"
local minecraft = { widget = wibox.widget.textbox() }
local settings = args.settings or function() end
local hideempty = args.hideempty or false
local hideoffline = args.hideoffline or true
local followtag = args.followtag or true
local notification_preset = args.notification_preset or { font = "Monospace 10" }
minecraft.widget:set_markup("N/A")
function minecraft.show(tout)
minecraft.hide()
if followtag then
notification_preset.screen = focused()
end
minecraft.notification = naughty.notify({
text = minecraft.notification_text,
-- icon = minecraft.icon
timeout = 0,
preset = notification_preset,
})
end
function minecraft.hide()
if minecraft.notification then
naughty.destroy(minecraft.notification)
end
end
function minecraft.attach(obj)
obj:connect_signal("mouse::enter", function()
minecraft.show()
end)
obj:connect_signal("mouse::leave", function()
minecraft.hide()
end)
obj:connect_signal("button::press", function()
minecraft.update()
minecraft.show()
end)
end
function minecraft.update()
local cmd = string.format("curl -s " .. "'" .. calluri .. "'")
easy_async(cmd, function(response, stderr, reason, exit_code)
local obj, pos, err = json.decode(response, 1, nil)
totalplayers = 0
if not err then
-- First get the length of the longest server name, for proper column alignment
local max_len = 6 -- Initialize to the length of "Server"
for k, v in pairs(obj) do
if (tonumber(v.num_players) > 0 or not hideempty) and (v.status == "online" or not hideoffline) then
local tmp = string.len(v.server_name)
if tmp > max_len then
max_len = tmp
end
end
end
local fmt = string.format("%%-%ds %%-8s %%-7s\n", max_len)
local text = string.format(fmt, "Server", "Version", "Players")
for k, v in pairs(obj) do
local players = tonumber(v.num_players)
if (players > 0 or not hideempty) and (v.status == "online" or not hideoffline) then
text = text .. string.format(fmt, v.server_name, v.version, v.num_players)
if v.players then
for i, p in pairs(v.players) do
text = text .. ' > ' .. p .. '\n'
end
end
end
totalplayers = totalplayers + players
end
minecraft.notification_text = text
minecraft.totalplayers = totalplayers;
widget = minecraft.widget
settings()
end
end)
end
minecraft.attach(minecraft.widget)
gears.timer {
timeout = timeout,
autostart = true,
callback = minecraft.update
}
minecraft.update()
return minecraft
end
return factory

View File

@ -0,0 +1,23 @@
local json = require ("dkjson")
local https = require("ssl.https")
local url = "https://masa.dy.fi/~masa/testailu/mc_stats_dev/dev_json.php?type=server_status"
local response, error = https.request(url)
local obj, pos, err = json.decode (response, 1, nil)
local text = ""
for k, v in pairs(obj) do
text = text .. v.status .. "\t"
text = text .. v.version .. "\t"
text = text .. v.num_players .. "\t"
text = text .. v.server_name .. "\t"
text = text .. "\n"
if v.players then
for i, p in pairs(v.players) do
text = text .. '\t\t' .. p .. '\n'
end
end
end
print(text)

774
config/awesome/rc.lua Normal file
View File

@ -0,0 +1,774 @@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup").widget
local lain = require("lain")
naughty.config.defaults.timeout = 5
naughty.config.defaults.screen = 1
naughty.config.defaults.position = "top_right"
naughty.config.defaults.margin = 8
naughty.config.defaults.gap = 1
naughty.config.defaults.ontop = true
naughty.config.defaults.font = "sans 8"
naughty.config.defaults.icon = "/usr/share/icons/Adwaita/48x48/status/dialog-information.png"
naughty.config.defaults.icon_size = 48
naughty.config.defaults.fg = beautiful.fg_tooltip
naughty.config.defaults.bg = beautiful.bg_tooltip
naughty.config.defaults.border_color = beautiful.border_tooltip
naughty.config.defaults.border_width = 1
naughty.config.defaults.hover_timeout = nil
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
-- Handle runtime errors after startup
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
-- Make sure we don't go into an endless error loop
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err) })
in_error = false
end)
end
-- }}}
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(awful.util.getdir("config") .. "/themes/lanxu/theme.lua")
local widgets = require("widgets");
-- This is used later as the default terminal and editor to run.
terminal = "termite"
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
awful.layout.suit.floating,
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
}
-- }}}
-- {{{ Helper functions
local function client_menu_toggle_fn()
local instance = nil
return function ()
if instance and instance.wibox.visible then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ theme = { width = 250 } })
end
end
end
-- }}}
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() return false, hotkeys_popup.show_help end},
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end}
}
lock = function()
-- Sync disks before lock (just in case)
awful.util.spawn("sync")
-- Lock screen
awful.util.spawn("xdg-screensaver lock")
--awful.util.spawn("xautolock -locknow")
--awful.util.spawn("xlock")
end
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal },
{ "lock", lock},
{ "suspend", "systemctl suspend"}
}
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar
-- Create a textclock widget
--mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
local taglist_buttons = awful.util.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
local tasklist_buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
if not c:isvisible() and c.first_tag then
c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({ }, 3, client_menu_toggle_fn()),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
-- Tags
-- Define a tag table which hold all screen tags.
primary_screen = 1
secondary_screen = screen:count()
tags = {
names = {
'IRC',
'Code',
'Net',
'GFX',
'Other',
},
layout = {
awful.layout.layouts[3], -- 1:IRC
awful.layout.layouts[4], -- 2:Code
awful.layout.layouts[10], -- 3:Net
awful.layout.layouts[10], -- 4:GFX
awful.layout.layouts[1],
}
}
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
--awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
tags[s] = awful.tag(tags.names, s, tags.layout)
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s })
local right_widgets = {
layout = wibox.layout.fixed.horizontal,
--mykeyboardlayout,
wibox.widget.systray(),
spacer,
--myserverstatus,
ipaddress,
spacer,
volume,
spacer,
mydpmsstatus,
spacer,
--mycloudstatus,
--spacer,
mycpu,
spacer,
mymem,
spacer,
myweather,
spacer,
mycputemp,
mygputemp,
mytextclock,
s.mylayoutbox,
}
-- Only show everything on the first screen
if s.index > 1 then
right_widgets = {
layout = wibox.layout.fixed.horizontal,
s.mylayoutbox,
}
end
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
right_widgets,
}
end)
-- }}}
-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}
-- {{{ Key bindings
globalkeys = awful.util.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
awful.key({ modkey, "Shift" }, "l", lock,
{description = "lock screen", group = "screen"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
c:raise()
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"}),
-- Menubar (dmenu)
awful.key({ modkey }, "d",
function()
--awful.spawn(string.format("dmenu_run -i -b -l 20 -fn 'Fura Code Nerd Font:size=10:style=Regular'"))
awful.spawn(string.format("rofi -show combi -combi-modi 'window,run,ssh' -modi combi"))
end,
{description = "show the menubar", group = "launcher"})
)
clientkeys = awful.util.table.join(
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "maximize", group = "client"})
)
local commands = {
print = false
}
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = awful.util.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
globalkeys = awful.util.table.join(globalkeys,
-- Pulseaudio
awful.key({ any }, "XF86AudioRaiseVolume", function()
awful.spawn(string.format("pactl set-sink-volume %s +1%%", volume.device))
volume.update()
end,
{description = "Raise audio volume", group = "audio"}), awful.key({ any }, "XF86AudioLowerVolume", function()
awful.spawn(string.format("pactl set-sink-volume %s -1%%", volume.device))
volume.update()
end,
{description = "Lower audio volume", group = "audio"}),
awful.key({ any }, "XF86AudioMute",
function()
awful.spawn(string.format("pactl set-sink-mute %s 1", volume.device))
volume.update()
end,
{description = "mute audio", group = "audio"}),
awful.key({ 'Shift' }, "XF86AudioMute",
function()
awful.spawn(string.format("pactl set-sink-mute %s 0", volume.device))
volume.update()
end,
{description = "unmute audio", group = "audio"}),
awful.key({ }, "Print",
function ()
--local command = [[bash -c 'escrotum "$(xdg-user-dir PICTURES)/%Y-%m-%d_%T_screenshot.png"']]
for i=1,screen:count() do
local command = "bash -c 'flameshot screen -n ".. i-1 .." -p \"$(xdg-user-dir PICTURES)/\"'"
awful.spawn.easy_async(command, function(stdout, stderr)
--naughty.notify {
-- title = "Screenshot saved!",
-- text = stdout,
--}
end)
end
end,
{description = "Take screenshot", group = "video"}),
awful.key({ 'Shift' }, "Print",
function ()
--local command = [[bash -c 'escrotum "$(xdg-user-dir PICTURES)/%Y-%m-%d_%T_screenshot.png"']]
for i=1,screen:count() do
local command = "bash -c 'flameshot gui -p \"$(xdg-user-dir PICTURES)/\"'"
awful.spawn.easy_async(command, function(stdout, stderr)
--naughty.notify {
-- title = "Screenshot saved!",
-- text = stdout,
--}
end)
end
end,
{description = "Take screenshot", group = "video"})
)
clientbuttons = awful.util.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))
-- Set keys
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Maximized clients.
{ rule_any = {
instance = {
},
class = {
"Zathura",
"MComix"
},
name = {
},
role = {
}
}, properties = {
floating = true,
maximized = true
}
},
-- Floating clients.
{ rule_any = {
instance = {
},
class = {
"Arandr",
"cantata",
"Steam",
"itch",
"Wine",
"mpv",
"Vlc",
"Sxiv",
"Plugin-container"
},
name = {
},
role = {
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = {
floating = true
}
},
-- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = false }
},
-- Window positioning
{ rule = { class = "Chromium" },
properties = { screen = primary_screen, tag = "Net" } },
{ rule = { class = "Firefox" },
properties = { screen = primary_screen, tag = "Net" } },
{ rule = { class = "Inkscape" },
properties = { screen = primary_screen, tag = "GFX" } },
{ rule = { class = "Gimp" },
properties = { screen = primary_screen, tag = "GFX" } },
{ rule = { class = "Blender" },
properties = { screen = primary_screen, tag = "GFX" } },
{ rule = { class = "Steam", name = "Friends List" },
properties = { screen = secondary_screen, tag = "Other", width = 300, height = 800, x = 3530, y = 30 } },
{ rule = { class = "Steam", name = "Steam" },
properties = { screen = secondary_screen, tag = "Other" } },
}
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and
not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = awful.util.table.join(
awful.button({ }, 1, function()
client.focus = c
c:raise()
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
client.focus = c
c:raise()
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}
local fullscreened_clients = {}
local function remove_client(tabl, c)
local index = awful.util.table.hasitem(tabl, c)
if index then
table.remove(tabl, index)
if #tabl == 0 then
awful.util.spawn("xset s blank")
awful.util.spawn("xset s on")
awful.util.spawn("xset +dpms")
naughty.notify({ preset = naughty.config.presets.low,
title = "DPMS information",
text = "Display power management is now back ON"})
end
end
end
client.connect_signal("property::fullscreen", function(c)
if c.fullscreen then
table.insert(fullscreened_clients, c)
if #fullscreened_clients == 1 then
awful.util.spawn("xset s noblank")
awful.util.spawn("xset s off")
awful.util.spawn("xset -dpms")
naughty.notify({
preset = naughty.config.presets.low,
title = "DPMS information",
text = "Display power management is now OFF"
})
end
else
remove_client(fullscreened_clients, c)
end
end)
client.connect_signal("unmanage", function(c)
if c.fullscreen then
remove_client(fullscreened_clients, c)
end
end)
awful.util.spawn_with_shell("run-once pasystray")
awful.util.spawn_with_shell("run-once blueman-applet")
awful.util.spawn_with_shell("run-once nm-applet")
awful.util.spawn_with_shell("run-once 'nextcloud --background'")
awful.util.spawn_with_shell("run-once 'udiskie --tray --notify --automount'")
awful.util.spawn_with_shell("run-once 'mpd /home/lanxu/.config/mpd/mpd.conf'")
awful.util.spawn_with_shell("run-once 'xscreensaver -no-splash'")
--awful.util.spawn_with_shell("run-once conky")
--awful.util.spawn_with_shell("run-once light-locker")
--awful.util.spawn_with_shell("run-once firefox-developer-edition")
--awful.util.spawn_with_shell("run-once firefox")
--awful.util.spawn_with_shell("run-once syncthing-gtk")

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

View File

@ -0,0 +1,127 @@
---------------------------
-- Default awesome theme --
---------------------------
local theme_assets = require("beautiful.theme_assets")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
local theme = {}
theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/lanxu"
theme.wallpaper = theme.dir .. "/background.png"
theme.font = "Fira Sans 10"
theme.bg_normal = "#222222"
theme.bg_focus = "#8A2BE2"
theme.bg_urgent = "#ff0000"
theme.bg_minimize = "#444444"
theme.bg_systray = theme.bg_normal
theme.fg_normal = "#d0bce2"
theme.fg_focus = "#ffffff"
theme.fg_urgent = "#ffffff"
theme.fg_minimize = "#ffffff"
theme.useless_gap = dpi(0)
theme.border_width = dpi(1)
theme.border_normal = "#000000"
theme.border_focus = "#535d6c"
theme.border_marked = "#91231c"
theme.wibar_height = 20
-- theme.wibar_border_width = 2
-- theme.wibar_border_color = "#222222"
-- There are other variable sets
-- overriding the default one when
-- defined, the sets are:
-- taglist_[bg|fg]_[focus|urgent|occupied|empty]
-- tasklist_[bg|fg]_[focus|urgent]
-- titlebar_[bg|fg]_[normal|focus]
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
-- Example:
--theme.taglist_bg_focus = "#ff0000"
-- Display the taglist squares
--theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
--theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
local taglist_square_size = dpi(4)
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
taglist_square_size, theme.fg_normal
)
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
taglist_square_size, theme.fg_normal
)
-- Variables set for theming the menu:
-- menu_[bg|fg]_[normal|focus]
-- menu_[border_color|border_width]
theme.menu_submenu_icon = theme.dir .. "/submenu.png"
theme.menu_height = dpi(15)
theme.menu_width = dpi(100)
-- You can add as many variables as
-- you wish and access them by using
-- beautiful.variable in your rc.lua
--theme.bg_widget = "#cc0000"
-- Define the image to load
theme.titlebar_close_button_normal = theme.dir .. "/titlebar/close_normal.png"
theme.titlebar_close_button_focus = theme.dir .. "/titlebar/close_focus.png"
theme.titlebar_minimize_button_normal = theme.dir .. "/titlebar/minimize_normal.png"
theme.titlebar_minimize_button_focus = theme.dir .. "/titlebar/minimize_focus.png"
theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/titlebar/ontop_normal_inactive.png"
theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/titlebar/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_active = theme.dir .. "/titlebar/ontop_normal_active.png"
theme.titlebar_ontop_button_focus_active = theme.dir .. "/titlebar/ontop_focus_active.png"
theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/titlebar/sticky_normal_inactive.png"
theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/titlebar/sticky_focus_inactive.png"
theme.titlebar_sticky_button_normal_active = theme.dir .. "/titlebar/sticky_normal_active.png"
theme.titlebar_sticky_button_focus_active = theme.dir .. "/titlebar/sticky_focus_active.png"
theme.titlebar_floating_button_normal_inactive = theme.dir .. "/titlebar/floating_normal_inactive.png"
theme.titlebar_floating_button_focus_inactive = theme.dir .. "/titlebar/floating_focus_inactive.png"
theme.titlebar_floating_button_normal_active = theme.dir .. "/titlebar/floating_normal_active.png"
theme.titlebar_floating_button_focus_active = theme.dir .. "/titlebar/floating_focus_active.png"
theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/titlebar/maximized_normal_inactive.png"
theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/titlebar/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_active = theme.dir .. "/titlebar/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_active = theme.dir .. "/titlebar/maximized_focus_active.png"
theme.wallpaper = theme.dir .. "/background.png"
-- You can use your own layout icons like this:
theme.layout_fairh = theme.dir .. "/layouts/fairhw.png"
theme.layout_fairv = theme.dir .. "/layouts/fairvw.png"
theme.layout_floating = theme.dir .. "/layouts/floatingw.png"
theme.layout_magnifier = theme.dir .. "/layouts/magnifierw.png"
theme.layout_max = theme.dir .. "/layouts/maxw.png"
theme.layout_fullscreen = theme.dir .. "/layouts/fullscreenw.png"
theme.layout_tilebottom = theme.dir .. "/layouts/tilebottomw.png"
theme.layout_tileleft = theme.dir .. "/layouts/tileleftw.png"
theme.layout_tile = theme.dir .. "/layouts/tilew.png"
theme.layout_tiletop = theme.dir .. "/layouts/tiletopw.png"
theme.layout_spiral = theme.dir .. "/layouts/spiralw.png"
theme.layout_dwindle = theme.dir .. "/layouts/dwindlew.png"
theme.layout_cornernw = theme.dir .. "/layouts/cornernww.png"
theme.layout_cornerne = theme.dir .. "/layouts/cornernew.png"
theme.layout_cornersw = theme.dir .. "/layouts/cornersww.png"
theme.layout_cornerse = theme.dir .. "/layouts/cornersew.png"
theme.awesome_icon = theme_assets.awesome_icon(
theme.menu_height, theme.bg_focus, theme.fg_focus
)
--theme.awesome_icon = theme.dir .. "/logo16.png"
-- Define the icon theme for application icons. If not set then the icons
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
theme.icon_theme = nil
return theme
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

172
config/awesome/widgets.lua Normal file
View File

@ -0,0 +1,172 @@
local gputemp = require("gputemp")
local hubic = require("hubic")
local dpmsstatus = require("dpmsstatus")
local lain = require("lain")
local vicious = require("vicious") -- Custom
local beautiful = require("beautiful") -- CPU temp
local wibox = require("wibox")
local gears = require("gears")
-- Variables
local valuecolor = "white"
icons_dir = os.getenv("HOME") .. "/.config/awesome/themes/lanxu/icons/"
cpuicon = wibox.widget.imagebox()
cpuicon.image = icons_dir .. "cpu.png"
cpuicon.resize = false
-- Helpers
function file_exists(name)
local f = io.open(name,"r")
if f ~= nil then io.close(f) return true else return false end
end
function create_markup(key, value, postfix, color)
return key .. " <span foreground='" .. color .. "'><b>" .. value .. postfix .."</b></span>"
end
-- Spacer
spacer = wibox.widget.textbox()
--spacer.text = "-"
spacer.forced_width = 8;
-- CPU
mycpu = lain.widget.cpu({
settings = function()
widget.markup = create_markup("CPU", cpu_now.usage, " %", valuecolor)
end
})
-- MEM
mymem = lain.widget.mem({
settings = function()
widget.markup = create_markup("MEM", mem_now.used, " MB", valuecolor)
end
})
-- GPU
mygputemp_text = wibox.widget.textbox()
mygputemp_text.align = "center"
vicious.register(mygputemp_text, gputemp,
function(widget, args)
temp = string.format("%.0f", tonumber(args[0]))
return create_markup("", temp, "", valuecolor)
end, 15, "AMD")
mygputemp = wibox.container.background()
mygputemp.forced_width = 70
mygputemp:set_widget(mygputemp_text)
--mytextclock:set_shape(gears.shape.hexagon)
mygputemp:set_bg('#5e35b1')
-- Hubic
myhubic = wibox.widget.textbox()
vicious.register(myhubic, hubic, create_markup("CLOUD", "$0", "", valuecolor), 15, "HUBIC")
-- Volume
volume = lain.widget.pulse({
scallback = function()
return "pacmd list-sinks | grep -Paoz \"(?s)(\\* index.*$(pactl info | grep -e 'ink' | cut -d' ' -f3).*(index)?)\" | tr -d '\\000' | grep -e 'index' -e 'device.string' -e 'name:' -e 'volume: front' -e 'muted'"
end,
settings = function()
volstr = volume_now.left .. " "
volcolor = valuecolor
if volume_now.muted == "yes" then
volcolor = "red"
end
widget.markup = create_markup("VOL", volstr, "%", volcolor)
end
})
-- Text clock
mytextclock_text = wibox.widget.textclock(create_markup("","%Y-%m-%d %H:%M","", valuecolor))
mytextclock_text.align = "center"
lain.widget.cal({
followtag = true,
attach_to = {mytextclock_text},
notification_preset = {
font = "Monospace 11", fg = "#FFFFFF", bg = "#000000"
}
})
mytextclock = wibox.container.background()
mytextclock.forced_width = 130
mytextclock:set_widget(mytextclock_text)
mytextclock:set_bg('#512da8')
-- CPU temperature
local tempfile = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon1/temp1_input"
if file_exists(tempfile) == false then
tempfile = "/sys/class/thermal/thermal_zone0/temp"
end
mycputemp_text = lain.widget.temp({
tempfile = tempfile,
settings = function()
temp = string.format("%.0f", tonumber(coretemp_now))
widget.markup = create_markup("", temp, "", valuecolor)
end
})
mycputemp_text.widget.align = "center"
mycputemp = wibox.container.background()
mycputemp.forced_width = 70
mycputemp:set_widget(mycputemp_text.widget)
mycputemp:set_bg('#9575cd')
-- Weather Widget
myweather = lain.widget.weather({
city_id = 634963,
lang = "fi",
followtag = true,
settings = function()
widget.markup = create_markup("Tampere", weather_now.main.temp, "", valuecolor)
end,
notification_preset = {
font = "Monospace 11", fg = "#FFFFFF", bg = "#000000"
}
})
-- DPMS
mydpmsstatus = wibox.widget.textbox()
-- mydpmsstatus.container.background.bg = '#ff0000'
--mydpmsstatus = {
-- widget = wibox.widget.textbox
--}
vicious.register(mydpmsstatus, dpmsstatus, function(widget, args)
color = valuecolor
if args[0] == "Enabled" then
return create_markup("DPMS", "ON", "", color)
else
color = "red"
return create_markup("DPMS", "OFF", "", color)
end
end)
local notification = {
font = "Monospace 10"
}
-- Servers
--local mcstatus = require("lanxu/mcstatus")
--myserverstatus = mcstatus({
--notification_preset = notification,
--settings = function()
--widget.markup = create_markup("PLAYERS", totalplayers, "", valuecolor)
--end
--})
--local cloudstatus = require("lanxu/cloudstatus")
--mycloudstatus = cloudstatus({
--notification_preset = notification,
--settings = function()
--widget.markup = create_markup("CLOUD", currentstatus, "", valuecolor)
--end
--})
local ip = require("lanxu/ip")
ipaddress = ip({
homeaddress = "91.157.104.247",
settings = function()
widget.markup = create_markup("IP", address, "", valuecolor)
end
})

View File

@ -0,0 +1,9 @@
# menu = { shadow = false; };
dropdown_menu = { shadow = false; };
popup_menu = { shadow = false; };
utility = { shadow = false; };
opacity-rule = [
"95:class_g = 'kitty' && focused",
"80:class_g = 'kitty' && !focused"
];

425
config/dunst/dunstrc Normal file
View File

@ -0,0 +1,425 @@
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "300x5-30+20"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 5
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 10
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
#frame_color = "#aaaaaa"
frame_color = foreground
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
idle_threshold = 120
### Text ###
font = Monospace 10
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons.
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/rofi -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/firefox -new-tab
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
# Manage dunst's desire for talking
# Can be one of the following values:
# crit: Critical features. Dunst aborts
# warn: Only non-fatal warnings
# mesg: Important Messages
# info: all unimportant stuff
# debug: all less than unimportant stuff
verbosity = mesg
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 0
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines action of mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: If the notification has exactly one action, or one is marked as default,
# invoke it. If there are multiple and no default, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
mouse_left_click = close_current
mouse_middle_click = do_action
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
# background = "#222222"
# foreground = "#888888"
background = "#fdf6e3"
foreground = "#93a1a1"
frame_color = "#93a1a1"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#fdf6e3"
foreground = "#002b36"
frame_color = "#002b36"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
#background = "#900000"
#foreground = "#ffffff"
#frame_color = "#ff0000"
background = "#dc322f"
foreground = "#eee8d5"
frame_color = "#cb4b16"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# timeout
# urgency
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg
[sound]
summary = "*"
script = ~/Scripts/dunst_message.sh

View File

@ -0,0 +1,112 @@
<fontconfig>
<match target="font">
<!-- If the requested font is Bitstream Vera Serif -->
<test name="family" compare="eq">
<string>Bitstream Vera Serif</string>
</test>
<!-- Replace the entire match list with Bitstream Vera Serif alone -->
<edit name="family" mode="assign_replace">
<string>Bitstream Vera Serif</string>
</edit>
<!-- Assign the serif family -->
<edit name="family" mode="append_last">
<string>serif</string>
</edit>
</match>
<match>
<!-- If the requested font is serif -->
<test qual="any" name="family">
<string>serif</string>
</test>
<!-- Make Bitstream Vera Serif the first result -->
<edit name="family" mode="prepend_first">
<string>Bitstream Vera Serif</string>
</edit>
<!-- Followed by Noto Color Emoji -->
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="font">
<!-- If the requested font is Bitstream Vera Sans -->
<test name="family" compare="eq">
<string>Bitstream Vera Sans</string>
</test>
<!-- Replace the entire match list with Bitstream Vera Sans alone -->
<edit name="family" mode="assign_replace">
<string>Bitstream Vera Sans</string>
</edit>
<!-- Assign the sans-serif family -->
<edit name="family" mode="append_last">
<string>sans-serif</string>
</edit>
</match>
<match target="pattern">
<!-- If the requested font is sans-serif -->
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<!-- Make Bitstream Vera Sans the first result -->
<edit name="family" mode="prepend_first">
<string>Bitstream Vera Sans</string>
</edit>
<!-- Followed by Noto Color Emoji -->
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="font">
<!-- If the requested font is Bitstream Vera Sans Mono -->
<test name="family" compare="eq">
<string>Bitstream Vera Sans Mono</string>
</test>
<!-- Replace the entire match list with Bitstream Vera Sans Mono alone -->
<edit name="family" mode="assign_replace">
<string>Bitstream Vera Sans Mono</string>
</edit>
<!-- Assign the monospace family last -->
<edit name="family" mode="append_last">
<string>monospace</string>
</edit>
</match>
<match target="pattern">
<!-- If the requested font is monospace -->
<test qual="any" name="family">
<string>monospace</string>
</test>
<!--
Make Bitstream Vera Sans Mono the first result
Note: If you want a different monospace font, this is where you change it.
-->
<edit name="family" mode="prepend_first">
<string>Bitstream Vera Sans Mono</string>
</edit>
<!-- Followed by Noto Color Emoji -->
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
<!-- Add emoji generic family -->
<alias binding="strong">
<family>emoji</family>
<default><family>Noto Color Emoji</family></default>
</alias>
<!-- Alias requests for the other emoji fonts -->
<alias binding="strong">
<family>Apple Color Emoji</family>
<prefer><family>Noto Color Emoji</family></prefer>
<default><family>sans-serif</family></default>
</alias>
<alias binding="strong">
<family>Segoe UI Emoji</family>
<prefer><family>Noto Color Emoji</family></prefer>
<default><family>sans-serif</family></default>
</alias>
</fontconfig>

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Priority:
! 1. The generic family OR specific family
! 2. The emoji font family (defined in 60-generic.conf)
! 3. All the rest
!-->
<alias binding="weak">
<family>monospace</family>
<prefer>
<family>emoji</family>
<family>Liberation Mono</family>
<family>Fira Mono</family>
</prefer>
</alias>
</fontconfig>

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Priority:
! 1. The generic family OR specific family
! 2. The emoji font family (defined in 60-generic.conf)
! 3. All the rest
!-->
<alias binding="weak">
<family>sans-serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
</fontconfig>

View File

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
! Sorry DejaVu... but you're treadin' on my emoji!
! I've gotta keep you around for package dependency reasons, though.
!-->
<selectfont>
<rejectfont>
<pattern>
<patelt name="family">
<string>DejaVu Sans</string>
</patelt>
</pattern>
<pattern>
<patelt name="family">
<string>DejaVu Serif</string>
</patelt>
</pattern>
<pattern>
<patelt name="family">
<string>DejaVu Sans Mono</string>
</patelt>
</pattern>
</rejectfont>
</selectfont>
</fontconfig>

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
No to the baked-in Firefox emoji font.
Firefox version <= 60 uses EmojiOne Mozilla, while newer uses Twemoji Mozilla
-->
<selectfont>
<rejectfont>
<pattern>
<patelt name="family">
<string>EmojiOne Mozilla</string>
</patelt>
</pattern>
<pattern>
<patelt name="family">
<string>Twemoji Mozilla</string>
</patelt>
</pattern>
</rejectfont>
</selectfont>
</fontconfig>

View File

@ -0,0 +1,64 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<!--<edit mode="assign" name="autohint"><bool>true</bool></edit>
<edit mode="assign" name="hinting"><bool>true</bool></edit>-->
<edit mode="assign" name="autohint"><bool>true</bool></edit>
<edit mode="assign" name="hinting"><bool>true</bool></edit>
<edit mode="assign" name="lcdfilter"><const>lcddefault</const></edit>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<!-- symbols do not support antialias -->
<!-- Removed antialias because it made all emoji invisible -->
<edit mode="assign" name="rgba"><const>rgb</const></edit>
</match>
<match target="font">
<test name="pixelsize" qual="any" compare="more"><double>15</double></test>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
</match>
<match target="font">
<test name="pixelsize" qual="any" compare="more"><double>12</double></test>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
</match>
<match target="font">
<test name="slant" compare="not_eq"><double>0</double></test>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>verdana</string></test>
<edit name="family" mode="assign" binding="same"><string>Bitstream Vera Sans</string></edit>
</match>
<!-- Prefer Liberation -->
<alias>
<family>sans-serif</family>
<prefer>
<family>Liberation Sans</family>
</prefer>
<default><family>Liberation Sans</family></default>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Liberation Serif</family>
</prefer>
<default><family>Liberation Serif</family></default>
</alias>
<!-- Monospace fonts are handled by 69-emoji-monospace.conf -->
<!--
<alias>
<family>monospace</family>
<prefer>
<family>Liberation Mono</family>
</prefer>
<default><family>Liberation Mono</family></default>
</alias>
-->
</fontconfig>

View File

@ -0,0 +1,4 @@
#!/bin/sh
rm ./conf.d/70-no-dejavu.conf
echo "Removed configuration"

Some files were not shown because too many files have changed in this diff Show More