Added unlink.sh and updated lua scripts for awesome

This commit is contained in:
lanxu 2017-07-03 22:46:25 +03:00
parent 4c374f04da
commit d97611ed7a
5 changed files with 41 additions and 7 deletions

View File

@ -418,6 +418,10 @@ clientkeys = awful.util.table.join(
{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.
@ -480,13 +484,21 @@ for i = 1, 9 do
{description = "Lower audio volume", group = "audio"}),
awful.key({ any }, "XF86AudioMute",
function()
awful.spawn(string.format("pactl set-sink-mute %s toggle", volume.device))
awful.spawn(string.format("pactl set-sink-mute %s 1", volume.device))
volume.update()
end,
{description = "mute audio", group = "audio"}),
awful.key({ any }, "Print",
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({ modkey }, "Print",
function ()
awful.spawn("escrotum \"$(xdg-user-dir PICTURES)/%Y-%m-%d_screenshot.png\"")
end,
function ()
awful.util.spawn_with_shell("FILE=$(escrotum); mv $FILE $(xdg-user-dir PICTURES)/", True)
end,
{description = "Take screenshot", group = "audio"})
)

View File

@ -7,6 +7,12 @@ local wibox = require("wibox")
-- Variables
local valuecolor = "white"
-- 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
@ -57,8 +63,13 @@ lain.widget.calendar({
})
-- CPU temperature
local tempfile = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:14/ATK0110:00/hwmon/hwmon1/temp1_input"
if file_exists(tempfile) == false then
tempfile = "/sys/class/thermal/thermal_zone0/temp"
end
mycputemp = lain.widget.temp({
tempfile = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:14/ATK0110:00/hwmon/hwmon1/temp1_input",
tempfile = tempfile,
settings = function()
widget.markup = create_markup("CPU", coretemp_now, "", valuecolor)
end

View File

@ -1,3 +1,3 @@
lain/
.tmp
.vim

View File

@ -1,3 +1,3 @@
mkdir vim
mkdir .vim
curl -fLo .vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
git clone https://github.com/copycat-killer/lain.git $(pwd)/.config/awesome/lain

11
unlink.sh Normal file
View File

@ -0,0 +1,11 @@
#!/biń/sh
# Create symlinks
unlink ~/.vimrc
unlink ~/.vim
unlink ~/.zshrc
unlink ~/.zprofile
unlink ~/.zshrc.local
unlink ~/.Xresources
unlink ~/.Xresources.d
unlink ~/.config/awesome