constantin-net

mocp_album_cover_add

Dec 7th, 2021 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. mocp_album_cover = wibox.widget {
  2. forced_height = 96,
  3. forced_width = 96,
  4. resize = true,
  5. widget = wibox.widget.imagebox
  6. }
  7. mocp_album_cover:set_image("/home/" .. user .. "/.moc/default_album.png")
  8. .................................................................
  9. s.popup_mocp = awful.popup {
  10. ontop = true,
  11. visible = false,
  12. screen = s,
  13. shape = function(cr, width, height) gears.shape.partially_rounded_rect(cr, width, height, true, true, false, true, 16) end,
  14. offset = { y = 5 },
  15. border_width = 2,
  16. border_color = beautiful.border_focus,
  17. widget = {
  18. {
  19. {
  20. {
  21. { { { widget = mocp_album_cover, }, bg = beautiful.bg_normal, shape_clip = true, shape = function(cr, width, height) gears.shape.partially_rounded_rect(cr, width, height, true, true, false, true, 16) end, widget = wibox.container.background, }, margins = 5, widget = wibox.container.margin, },
  22. {
  23. {
  24. { widget = mocp_playlist_button },
  25. { widget = mocp_shuffle_button },
  26. { widget = mocp_repeat_button },
  27. layout = wibox.layout.align.horizontal,
  28. expand = 'none',
  29. },
  30. { widget = mocwidget.w_artist },
  31. { widget = mocwidget.w_album },
  32. { widget = mocwidget.w_title },
  33. layout = wibox.layout.fixed.vertical,
  34. },
  35. layout = wibox.layout.fixed.horizontal,
  36. },
  37. layout = wibox.layout.fixed.horizontal,
  38. },
  39. { widget = mocline },
  40. {
  41. { widget = mocp_prev_button },
  42. { widget = mocp_pause_button },
  43. { widget = mocp_next_button },
  44. layout = wibox.layout.align.horizontal,
  45. expand = 'none',
  46. },
  47. layout = wibox.layout.fixed.vertical,
  48. },
  49. margins = 10,
  50. widget = wibox.container.margin,
  51. },
  52. }
  53. awful.placement.right(s.popup_mocp, { margins = { right = 65, top = 50, }, parent = s })
  54. .................................................................
  55. awesome.connect_signal("song::changed", function() mocp_album_cover:set_image(gears.surface.load_uncached("/home/" .. user .. "/.moc/current_album.png")) end)
  56. ..............................................
  57. ffmpeg -y -i "`mocp -Q %file`" $HOME/.moc/current_album.png
  58. if [ $? -eq 1 ]; then
  59. cp $HOME/.moc/default_album.png $HOME/.moc/current_album.png
  60. fi
  61. .........................................
  62. awesome.emit_signal("song::changed")
  63.  
Add Comment
Please, Sign In to add comment