desktop asthetic changes
This commit is contained in:
parent
71f6bbc9b1
commit
fbae04a8f1
|
@ -318,7 +318,7 @@ colors:
|
||||||
#
|
#
|
||||||
# Window opacity as a floating point number from `0.0` to `1.0`.
|
# Window opacity as a floating point number from `0.0` to `1.0`.
|
||||||
# The value `0.0` is completely transparent and `1.0` is opaque.
|
# The value `0.0` is completely transparent and `1.0` is opaque.
|
||||||
background_opacity: 0.95
|
background_opacity: 0.80
|
||||||
|
|
||||||
#selection:
|
#selection:
|
||||||
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
|
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
(if (= "syl\n" stdout)
|
(if (= "syl\n" stdout)
|
||||||
(global laptop true)
|
(global laptop true)
|
||||||
(global laptop false))))
|
(global laptop false))))
|
||||||
(local laptop true)
|
(local laptop false)
|
||||||
|
|
||||||
;; Table of layouts to cover with awful.layout.inc, order matters.
|
;; Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
(set awful.layout.layouts [
|
(set awful.layout.layouts [
|
||||||
|
@ -179,16 +179,25 @@
|
||||||
:bg_empty beautiful.bg_normal
|
:bg_empty beautiful.bg_normal
|
||||||
}
|
}
|
||||||
:layout {
|
:layout {
|
||||||
:spacing (dpi 10)
|
:spacing (dpi 5)
|
||||||
:spacing_widget {
|
:spacing_widget {
|
||||||
:valign "center"
|
:valign "center"
|
||||||
:halign "center"
|
:halign "center"
|
||||||
:widget wibox.container.place
|
:widget wibox.container.place
|
||||||
}
|
}
|
||||||
:layout wibox.layout.flex.horizontal
|
:layout wibox.layout.flex.horizontal
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
;; (set s.mytaglistbg ( {
|
||||||
|
;; 1 {
|
||||||
|
;; s.mytaglist
|
||||||
|
;; }
|
||||||
|
;; :widget wibox.container.background
|
||||||
|
;; :shape gears.shape.rounded_bar
|
||||||
|
;; :bg beautiful.bg_normal
|
||||||
|
;; }))
|
||||||
|
|
||||||
;; Create a tasklist widget
|
;; Create a tasklist widget
|
||||||
(set s.mytasklist (awful.widget.tasklist {
|
(set s.mytasklist (awful.widget.tasklist {
|
||||||
:screen s
|
:screen s
|
||||||
|
@ -204,7 +213,8 @@
|
||||||
:spacing (dpi 20)
|
:spacing (dpi 20)
|
||||||
:spacing_widget {
|
:spacing_widget {
|
||||||
1 {
|
1 {
|
||||||
:forced_width (dpi 5) :forced_height (dpi 20)
|
:forced_width (dpi 5)
|
||||||
|
:forced_height (dpi 20)
|
||||||
:widget wibox.widget.separator
|
:widget wibox.widget.separator
|
||||||
}
|
}
|
||||||
:valign "center"
|
:valign "center"
|
||||||
|
@ -254,7 +264,8 @@
|
||||||
:spacing (dpi 20)
|
:spacing (dpi 20)
|
||||||
:spacing_widget {
|
:spacing_widget {
|
||||||
1 {
|
1 {
|
||||||
:forced_width (dpi 5) :forced_height (dpi 20)
|
:forced_width (dpi 5)
|
||||||
|
:forced_height (dpi 20)
|
||||||
:widget wibox.widget.separator
|
:widget wibox.widget.separator
|
||||||
}
|
}
|
||||||
:valign "center"
|
:valign "center"
|
||||||
|
@ -386,6 +397,8 @@
|
||||||
(set s.mysystray { 1 { 1 { 1 (wibox.widget.systray)
|
(set s.mysystray { 1 { 1 { 1 (wibox.widget.systray)
|
||||||
:widget wibox.container.margin
|
:widget wibox.container.margin
|
||||||
:right (dpi 10)
|
:right (dpi 10)
|
||||||
|
:top (dpi 2)
|
||||||
|
:bottom (dpi 2)
|
||||||
:left (dpi 10)}
|
:left (dpi 10)}
|
||||||
:widget wibox.container.background
|
:widget wibox.container.background
|
||||||
:shape gears.shape.rounded_bar
|
:shape gears.shape.rounded_bar
|
||||||
|
@ -400,7 +413,7 @@
|
||||||
1 s.cpuwidget
|
1 s.cpuwidget
|
||||||
2 s.volumewidget
|
2 s.volumewidget
|
||||||
3 (if laptop s.batterywidget s.myemptywidget)
|
3 (if laptop s.batterywidget s.myemptywidget)
|
||||||
4 s.mysystray
|
4 (if (= s.index 1) s.mysystray)
|
||||||
5 s.mylayoutbox
|
5 s.mylayoutbox
|
||||||
}
|
}
|
||||||
:widget wibox.container.background
|
:widget wibox.container.background
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
{:description "restore minimized" :group "client"})
|
{:description "restore minimized" :group "client"})
|
||||||
|
|
||||||
;; Prompt
|
;; Prompt
|
||||||
(awful.key [ modkey ] "r" (fn [] (awful.spawn "/home/chris/.dotfiles/rofi/launchers-git/run.sh"))
|
(awful.key [ modkey ] "Menu" (fn [] (awful.spawn "/home/chris/.dotfiles/rofi/launchers-git/run.sh"))
|
||||||
{:description "run prompt" :group "launcher"})
|
{:description "run prompt" :group "launcher"})
|
||||||
|
|
||||||
(awful.key [ modkey shift ctrl ] "x" (fn []
|
(awful.key [ modkey shift ctrl ] "x" (fn []
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
{:description "launch eshell in new emacs frame" :group "apps" })
|
{:description "launch eshell in new emacs frame" :group "apps" })
|
||||||
(awful.key [ modkey ] "e" (fn [] (awful.spawn "emacsclient -c -a 'emacs'"))
|
(awful.key [ modkey ] "e" (fn [] (awful.spawn "emacsclient -c -a 'emacs'"))
|
||||||
{:description "launch new emacs frame" :group "apps" })
|
{:description "launch new emacs frame" :group "apps" })
|
||||||
(awful.key [ modkey ] "p" (fn [] (awful.spawn "rofi-pass"))
|
(awful.key [ modkey ] "p" (fn [] (awful.spawn "rofi-rbw"))
|
||||||
{:description "select pass" :group "apps" })
|
{:description "select pass" :group "apps" })
|
||||||
(awful.key [ modkey shift ] "w" (fn [] (awful.spawn "libreoffice --writer"))
|
(awful.key [ modkey shift ] "w" (fn [] (awful.spawn "libreoffice --writer"))
|
||||||
{:description "Open Writer" :group "apps" })
|
{:description "Open Writer" :group "apps" })
|
||||||
|
|
71
picom.conf
71
picom.conf
|
@ -1,64 +1,42 @@
|
||||||
#################################
|
# Corners
|
||||||
# Corners #
|
|
||||||
#################################
|
|
||||||
# requires: https://github.com/sdhand/compton
|
|
||||||
corner-radius = 14.0;
|
corner-radius = 14.0;
|
||||||
rounded-corners-exclude = [
|
rounded-corners-exclude = [
|
||||||
#"window_type = 'normal'",
|
#"window_type = 'normal'",
|
||||||
"class_g = 'awesome'",
|
"class_g = 'awesome'",
|
||||||
# "class_g = 'URxvt'",
|
|
||||||
"class_g = 'XTerm'",
|
"class_g = 'XTerm'",
|
||||||
"class_g = 'kitty'",
|
"class_g = 'kitty'",
|
||||||
# "class_g = 'emacs'",
|
# "class_g = 'emacs'",
|
||||||
# "name_g = 'EXWM workspace'",
|
|
||||||
# "class_g = 'Polybar'",
|
|
||||||
# "class_g = 'mpv'",
|
|
||||||
# "class_g = 'qutebrowser'",
|
|
||||||
#"class_g = 'TelegramDesktop'",
|
|
||||||
# "class_g = 'firefox'",
|
|
||||||
"class_g = 'Thunderbird'",
|
"class_g = 'Thunderbird'",
|
||||||
# "class_g = 'Alacritty'"
|
|
||||||
];
|
];
|
||||||
round-borders = 12;
|
round-borders = 12;
|
||||||
round-borders-exclude = [
|
round-borders-exclude = [
|
||||||
#"class_g = 'TelegramDesktop'",
|
#"class_g = 'TelegramDesktop'",
|
||||||
];
|
];
|
||||||
|
|
||||||
#################################
|
#Shadows
|
||||||
# Shadows #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
|
|
||||||
# Enabled client-side shadows on windows. Note desktop windows
|
# Enabled client-side shadows on windows. Note desktop windows
|
||||||
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
||||||
# unless explicitly requested using the wintypes option.
|
# unless explicitly requested using the wintypes option.
|
||||||
#
|
|
||||||
# shadow = false
|
|
||||||
shadow = true;
|
shadow = true;
|
||||||
|
|
||||||
# The blur radius for shadows, in pixels. (defaults to 12)
|
# The blur radius for shadows, in pixels. (defaults to 12)
|
||||||
# shadow-radius = 12
|
|
||||||
shadow-radius = 13;
|
shadow-radius = 13;
|
||||||
|
|
||||||
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
||||||
shadow-opacity = .65
|
shadow-opacity = .75;
|
||||||
|
|
||||||
# The left offset for shadows, in pixels. (defaults to -15)
|
# The left offset for shadows, in pixels. (defaults to -15)
|
||||||
# shadow-offset-x = -15
|
|
||||||
shadow-offset-x = 2;
|
shadow-offset-x = 2;
|
||||||
|
|
||||||
# The top offset for shadows, in pixels. (defaults to -15)
|
# The top offset for shadows, in pixels. (defaults to -15)
|
||||||
# shadow-offset-y = -15
|
|
||||||
shadow-offset-y = 2;
|
shadow-offset-y = 2;
|
||||||
|
|
||||||
# Avoid drawing shadows on dock/panel windows. This option is deprecated,
|
# Avoid drawing shadows on dock/panel windows. This option is deprecated,
|
||||||
# you should use the *wintypes* option in your config file instead.
|
# you should use the *wintypes* option in your config file instead.
|
||||||
#
|
|
||||||
# no-dock-shadow = false
|
# no-dock-shadow = false
|
||||||
|
|
||||||
# Don't draw shadows on drag-and-drop windows. This option is deprecated,
|
# Don't draw shadows on drag-and-drop windows. This option is deprecated,
|
||||||
# you should use the *wintypes* option in your config file instead.
|
# you should use the *wintypes* option in your config file instead.
|
||||||
#
|
|
||||||
# no-dnd-shadow = false
|
# no-dnd-shadow = false
|
||||||
|
|
||||||
# Red color value of shadow (0.0 - 1.0, defaults to 0).
|
# Red color value of shadow (0.0 - 1.0, defaults to 0).
|
||||||
|
@ -97,11 +75,6 @@ shadow-exclude = [
|
||||||
"class_g = 'awesome'",
|
"class_g = 'awesome'",
|
||||||
# "class_g = 'qutebrowser'",
|
# "class_g = 'qutebrowser'",
|
||||||
"class_g = 'slop'",
|
"class_g = 'slop'",
|
||||||
# "class_g = 'qutebrowser'",
|
|
||||||
# "class_g = 'mpv'",
|
|
||||||
# "class_g = 'microsoft teams - insiders'",
|
|
||||||
# "class_g = 'Polybar'",
|
|
||||||
# "class_g = 'Rofi'",
|
|
||||||
"_GTK_FRAME_EXTENTS@:c"
|
"_GTK_FRAME_EXTENTS@:c"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -109,30 +82,23 @@ shadow-exclude = [
|
||||||
# be painted in, such as a dock window region. Use
|
# be painted in, such as a dock window region. Use
|
||||||
# shadow-exclude-reg = "x10+0+0"
|
# shadow-exclude-reg = "x10+0+0"
|
||||||
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
|
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
|
||||||
#
|
|
||||||
shadow-exclude-reg = "x0+0+0"
|
shadow-exclude-reg = "x0+0+0"
|
||||||
|
|
||||||
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
|
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
|
||||||
# xinerama-shadow-crop = false
|
# xinerama-shadow-crop = false
|
||||||
|
|
||||||
|
# Fading
|
||||||
#################################
|
|
||||||
# Fading #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
|
|
||||||
# Fade windows in/out when opening/closing and when opacity changes,
|
# Fade windows in/out when opening/closing and when opacity changes,
|
||||||
# unless no-fading-openclose is used.
|
# unless no-fading-openclose is used.
|
||||||
# fading = false
|
|
||||||
fading = true;
|
fading = true;
|
||||||
|
|
||||||
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
|
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
|
||||||
# fade-in-step = 0.028
|
# fade-in-step = 0.028
|
||||||
fade-in-step = 0.3;
|
fade-in-step = 0.01;
|
||||||
|
|
||||||
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
|
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
|
||||||
# fade-out-step = 0.03
|
# fade-out-step = 0.03
|
||||||
fade-out-step = 0.3;
|
fade-out-step = 0.01;
|
||||||
|
|
||||||
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
|
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
|
||||||
# fade-delta = 10
|
# fade-delta = 10
|
||||||
|
@ -307,7 +273,6 @@ backend = "glx";
|
||||||
|
|
||||||
|
|
||||||
# Enable/disable VSync.
|
# Enable/disable VSync.
|
||||||
# vsync = false
|
|
||||||
vsync = true
|
vsync = true
|
||||||
|
|
||||||
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
|
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
|
||||||
|
@ -325,41 +290,32 @@ mark-ovredir-focused = true;
|
||||||
|
|
||||||
# Try to detect windows with rounded corners and don't consider them
|
# Try to detect windows with rounded corners and don't consider them
|
||||||
# shaped windows. The accuracy is not very high, unfortunately.
|
# shaped windows. The accuracy is not very high, unfortunately.
|
||||||
#
|
|
||||||
# detect-rounded-corners = false
|
|
||||||
detect-rounded-corners = true;
|
detect-rounded-corners = true;
|
||||||
|
|
||||||
# Detect '_NET_WM_OPACITY' on client windows, useful for window managers
|
# Detect '_NET_WM_OPACITY' on client windows, useful for window managers
|
||||||
# not passing '_NET_WM_OPACITY' of client windows to frame windows.
|
# not passing '_NET_WM_OPACITY' of client windows to frame windows.
|
||||||
#
|
|
||||||
# detect-client-opacity = false
|
|
||||||
detect-client-opacity = true;
|
detect-client-opacity = true;
|
||||||
|
|
||||||
# Specify refresh rate of the screen. If not specified or 0, picom will
|
# Specify refresh rate of the screen. If not specified or 0, picom will
|
||||||
# try detecting this with X RandR extension.
|
# try detecting this with X RandR extension.
|
||||||
#
|
refresh-rate = 0;
|
||||||
# refresh-rate = 60
|
|
||||||
refresh-rate = 0
|
|
||||||
|
|
||||||
# Limit picom to repaint at most once every 1 / 'refresh_rate' second to
|
# Limit picom to repaint at most once every 1 / 'refresh_rate' second to
|
||||||
# boost performance. This should not be used with
|
# boost performance. This should not be used with
|
||||||
# vsync drm/opengl/opengl-oml
|
# vsync drm/opengl/opengl-oml
|
||||||
# as they essentially does sw-opti's job already,
|
# as they essentially does sw-opti's job already,
|
||||||
# unless you wish to specify a lower refresh rate than the actual value.
|
# unless you wish to specify a lower refresh rate than the actual value.
|
||||||
#
|
|
||||||
# sw-opti =
|
# sw-opti =
|
||||||
|
|
||||||
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
|
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
|
||||||
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
|
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
|
||||||
# provided that the WM supports it.
|
# provided that the WM supports it.
|
||||||
#
|
use-ewmh-active-win = true;
|
||||||
use-ewmh-active-win = true
|
|
||||||
|
|
||||||
# Unredirect all windows if a full-screen opaque window is detected,
|
# Unredirect all windows if a full-screen opaque window is detected,
|
||||||
# to maximize performance for full-screen windows. Known to cause flickering
|
# to maximize performance for full-screen windows. Known to cause flickering
|
||||||
# when redirecting/unredirecting windows. paint-on-overlay may make the flickering less obvious.
|
# when redirecting/unredirecting windows. paint-on-overlay may make the flickering less obvious.
|
||||||
#
|
unredir-if-possible = true;
|
||||||
# unredir-if-possible = false
|
|
||||||
|
|
||||||
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
|
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
|
||||||
# unredir-if-possible-delay = 0
|
# unredir-if-possible-delay = 0
|
||||||
|
@ -371,14 +327,14 @@ use-ewmh-active-win = true
|
||||||
# in the same group focused at the same time.
|
# in the same group focused at the same time.
|
||||||
#
|
#
|
||||||
# detect-transient = false
|
# detect-transient = false
|
||||||
detect-transient = true
|
detect-transient = true;
|
||||||
|
|
||||||
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
|
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
|
||||||
# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if
|
# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if
|
||||||
# detect-transient is enabled, too.
|
# detect-transient is enabled, too.
|
||||||
#
|
#
|
||||||
# detect-client-leader = false
|
# detect-client-leader = false
|
||||||
detect-client-leader = true
|
detect-client-leader = true;
|
||||||
|
|
||||||
# Resize damaged region by a specific number of pixels.
|
# Resize damaged region by a specific number of pixels.
|
||||||
# A positive value enlarges it while a negative one shrinks it.
|
# A positive value enlarges it while a negative one shrinks it.
|
||||||
|
@ -402,8 +358,7 @@ detect-client-leader = true
|
||||||
# Might cause incorrect opacity when rendering transparent content (but never
|
# Might cause incorrect opacity when rendering transparent content (but never
|
||||||
# practically happened) and may not work with blur-background.
|
# practically happened) and may not work with blur-background.
|
||||||
# My tests show a 15% performance boost. Recommended.
|
# My tests show a 15% performance boost. Recommended.
|
||||||
#
|
glx-no-stencil = true
|
||||||
# glx-no-stencil = false
|
|
||||||
|
|
||||||
# GLX backend: Avoid rebinding pixmap on window damage.
|
# GLX backend: Avoid rebinding pixmap on window damage.
|
||||||
# Probably could improve performance on rapid window content changes,
|
# Probably could improve performance on rapid window content changes,
|
||||||
|
@ -418,7 +373,7 @@ detect-client-leader = true
|
||||||
# The opposing option is use-damage
|
# The opposing option is use-damage
|
||||||
#
|
#
|
||||||
# no-use-damage = false
|
# no-use-damage = false
|
||||||
use-damage = true
|
use-damage = true;
|
||||||
|
|
||||||
# Use X Sync fence to sync clients' draw calls, to make sure all draw
|
# Use X Sync fence to sync clients' draw calls, to make sure all draw
|
||||||
# calls are finished before picom starts drawing. Needed on nvidia-drivers
|
# calls are finished before picom starts drawing. Needed on nvidia-drivers
|
||||||
|
|
|
@ -63,7 +63,7 @@ window {
|
||||||
}
|
}
|
||||||
|
|
||||||
mainbox {
|
mainbox {
|
||||||
border-radius: 35px;
|
border-radius: 16;
|
||||||
background-color: @transparent;
|
background-color: @transparent;
|
||||||
text-color: @base05;
|
text-color: @base05;
|
||||||
transparency: "real";
|
transparency: "real";
|
||||||
|
|
343
scripts/fm6000
Executable file
343
scripts/fm6000
Executable file
|
@ -0,0 +1,343 @@
|
||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
# Dilbert themed system info fetch tool
|
||||||
|
# https://github.com/anhsirk0/fetch-master-6000
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Term::ANSIColor;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
my $length = 13;
|
||||||
|
my $gap = 3;
|
||||||
|
my $margin = 2;
|
||||||
|
my $color = 'yellow';
|
||||||
|
|
||||||
|
my $wally;
|
||||||
|
my $dogbert;
|
||||||
|
my $alice;
|
||||||
|
my $phb;
|
||||||
|
my $asok;
|
||||||
|
my $help;
|
||||||
|
my $not_de;
|
||||||
|
my $random;
|
||||||
|
|
||||||
|
my @colors = (
|
||||||
|
'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white',
|
||||||
|
'bright_red', 'bright_green', 'bright_yellow',
|
||||||
|
'bright_blue', 'bright_magenta', 'bright_cyan', 'bright_white'
|
||||||
|
);
|
||||||
|
|
||||||
|
sub get_os {
|
||||||
|
my $os = `lsb_release -sd`;
|
||||||
|
# for BSD
|
||||||
|
unless ($os) { $os = `uname -s`; }
|
||||||
|
for($os){
|
||||||
|
s/"//;
|
||||||
|
s/ .*//;
|
||||||
|
s/"//;
|
||||||
|
chomp;
|
||||||
|
}
|
||||||
|
return $os;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_de {
|
||||||
|
my $de = $ENV{XDG_CURRENT_DESKTOP};
|
||||||
|
unless ($de) { $de = $ENV{XDG_SESSION_DESKTOP} };
|
||||||
|
unless ($de) { $de = $ENV{DESKTOP_SESSION} };
|
||||||
|
return $de;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub shell {
|
||||||
|
return (split '/', $ENV{SHELL})[-1];
|
||||||
|
}
|
||||||
|
|
||||||
|
sub kernel {
|
||||||
|
my $ke = `uname -r`;
|
||||||
|
$ke =~ s/-.*//;
|
||||||
|
chomp $ke;
|
||||||
|
return $ke
|
||||||
|
}
|
||||||
|
|
||||||
|
sub packages {
|
||||||
|
# for arch based
|
||||||
|
my $pacs = `pacman -Q`;
|
||||||
|
# for debian based
|
||||||
|
unless ($pacs) { $pacs = `dpkg-query -f '\n' -W`; }
|
||||||
|
# for fedora
|
||||||
|
unless ($pacs) { $pacs = `yum list installed`; }
|
||||||
|
# for BSD
|
||||||
|
unless ($pacs) { $pacs = `pkg info`; }
|
||||||
|
|
||||||
|
my $count = $pacs =~ tr/\n//;
|
||||||
|
return $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub uptime {
|
||||||
|
my $time = `uptime`;
|
||||||
|
for($time) {
|
||||||
|
s/.*up\s+//;
|
||||||
|
s/,\s+[0-9]+ user.*//;
|
||||||
|
s/ //g;
|
||||||
|
s/,/:/g;
|
||||||
|
s/[a-z]+//g;
|
||||||
|
chomp
|
||||||
|
}
|
||||||
|
|
||||||
|
my @time = reverse(split ":", $time);
|
||||||
|
if (scalar @time == 2) {
|
||||||
|
$time[0] =~ s/^0//; # remove starting '0' (01 -> 1)
|
||||||
|
$time = $time[1]. "h, " . $time[0] . "m";
|
||||||
|
} elsif (scalar @time == 3) {
|
||||||
|
$time[0] =~ s/^0//; # remove starting '0' (01 -> 1)
|
||||||
|
$time = $time[2]. "d, " . $time[1]. "h, " . $time[0] . "m";
|
||||||
|
} else {
|
||||||
|
$time .= "m";
|
||||||
|
}
|
||||||
|
return $time;
|
||||||
|
}
|
||||||
|
|
||||||
|
# today's internet usage via vnstat
|
||||||
|
sub usage {
|
||||||
|
my $data = `vnstat`;
|
||||||
|
my $today;
|
||||||
|
foreach my $line (split '\n', $data) {
|
||||||
|
if ($line =~ /today/) {
|
||||||
|
$today = (split '\|', $line)[2];
|
||||||
|
$today =~ s/^ *//;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $today;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub format_info {
|
||||||
|
my %info = %{(shift)};
|
||||||
|
# format => "MARGIN PLACEHOLDER GAP NAME"
|
||||||
|
my $text = ' ' x $margin . colored($info{'placeholder'}, $info{'color'});
|
||||||
|
$text .= ' ' x (7 + $gap - length $info{'placeholder'});
|
||||||
|
$text .= $info{'name'} . ' ' x ($length - length $info{'name'});
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_info {
|
||||||
|
my $os = get_os();
|
||||||
|
my $ke = kernel();
|
||||||
|
my $de = get_de();
|
||||||
|
my $sh = shell();
|
||||||
|
my $up = uptime();
|
||||||
|
my $pac = packages();
|
||||||
|
my $de_placeholder = 'DE';
|
||||||
|
my $vnstat = '-1';
|
||||||
|
my $usg;
|
||||||
|
|
||||||
|
GetOptions (
|
||||||
|
"help" => \$help,
|
||||||
|
"os=s" => \$os,
|
||||||
|
"kernel=s" => \$ke,
|
||||||
|
"de=s" => \$de,
|
||||||
|
"shell=s" => \$sh,
|
||||||
|
"uptime=s" => \$up,
|
||||||
|
"packages=i" => \$pac,
|
||||||
|
"margin=i" => \$margin,
|
||||||
|
"length=i" => \$length,
|
||||||
|
"gap=i" => \$gap,
|
||||||
|
"color=s" => \$color,
|
||||||
|
"not_de" => \$not_de,
|
||||||
|
"vnstat:s" => \$vnstat,
|
||||||
|
"wally" => \$wally,
|
||||||
|
"dogbert" => \$dogbert,
|
||||||
|
"alice" => \$alice,
|
||||||
|
"phb" => \$phb,
|
||||||
|
"asok" => \$asok,
|
||||||
|
"random" => \$random,
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($help) {
|
||||||
|
print_help();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($not_de) {
|
||||||
|
$de_placeholder = 'WM';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($vnstat eq '') {
|
||||||
|
$vnstat = usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($color eq "random") {
|
||||||
|
$color = @colors[int(rand scalar @colors)];
|
||||||
|
}
|
||||||
|
|
||||||
|
my %usg = (
|
||||||
|
'placeholder' => 'VNSTAT',
|
||||||
|
'color' => 'magenta',
|
||||||
|
'name' => $vnstat
|
||||||
|
);
|
||||||
|
|
||||||
|
my %os = (
|
||||||
|
'placeholder' => 'OS',
|
||||||
|
'color' => 'bright_green',
|
||||||
|
'name' => $os,
|
||||||
|
);
|
||||||
|
|
||||||
|
my %ke = (
|
||||||
|
'placeholder' => 'KERNEL',
|
||||||
|
'color' => 'blue',
|
||||||
|
'name' => $ke,
|
||||||
|
);
|
||||||
|
|
||||||
|
my %de = (
|
||||||
|
'placeholder' => $de_placeholder,
|
||||||
|
'color' => 'bright_red',
|
||||||
|
'name' => $de,
|
||||||
|
);
|
||||||
|
|
||||||
|
my %sh = (
|
||||||
|
'placeholder' => 'SHELL',
|
||||||
|
'color' => 'yellow',
|
||||||
|
'name' => $sh,
|
||||||
|
);
|
||||||
|
|
||||||
|
my %up = (
|
||||||
|
'placeholder' => 'UPTIME',
|
||||||
|
'color' => 'bright_magenta',
|
||||||
|
'name' => $up,
|
||||||
|
);
|
||||||
|
|
||||||
|
my %pac = (
|
||||||
|
'placeholder' => 'PACKAGE',
|
||||||
|
'color' => 'cyan',
|
||||||
|
'name' => $pac,
|
||||||
|
);
|
||||||
|
|
||||||
|
$os = format_info(\%os);
|
||||||
|
$ke = format_info(\%ke);
|
||||||
|
$de = format_info(\%de);
|
||||||
|
$sh = format_info(\%sh);
|
||||||
|
$up = format_info(\%up);
|
||||||
|
$pac = format_info(\%pac);
|
||||||
|
$usg = format_info(\%usg);
|
||||||
|
|
||||||
|
my $i = 0;
|
||||||
|
my @info;
|
||||||
|
$info[$i++] = ' ' x ($length + $gap + 7 + $margin);
|
||||||
|
$info[$i++] = $os;
|
||||||
|
if ($vnstat eq '-1' ) { $info[$i++] = $ke; }
|
||||||
|
$info[$i++] = $de;
|
||||||
|
$info[$i++] = $sh;
|
||||||
|
$info[$i++] = $up;
|
||||||
|
$info[$i++] = $pac;
|
||||||
|
unless ($vnstat eq '-1' ) { $info[$i++] = $usg; }
|
||||||
|
$info[$i++] = ' ' x ($length + $gap + 7 + $margin);
|
||||||
|
|
||||||
|
return @info;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub main {
|
||||||
|
my @info = get_info();
|
||||||
|
if ($random) {
|
||||||
|
my @arr = map { 0 } (1..6);
|
||||||
|
$arr[int rand(6)] = 1;
|
||||||
|
($wally, $dogbert, $alice, $phb, $asok) = splice @arr, 0, 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $text = "\n";
|
||||||
|
if ($wally) {
|
||||||
|
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
|
||||||
|
$text .= colored(q{ .-'''-. │}, $color) . $info[0] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | | │}, $color) . $info[1] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ⪜|---_---|⪛ ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ Ͼ|__(_)__|Ͽ ││}, $color) . $info[3] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | _ | ││}, $color) . $info[4] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | | ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ˏ====○====ˎ │}, $color) . $info[6] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ / \ │}, $color) . $info[7] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
|
||||||
|
} elsif ($dogbert) {
|
||||||
|
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
|
||||||
|
$text .= colored(q{ │}, $color) . $info[0] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ .-----. │}, $color) . $info[1] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ .` `. ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ / /-() ()-\ \ ││}, $color) . $info[3] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ \_| ○ |_/ ││}, $color) . $info[4] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ '. .' ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ `-._.-' │}, $color) . $info[6] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ │}, $color) . $info[7] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
|
||||||
|
} elsif ($alice) {
|
||||||
|
$text .= colored(q{ ..-.. ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
|
||||||
|
$text .= colored(q{ (~ ~) │}, $color) . $info[0] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ( ) │}, $color) . $info[1] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ( ~~~~~~~ ) ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ( | . . | ) ││}, $color) . $info[3] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ( | (_) | ) ││}, $color) . $info[4] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ( | | ) ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ (.,.,.| === |.,.,.) │}, $color) . $info[6] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ '.___.' │}, $color) . $info[7] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ / \ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
|
||||||
|
} elsif ($phb) {
|
||||||
|
$text .= colored(q{ @ @ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
|
||||||
|
$text .= colored(q{ @@ ..-.. @@ │}, $color) . $info[0] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ @@@' _ _ '@@@ │}, $color) . $info[1] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ @( . . )@ ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | (_) | ││}, $color) . $info[3] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | _ | ││}, $color) . $info[4] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ |_ _| ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ /|_'---'_|\ │}, $color) . $info[6] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ / | '\_/' | \ │}, $color) . $info[7] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{/ | | | | \ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
|
||||||
|
} elsif ($asok) {
|
||||||
|
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
|
||||||
|
$text .= colored(q{ @@@@@@@@@ │}, $color) . $info[0] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | | │}, $color) . $info[1] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | _ _ | ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ Ͼ| ○ ○ |Ͽ ││}, $color) . $info[3] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | u | ││}, $color) . $info[4] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | --- | ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ / `-._.-´ \ │}, $color) . $info[6] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | │}, $color) . $info[7] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
|
||||||
|
} else {
|
||||||
|
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
|
||||||
|
$text .= colored(q{ დოოოოოდ │}, $color) . $info[0] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | | │}, $color) . $info[1] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | | ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ |-ᱛ ᱛ-| ││}, $color) . $info[3] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ Ͼ ∪ Ͽ ││}, $color) . $info[4] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ | | ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ ˏ`-.ŏ.-´ˎ │}, $color) . $info[6] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ @ │}, $color) . $info[7] . colored('│', $color) . "\n";
|
||||||
|
$text .= colored(q{ @ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "\n";
|
||||||
|
print $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub print_help {
|
||||||
|
print "usage: fm6000 [options]\n\n";
|
||||||
|
print "-c, --color=STR Base color\n";
|
||||||
|
print "-w, --wally Display Wally \n";
|
||||||
|
print "-dog, --dogbert Display Dogbert \n";
|
||||||
|
print "-al, --alice Display Alice \n";
|
||||||
|
print "-phb, --phb Display Pointy haired Boss \n";
|
||||||
|
print "-as, --asok Display Asok \n";
|
||||||
|
print "-r, --random Display Random Art \n";
|
||||||
|
print "-n, --not_de To use 'WM' instead of 'DE'\n";
|
||||||
|
print "-o, --os=STR OS name\n";
|
||||||
|
print "-k or --kernel=STR Kernel version\n";
|
||||||
|
print "-de or --de=STR Desktop environment name\n";
|
||||||
|
print "-s or --shell=STR Shell name\n";
|
||||||
|
print "-u or --uptime=STR Uptime\n";
|
||||||
|
print "-pa or --package=INT Number of packages\n";
|
||||||
|
print "-v or --vnstat=STR Use vnstat instead of kernel\n";
|
||||||
|
print "-m or --margin=INT Spaces on the left side of info\n";
|
||||||
|
print "-g or --gap=INT Spaces between info and info_value\n";
|
||||||
|
print "-l or --length=INT Length of the board ( > 14)\n\n";
|
||||||
|
print "available colors: \n";
|
||||||
|
print join(", ", splice(@colors, 0, 7)) . ", random\n";
|
||||||
|
print join(", ", @colors) . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
Loading…
Reference in a new issue