monitors, brightness, battery widget
This commit is contained in:
@@ -12,4 +12,9 @@ function usage_and_exit {
|
|||||||
if [ ${#} -ne 1 ]; then
|
if [ ${#} -ne 1 ]; then
|
||||||
usage_and_exit
|
usage_and_exit
|
||||||
fi
|
fi
|
||||||
xbacklight -inc ${1}
|
BRIGHTNESS=$(( $(</sys/class/backlight/intel_backlight/brightness)+${1} ))
|
||||||
|
if (( $BRIGHTNESS < 7500 )) && (( $BRIGHTNESS > 0 ))
|
||||||
|
then
|
||||||
|
echo $BRIGHTNESS > "/sys/class/backlight/intel_backlight/brightness"
|
||||||
|
fi
|
||||||
|
echo $(( 100*$BRIGHTNESS/7500 ))
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ then
|
|||||||
xrandr --output DP1-1 --mode 2560x1440 --pos 1920x0 --rotate normal
|
xrandr --output DP1-1 --mode 2560x1440 --pos 1920x0 --rotate normal
|
||||||
elif [ "$DISPLAY_COUNT" == 1 ]
|
elif [ "$DISPLAY_COUNT" == 1 ]
|
||||||
then
|
then
|
||||||
|
xrandr --output DP1-2 --off
|
||||||
|
xrandr --output DP1-1 --off
|
||||||
xrandr --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
|
xrandr --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
|
||||||
elif [ "$DISPLAY_COUNT" == 2 ]
|
elif [ "$DISPLAY_COUNT" == 2 ]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ local beautiful = require("beautiful")
|
|||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local menubar = require("menubar")
|
local menubar = require("menubar")
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
||||||
|
-- Battery notif
|
||||||
|
local battery = require("battery")
|
||||||
|
|
||||||
-- Enable hotkeys help widget for VIM and other apps
|
-- Enable hotkeys help widget for VIM and other apps
|
||||||
-- when client with a matching name is opened:
|
-- when client with a matching name is opened:
|
||||||
require("awful.hotkeys_popup.keys")
|
require("awful.hotkeys_popup.keys")
|
||||||
@@ -57,10 +60,10 @@ modkey = "Mod4"
|
|||||||
|
|
||||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
awful.layout.layouts = {
|
awful.layout.layouts = {
|
||||||
awful.layout.suit.fair,
|
|
||||||
awful.layout.suit.fair.horizontal,
|
|
||||||
awful.layout.suit.tile,
|
awful.layout.suit.tile,
|
||||||
awful.layout.suit.tile.left,
|
awful.layout.suit.tile.left,
|
||||||
|
awful.layout.suit.fair,
|
||||||
|
awful.layout.suit.fair.horizontal,
|
||||||
awful.layout.suit.tile.bottom,
|
awful.layout.suit.tile.bottom,
|
||||||
awful.layout.suit.tile.top,
|
awful.layout.suit.tile.top,
|
||||||
awful.layout.suit.spiral,
|
awful.layout.suit.spiral,
|
||||||
@@ -116,6 +119,8 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
|
|||||||
-- Keyboard map indicator and switcher
|
-- Keyboard map indicator and switcher
|
||||||
mykeyboardlayout = awful.widget.keyboardlayout()
|
mykeyboardlayout = awful.widget.keyboardlayout()
|
||||||
|
|
||||||
|
-- Battery
|
||||||
|
batterywidget = wibox.widget.textbox()
|
||||||
-- {{{ Wibar
|
-- {{{ Wibar
|
||||||
-- Create a textclock widget
|
-- Create a textclock widget
|
||||||
mytextclock = wibox.widget.textclock()
|
mytextclock = wibox.widget.textclock()
|
||||||
@@ -257,6 +262,7 @@ awful.screen.connect_for_each_screen(function(s)
|
|||||||
mykeyboardlayout,
|
mykeyboardlayout,
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
mytextclock,
|
mytextclock,
|
||||||
|
batterywidget,
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -343,8 +349,18 @@ globalkeys = gears.table.join(
|
|||||||
{description = "select previous", group = "layout"}),
|
{description = "select previous", group = "layout"}),
|
||||||
|
|
||||||
-- Display Brightness
|
-- Display Brightness
|
||||||
awful.key({}, "XF86MonBrightnessUp", function () awful.util.spawn("/home/snarbutas/.bin/brightness +15", false) end),
|
awful.key({}, "XF86MonBrightnessUp",
|
||||||
awful.key({}, "XF86MonBrightnessDown",function () awful.util.spawn("/home/snarbutas/.bin/brightness -15", false) end),
|
function ()
|
||||||
|
awful.spawn.easy_async("/home/snarbutas/.bin/brightness +750", function(stdout, stderr, reason, exit_code)
|
||||||
|
naughty.notify {title = "💡", text = stdout, timeout = 0.5}
|
||||||
|
end)
|
||||||
|
end),
|
||||||
|
awful.key({}, "XF86MonBrightnessDown",
|
||||||
|
function ()
|
||||||
|
awful.spawn.easy_async("/home/snarbutas/.bin/brightness -750", function(stdout, stderr, reason, exit_code)
|
||||||
|
naughty.notify {title = "💡", text = stdout, timeout = 0.5}
|
||||||
|
end)
|
||||||
|
end),
|
||||||
-- Extend monitor
|
-- Extend monitor
|
||||||
awful.key({ "Control", "Mod4" }, "e", function () awful.util.spawn("/home/snarbutas/.bin/multimonitor", false) end),
|
awful.key({ "Control", "Mod4" }, "e", function () awful.util.spawn("/home/snarbutas/.bin/multimonitor", false) end),
|
||||||
-- Lock computer
|
-- Lock computer
|
||||||
@@ -656,4 +672,11 @@ end)
|
|||||||
|
|
||||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus 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)
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
|
||||||
|
-- Automatically check battery
|
||||||
|
batterywidget_timer = timer({timeout = 1})
|
||||||
|
batterywidget_timer:connect_signal("timeout", function()
|
||||||
|
batterywidget:set_text(batteryInfo("BAT0"))
|
||||||
|
end)
|
||||||
|
batterywidget_timer:start()
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ source "/home/snarbutas/.zsh-git-prompt/zshrc.sh"
|
|||||||
ZSH_THEME_GIT_PROMPT_BRANCH="%{\x1b[3m%}%{$fg[cyan]%}"
|
ZSH_THEME_GIT_PROMPT_BRANCH="%{\x1b[3m%}%{$fg[cyan]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%}%{¤%G%}"
|
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%}%{¤%G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[blue]%}%{x%G%}"
|
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[blue]%}%{x%G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CHANGED="%{%F{196}%}%{+%G%}%F{reset}"
|
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[red]%}%{+%G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_BEHIND="%{%F{196}%}%{↓%F{reset}%G%}"
|
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[red]%}%{↓%G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%}%{↑%G%}"
|
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%}%{↑%G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%F{196}%}%{…%F{reset}%G%}"
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}%{…%G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}%{✔%G%}"
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}%{✔%G%}"
|
||||||
### =============== Git prompt ================ ###
|
### =============== Git prompt ================ ###
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ ttyctl -f
|
|||||||
stty -ixon -ixoff
|
stty -ixon -ixoff
|
||||||
|
|
||||||
## Set a nice prompt
|
## Set a nice prompt
|
||||||
PROMPT='%F{red}[%F{blue}%*%F{red}]%f %F{yellow}bosman%f %F{magenta}[%f%B%F{magenta}%1~%f%b%F{magenta}]%f %(!.%F{196}.%F{46})≫ %f%(!..$(git_super_status)) '
|
PROMPT='%F{red}[%F{blue}%*%F{red}]%f %F{yellow}bosman%f %F{magenta}[%f%B%F{magenta}%1~%f%b%F{magenta}]%f %(!.%F{red}.%F{green})≫ %f$(git_super_status) '
|
||||||
RPROMPT=$'%F{cyan}%*%f'
|
RPROMPT=$'%F{cyan}%*%f'
|
||||||
|
|
||||||
## Set a nice remote prompt
|
## Set a nice remote prompt
|
||||||
|
|||||||
Reference in New Issue
Block a user