diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 8fa4f21..d6535f6 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -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.util.spawn_with_shell("FILE=$(escrotum); mv $FILE $(xdg-user-dir PICTURES)/", True) + awful.spawn("escrotum \"$(xdg-user-dir PICTURES)/%Y-%m-%d_screenshot.png\"") + end, + function () end, {description = "Take screenshot", group = "audio"}) ) diff --git a/.config/awesome/widgets.lua b/.config/awesome/widgets.lua index 608b0ca..58536f5 100644 --- a/.config/awesome/widgets.lua +++ b/.config/awesome/widgets.lua @@ -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 .. " " .. value .. postfix .."" 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 diff --git a/.hgignore b/.hgignore index e3a9713..f731943 100644 --- a/.hgignore +++ b/.hgignore @@ -1,3 +1,3 @@ lain/ .tmp - +.vim diff --git a/setup.sh b/setup.sh index 5d57864..fc95289 100644 --- a/setup.sh +++ b/setup.sh @@ -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 diff --git a/unlink.sh b/unlink.sh new file mode 100644 index 0000000..a0867ad --- /dev/null +++ b/unlink.sh @@ -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