Last active
August 29, 2015 13:57
-
-
Save firstspring1845/9670322 to your computer and use it in GitHub Desktop.
アイコンを変えるプラグインです、ショートカットキーを設定して使ってね
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
Plugin.create :icon_change do | |
require 'base64' | |
command(:icon_change, | |
name: 'アイコン変更', | |
condition: lambda{ |opt| true}, | |
visible: false, | |
role: :window) do |opt| | |
dialog = Gtk::FileChooserDialog.new("Open Icon", | |
nil, | |
Gtk::FileChooser::ACTION_OPEN, | |
nil, | |
[Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], | |
[Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) | |
if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT | |
(Service.primary.twitter/'account/update_profile_image').json(:image => Base64.encode64(File.binread(dialog.filename))).next do |d| | |
activity :system, "アイコンを変更しました" | |
end | |
end | |
dialog.destroy | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment